SAP software solutions are widely used among product and process oriented enterprises for finance, operations, HR and many other aspects of the business. SAP ERP solutions provide reliable and efficient platforms to build and integrate enterprise or business-wide data and information systems with ease.
One of the drawbacks however is vendor lock-in and the relative inflexibility of SAP solutions to align itself with the business model or customization required. Having understood these challenges, SAP software vendors are moving towards exposing their solutions to SOA.
WSO2 ESB on the other hand leverages the best of both worlds by supporting technologies along with native SOA integration technologies. It has the capability to connect existing SAP based solutions of an enterprise with other data/business oriented systems and to mix-and-match user requirements with minimal effort. As a result, enterprises can keep parts of their systems independent of SAP and extensible for many other systems, solutions and middleware.
This section describes how to set up WSO2 ESB in a SAP environment, how to install the SAP JCo middleware library, SAP Intermediate Document (Idoc) and Business Application Programming Interface (BAPI) adapters.
Installing WSO2 SAP Adapter
The WSO2 SAP adapter is written as a transport for WSO2 ESB. The relevant jar is org.wso2.carbon.transports.sap-VERSION.jar (e.g. org.wso2.carbon.transports.sap-1.0.jar). Follow the steps below to install and set up.
1. Download and install WSO2 ESB using instruction given in section Getting Started.
2. Download the sapidoc3.jar and sapjco3.jar middleware libraries from SAP support at and copy them to <ESB_HOME>/repository/components/lib directory.
3. Copy the native SAP jco library to the system path. Pick the system path relevant to your operating system from the list below.
|Copy the Linux native SAP jco library (libsapjco3.so) to <JDK_HOME>/jre/lib/i386/server.|
|Copy the Linux native SAP jco library (libsapjco3.so) to <JDK_HOME>/jre/lib/amd64.|
|Copy the Windows native SAP jco library (sapjco3.dll) to <WINDOWS_HOME>/system32.|
4. Copy the SAP endpoint property files to <ESB_HOME>/repository/conf/sap. When communicating with an external SAP endpoint using IDoc or BAPI, there are two property files for server-side and client-side as follows:
- *.dest - SAP endpoint properties when the ESB acts as the client to an external SAP endpoint.
- *.server - SAP endpoint properties when the ESB acts as the server to an external SAP endpoint.
The SAP client and server properties file should be available with its name according to the property transport.sap.serverName for server, and the endpoint name for the destination. The next section explains this in detail.
5. Start the ESB using the
-Djava.library.path switch to specify the location of your SAP jco library. For example:
Configuring WSO2 SAP Adapter
As noted earlier, the SAP adapter was written as a new transport for the WSO2 ESB. This transport consists of two parts as follows.
- BAPI/RFC transport
- IDoc transport
Just as a normal transport, define each of these transports' receiver/sender configurations in <ESB_HOME>/repository/conf/Axis2/axis2.xml file. Examples are given below for your reference.
The table below summarizes how to define a SAP endpoint and a proxy service.
|Endpoint Configuration||ProxyService Configuration|
The SAP endpoint client property file should be in <ESB_HOME>//repository/conf/sap/JCOCLIENT01.dest.
SAP endpoint server property file should be in <ESB_HOME>/repository/conf/sap/JCOS ERVER01.server
The SAP endpoint client property file should be in <ESB_HOME>/repository/conf/sap/JCOCLIENT01.dest
SAP endpoint server property file should be in <ESB_HOME>/repository/conf/sap/JCOSERVER01.server
You have to specify some properties when communicating with a SAP system using the JCo middleware library. They are specified using the *.dest and *.server properties files in <ESB_HOME>/repository/conf/sap directory. The two tables below define the properties and their possible values.
Server properties (*.server property file)
|Program ID of the server|
|You can enable or disable the RFC trace|
|params||Arbitrary parameters for RFC library|
|SNC level of security (1-9)|
|Path to the SNC library|
|Name of the profile file used during start-up|
|Determines whether or not you connect in unicode|
mode (1=true, 0=false)
|Maximum server start-up delay time in seconds|
Client properties (*.dest property file)
|Alias user name|
|R/3 system number|
|R/3 application server|
|R/3 message server|
|group||Group of application servers|
|Program ID of external server program|
|tphost||Host of external server program|
|Type of remote host (3=R/3, E=External)|
|codepage||Initial code page for logon|
|Use remote SAP graphical user interface|
|Use the specified SAP cookie version 2 as the logon ticket|
|grt_data||Additional data for GUI|
|Host to which the remote GUI is redirected|
|Service to which the remote GUI is redirected|
|use_guiprogid||Progid of the server that starts the remote GUI|
SNC partner name (for example, CN=B20, O=SAP-AG, C=DE\) snc_mode
|SNC mode (0 or 1)|
|SNC level of security (1-9)|
|SNC name; overrides default SNC partner|
|snc_lib||Path to the library|
|SAPLOGON string on 32-bit Windows|
|Data for external application (PAS)|
|Type of external authentication (PAS)|
|Use the specified X509-certificate as the logon ticket|
|R/3 port number of message server|
|Profile name used for shared memory communication|
|Idle timeout for the connection|
|RFC library character conversion errors (1 or 0)|
|Enable or disable logon check at open time (1 or 0)|
|Enable or disable RFC trace (1 or 0)|
|Enable ABAP debugging (1 or 0)|
|Get or do not get a SSO ticket after logon (1 or 0)|
|Enable or disable uppercase character conversions for logon|
Given below are general troubleshooting guides.
How to handle the Server unknown error
An example of this error message is as follows:
The solution is to add your SAP server names to /etc/services file with their relevant ports. For example, the following lines can be added as relevant to the example error given above.