Skip to Content
Author's profile photo JEET MAHESHWARI

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

 

  1. 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.
  2. 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.    
  3. 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.                                                                                 
  4. 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.
  5. Once the application is running, we can test the xsodata service from the application URL. Metadata of service.xsodata is displayed.
  6. 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

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      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!

      Author's profile photo Stefano Cataldo
      Stefano Cataldo

      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

      Author's profile photo Lucia Subatin
      Lucia Subatin

      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:

      Author's profile photo Former Member
      Former Member

      Thanks Lucia, that was the issue actually 🙂

      Author's profile photo Stefano Cataldo
      Stefano Cataldo

      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:

      1. The xsodata don't work. It only said "500 Invalid HANA settings provided. OData services are disabled." Google didn't really helped 🙁
      2. I haven't the .che folder ... do I miss something? (See scrennshot I post for reply the other comments)

      Did anybody of you finish this tutorial? I would really appreciate any kind of help.

      Stefano

       

      Author's profile photo Lucia Subatin
      Lucia Subatin

      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.

      Author's profile photo Daniel Souza
      Daniel Souza
      • open the file xs-app.json and write the follow code
      {
      	"welcomeFile": "index.html",
      	"authenticationMethod": "none",
      	"routes": [{
      		"source": "(.*)(.tinyjs)",
      		"destination": "tinyjs_api"
      	
      	},
      	{
      		"source": "(.*)(.xsodata)",
      		"destination": "tinyjs_api"
      	}]
      }