-
Notifications
You must be signed in to change notification settings - Fork 168
Description
Describe the bug
Starting from the python server example with registration I was able to connect to the SAP backend, BUT the sample stated zero as the registrationscount. I was also NOT able to ping my RFC-Destination with a conneciton test in SM59.
A test with the rfcexec program contained in the sapnwrfc package connected successfully to the backend with the same connection parameters.
Pyrfc also connected succesfully to the backend in an RFC-client setup.
To Reproduce
Prerequisites: Correctly installed SAP NW RFC SDK and pyrfc
a) In SAP Start transaction SM59, create a tcp/ip RFC destination ZCM_TEST with registration with program_id ZCM_TEST
b) First try to start the successfull scenario:
open a terminal and run the rfexec program located in the bin directory of the nwrfc sdk installation directory:
./rfcexec -a ZCM_TEST -g /H/<sap_router>/S/3299/H/<sap_gateway> -x 3300
<sap_router> and <sap_gateway> are the hostnames of your sap-gateway and sap-router. The sap-gateway can also be maintained in sm59, like the gateway service (number after the -x argument). In this example the sap-router is accessible via the port 3299.
c) try to connect now with the server program - I tried different settings passing the GWHOST including the saprouter, as well as trying to pass it to the server with the SAPROUTER argument. None of those worked. Here a code snipped
...
# create server
server = pyrfc.Server(
server_params={
"SERVER_NAME":"ZCM_TEST",
"PROGRAM_ID":"ZCM_TEST",
#"SAPROUTER":"/H/<sap_router>/S/3299", #this was option one: saprouter
"GWHOST":"/H/<sap_router>/S/3299/H/<sap_gateway>",
"GWSERV":"3300"},
#I used the same client params as with a successfull client test
client_params=TEST,
},
)
...
I also found out, that the server sample tries to print a server.options - Attribute, that is not contained any more in the Server-class. I therefore assume that there might also be different handling needed, or that there is a bug in the Server-class, or the example is outdated.
Thank you for your help.
Successfull PING after registraction of with rfcexec:

After running the above registration with the VSCode the output of the server-example an registering the function STFC_STRUCTURE:

This is the output of a print(server.get_server_attributes()) after the server.addfunction and server.start - call and waiting for the key press to stop the server.
The connection test then shows:

A call to STFC_STRUCTURE with destination ZCM_TEST also show a communication error:

Environment
- Mac-OS Sonoma 14.3.1, MacBook Pro M1 Chip 32 GB
- Not running in docker
- PyRFC version 3.3.1
- SAP Netweaver RFC SDK 7.50.13
- SAP Setup: SAP_Basis release 7.58 SP0001, Connection goes throug a load balancer, saprouter to the SAP.
Additional context
It would be good to have also a sample in pyrfc that has direct connection parameters, because the configuration file containing the parameters for the give destination in the current sample is not provided.
