SAP

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

SAP HANA XS Advanced, Creating a Node.js Module

Creating a Node.js Module and implementing XSJS and XSODATA

Overview

🎓 beginner ⏱ 15 min. SAP HANABeginnerOdataExpress Edition
Thomas Jung T Thomas Jung November 1, 2022
Created on September 19, 2016
Contributors

More from Thomas Jung

See all 228 tutorials by Thomas Jung →

Prerequisites

Steps

Next Steps

Time to Complete

15 Min.


Step 1 Create a Node.js module
—

Like the previous exercises, you will start by creating a new module. New->Node.js Module

New Module
New Module

Name the module core_xsjs and press Next.

js module
js module

Be sure to check the box Enable XSJS support. Then press Next. Then press Finish.

XSJS support
XSJS support

Once again the mta.yaml file has been extended to add the core_xsjs module.

MTA module updated
MTA module updated

This XSJS module will also need the UAA service for authentication. Additionally, it will need data from the database module and the HDI container behind it. Add those dependencies to the node module

MTA module updated
MTA module updated

Now you need to add the dependency from the web module to this new Node.js module and a destination route to it as well.

In the Requires section of the web module, add core_xsjs_api

If you are editing this manually, this should match the name of the value under Provides in the new node module

MTA module updated
MTA module updated

Add destinations in the field group and the following key-value pairs as the properties for the core_xsjs_api module:

Code
name: core-xsjs-backend
url: ~{url}
forwardAuthToken: true

The complete section for the web module should now look like this:

MTA module updated
MTA module updated

Step 2 > ### What is this configuration for?
+
Step 3 Configure Routes
+
Step 4 Enable authentication in your service
+
Step 5 Create an OData service
+
Step 6 Create an XSJS service
+
Step 7 Execute the xsjs module
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 7
1. Create a Node.js module 2. > ### What is this configuration for? 3. Configure Routes 4. Enable authentication in your service 5. Create an OData service 6. Create an XSJS service 7. Execute the xsjs module
Next