on ‎2025 Jun 09 2:28 PM
Hi everyone,
I set up a node rfc server according to the official documentation. https://github.com/SAP-archive/node-rfc/blob/HEAD/doc/usage.md#nodejs-server-program-example
I set up the ini file, the rfc destination (which successfully passes the connection test), the sec_info, and reg_info.
I'm calling the Node.js RFC function from ABAP using a CALL FUNCTION ... DESTINATION statement.
The issue is sometimes it works and sometimes not. Once it executes the node js function I defined successfully then I restart the server again and then I get the error that the function module (name of the function) not found.
I could not find a reasonable pattern that under what condition it works and under what condition it does not.
I appreciate any help.
I can provide my full codes if needed.
Thanks in advance
Request clarification before answering.
Looks like you have two instances of the server running? One which has the required definition of the FM you call, and one that doesn't. The ABAP system then does "load balancing" and sometimes calls the correctly configured server program and sometimes the other one... 🙂
That is the only plausible explanation, because a server program simply does not "sometimes know the incoming FM and sometimes doesn't know it"...
Check "SMGW --> Logged on Clients" in order to see, how many registered server connections for the given Program ID (TP Name) exist.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Strange, looks fine so far.
In this case, there must be something very wrong either in the Python wrapper around libsapnwrfc.so, or in your Python code itself. Try setting the environment variable RFC_TRACE=4, before starting the server program. Then we can see, what the program is doing.
I have never used Python, but when doing it in C, I would do something like
RFC_ERROR_INFO errorInfo;
// Either manually created or obtained from ABAP DDIC:
RFC_FUNCTION_DESC_HANDLE myFuncDesc = ...;
RfcInstallServerFunction(cU("NPL"), myFuncDesc, handlerFunction, &errorInfo);
at the very beginning, and the function should be known for the runtime of the process. The only way to make it "unknown" again, is to call RfcInstallServerFunction a second time like this
RfcInstallServerFunction(cU("NPL"), myFuncDesc, NULL, &errorInfo);
If this is happening, we should see it in the RFC Trace.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.