SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
249 stars 73 forks source link

BAPI_SALESORDER_CREATEFROMDAT2 (node-rfc call) #287

Closed emryism closed 11 months ago

emryism commented 1 year ago

Hello, I am using the latest version of node-rfc with node 16 and I am making a call to BAPI_SALESORDER_CREATEFROMDAT2, this returns a success message with my order number, but when I go to SAP TCODE VA03 my order is not there.

Example return message: "MESSAGE":" 3020150240 has been saved".

The call also includes the commit.

result = await rfcInvoke2('BAPI_SALESORDER_CREATEFROMDAT2', obj) await rfcInvoke2('BAPI_TRANSACTION_COMMIT', { "WAIT": "X" })

Enviroment:

node: 16.20.0 npm: 8.19.4 node-rfc: 2.7.0

bsrdjan commented 1 year ago

but when I go to SAP TCODE VA03 my order is not there.

Can you check again later, perhaps more time needed on ABAP side to create the order?

The issue is unlikely related to node-rfc because over RFC protocol the NodeJS behaves exactly as ABAP system. If you have access to ABAP system, can you open transaction SE37 and run BAPI_SALESORDER_CREATEFROMDAT2 from there, with same input parameters?

If it does not work from NodeJS / node-rfc, then it does not work from ABAP and SE37 either and vice versa.

emryism commented 1 year ago

I tried from another environment with another version of node-rfc to load the same order and if it loaded well in SAP.

Both environments have the same object and the same SAP user.

The new environment that did load is:

node: 0.10.37 npm: 1.4.28 node rfc 0.1.4

Note: in both cases node-rfc returns the same positive response for both BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_TRANSACTION_COMMIT.

In conclusion it worked with (node 0.1.37, node-rfc 0.1.4), but not with (node 16.20.0, node-rfc 2.7.0).

bsrdjan commented 1 year ago

which SAP NWRFC SDK version is used, with node-rfc 0.1.4 and with 2.7.0 ?

Can you send me the exact payload, to reproduce the issue?

Can you also test in ABAP system, as per my previous comment?