-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect SAP system from python using PYRFC, SAPGUI login works fine #212
Comments
Perhaps the domain name resolution does not resolve the XYZ.com to ip addr. Did you try to replace the hostname with the host ip address in |
Thank you for your response. from pyrfc import Connection
conn = Connection(user='BOTID', passwd='XXXXX', ashost='XYZ.com', sysnr='50', client='100')
#conn = Connection(user='BOTID', passwd='XXXXX, ashost='192.30.33.16', sysnr='50', client='100')
result = conn.call('STFC_CONNECTION', REQUTEXT=u'Hello SAP!')
print(result)
{u'ECHOTEXT': u'Hello SAP!',
u'RESPTEXT': u'SAP R/3 Rel. 702 Sysid: ABC Date: 20121001 Time: 134524 Logon_Data: 100/ME/E'} Error:
File "src/pyrfc/_pyrfc.pyx", line 173, in pyrfc.pyrfc.Connection.__init__
File "src/pyrfc/_pyrfc.pyx", line 221, in pyrfc.pyrfc.Connection._open
File "src/pyrfc/_pyrfc.pyx", line 251, in pyrfc.pyrfc.Connection._error
pyrfc._exception.CommunicationError: RFC_COMMUNICATION_FAILURE (rc=1): key=RFC_COMMUNICATION_FAILURE, message=
LOCATION CPIC (TCP/IP) on local host 4a4ed54a8426 with Unicode
ERROR partner 'XYZ.com:3350' not reached
TIME Thu Nov 26 16:34:15 2020
RELEASE 753
COMPONENT NI (network interface)
VERSION 40
RC -10
MODULE /bas/753_REL/src/base/ni/nibuf.cpp
LINE 4568
DETAIL NiBufIConnect: connection pending after 60000ms
SYSTEM CALL connect
ERRNO 115
ERRNO TEXT Operation now in progress
COUNTER 4
[MSG: class=, type=, number=, v1-4:=;;;] One thing I notices when I tried from SAPGUI it connect to "XYZ.com:sapdp50 (3250) and when I try it from Python code it connect to XYZ.com:3350. Do I need to check on firewall setting or add this ip and port anywhere to give network access?? Thank you in advance for your kind help.. much needed |
Looks like port for the load balancer is missing. Please check similar issues: SAP-archive/node-rfc#146 and #79, also the "Parameters for load balancing" example in You can try with MSHOST=XYZ.com
MSSERV=3250 instead of: ASHOST=XYZ.com
SYSNR=50 |
Thank you for your response! after trying, I got below error --------------------------------
[Thr 20400] Fri Nov 27 01:30:43:185 2020
[Thr 20400] +--------+-------------------------------------+------------------+
[Thr 20400] | Offset | Data (14 bytes)
[Thr 20400] +--------+-------------------------------------+------------------+
[Thr 20400] | 000000 | 2a2a4450 544d4d53 472a2a00 00f8 | **DPTMMSG**... |
[Thr 20400] +--------+-------------------------------------+------------------+
Traceback (most recent call last):
File "Check_pyrfc.py", line 3, in <module>
conn = Connection(user='BOTID', passwd='XXXX', mshost='XYZ.com', msserv ='3250', client='100')
File "src\pyrfc\_pyrfc.pyx", line 173, in pyrfc.pyrfc.Connection.__init__
File "src\pyrfc\_pyrfc.pyx", line 221, in pyrfc.pyrfc.Connection._open
File "src\pyrfc\_pyrfc.pyx", line 251, in pyrfc.pyrfc.Connection._error
pyrfc._exception.CommunicationError: RFC_COMMUNICATION_FAILURE (rc=1): key=RFC_COMMUNICATION_FAILURE, message=
ERROR The message received isn't from a message server.
Are you really connected to the message server?
Please check your connection parameters.
(XYZ.com / 3250)
TIME Fri Nov 27 01:30:43 2020
RELEASE 753
COMPONENT MS (message handling interface, multithreaded)
VERSION 4
RC -29
MODULE D:/depot/bas/753_REL/src/krn/ms/msxxi.c
LINE 382
COUNTER 1
[MSG: class=, type=, number=, v1-4:=;;;] I really appreciate your help on it. |
Hi bsrdjan Now my connection is working from Python running on windows. but same code id I am running from Docker -Linux image it is giving same error. Do you have any idea about Docker, if any change needs to be made to make connection happen ERROR partner 'XYZ.com:3350' not reached
TIME Thu Nov 26 16:34:15 2020
RELEASE 753
COMPONENT NI (network interface)
VERSION 40
RC -10
MODULE /bas/753_REL/src/base/ni/nibuf.cpp
LINE 4568
DETAIL NiBufIConnect: connection pending after 60000ms
SYSTEM CALL connect
ERRNO 115
ERRNO TEXT Operation now in progress
COUNTER 4
[MSG: class=, type=, number=, v1-4:=;;;] Thanks a ton for your response and help |
The same connection parameters should work from docker as well, no special changes required for docker. Did you try the IP instead of XYZ.com ? |
bsrdjan, Thank you for your response. |
It looks like a network error. Did you try the niping test from docker ? You can also try with SAP/fundamental-tools docker images, regularly used in testing, like the python-39.Dockerfile for example. |
if it works on Windows and not on other platforms, please check this answer and try with: pip uninstall pynwrfc
PYRFC_BUILD_CYTHON=yes pip install pynwrfc --no-binary :all: |
Please try also 2.4.0: |
I am trying to connect with SAP using this library. Do I need SAP installed on my system? |
@abdullahansari00 no, all prerequisites are listed in README: https://github.com/SAP/PyRFC |
Hi @bsrdjan
I am working on to create connection of Python with SAP ECC using PYRFC. When I try it from SAPGUI my connection works fine, but when tried it from Python code it does not work on my PC. But again it works from my other team members pc from python
So I checked all the configuration on my pc, are identical to other members pc. So I am clueless now,
When checked with nslookup, I get proper IP of the server
Need your urgent help to find out the exact reason and where to fix it. As per your comments in other issue I tried Niping, it also works fine. Please let me know if you need any more details.
Thank you in advance for your help
The text was updated successfully, but these errors were encountered: