Skip to content
 
 

Repository files navigation

Fork Notice

This is a community-maintained fork of SAP-archive/node-rfc, which SAP archived on 2026-05-28 after being unable to continue maintaining it (see issue #329 for the original announcement). SAP confirmed there are no plans to revive the project and gave explicit permission for community forks to continue it.

This fork is maintained independently by @engjellavdiu and is not affiliated with or supported by SAP. All credit for the original design and implementation goes to SAP and the original author, Srdjan Boskovic.

Current focus: keeping the connector building and running on current Node.js LTS releases (starting with Node.js 24). The SAP NW RFC SDK requirement described below is unchanged — it remains a separate, proprietary download that SAP does not provide support for in the context of this fork.

Scope of this fork: this fork exists solely to keep node-rfc building and running on current Node.js versions. It does not add features, change behavior, or otherwise diverge from upstream beyond dependency/toolchain updates required for Node.js compatibility. If you need functional changes, please open an issue to discuss first.

  • Verified: compiles and loads correctly on Node.js v24.18.0 (LTS), against SAP NW RFC SDK 7.50 Patch Level 17. Native compile, module load, and client construction all confirmed. Functional RFC calls have also been verified against live SAP backends in production use. There is no public CI or automated test suite for this fork yet, so all verification is manual.

node-rfc

Asynchronous, non-blocking SAP NetWeaver RFC SDK client and server bindings for Node.js. Direct consumption of ABAP business logic from Node.js and extending ABAP eco-system with Node.js capabilities, with automatic ABAP <-> Node.js data conversions.

License N-API version Node.js

Not yet published to npm under this fork. See Download and Installation for building from source.

Key features

  • Based on N-API standard
  • Client and Server bindings
  • Stateless and stateful connections (multiple function calls in the same ABAP session (same context))
  • Async and callback API
  • ECMAScript, TypeScript
  • Sequential and parallel calls, using one or more clients
  • Automatic conversion between Node.js and ABAP datatypes
  • Direct and managed connections (connection pool)
  • Throughput monitoring: number of calls, bytes sent/received, application/total time; SAP NWRFC SDK >= 7.53 required
  • Usage examples & code-snippets: SAP-samples/node-rfc-samples

Content

Supported platforms

Other platforms and frameworks:

Requirements

node-gyp

Build toolchain is based on node-gyp and Python. For further details check: node-gyp#Installation

SAP NW RFC SDK 7.50 PL12

Docker

Docker container examples for Linux, Intel and ARM based Darwin: SAP/fundamental-tools/docker. SAP NWRFC SDK libraries are not included.

Linux

Windows

macOS

  • 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

Download and Installation

More info: Installation

❗ The build from source requires Node.js release with minimum N-API version given in package.json property "napi_versions": Node-API version matrix.

This fork is not currently published to npm. After the SAP NW RFC SDK is installed on your system (SAP NW RFC SDK Installation), build from source:

git clone https://github.com/engjellavdiu/node-rfc.git
cd node-rfc
npm install
npm run build   # compiles the TypeScript wrapper and the native addon

For faster local iteration on a single Node.js target instead of the full prebuild matrix, use npm run dev in place of npm run cpp (both invoked via npm run build).

Getting started

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

Direct client

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);
    }
})();

Managed client

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.

More resource and info about ABAP Connectors and RFC Communication

Highly reccomended series of three insightful articles about RFC communication and SAP NW RFC Library, published in the SAP Professional Journal (SPJ):

and more:

How to obtain support

This fork receives no support from SAP. If you encounter an issue or have a feature request specific to this fork, please open a ticket here.

For general SAP NW RFC SDK or ABAP-side questions, the SCN Forum (search for "node-rfc") and Stack Overflow (tag "node-rfc") remain useful, but responses there predate this fork and are not guaranteed to reflect its current state.

Contributing

We appreciate contributions from the community to node-rfc! See CONTRIBUTING.md for more details on our philosophy around extending this module.

Code of Conduct

See Code of Conduct

About

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages