Skip to end of metadata
Go to start of metadata

Applies to:

Unix and Linux clients; SAP Netweaver ABAP servers


Installation of the sapnwrfc package for python, for the purposes of making RFC calls to an SAP Netweaver ABAP system from a python script.


Author:            David Hull
Company:       The Walt Disney Company
Created on:    01 April, 2010
Author(s) Bio
David is currently an SAP Architect, and has been a Basis Administrator and Database Administrator for over 15 years.

1. Download and install SAP Netweaver RFC SDK

To do this, you must have a valid S-user account at Here are the instructions to obtain this, per note 1025361:
The installation files for the SAP NW RFC SDK are available on the SAP Service Marketplace:
-> Entry by Application Group
-> Additional Components
-> SAP NW RFC SDK 7.11
-> SAP NW RFC SDK 7.11
-> <platform>
-> NWRFC_2-20004xxx.SAR

 After downloading the NW RFC SDK for your platform, simply unpack it somewhere convenient for you such as /usr/sap/nwrfcsdk. Set the environment variable LD_LIBRARY_PATH to the lib directory of the SDK both to build the perl module, as well as to execute the scripts.

2. Download and install the PyYAML package

Get the latest version of the PyYAML package so that your python script can read yaml files.

3. Download and install sapnwrfc package

Download the latest sapnwrfc package from Piers Harding's website.

At this point, you should be ready to execute a python script using the sapnwrfc interface.

4. Preparing a script

To prepare a script, you'll need a 'yml' file similar to the 'sap.yml' file included with the sapnwrfc download. The file looks like this:

Put the file in the same directory your script will be in, and correct the parameters in it to connect to your test system. You'll need to change the application server name, system number, client, username and password. Then, you should be able to execute a simple script such as the following:

Related Content

blog: Python and SAP Adventures
wiki: sapnwrfc for Python