Closed ikit closed 2 years ago
The usage of connection parameters like ashost
, mshost
, mysapsso2
etc. is described in sapnwrfc.ini
file of SAP NWRFC SDK. It is located in SDK demo
folder:
cd $SAPNWRFC_HOME/demo
Logs can be activated using rfc_trace
connection parameter, which is also described in sapnwrfc.ini
. Use the RFC_TRACE=3 in DEFAULT section for the most detailed trace.
You can use your own sapnwrfc.ini
and maintain destinations' connection parameters there, like:
sapnwrfc.ini
DEFAULT
#RFC_TRACE=3 # 'global' trace level
DEST=QM7
USER=demo
PASSWD=welcome
ASHOST=ldciqm7
SYSNR=00
CLIENT=005
LANG=EN
RFC_TRACE=2 # 'local' trace level
DEST=MME
USER=demo
PASSWD=welcome
#ASHOST=coevi51
ASHOST=10.68.110.51
SYSNR=00
CLIENT=620
LANG=EN
Destinations can be used with client or pool connections, like:
const client = new Client({dest: "MME"});
const pool = new Pool({connectionParameters: {dest: "OM7"} });
Hope this helps with further testing.
Hi, thanks for your answer.
But even if I set the RFC_TRACE=3
in the sapnwrfc.ini, I don't see more log when I run my code... but I thinks that is normal, because I hope that sapnwrfc lib don't load demo settings file when node-rfc use it.
In the Client
constructor options, I see I can set trace
which is EnumTrace
type.
But I cannot use this option in my code because the EnumTrace
type is not exported by the node-rfc module.
how I'm supposed to use this option ?
I notice that If I provide a wrong mysapsso2
, I got a RFC_ABAP_MESSAGE
saying "SSO Ticket not interpretable".
So I suppose that the connection between my application and the SAP server is ok (when I provide a good sso token).
But then the client
object didn't answer when I use the call method.
Hi
The main problem was that my application do lot of async call, and some of them were not well catched. That's why the rfc error was lost.
Now I properly catch errors, and solve it (bad network settings), the Client connection with SSO seems work well 👍 Thanks for the help.
Glad to hear :) I was just writing the answer and let me share it anyway, it might help with tracing if needed later on.
But even if I set the RFC_TRACE=3 in the sapnwrfc.ini, I don't see more log when I run my code... but I thinks that is normal, because I hope that sapnwrfc lib don't load demo settings file when node-rfc use it.
The demo INI file is not used but SAP NWRFC SDK is looking for sapnwrfc.ini
in current working folder. When sapnwrfc.ini
is found there, the RFC_TRACE=3 in the DEFAULT section should provide the most detailed log. It can be also set as destination (system) connection parameter. SAP NWRFC SDK can search for sapnwrfc.ini
also in another folder, set by setinifiledirectory add-on method.
EnumTrace
is not exported and that will be fixed. In the meantime, the trace
connection parameter can be set like:
const connectionParameters = {
user: "demo",
passwd: "welcome",
ashost: "10.11.12.13",
sysnr: "00",
client: "320",
lang: "EN",
trace:"3", // or '0', '1', '2'
};
But then the client object didn't answer when I use the call method.
Before using call()
method you can check the client.alive flag or use the client.ping() method to check if the connection is open.
Some network error messages take 1 or 2 min to come up. You could eventually try to wait 2 min or so, to check if any errors reported from the call()
method.
It looks solved but please re-open if needed.
Question Hi, I'm trying to create a connection to SAP using node-rfc with user sso token. The creation of the Client doesn't raise any error, but then when I try to call a query, nothing append (no result, no exception catched).
Below the parameters I provide to the client.
Note that all works fine if a use Client pool with a generic user with login/pwd authent
ashost
andmshost
maybe there is a conflict here ?