Unable to connect some SAP systems from python using PYRFC, SAPGUI login works fine
Dear colleagues,
I am working on creating a connection of Python with SAP ECC using PYRFC, most the ABAP systems can able establish the connection successfully, but a few ABAP systems always establish connection fails with the error message "Name or password is incorrect (repeat logon) ", it seems that the test account is not valid, however when I try it from SAPGUI my connection works fine.
The error logs are as below:
conn = Connection(user="xxxx", passwd="xxxx!", ashost="xxxx.xxx.sap.corp", sysnr="00", clientNum="002")
File "src/pyrfc/_pyrfc.pyx", line 264, in pyrfc.pyrfc.Connection.__init__
File "src/pyrfc/_pyrfc.pyx", line 310, in pyrfc.pyrfc.Connection._open
File "src/pyrfc/_pyrfc.pyx", line 353, in pyrfc.pyrfc.Connection._error
pyrfc._exception.LogonError: RFC_LOGON_FAILURE (rc=2): key=RFC_LOGON_FAILURE, message=Name or password is incorrect (repeat logon) [MSG: class=, type=, number=, v1-4:=;;;]
Just in case it is a test account issue, I applied some new test accounts with different names and different clients but still get the same error.
besides that, I also tried to use the IP address instead of the 'xxxx.xxx.sap.corp' as well, but still not working and get the same error again.
Since we have more than 10 ABAP systems, only 2 ABAP systems get this error. I am wondering if is there anything needs to be set on the ABAP side to enable the connection of pyrfc? or could someone know how to fix it?
additional info: pyrfc version: 2.5.0 (test 2.0.2 as well, getting same error message)
Please let me know if you need any more details. Thank you in advance for your help.
is there anything needs to be set on the ABAP side to enable the connection of pyrfc
Nothing PyRFC specific but ABAP system shall be configured for RFC communication in general and ABAP user profile shall be configured RFC communication. There are OSS notes describing these configurations or better check with Basis consultant.
Some ABAP systems are configured for SNC connections only and logon with user/password is not allowed. Then different logon auth is required in PyRFC client: http://sap.github.io/PyRFC/authentication.html#snc-with-user-pse
Please re-open if needed