- Notifications
You must be signed in to change notification settings - Fork74
Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
License
SAP-archive/node-rfc
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This public repository is no longer maintained. Please seethis issue for details.
Asynchronous, non-blockingSAP NetWeaver RFC SDK client and server bindings forNode.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.
- Based onN-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
- Supported Platforms
- Requirements
- Download and installation
- Getting started
- Usage
- API
- Troubleshooting
- More resource and info about SAP Connectors and RFC communication
- Code of Conduct
- Contributing
Kyma and BTP Node.JS buildpack:ABAP RFC connectivity from Kyma and BTP Node.JS buildpack
AWS Lambdas, heroku ...
- Create GitHub issue to get up-to-date information
- Create SAP feature request for
Security Services
category of theSAP Cloud Platform – Platform Foundation
Operating systems: thenode-rfc connector can be built from source(build instructions) on all platforms supported by bothSAP NW RFC SDK and byNode.js
Node.js:current and active LTS releases
Docker containers:SAP fundamental-tools/docker
Electron: current release, seeSAP-samples/node-rfc-samples/frameworks/electron-quick-start and #144
Deno: latest release
Other platforms and frameworks:
NW.js
- Feature request: #144
- SAP-samples/node-rfc-samples/frameworks/nwjs-quick-start
Node-RED
- Feature requests: #161 and #148
- Experimental work:PaulWieland/node-red-contrib-saprfc
Build toolchain is based onnode-gyp
and Python. For further details check:node-gyp#Installation
seeSAP Note 3337381: SAP NetWeaver RFC SDK 7.50 -- Patch Level 12 for a list of bug fixes and enhancements made with this patch release.
Only the latest patch level is supported by SAP
The latest version is fully backwards compatible, from today S4, down to R/3 release 4.6C.
Can be downloaded from SAP Software Download Center of the SAP Support Portal, like described athttps://support.sap.com/nwrfcsdk.
If you are lacking the required authorization for downloading software from the SAP Service Marketplace, please follow the instructions ofSAP Note 1037575 for requesting this authorization.
Release notes:SAP Note 3337381 - SAP NetWeaver RFC SDK 7.50 -- Patch Level 12
Only the latest path level is supported by SAP
SAP NW RFC SDK C++ binaries must be downloaded from SAP Suport Portal and locally installed. Checkinstallation instructions andSAP NW RFC SDK section on SAP Support Portal. Using the latest version is reccomended as SAP NW RFC SDK is fully backwards compatible, supporting all NetWeaver systems, from today S4, down to R/3 release 4.6C.
Docker container examples for Linux, Intel and ARM based Darwin:SAP/fundamental-tools/docker. SAP NWRFC SDK libraries are not included.
- Build toolchain is based on Ubuntu 20.04, for node-rfc binaries compatible with glibc >= 2.28 and libstdc++ >= 6.0.25 (GLIBCXX_3.4.25). The build toolchain follows is defined bystandard Node.js build toolchain configuration
Visual C++ Redistributable is required for runtime. The version is given inSAP Note 2573790 - Installation, Support and Availability of the SAP NetWeaver RFC Library 7.50
Build toolchain requiresMicrosoft 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
❗ The build from source requires Node.js release with minimum N-API version given inpackage.json
property "napi_versions":Node-API version matrix.
After the SAP NW RFC SDK is installed on your system, thenode-rfc
can be installed from npm:
npm install node-rfc
Alternatively, when thenode-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 https://github.com/SAP/node-rfc.gitcd node-rfcnpm installnpm run addon# rebuild native addonnpm run ts# rebuild typescript wrapper
SeeUsage andAPI, alsoSAP NWRFC SDK 7.50 Programming Guide
In order to call remote enabled ABAP function module, we need to create anode-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 tosapnwrfc.ini file in your working directory:
DEST=MMEUSER=demoPASSWD=welcomeASHOST=myhostSYSNR=00CLIENT=620LANG=EN
Connection parameters are documented insapnwrfc.ini
file, located in theSAP NWRFC SDKdemo
folder. Check also section4.1.2 Using sapnwrfc.ini
ofSAP NWRFC SDK 7.50 Programming Guide
Call the ABAP RFM. When in doubt about RFM parameters' structure tryabap call
CLI tool ofSAP/fundamental-tools
constnoderfc=require("node-rfc");constclient=newnoderfc.Client({dest:"MME"});(async()=>{try{// unlike the connection acquired from pool,// the direct client connection is initially closedawaitclient.open();// invoke ABAP function module, passing structure and table parameters// ABAP structureconstabap_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 tableletabap_table=[abap_structure];constresult=awaitclient.call("STFC_STRUCTURE",{IMPORTSTRUCT:abap_structure,RFCTABLE:abap_table,});// check the resultconsole.log(result);}catch(err){// connection and invocation errorsconsole.error(err);}})();
constnoderfc=require("node-rfc");constpool=newnoderfc.Pool({connectionParameters:{dest:"MME"}});(async()=>{try{// get a client connection instanceconstclient=awaitpool.acquire();// invoke ABAP function module, passing structure and table parameters// ABAP structureconstabap_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 tableletabap_table=[abap_structure];constresult=awaitclient.call("STFC_STRUCTURE",{IMPORTSTRUCT:abap_structure,RFCTABLE:abap_table,});// check the resultconsole.log(result);}catch(err){// connection and invocation errorsconsole.error(err);}})();
Finally, the connection is closed automatically when the instance is deleted by the garbage collector or by explicitly calling theclient.close()
method of the direct client, orclient.release()
orpool.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 aticket.
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 tonode-rfc!SeeCONTRIBUTING.md for more details on our philosophy around extending this module.
About
Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js