This section describes the steps for connecting EcoSys to SAP through the web service API and SAP’s JCO.
SAP Adaptor Network Architecture
The SAP Adaptor is a component (pluginsap.war) that you can deploy within the same container as the EcoSys web application (ecosys.war), or on a different container and/or host. There are three connections involved in making the plug-in operate:
STEP 1: The EcoSys web application utilizes SOAP web service calls to communicate with the plug-in. You configure the connection in the EcoSys UI on the External Systems screen, and using the <url> tag.
STEP 2: The SAP Adapter utilizes SAP’s JCo (Java Connector) to communicate with the SAP system. You configure this connection in the EcoSys UI on the External Systems screen, using several connection attributes that identify the SAP system.
STEP 3: The plug-in then connects back to the EcoSys system using SOAP calls to the static SOAP API (SSAPI). You configure this connection in the EcoSys FMServerSettings.properties file, and should be an address accessible from wherever the plug-in is deployed.
The status for each of these connections is reported on the System Info > Integration screen. All three connections must be reported as successful for the plug-in to operate correctly.
Before configuring the SAP Adaptor to connect to SAP, you must install the JCO client component on the EcoSys server. This includes two parts:
The SAP sapjco3.dll file must reside in the operating system’s PATH. It is recommended to copy this file to the c:\windows\system32 folder.
Install the SAP JCO Java libraries. Specifically, add the sapjco3.jar file to the application server’s Java CLASSPATH. This can be done by copying the sapjco3.jar file into the EcoSys lib folder or the common lib folder of the application server.
In addition, you must prepare the database for SAP transactions by executing the following one of the following scripts against the ESFM database type that matches the environment.
For MSSQL, run fm_ss_sap_global_objects.sql. This script is located in the EcoSys\database\sqlserver\utils folder.
For Oracle, run fm_or_sap_global_objects.sql. This script is located in the EcoSys\database\oracle\utils folder.
Configure the SAP Adaptor to Connect to SAP
After you have installed the underlying web service components, you can configure the connection to SAP using the EcoSys web application:
Log in as an administrator user.
Navigate to the External Data Sources screen.
Add a new external data source for your SAP connection, and set the type to Web Service API.
Configure the connection information as follows, replacing the bold fields with values corresponding to your SAP system. Set the plug-in service URL to match the URL where the SAP Adaptor was deployed. Usually, this is on the same application server where the EcoSys web application was deployed.
If the SAP installation requires the use of a wrapper or proxy around the RFC_READ_TABLE call, this may be specified as an optional parameter in the connection configuration. In this example, the system will call ZRFC_READ_TABLE in place of the standard function:
If the SAP system does not require this proxy function, omit this parameter and it will call the native RFC_READ_TABLE by default.
Validating the SAP Connection
After you have set up the connection information for the external system, you can validate the connection. Navigate to the System Info screen, and then select the Integration tab. A button displays for your SAP connection. Clicking that button runs through a test to validate the SAP connection. The output includes the status and version for three different components of each connection:
The status and version of the plug-in interface itself (the EcoSys adaptor to SAP)
The status and version of the external system provided by the plug-in (in this case SAP)
The status and version of the EcoSys API service the plug-in is using (most of the time this will be the same as your EcoSys web application)
Each of the three sub components must report Connection Successful, or provide detailed information about what kind of failure was encountered.
You can then go back to External Data Sources, modify the connection info, then test the connection again until the issues are resolved. You may use this process at any point to validate the connection is functioning.
Troubleshooting the SAP Connection
The following are common issues when connecting to SAP and their cause/resolution:
Missing Java Libraries indicates a .jar file is missing from the application server runtime classpath:
Solution: Add the sapjco3.jar file to your application server’s CLASSPATH.
This .jar file is part of SAP’s software distribution, and is not supplied by EcoSys.
Missing Windows Libraries indicates a .dll file is missing from the Windows OS PATH (c:\windows\system32 or similar):
caused by --> java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [no sapjcorfc in java.library.path]. java.library.path
Solution: Copy the sapjco3.dll file to c:\windows\system32 or somewhere in your OS PATH.
This .dll file is part of SAP’s software distribution, and are not supplied by EcoSys.
Network connection to SAP system not available indicates that the system cannot connect to a live SAP system:
ERROR partner not reached
com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
Connect_PM GWHOST=192.168.2.13, GWSERV=sapgw00, ASHOST=192.168.2.13, SYSNR=00
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
Solution: Verify network connectivity between the EcoSys server and the SAP server. You can do this using ping (the SAP server should reply when pinged from the EcoSys server command line), and also by using telnet to test the connection to the SAP port (typically port 3300 or 3600, depending on the system number).