Skip to content
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

Registering Pyrfc-Server does not work #369

Open
Nordmaennchen opened this issue Jun 25, 2024 · 0 comments
Open

Registering Pyrfc-Server does not work #369

Nordmaennchen opened this issue Jun 25, 2024 · 0 comments

Comments

@Nordmaennchen
Copy link

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.

Screenshots
RFC-Destination
grafik

Successfull PING after registraction of with rfcexec:
grafik

After running the above registration with the VSCode the output of the server-example an registering the function STFC_STRUCTURE:
grafik
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:
grafik

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant