Setting Up an SAP Connection

If you plan to develop mobile applications using the SAP framework, you must first set up a SAP connection by configuring some UA server files.

To set up an SAP connection:

  1. Configure the SAP connection using the SAP Java Connector (SAP JCo). SAP JCo is a toolkit that allows a Java application to communicate with any SAP system. The SAP Java Connector can be downloaded from the SAP Service Marketplace Web site by a registered SAP customer.

  2. Modify the UAglobal.properties.xml file located in %Sybase%\WorkSpace\DevRuntimes\UA\tomcat\tomcat\webapps\onepage\config to enable SAP and identify ConnectionPools.

  3. Create a property file for each ConnectionPool, and configure the connection properties.

  4. Enable the SAP property by setting it to "true":

    <Property name=SAP.Enabled" value="true"

Once you complete these procedures, you can create a SAP element. Go to "Configuring the SAP Java connector."

Configuring the SAP Java connector:

  1. Open a Web browser window and enter the SAP Marketplace URL,which is currently https://websmp204.sap-ag.de/swdc. https://websmp204.sap-ag.de/swdc

  2. In the Client Authentication window, select the certificate to use when connecting, and click OK. The SAP Service Marketplace window displays.

  3. Enter your registered SAP customer user name and password in the User Name and Password fields, and click OK.

  4. Select the SAP Java Connector link, and follow the installation instructions provided by SAP. When prompted, copy the .jar and .dll files to these locations:

    • Copy sapjco.jar to:

      • Tomcat

        %SYBASE%\WorkSpace\DevRuntimes\UA\tomcat\tomcat\webapps\onepage\WEB-INF\classes

      • EAServer

        %SYBASE%\WorkSpace\DevRuntimes\EAServer\Repository\WebApplication\onepage\WEB-INF\classes

    • Copy librfc32.dll and sapjcorfc.dll to %SYBASE%\WorkSpace\DevRuntimes\Shared\jdk1.4.2_06\jre\bin.

  5. Close your Web browser.

  6. Navigate to:

    • Tomcat

      %SYBASE%\WorkSpace\DevRuntimes\UA\tomcat\tomcat\webapps\onepage\WEB-INF\lib

    • EAServer

      %SYBASE%\WorkSpace\DevRuntimes\EAServer\Repository\WebApplication\onepage\WEB-INF\lib

    Use a text editor to open the sapjco.properties file and edit it for your environment. The SAP wizard uses information in the sapjco.properties file to connect to your SAP system.

    Check the documentation that comes with the JCO package for information about the properties you can set to define a SAP connection. Specifically, see the Javadocs for the JCO.createClient (java.util.Properties) method. The six most commonly used properties are included in the file as a sample (for example, jco.client.client=400).

  7. Save and close the file.

  8. Go to "Modifying global.properties.xml for SAP."

Modifying global.properties.xml for SAP

  1. In a text editor, open global.properties.xml, located in %SYBASE%\WorkSpace\DevRuntimes\UA\tomcat\tomcat\webapps\onepage\config if you are using Tomcat and %SYBASE%\WorkSpace\DevRuntimes\EAServer\Repository\WebApplication\onepage\config if you are using EAServer.

  2. Search the file for the SAPGroup property.

  3. Look for: <Property name="DefaultConnection PoolName".

    By default, DefaultConnectionPoolName is set to “sapjco.” <Property name="DefaultConnectionPoolName" value="sapjco" description="connection pool name for the default SAP connection" menugroup="100" /> </PropertyGroup>

    Determine which ConnectionPool from the list to use as the default SAP connection and change the value as necessary.

  4. Save and close the file.

  5. Go to "Creating Connection Pool Property Files."

Creating Connection Pool Property Files

For each ConnectionPool listed in the global.properties.xml file, there should be a poolname.properties file in %SYBASE%\WorkSpace\DevRuntimes\UA\tomcat\tomcat\webapps\onepage\WEB-INF\classes. Use the sapjco.properties file (or template.sapjco.properties file) as a base, and modify the ConnectionPool connection properties, using information in the JCO package Javadocs as a guide.

  1. In a text editor, open sapjco.properties (located in %SYBASE%\WorkSpace\DevRuntimes\UA\tomcat\tomcat\webapps\onepage \WEB-INF\classes).

  2. Save the file in the same directory, using the following naming format: poolname.properties Substitute one of the ConnectionPool names you established in the global.properties.xml file for poolname.

  3. Modify the file by setting up the connection properties for the SAP connection. The following properties are included in the file as an example:

    jco.client.client=400

    jco.client.user=sap

    jco.client.passwd=1sap

    jco.client.lang=EN

    jco.client.ashost=sap.try.sybase.com

    jco.client.sysnr=00

  4. Save and close the file.

Related Tasks

Creating SAP Elements

Send your feedback on this help topic to Sybase Tech Pubs: pubs@sybase.com