Closed Gopinath-gs closed 4 years ago
I think you misunderstood the meaning of the parameter -E: it is used for setting the input parameters of the function module EDI_DATA_INCOMING/EDI_STATUS_INCOMING. These function modules have two parameters PATH and PORT, but this PORT is an ALE/EDI port and not a network port… In any case, PORT is only an input parameter of the function module that is called after the connection is opened -- it is not used for opening the connection.
Try one of the following:
However: are you really sure that 3601 is the correct RFC port for your SAP system?? Usually the 36XX ports are not gateway ports (used for RFC protocol), but dispatcher ports (used for DIAG protocol, e.g. for SAPGui connections). If 3601 is the dispatcher port, then I would expect the gateway port to be 3301, so all you would need to do is supply "-s 01" in your connect parameters.
Best Regards, Ulrich
Ah, wait a moment, 36XX is the message server port, not the dispatcher... My bad... So it looks like you are trying group logon? Then instead of the parameters -h and -s (which get mapped to RFC parameters "ashost" and "sysnr"), you need to modify startrfc.cpp to accept parameters that get mapped to the RFC parameters "mshost", "sysid" and "group". In /etc/services you will need an entry that maps service name "sapmsABC" to 3601 (if "ABC" is the sysid of your SAP system).
Alternatively, if you can't modify /etc/services, you can replace the parameter "sysid" with "msserv" and pass 3601 directly.
A third alternative: I just looked at the code of startrfc and noticed, that it supports the parameter -D, which allows referencing an entry in the sapnwrfc.ini file. So the following would work without any code modifications:
Create a file sapnwrfc.ini in the current working directory where you start startrfc and fill it as follows: DEST=ABC MSHOST=servername.com MSSERV=3601 GROUP=PUBLIC CLIENT=100
Now you can start startrfc with the following parameters: startrfc -u data_usr -p pwd -D ABC -l EN [+ further parameters for setting the inputs of FM EDI_xx_INCOMING, depending on the EDI customizing of your SAP system]
However, all this has nothing to do with PyRFC. I am not familiar, but I am pretty sure PyRFC also has parameters that allow group logon. (Check the docs of PyRFC for how these look like.)
Best Regards, Ulrich
I'm sorry for the late response. I'm looking into the replies now. I comeback to you soon.
Hi Ulrich Thank you for your reply.
I tried your 3rd option. I got below error message. I tried to check the connection with startrfc -u username -p pwd -D configfile -i Error: Parameter ASHOST, GWHOST, MSHOST or PORT is missing.
I'm going to try other options.
Hi Gopinath,
this is wrong:
startrfc -u username -p pwd -D configfile -i
The parameter -D does not specify the name of the file, but the destination inside the file. The file is found by the NW RFC Lib automatically, if it is in the current working directory. Do it exactly as I described: file has to be named sapnwrfc.ini, first line in the file needs to be
DEST=ABC
and the parameter -D ABC needs to be passed to startrfc.
I think PyRFC accepted the parameters. I'm able to test the connection. Appreciate for your help- Ulrich
Cheers
I tried to connect SAP server using below config. The connection fails with error "partner not reached" As port is not open for 3300, Connection fails. Thats ok.
I understand that PyRFC tries to connect with sysnr suffix based port number. The question and the issue is Why config -E is not used?
/usr/local/sap/nwrfcsdk/bin/startrfc -h servername.com -s 00 -u data_usr -p pwd -c 100 -i -E 3601
Error: ERROR partner 'servername.com:3300' not reached TIME Fri Oct 16 11:55:43 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 2