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 table and variable parameters 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); | |
var MAX_ROWS = 3; | |
var SELECTION_RANGE_str = { | |
PARAMETER: "USERNAME", | |
SIGN: "I", | |
OPTION: "CP", | |
LOW: "A*" | |
}; | |
var SELECTION_RANGE_tab = [SELECTION_RANGE_str]; | |
client.connect(function(err) { | |
if (err) { | |
return console.error('could not connect to server', err); | |
} | |
client.invoke('BAPI_USER_GETLIST', { | |
MAX_ROWS: MAX_ROWS, | |
SELECTION_RANGE: SELECTION_RANGE_tab | |
}, | |
function(err, res) { | |
if (err) { | |
return console.error('Error invoking BAPI_USER_GETLIST:', err); | |
} | |
console.log('Result BAPI_USER_GETLIST:', res); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment