# Connecting to SAP with 3rd party Python lib or SAP JCo jar

**URL:** <https://forum.inductiveautomation.com/t/connecting-to-sap-with-3rd-party-python-lib-or-sap-jco-jar/40712>\
**Category:** Ignition\
**Created:** [November 16, 2020, 11:12pm UTC](https://forum.inductiveautomation.com/t/connecting-to-sap-with-3rd-party-python-lib-or-sap-jco-jar/40712 "2020-11-16T23:12:44Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![phyatt](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/phyatt/32/19545_2.png) [@phyatt](https://forum.inductiveautomation.com/u/phyatt)\
**Post date:** [November 17, 2020, 7:21pm UTC](https://forum.inductiveautomation.com/t/connecting-to-sap-with-3rd-party-python-lib-or-sap-jco-jar/40712/9 "2020-11-17T19:21:57Z")

</div>

I’m using SAPJco3 for RFC calls to SAP and it works nicely.

- Place the SAPJco3 library in a folder on your gateway. (c:\SAPJco3 for example) Be sure to get the bit version to match your Java environment. (i.e.: 64 bit SAPJco3 library)

- Edit the ignition.conf file and add **wrapper.java.classpath.3=c:\SAPJco3/sapjco3.jar**

```auto
# Java Classpath (include wrapper.jar) Add class path elements as
# needed starting from 1
wrapper.java.classpath.1=lib/wrapper.jar
wrapper.java.classpath.2=lib/catapult.jar
wrapper.java.classpath.3=c:\SAPJco3/sapjco3.jar

```

- Place required .jcoDestination files in the \Program Files\Inductive Automation\Ignition folder.

This could be something like: DEV.jcoDestination, QAS.jcoDestination, PRD.jcoDestination  
This format works for me.

```auto
ashost=192.168.x.x
sysnr=00
client=110
user=username
passwd=password (The SAPJco3 library will update a clear text password with an encrypted version after the first connection.)
lang=en
pool_capacity=0

```

Limit your function calls to the gateway scope or you’ll need the SAPJco3 setup on your clients!

Sample function to return a table from SAP. Note: sapSystem is a string representing the file name of your destination file without the ‘.jcoDestination’ extension.

```auto
def Z_OEE_RATE_LIST(werks,sapSystem):
# Plant Number (werks) is passed in - Datasets returned
from com.sap.conn.jco import JCoDestinationManager
destination = JCoDestinationManager.getDestination(sapSystem)
function = destination.getRepository().getFunction("Z_OEE_RATE_LIST")
function.getImportParameterList().setValue("WERKS", werks)
function.execute(destination)
#
ds = function.getTableParameterList().getTable("OEE_RATE_LIST")
return ds

```

You can send and receive tables and individual values as needed.

I hope that helps. Let me know if you need clarification.

Paul

---

_[View the full topic](https://forum.inductiveautomation.com/t/connecting-to-sap-with-3rd-party-python-lib-or-sap-jco-jar/40712)._
