No need to present SAP, it is one of the most used ERP in the world. Usually, when discussing with our customer, the common challenge they are facing is the in-house technical SAP knowledge and/or the cost of external resources. Therefore they have to make choice based on budget; stable operation and mission critical change having priority, it usually means not much budget left to spend time on process simplification, optimization and automation.
Good news is, SAP do expose the business function to outside program thru the BAPI (Business Application Programming Interface), to make it simple an API. The second good news is that BAPI are accessible from outside SAP. There are a lot of literature out there that can explain in more details BAPI and RFC.
In the following post, we will explain how to use BAPI via python from a regular Windows machine. Same can be done with a Linux machine or a Mac.
1. Python
First, you need to install Python on your computer. All required step can be found on python.org web site.
2. SAP RFC SDK
Download and install the SAP RFC SDK available directly on SAP Website here
After downloading the install will consist on the following steps:
3. Wheel
Install wheel:
pip install wheel
4. Microsoft Visual C++ 14.0
If not already on your computer, you will need to insall Microsot Visual C++ 14.0. This website explains the why and how.
5. pyRfc
The last step is to install pyrfc. The best way that has always worked for us is to follow these steps:
git clone https://github.com/SAP/PyRFC
python setup.py bdist_wheel
pip install dist/pyrfc-1.9.6-cp27-cp27mu-linux_x86_64.whl
After these steps, you should be good to go.
you can now move to the next part.