Systems, Applications, and Products (SAP) for data processing is an industry leading enterprise software solution that is widely used among product and process oriented enterprises for finance, operations, HR and many other aspects of a business. SAP ERP solutions provide reliable and efficient platforms to build and integrate enterprise or business-wide data and information systems with ease.
WSO2 ESB leverages the best of both worlds by providing the integration layer so that an existing SAP R/3 based solutions of an enterprise can be integrated with other data/business oriented systems so that you can mix-and-match 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.
The WSO2 SAP adapter is shipped with WSO2 ESB and is implemented as a transport for WSO2 ESB. This is provided in the <ESB_HOME>/repository/components/plugins
directory as org.wso2.carbon.transports.sap-VERSION.jar
(e.g. org.wso2.carbon.transports.sap_1.0.0.jar
).
The WSO2 SAP adapter has full IDoc and experimental BAPI support. It used the SAP JCO library as the underlying framework to communicate with SAP. 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.
Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Installing WSO2 SAP Adapter
Follow the instructions below to install and set up the ESB SAP adapter.
- Download and install WSO2 ESB by following the instruction in Getting Started.
Download the
sapidoc3.jar
andsapjco3.jar
middleware libraries from the SAP support portal https://websmp109.sap-ag.de/connectors and copy those libraries to the<ESB_HOME>/repository/components/lib
directory.Info title Note You need to have SAP login credentials to access the SAP support portal.
Download the native SAP JCo library and copy it to the system path. You need to select the system path applicable to your operating system as described below.
Linux 32-bit
Copy the Linux native SAP jco library libsapjco3.so
to<JDK_HOME>/jre/lib/i386/server
.Linux 64-bit
Copy the Linux native SAP jco library libsapjco3.so
to<JDK_HOME>/jre/lib/amd64
.Windows
Copy the Windows native SAP jco library sapjco3.dll
to<WINDOWS_HOME>/system32
.Copy the following SAP endpoint property files to the
<ESB_HOME>/repository/conf/sap
directory. You need to have two property files, one at the server-end and the other at the client-end to communicate with an external SAP endpoint using IDoc or BAPI.Info This directory does not exist by default. A SAP system administrator has to create the directory and provide access rights so that you can read the property files saved in the directory. *.dest
: This is where we keep SAP endpoint parameters when WSO2 ESB should act as a client to an external SAP endpoint.*.server
: This is where we keep SAP endpoint parameters when WSO2 ESB should act as a server to an external SAP endpoint.
- Start the ESB using the
-Djava.library.path
switch to specify the location of your SAP jco library.
For example./wso2server.sh -Djava.library.path=/usr/lib/jvm/jre1.7.0/lib/i386/server/
Configuring WSO2 SAP Adapter
As mentioned above, the SAP adapter is implemented as a transport for WSO2 ESB. This transport consists of two parts as follows:
- BAPI/RFC adapter
- IDoc adapter
Just like any other transport, you need to enable the BAPI/RFC adapter as well as the IDoc adapter in order to use the SAP adapter.
To enable the BAPI/RFC adapter
Edit the
<ESB_HOME>/repository/conf/axis2/axis2.xml
file and uncomment the BAPI sender and listener as follows:Code Block language xml <transportSender name="bapi" class="org.wso2.carbon.transports.sap.SAPTransportSender"/> ... <transportReceiver name="bapi" class="org.wso2.carbon.transports.sap.SAPTransportListener"/>
To enable the IDoc adapter
Edit the
<ESB_HOME>/repository/conf/axis2/axis2.xml
file and uncomment the IDoc sender and listener as follows:Code Block language xml <transportSender name=”idoc” class="org.wso2.carbon.transports.sap.SAPTransportSender"/> ... <transportReceiver name=”idoc” class="org.wso2.carbon.transports.sap.SAPTransportListener"/>
...
Setting up the *.dest property file
To setup WSO2 ESB as a client to a SAP system you need to create the *.dest
property file and define the relevant properties. The following table lists the properties and the description of each property that should be specified in the *.dest
property file.
...
jco.client.client
...
jco.client.user
...
jco.client.alias_user
...
jco.client.passwd
...
jco.client.lang
...
jco.client.sysnr
...
jco.client.ashost
...
jco.client.mshost
...
jco.client.gwhost
...
jco.client.gwserv
...
jco.client.r3name
...
jco.client.tpname
...
jco.client.type
...
jco.client.use_sapgui
...
jco.client.mysapsso2
...
jco.client.use_guihost
...
jco.client.use_guiserv
...
SNC partner name (for example, CN=B20, O=SAP-AG, C=DE\) snc_mode
...
jco.client.snc_mode
...
jco.client.snc_qop
...
jco.client.snc_myname
...
jco.client.Dest
...
jco.client.saplogon_id
...
jco.client.extiddata
...
jco.client.extidtype
...
jco.client.x509cert
...
jco.client.msserv
...
jco.client.profile_name
...
jco.client.idle_timeout
...
jco.client.ice Ignore
...
jco.client.logon
...
jco.client.trace
...
jco.client.abap_debug
...
jco.client.getsso2
...
jco.client.toupper
...
Systems, Applications, and Products (SAP) for data processing is an industry leading enterprise software solution that is widely used among product and process oriented enterprises for finance, operations, HR and many other aspects of a business. SAP ERP solutions provide reliable and efficient platforms to build and integrate enterprise or business-wide data and information systems with ease.
WSO2 ESB leverages the best of both worlds by providing the integration layer so that an existing SAP R/3 based solutions of an enterprise can be integrated with other data/business oriented systems so that you can mix-and-match 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.
The WSO2 SAP adapter is shipped with WSO2 ESB and is implemented as a transport for WSO2 ESB. This is provided in the <ESB_HOME>/repository/components/plugins
directory as org.wso2.carbon.transports.sap-VERSION.jar
(e.g. org.wso2.carbon.transports.sap_1.0.0.jar
).
The WSO2 SAP adapter has full IDoc and experimental BAPI support. It used the SAP JCO library as the underlying framework to communicate with SAP. 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.
...
Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
Installing WSO2 SAP Adapter
Follow the instructions below to install and set up the ESB SAP adapter.
- Download and install WSO2 ESB by following the instruction in Getting Started.
Download the
sapidoc3.jar
andsapjco3.jar
middleware libraries from the SAP support portal and copy those libraries to the<ESB_HOME>/repository/components/lib
directory.Info title Note You need to have SAP login credentials to access the SAP support portal.
Download the native SAP JCo library and copy it to the system path. You need to select the system path applicable to your operating system as described below.
Linux 32-bit
Copy the Linux native SAP jco library libsapjco3.so
to<JDK_HOME>/jre/lib/i386/server
.Linux 64-bit
Copy the Linux native SAP jco library libsapjco3.so
to<JDK_HOME>/jre/lib/amd64
.Windows
Copy the Windows native SAP jco library sapjco3.dll
to<WINDOWS_HOME>/system32
.Create a directory named
sap
in the<ESB_HOME>/repository/conf/
directory and provide access rights to read the properties files you will save in it later.Copy the following SAP endpoint property files to the
<ESB_HOME>/repository/conf/sap
directory. You need to have two property files, one at the server-end and the other at the client-end to communicate with an external SAP endpoint using IDoc or BAPI.*.dest
: This is where we keep SAP endpoint parameters when WSO2 ESB should act as a client to an external SAP endpoint.*.server
: This is where we keep SAP endpoint parameters when WSO2 ESB should act as a server to an external SAP endpoint.
- Start the ESB using the
-Djava.library.path
switch to specify the location of your SAP jco library.
For example./wso2server.sh -Djava.library.path=/usr/lib/jvm/jre1.7.0/lib/i386/server/
...
Configuring WSO2 SAP Adapter
As mentioned above, the SAP adapter is implemented as a transport for WSO2 ESB. This transport consists of two parts as follows:
- BAPI/RFC adapter
- IDoc adapter
Just like any other transport, you need to enable the BAPI/RFC adapter as well as the IDoc adapter in order to use the SAP adapter.
To enable the BAPI/RFC adapter
Edit the
<ESB_HOME>/repository/conf/axis2/axis2.xml
file and uncomment the BAPI sender and listener as follows:Code Block language xml <transportSender name="bapi" class="org.wso2.carbon.transports.sap.SAPTransportSender"/> ... <transportReceiver name="bapi" class="org.wso2.carbon.transports.sap.SAPTransportListener"/>
To enable the IDoc adapter
Edit the
<ESB_HOME>/repository/conf/axis2/axis2.xml
file and uncomment the IDoc sender and listener as follows:Code Block language xml <transportSender name=”idoc” class="org.wso2.carbon.transports.sap.SAPTransportSender"/> ... <transportReceiver name=”idoc” class="org.wso2.carbon.transports.sap.SAPTransportListener"/>
Anchor | ||||
---|---|---|---|---|
|
...
Setting up the *.dest property file
To setup WSO2 ESB as a client to a SAP system you need to create the *.dest
property file and define the relevant properties. The following table lists the properties and the description of each property that should be specified in the *.dest
property file.
Property | Description |
---|---|
| Client logon |
| User logon |
| Alias user name |
| Logon password |
| Logon language |
| R/3 system number |
| R/3 application server |
| R/3 message server |
| Gateway host |
| Gateway service |
| R/3 name |
jco.client.group | Group of application servers |
| Program ID of external server program |
jco.client.tphost | Host of external server program |
| Type of remote host (3=R/3, E=External) |
jco.client.codepage | Initial code page for logon |
| Use remote SAP graphical user interface |
| Use the specified SAP cookie version 2 as the logon ticket |
jco.client.grt_data | Additional data for GUI |
| Host to which the remote GUI is redirected |
| Service to which the remote GUI is redirected |
jco.client.use_guiprogid | Progid of the server that starts the remote GUI |
jco.client.snc_partnername | 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 |
jco.client.snc_lib | Path to the library |
| R/2 destination |
| 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 |
Info | ||
---|---|---|
| ||
You can obtain the values for these properties from your SAP system administrator. |
The *.dest
property file should be named <SAP-GWHOST>.dest
. For example, if the name of your SAP gateway is SAPSYS
, the name of the file should be SAPSYS.dest.
Following is a sample configuration for the *.dest
property file:
Code Block |
---|
jco.client.client=800
jco.client.user=wso2_user
jco.client.passwd=wso2pass14
jco.client.lang=en
jco.client.ashost=/H/217.116.29.154/S/3299/H/10.100.5.120/S/3200
jco.client.gwserv=3300
jco.client.sysnr=00
jco.client.idle_timeout=300
jco.client.logon=0
jco.client.msserv=3600
jco.client.trace=0
jco.client.getsso2=0
jco.client.r3name=CPT |
Setting up the *.server property file
To setup WSO2 ESB as an IDoc server you need to create the *.server
property file and define the relevant properties. The following table lists the properties and the description of each property that should be specified in the *.server
property file.
Property | Description |
---|---|
| Gateway host |
| Gateway service |
| Program ID of the server |
| You can enable or disable the RFC trace |
jco.server.repository_destination | Name of the .dest file. For example, if the .dest file is SAPSYS01.dest , set this to SAPSYS01 . |
jco.server.params | Arbitrary parameters for RFC library |
| SNC name |
| 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 |
Info | ||
---|---|---|
| ||
You can obtain the values for these properties from your SAP system administrator. |
The *.dest
property file should This file should be named <SAP-GWHOST>.destserver
. For example, if the name of your SAP gateway is SAPSYS
, the name of the file should be SAPSYS.destserver.
Following is a sample configuration for the the *.dest
property server
property file:
Code Block |
---|
jco.clientserver.client=800 jco.client.user=wso2_user jco.client.passwd=wso2pass14 jco.client.lang=en jco.client.ashost=gwhost=/H/217.116.29.154/S/3299/H/10.100.5.120/S/3200 jco.clientserver.gwserv=3300 jco.server.progid=IGS.CPT jco.clientserver.sysnr=00repository_destination=IGS.CPT jco.clientserver.idle_timeout=300name=IGS.CPT jco.clientserver.logon=0 jco.client.msserv=3600 jco.client.trace=0 jco.client.getsso2=0 jco.client.r3name=CPT |
Setting up the *.server property file
To setup WSO2 ESB as an IDoc server you need to create the *.server
property file and define the relevant properties. The following table lists the properties and the description of each property that should be specified in the *.server
property file.
Property | Description |
---|---|
| Gateway host |
| Gateway service |
| Program ID of the server |
| You can enable or disable the RFC trace |
jco.server.repository_destination | Name of the .dest file. For example, if the .dest file is SAPSYS01.dest , set this to SAPSYS01 . |
jco.server.params | Arbitrary parameters for RFC library |
| SNC name |
| 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 |
Info | ||
---|---|---|
| ||
You can obtain the values for these properties from your SAP system administrator. |
This file should be named <SAP-GWHOST>.server
. For example, if the name of your SAP gateway is SAPSYS
, the name of the file should be SAPSYS.server.
Following is a sample configuration for the *.server
property file:
Code Block |
---|
jco.server.gwhost=/H/217.116.29.154/S/3299/H/10.100.5.120/S/3200
jco.server.gwserv=3300
jco.server.progid=IGS.CPT
jco.server.repository_destination=IGS.CPT
jco.server.name=IGS.CPT
jco.server.unicode=1 |
The table below summarises how you can define a SAP endpoint and a proxy service.
...
BAPI/RFC adapter
...
Code Block | ||
---|---|---|
| ||
<endpoint name="sapbapiendpoint">
<address uri="bapi:/JCOCLIENT01"/>
</endpoint> |
The SAP endpoint client property file should be in <ESB_HOME>/repository/conf/sap/JCOCLIENT01.dest
...
Code Block | ||
---|---|---|
| ||
<proxy name=”sapbapiproxy” transports=”bapi”/>
//in,out,fault Sequence
<parameter name="transport.sap.serverName">JCOSERVER01</parameter>
// other parameters
</proxy> |
SAP endpoint server property file should be in <ESB_HOME>/repository/conf/sap/JCOS ERVER01.server
...
Code Block | ||
---|---|---|
| ||
<endpoint name="sapidocendpoint">
<address uri="idoc:/JCOCLIENT01"/>
</endpoint> |
The SAP endpoint client property file should be in <ESB_HOME>/repository/conf/sap/JCOCLIENT01.dest
Code Block | ||
---|---|---|
| ||
<proxy name=”sapidocproxy”transports=”idoc”/>
//in,out,fault Sequence
<parameter name="transport.sap.serverName">JCOSERVER01</parameter>
// other parameters
</proxy> |
...
unicode=1 |
The table below summarises how you can define a SAP endpoint and a proxy service.
Endpoint Configuration | ProxyService Configuration | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
BAPI/RFC adapter |
The SAP endpoint client property file should be in |
SAP endpoint server property file should be in | ||||||||||
IDoc adapter |
The SAP endpoint client property file should be in |
SAP endpoint server property file should be in |
Following are descriptions of the proxy level listener parameters that can be defined in a proxy configuration:
Parameter | Description |
---|---|
transport.sap.serverName | The name of the server containing the JCO server configuration. |
transport.sap. enableErrorListener | Set this to enable the default error listener. If this is used together with the transport.sap. customErrorListener parameter, the custom error listener will be used. |
transport.sap. enableTIDHandler | Set this to enable the transaction handler to handle transactions that are received from a SAP system. Transactional applications must provide a custom implementation using the transport.sap. customTIDHandler parameter. |
transport.sap. customTIDHandler | The fully qualified class name for the custom TID handler implementing JCoServerTIDHandler . |
transport.sap.connections | The number of registered connections managed by the server instance. The default value is 1 and the maximum value is 100 . |
transport.sap. customErrorListener | The fully qualified class name for the custom error listener implementing JCoServerErrorListener . |
transport.sap. customExceptionListener | The fully qualified class name for the custom exception listener implementing JCoServerExceptionListener . |
Following are descriptions of the SAP client properties that can be defined in the message context with axis2-client scope:
Property | Description |
---|---|
transport.sap.xmlMapper | The key of custom IDOC XML mapper to use. This key should be defined in the transport.sap. customXMLMappers parameter. If no key is specified the default IDoc XML mapper will be used. |
transport.sap. xmlParserOptions | The options for the default IDoc XML parser to be used in the default IDoc XML mapper. Multiple options can be combined using the bitwise OR "|" operator. The possible parser options are as follows: PARSE_ACCEPT_ONLY_XMLVERSION_10 3328 |
Following is an Axis2 transport sender property that can be defined in axis2.xml:
transport.sap.customXMLMappers
: The key/value list of custom mappers, where the values are fully qualified class names for custom mappers implementing org.wso2.carbon.transports.sap.idoc.IDocXMLMapper
.
...
Troubleshooting
Given below are general troubleshooting guidelines.
...