
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Asynchronous, non-blocking SAP NetWeaver RFC SDK client bindings for Node.js, providing convenient ABAP business logic consumption from Node.js.
Operating systems: the node-rfc connector can be built from source(build instructions) on all platforms supported by both SAP NW RFC SDK and by Node.js
Node.js: current and active LTS releases
Docker containers: SAP fundamental-tools/docker
Electron: current release, see SAP-samples/node-rfc-samples/frameworks/electron-quick-start and #144
Deno: latest release
Other platforms and frameworks:
SAP Cloud Platform, AWS Lambdas, heroku ...
Security Services category of the SAP Cloud Platform – Platform FoundationNW.js
Node-RED
Build toolchain is based on node-gyp and requires Python. For build platform requirepements details check: node-gyp#Installation
Docker container examples for Linux, Intel and ARM based Darwin: SAP/fundamental-tools/docker. SAP NWRFC SDK libraries are not included.
Visual C++ Redistributable is required for runtime. The version is given in SAP Note 2573790 - Installation, Support and Availability of the SAP NetWeaver RFC Library 7.50
Build toolchain requires Microsoft C++ Build Tools, the latest version reccomended
Remote paths must be set in SAP NWRFC SDK for macOS: documentation
When the node-rfc is started for the first time, the popups come-up for each NWRFC SDK library, to confirm it should be opened. If SDK is installed in admin folder, the node-rfc app shall be that first time started with admin privileges, eg. sudo -E
More info: Installation
:exclamation: The build from source requires Node.js release with minimum N-API version given in package.json property "napi_versions": Node-API version matrix.
After the SAP NW RFC SDK is installed on your system, the node-rfc can be installed from npm:
npm install node-rfc
Alternatively, when the node-rfc package is not provided for your platform for example, the package shall be built from source. This installation method is highly recommended on Linux platforms:
git clone --single-branch https://github.com/SAP/node-rfc.git
cd node-rfc
npm install
npm run addon # rebuild native addon
npm run ts # rebuild typescript wrapper
See Usage and API, also SAP NWRFC SDK 7.50 Programming Guide
In order to call remote enabled ABAP function module, we need to create a node-rfc client instance with valid logon credentials, connect to SAP ABAP NetWeaver system and then invoke a remote enabled ABAP function module from nodejs. Async example below shows basic principles and you can check the documentationand unit tests for more examles.
Add your ABAP system destintion to sapnwrfc.ini file in your working directory:
DEST=MME
USER=demo
PASSWD=welcome
ASHOST=myhost
SYSNR=00
CLIENT=620
LANG=EN
Connection parameters are documented in sapnwrfc.ini file, located in the SAP NWRFC SDK demo folder. Check also section 4.1.2 Using sapnwrfc.ini of SAP NWRFC SDK 7.50 Programming Guide
Call the ABAP RFM. When in doubt about RFM parameters' structure try abap call CLI tool of SAP/fundamental-tools
const noderfc = require("node-rfc");
const client = new noderfc.Client({ dest: "MME" });
(async () => {
try {
// unlike the connection acquired from pool,
// the direct client connection is initially closed
await client.open();
// invoke ABAP function module, passing structure and table parameters
// ABAP structure
const abap_structure = {
RFCINT4: 345,
RFCFLOAT: 1.23456789,
RFCCHAR4: "ABCD",
RFCDATE: "20180625", // ABAP date format
// or RFCDATE: new Date('2018-06-25'), // as JavaScript Date object, with clientOption "date"
};
// ABAP table
let abap_table = [abap_structure];
const result = await client.call("STFC_STRUCTURE", {
IMPORTSTRUCT: abap_structure,
RFCTABLE: abap_table,
});
// check the result
console.log(result);
} catch (err) {
// connection and invocation errors
console.error(err);
}
})();
const noderfc = require("node-rfc");
const pool = new noderfc.Pool({ connectionParameters: { dest: "MME" } });
(async () => {
try {
// get a client connection instance
const client = await pool.acquire();
// invoke ABAP function module, passing structure and table parameters
// ABAP structure
const abap_structure = {
RFCINT4: 345,
RFCFLOAT: 1.23456789,
RFCCHAR4: "ABCD",
RFCDATE: "20180625", // ABAP date format
// or RFCDATE: new Date('2018-06-25'), // as JavaScript Date object, with clientOption "date"
};
// ABAP table
let abap_table = [abap_structure];
const result = await client.call("STFC_STRUCTURE", {
IMPORTSTRUCT: abap_structure,
RFCTABLE: abap_table,
});
// check the result
console.log(result);
} catch (err) {
// connection and invocation errors
console.error(err);
}
})();
Finally, the connection is closed automatically when the instance is deleted by the garbage collector or by explicitly calling the client.close() method of the direct client, or client.release() or pool.release() for the managed client.
Highly reccomended series of three insightful articles about RFC communication and SAP NW RFC Library, published in the SAP Professional Journal (SPJ):
and more:
If you encounter an issue or have a feature request, you can create a ticket.
Check out the SCN Forum (search for "node-rfc") and stackoverflow (use the tag "node-rfc"), to discuss code-related problems and questions.
We appreciate contributions from the community to node-rfc! See CONTRIBUTING.md for more details on our philosophy around extending this module.
Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
FAQs
nodejs bindings for SAP NW RFC SDK
The npm package node-rfc receives a total of 2,189 weekly downloads. As such, node-rfc popularity was classified as popular.
We found that node-rfc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.