Last active
April 17, 2018 21:18
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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