SAP HANA EXPRESS XSA Application Part 1
SAP HANA EXPRESS 2.0 provides us with SAP WEB IDE for HANA , enabling us to develop XS Advanced application supporting Node.js as well as JAVA framework. With this series of blog, I will share my first XSA application having database module for database artifact, Node.js module for XSODATA services i.e. business logic as well as user interface module based on SAP FIORI Master detail template.
Part 1 : HANA XSA MTA project and HDI Module
Part 2 : Node.js Module
Part 3 : SAP FIORI MASTER_DETAIL UI Module
First, we need to set up SAP HANA EXPRESS on Google cloud platform. Refer the below link to set up your instance of SAP HANA EXPRESS.
Once we have the HANA Express Edition instance set up and able to access SAP WEB IDE for HANA we can start with our first XSA application.
- Make sure all the XS apps instance are running before accessing the SAP WEB IDE for HANA . It takes on average 30-45 mins once we start HANA DB for all the required services to start. Same can be checked using XS apps command in SSH client or by access the XSA-ADMIN applcation.
In Part 1, we will start by creating Multi-Target Application project and HDI Module.
- Create an new MTA project in you work space New->Project from template : Provide the application name as well as space. . Once all the steps of the wizard is complete, we can see the MTA project been created in our work space with the required files such mta.yaml. With SAP WEB IDE for HANA 2 SPS 1, we can edit mta.yaml in source based as well as form based editor.
- Create an HDI database Module. Right click of n Project name and select HDB Module. Complete the steps as per the HDI Module wizard. HANA 2 SPS 01 supports downward compatibility i.e. deploying the module in lower version.
- Once the final step is completed, in the logs we can see the steps performed to deploy the HDI module in the HDI container and in the work space we can see HDI module artifacts created. mta.yaml file is also been updated.
- Now we can create database artifacts such as view, procedures, CDS artifacts. We will create an CDS artifact having the database table as well as exposing the same using ODATA annotation. Right click on the HDI module and select New->CDS Artifact
We can see we have both Graphical as well as source based editor for CDS artifact.
- Result of above step is .hdbcds file been created. We can navigate between both the editors and changes saved by using one is visible in the other editor. Graphical editor has the features of creating association, built in expression for specific column, indexes, partition.
- We will continue editing .hdbcds file and creating to two entity table Customer and Orders
Here we a have used source based editor. Upon SAVE and Build, we can view and edit the entity using graphical editor. Now SAVE and Build and generate the database artifacts .
- In SAP WEB IDE we can navigate to Database explorer to view the tables created in the above step. To navigate, select Tool->Database explorer. Add HDI container which got created wtih HDI module.
- On selecting TABLES catalog, we can see two tables entity Customer as well as Orders
- Right click on one of the entity, you will get the option to generate SELECT, INSERT statements. As well to view the definition as well as Open data. We will generate the INSERT statement and update few records in both the entities.
Thus we have seen till now to create MTA project as well as HDI module in an SAP WEB IDE for HANA.
Next we will create an Node.js module with xsodata service for both the entities created in
Business Module Part 2 : Creation of Node.js module
Presentation Module Part 3 : SAP FIORI MASTER_DETAIL UI Module