SAP HANA EXPRESS XSA Application Part 2
In this part, we will continue developing our XSA application with Node.js module for business logic. Please refer the Part 1 for MTA project and database HDI Module creation steps.
HANA XSA MTA project and HDI Module
- Right click on the MTA project name and create Node.js module New->Node.js Module. Complete the steps in the wizard .
The wizard even provides an option of XSJS support. Kindly check the same as we are going to use xsodata services.
- Once the above steps is completed, we can see the Node.js module in our project workspace with all the source files such as server.js to bootstrap xsjs, package.json created.
- As shown below , we have both HDI module(CMData) and Node.js module(MSBusinessLogic). This both module needs to interact with each other. To achieve this, we to maintain required entries in mta.yaml file. In mta.yml file, we need to mention Node.js module requires HDI module and Node.js module provide service to be used by any other module.
- Next we willl create xsodata service for the two entities created in CMData HDI module. Right click on MSBusinessLogic module and create an new file as service.xsodata under the lib folder.
In the xsodata, we have defined the service to expose the entities as well as the association from Customer to Orders.
Save, Build and Run the application.
- Once the application is running, we can test the xsodata service from the application URL. Metadata of service.xsodata is displayed.
- We will also create XSJS to interact with the HDI module.
Thus till now we have created MTA poject, HDI module and Node.js module. Also we have seen how the Node.js module consumes the HDI module artifacts.
Next we will create an user interface module and show how the same consumes the xsodata service provided by Node.js module.
Part 3 : User Interface Module
I have Hana Express VM
Version: SAP Web IDE for HANA 2
SPS 02 Patch 0 ( Build 4.2.14 )
In the new menu of the MTA there is node option for Node.js project!
Hi Former Member
I wonder about you have this problems. In my WebIDE I can see that option :O
I have the same SAP WEBIDE Version as you. Did you manage to work it? Did you successfull complete the tutorial?
Regards, Stefano
If you can't see the Node.js module wizard on Web IDE, it may be because the service is not running. For HXE on GCP, using a separate browser or incognito mode, log in as XSA_ADMIN to https://hxehost:51015 (the cockpit) and go into the "Application Monitor" tile and make sure the nodejstools service is running:
Thanks Lucia, that was the issue actually 🙂
Hi together,
somehow I'm not able to follow the tutorial. I'm using
Version: SAP Web IDE for HANA 2
SPS 02 Patch 0 ( Build 4.2.14 )
The problem is, that many staff are shown here don't appear or are different. However, I get the database and I was able to insert some data in the table. Nevertheless I have severe problems:
Did anybody of you finish this tutorial? I would really appreciate any kind of help.
Stefano
Hi, I bumped into your error while looking for something else... but, that is telling you that you are missing the dependency to the hdi container and db module in the definition of the js module (you need to set it up in the mta.yaml).
You should see the .che folder if you enable the hidden files, under the "View" menu in Web IDE.
You can also see the details to these steps for a very similar introductory app in either SAP Help https://help.sap.com/viewer/400066065a1b46cf91df0ab436404ddc/2.0.02/en-US/3375e588350b47d4aa4200564429f96b.html
Or the Developer Center: https://www.sap.com/developer/groups/hana-xsa-get-started.html
Cheers!
Lucia.