Tuesday 13 June 2017

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.

HANA Express Edition on Google Cloud Platform and Ubuntu

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 :

SAP HANA, HANA XSA, SAP HANA EXPRESS

Provide the application name as well as space. 

SAP HANA, HANA XSA, SAP HANA EXPRESS

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.

2. 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.

SAP HANA, HANA XSA, SAP HANA EXPRESS


SAP HANA, HANA XSA, SAP HANA EXPRESS

3. 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.

SAP HANA, HANA XSA, SAP HANA EXPRESS


SAP HANA, HANA XSA, SAP HANA EXPRESS
4. 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

SAP HANA, HANA XSA, SAP HANA EXPRESS

We can see we have both Graphical as well as source based editor for CDS artifact.

SAP HANA, HANA XSA, SAP HANA EXPRESS

5. 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.     

SAP HANA, HANA XSA, SAP HANA EXPRESS

6. We will continue editing .hdbcds file and creating to two entity table Customer and Orders

SAP HANA, HANA XSA, SAP HANA EXPRESS

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 . 

SAP HANA, HANA XSA, SAP HANA EXPRESS

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.

SAP HANA, HANA XSA, SAP HANA EXPRESS

8. On selecting TABLES catalog, we can see two tables entity Customer as well as Orders 

SAP HANA, HANA XSA, SAP HANA EXPRESS

9. 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.

SAP HANA, HANA XSA, SAP HANA EXPRESS


Thus we have seen till now to create MTA project as well as HDI module in an SAP WEB IDE for HANA.

No comments:

Post a Comment