Article
· Jul 14, 2016 1m read

Headstart to connect to SAP using SAPJCo3 with Ensemble and HealthShare

Recently we have exercised this with a partner. It may be helpful for others as well.

The basic functionality is to connect to SAP through SAPJCo (Supporting SAPJCo 3.07+).

As a first step have a production with at least two items of the following type:

  • EnsLib.JavaGateway.Service
  • EnsLib.SAP.Operation

Configure the settings for the Java Gateway and the SAP Operation accordingly. And start the production.

 

Now the library sapjco3.jar needs to get imported to be used by further internal functionality.
Therefore start in a browser the webpage for simplified SAPJCo base installation

/csp/<your sapjco namespace>/EnsPortal.Dialog.SAPJCO.BaseConfiguration.cls.

Name the SAPJCo-Operation just in the wizard (in our case it is called „SAPJCoOperation“ within the production).

As the next step, you'll import the Java library e.g. "C: \sapjco\JCO3_64\sapjco3.jar". You need to get a version from the owner of the SAP system (the SAP system owner is entitled to download it from SAP Marketplace).

Now almost all relevant information to import the sapjco3.jar is available. Open the „Import sapjco3.jar“. A click on the textfield will start a filedialog. Point it tot he jar-file.

By clicking on the Import sapjco3.jar button the proxy classes will be generated. After the successful import you should see the following screen:

Now the real work may begin.

Discussion (2)0
Log in or sign up to continue

Troubleshoot #1

Just in case you find a java UnsatisfiedLinkError...
It seemed that the test installation wrongly choose the 32-bit version.
It was solved on my maschine by reinstalling the Java JRE 64 bit.

This was on Java(TM) SE Runtime Environment (build 1.8.0_92-b14).

java.lang.UnsatisfiedLinkError: C:\....\sapjco3.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform

Troubleshoot #2

I just recently had a case on a customer site where their SAPJCo interface stopped working after the production or system gets restarted. This always results in the following error:

ERROR#5023: Java-Gateway-Error: java.lang.ClassNotFoundException ...

In order to make this working again, the sapjco3.jar and BAPI's always needs to imported/generated again.

The reason for this was, that using the SAPJCo installation/import webpage is setting and using the Class Path from the jar file during the import, but restarting production or system makes the production/service forget about it.

Solution: What's missing here is that in the EnsLib.JavaGateway.Service of the production the "Class Path" needs to be specified in the "additional settings" as well to the full-path reference to the sapjco3.jar.

With that setup in place, production and system could now be restarted without affecting the SAPJCo interface.