Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
SAP/node-rfc nodule: usage of table and variable parameters of SAP's BAPI
//demo prg to showcase usage of structure parameter of SAP's BAPI while called from nodejs app via SAP/node-rfc nodule
"use strict";
var rfc = require('node-rfc');
var abapSystem = {
user: 'sap_user',
passwd: 'sap_user_pwd',
ashost: 'sap.nodomain',
sysnr: '01',
client: '800'
};
var client = new rfc.Client(abapSystem);
client.connect(function(err) {
if (err) {
return console.error('could not connect to server', err);
}
var IMPORTSTRUCT = {
RFCDATA1: 'some value of structure field RFCDATA1',
RFCDATA2: 'some value of structure field RFCDATA2'
};
client.invoke('STFC_STRUCTURE',
{ IMPORTSTRUCT: IMPORTSTRUCT },
function(err, res) {
if (err) {
return console.error('Error invoking STFC_STRUCTURE:', err);
}
console.log('Result STFC_STRUCTURE:', res);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment