Skip to content

Unable to connect SAP system from python using PYRFC, SAPGUI login works fine #212

@rushikeshk-k

Description

@rushikeshk-k

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,

  • Server details are changed to - XYZ.com
root@4a4ed54a8426:/app/models# python Check_pyrfc.py
Traceback (most recent call last):
  File "Check_pyrfc.py", line 4, in <module>
    conn = Connection(user='BOTID', passwd='XXXXX', ashost='XYZ.com', sysnr='50', 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=
LOCATION    CPIC (TCP/IP) on local host 4a4ed54a8426 with Unicode
ERROR       partner 'XYZ.com:3350' not reached
TIME        Thu Nov 26 14:11:34 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:=;;;]

When checked with nslookup, I get proper IP of the server

C:\Program Files (x86)\SAP\FrontEnd\SAPgui>nslookup XYZ.com
Server:  XYZ.com
Address:  11.106.2.13 (ip changed)

Non-authoritative answer:
Name:    XYZ.com
Address:  192.30.33.16 (ip changed)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions