SAP / node-rfc

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

Error when calling RFC BAPI_BUPA_CENTRAL_GETDETAIL from node.js application #163

Closed sap2019 closed 4 years ago

sap2019 commented 4 years ago

Hi,

I am getting error "Error invoking BAPI_BUPA_CENTRAL_GETDETAIL [TypeError: Char expected when filling field BUSINESSPARTNER of type 0] while calling RFC BAPI_BUPA_CENTRAL_GETDETAIL from node.js locally. Below is my source code var client = new rfc.Client(abapSystem); var BPARTNER_str = { BPARTNER : "407" };

client.connect(function(err) { if (err) { return console.error('could not connect to server', err); }
client.invoke('BAPI_BUPA_CENTRAL_GETDETAIL', { BUSINESSPARTNER: BPARTNER_str }, function(err, res) { if (err) { return console.error('Error invoking BAPI_BUPA_CENTRAL_GETDETAIL', err); } console.log('Result BAPI_BUPA_CENTRAL_GETDETAIL:', res); }); });

bsrdjan commented 4 years ago

It is a bug, need to be fixed.

bsrdjan commented 4 years ago

Checked the RFM signature and the node-rfc works correct. The BUSINESSPARTNER is a variable, not the structure.

Try:

    client.invoke(
        "BAPI_BUPA_CENTRAL_GETDETAIL",
        {
            BUSINESSPARTNER: "407",
        },
sap2019 commented 4 years ago

@bsrdjan : thanks alot. Its working now.