Skip to content

Instantly share code, notes, and snippets.

@softy12
Last active April 17, 2018 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save softy12/6656cdeea4deaf72dcd1257b39508625 to your computer and use it in GitHub Desktop.
Save softy12/6656cdeea4deaf72dcd1257b39508625 to your computer and use it in GitHub Desktop.
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