Connecting OpenERP and SAP

Hestin Jose's picture

OpenERP can connect to SAP through the RFC gateway using sapnwrfc (SAP NetWeaver R/3 RFC Connector for Python)

The below tutorial is based on the experiance in configuring sapnwrfc in ubuntu 10.04 . There might be changes in other distros and versions. Its is assumed that the commands given below will be run as root user.

You have to download the following

  1. nwrfcsdk - SAP Netweaver RFC SDK. Download recent version appropriate to your architecture(32bit, 64bit ...) from SAP Marketplace.
  2. sapcar - Archive manager. The downloaded nwrfcsdk will be a .SAR archive. We need sapcar to extract the downloaded .SAR archive. Download from SAP Marketplace recent version appropriate to your architecture(32bit, 64bit ...)
  3. sapnwrfc - From http://www.piersharding.com/download/python/sapnwrfc/. Download the latest release

Extract the SDK which will be something like NWRFC_1-20004565.SAR using sapcar (SAPCAR-32bit.exe)  You will get a folder named nwrfcsdk.

  • chmod +x SAPCAR-32bit.exe
  • ./SAPCAR-32bit.exe -xv -f NWRFC_xxxxxxxxxx.SAR

Create a folder /usr/sap and copy this folder(nwrfcsdk) to it.

  • mkdir /usr/sap
  • cp -r nwrfcsdk /usr/sap

Now create a file sap.conf(name can be anything ending with .conf) under the directory /usr/sap/nwrfcsdk/lib
 

  • echo "/usr/sap/nwrfcsdk/lib" > /etc/ld.so.conf.d/sap.conf

To load the libraries run
 

  • ldconfig -v

SAP RFC Gateway will listen on port 3300 by default. If not check on which port it is listening.
Make sure you can reach the port on sap server. For example check if you can connect telnet to it by

  • telnet SAP_SERVER_IP 3300

Install PyYAML

  • apt-get install python-yaml

Extract sapnwrfc, and change directory to the extracted folder and install sapnwrfc

  • tar -zxf sapnwrfc-xxxxxx.tar.gz
  • cd sapnwrfc-xxxxx
  • python setup.py install

Make sure this finishes with no errors.

Now everything is ready to connect to SAP. 
Check the examples coming with sapnwrfc(folder examples). The examples check for the configuration file inside the directory examples/examples. So you have to create a directory examples(mkdir examples/examples) and create a yml file with the connection settings similer to the sap.yml file given in examples.
 

 

Tags: Integrating OpenERP and SAP, synchronizing OpenERP and  SAP, OpenERP, SAP, sapnwrfc , connecting to SAP using python, connecting to SAP RFC gateway from linux, SAP and python

Andrew Stephan 's picture

nice info though I could

nice info though I could search it in Internet. But it is incredible that this was successfully implemented. It will give confidence to existing SAP users to connect to OpenERP (which is really a fantastic open source ERP) and save the additional license costs for their enhancement requirements..!!

VPN,hss,hss elite,hot psot shield,proxy,unblock websites,'s picture

Hi! Quick question that's

Hi! Quick question that's totally off topic. Do you know how to make your
site mobile friendly? My website looks weird when viewing
from my iphone4. I'm trying to find a theme or plugin that might
be able to correct this problem. If you have any suggestions,
please share. With thanks!