This section describes how to set up a SAP connection, if you plan to develop mobile applications using the SAP framework.
To set up the SAP connection you must:
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.
Modify the global.properties.xml file to enable SAP and identify ConnectionPools.
Create a property file for each ConnectionPool, and configure connection properties.
Details for each of these steps are provided in the procedures that follow. Once you have set up the SAP connections, you can create SAP elements in the Mobile Web Studio Application Builder. See the Unwired Accelerator Developer’s Guide for information about using the SAP element.
Configuring the SAP Java
connector
Open a Web browser window and enter the SAP Marketplace URL, which currently is:
https://websmp204.sap-ag.de/swdc
The Client Authentication window displays.
Select the certificate to use when connecting, and click OK. The Enter Network Password window displays.
Enter your registered SAP customer user name and password in the User Name and Password fields, and click OK. The SAP Software Distribution Center window displays.
In the You Are Here navigation bar on the left side of the page, navigate to Download | SAP Connectors | SAP Java Connector | Tools and Services. Click the link for SAP JCo Release 2.0.12 to download the SAP Java Connector.
Follow the installation instructions provided by SAP. When prompted, copy the .jar and .so files to these locations:
Copy sapjco.jar to:
Tomcat
$SYBASE/tomcat/webapps/onepage/WEB-INF/lib
Copy librfccm.so and libsapjcorfc.so to:
Tomcat
$SYBASE/jdk1.5.0_05/jre/bin
Close the Web browser.
Change to the following directory:
Tomcat
$SYBASE/tomcat/webapps/onepage /WEB-INF/classes
As a backup, save a copy of the sapjco.properties file to a name such as template.sapjco.properties.
Using a text editor, 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 30-40 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).
Save the file and close it.
Restart the Tomcat application server, using information in “Starting and stopping the Tomcat application server”.
Modifying the global.properties.xml file
for SAP
Modify the SAP-related properties in global.properties.xml.
SAP.Enabled – enables SAP in Mobile Web Studio.
ConnectionPools – a comma-separated list of connection pool names. Each connection pool must have a poolname.properties file defined as described in “Creating ConnectionPool property files”.
DefaultConnectionPoolName – identifies the connection pool to use for the default SAP connection.
In a text editor, open global.properties.xml, located in $SYBASE/tomcat/webapps/onepage/config if you are using Tomcat.
Search the file for SAPGroup
.
Look for SAP.Enabled. By default, SAP.Enabled is set to “false.” Change the entry to “true.”
Look for: <Property name="ConnectionPools"
.
By default, ConnectionPools is set to “sapjco.”
<Property name="ConnectionPools"
value="sapjco"
description="Comma separated list
of connectionpool
names." menugroup="100" />
</PropertyGroup>
The default ConnectionPool “sapjco” has a corresponding property file sapjco.properties in which SAP connection properties are defined. Each ConnectionPool name in the list must have its own property file, as described in “Creating ConnectionPool property files”.
Identify the ConnectionPools you need for SAP connection, using SAP documentation, and change the value as necessary.
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 to use as the default SAP connection from the list, and change the value as necessary.
Save the file and close it.
Creating ConnectionPool
property files
For each ConnectionPool listed in the global.properties.xml file, there should be a poolname.properties file in $SYBASE/tomcat/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.
In a text editor, open sapjco.properties (located in $SYBASE/tomcat/webapps/onepage/config).
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.
Modify the file by setting up the connection properties for the SAP connection. The following properties are included in the file as an example. Check the Javadocs for information about these properties, and many more.
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
Save the file and close it.