I found a method for connecting python to sap on the Internet a few days ago. Currently, this open-source project is available:
1. pysaprfc: http://pysaprfc.sourceforge.net/http://pypi.python.org/pypi/Python%20SAP%20RFC%20module/1.0.0
2. saprfc/sapnwrfc: http://www.piersharding.com/blog/ http://pypi.python.org/pypi/sapnwrfc/0.10
First, this project requires the sap Connection Library File librfc. dll (Linux: librfccm. So ).
Librfc. dll can be found under system32 after sapgui is installed. librfccm. So can be found in jco2.x for Linux.
Store the library files in a specific library location according to system requirements. The window is under system32, And the Linux is under/usr/lib.
Pysaprfc can be used directly. saprfc also requires the. h header of the sap rfc sdk, which can be found in the sap gui installation package.
The problem is that both methods have a problem where Unicode characters cannot be processed (Chinese characters obtained from SAP are garbled ), it seems that you need to download the new sap rfc sdk or SAP NetWeaver rfc sdk again. Currently, I have no permission to download these two things. If you have any friends who can download them, please send them to me, in addition, if you have a better method, please do not hesitate to inform us...