1.3.1 • Published 5 years ago
rfmcall v1.3.1
rfmcall
ABAP RFM calls from NodeJS even easier.
RFM call templates, with pre-initialized ABAP data structures, saving the development and troubleshooting time: rfmcall @ SAP SCN
Maintained as a part of SAP Fundamental Library for ABAP, can be used also independent.
Usage
Invoke the utility with ABAP backend destination (maintained in sapnwrfc.ini) and ABAP RFM name. The RFM call template is by default echoed to console, with the source code for RFM parameters initialization and invocation.
$ npm install rfmcall
$ rfmcall MME STFC_CONNECTION
//
// STFC_CONNECTION
//
let params = {
// IMPORT PARAMETERS
REQUTEXT : "", // CHAR (255)
};
result = await client.call("STFC_CONNECTION", params);Using the -s option, the template is saved to local js file:
$ rfmcall MME BAPI_USER_GET_DETAIL -s
$ cat BAPI_USER_GET_DETAIL.jsRFM Template
The RFM call template starts with ABAP RFM parameters initialization, followed by RFM call.
- Optional parameters are commented out
- RFM elementary parameters (variables) are initialized with a NodeJS number, string of Buffer
- RFM structure and table parameters are initialized with empty object
{}or array[] - The structure name is provided in a comment, with the detailed field level initialization following below
- The name of conversion (ALPHA) exit, if relevant for certain parameter or field, is provided in a comment (see BAPICOMREM/LANGU below )
BAPI_USER_GET_DETAIL.js
//
// BAPI_USER_GET_DETAIL
//
let params = {
// IMPORT PARAMETERS
USERNAME: "", // CHAR (12) User Name
//CACHE_RESULTS : "", // CHAR (1) Temporarily buffer results in work process
// TABLE PARAMETERS
RETURN: [], // BAPIRET2 Return Structure
//ACTIVITYGROUPS : [], // BAPIAGR Activity Groups
//ADDCOMREM : [], // BAPICOMREM BAPI Structure Communication Comments
//ADDFAX : [], // BAPIADFAX BAPI Structure Fax Numbers
...
...
};
...
...
// ACTIVITYGROUPS BAPIAGR Activity Groups
let ACTIVITYGROUPS = []; // BAPIAGR Activity Groups
let BAPIAGR = {
AGR_NAME : "", // CHAR (30) Role Name
AGR_TEXT : "", // CHAR (80) Role Description
FROM_DAT : "", // DATS (8) Date of menu generation
ORG_FLAG : "", // CHAR (1) Indicator: Indirect Assignment of the User to the Role
TO_DAT : "", // DATS (8) Date of menu generation
};
// ADDCOMREM BAPICOMREM BAPI Structure Communication Comments
let ADDCOMREM = []; // BAPICOMREM BAPI Structure Communication Comments
let BAPICOMREM = {
COMM_NOTES : "", // CHAR (50) Communication link notes
COMM_TYPE : "", // CHAR (3) Communication Method (Key) (Business Address Services)
CONSNUMBER : "", // NUMC (3) Sequence Number
ERRORFLAG : "", // CHAR (1) Flag: Record not processed
LANGU : "", // LANG (1) ALPHA=ISOLA Language Key
LANGU_ISO : "", // CHAR (2) 2-Character SAP Language Code
};Enjoy!
