Monday, 16 September 2019

Develop a full-stack multi module business application(MTA) by using java as middle-ware.

In this blog, I will explain the step by step process to create a multi module business application(MTA) by using java as the middle-ware component with the help of SAP Web IDE full-stack and this application will be deployed onto the Cloud Foundry trail account.

Functionality of the Application :- Here I am going to display the list of employees of an organization.

Technical Architecture : –


SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Prerequisites: – 


1. Access to SAP Web IDE Full-Stack.
2. Enable SAP HANA Database Development Tools, Tools for Java Development, SAP HANA Database Explorer and SAP Cloud Platform Business Application Development Tools features in Web IDE.
3. Enable Cloud foundry in the SCP trail account.
4. Create Space and Organisation in the Cloud Foundry account.
5. Configure the Cloud Foundry space and install the Builder.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Application: –


Launch SAP Web IDE full-stack and create a MTA application from the template.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

One MTA project will be created in your workspace with name MTA_Employee.

Create a DB module for the MTA project as shown below.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Create a CDS view in the DB module as shown below.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Give the name of the CDS view as Organization.

One CDS view will be created under scr folder, now open the CDS view in the Code Editor and replace the entire code with the code given in the path Organization.hdbcds.

Build the CDS view to create the Employee table in the HANA DB.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Once the Build is successful one table will be created in the DB, which can be checked from the Data Base explores by adding the DB to the  DB explorer in the Web IDE.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Add some records into the table by generating and executing the insert statement.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Execute the above SQL query by putting some values as shown in the screenshot.

Create a calculation view in the DB module to read the Employee table.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

◈ One Calculation view will be created under the src folder with name GetEmployees, now open it in the Code Editor and replace the entire code with the code given in the path GetEmployees.hdbcalculationview.
◈ Build the DB module by right clicking and selecting Build on the DB folder.
◈ Now we will create Java module.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Now Java module is created and the folder structure will look like as below.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Open the pom.xml and replace the entire content with code given in the path pom.xml.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Open the web.xml and replace the entire content as given in the path web.xml.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Now create the below java classes and copy the code from the mentioned path. Make sure the folder structure is exactly same, create the missing folders.

     ◈ GetEmployeeServlet  :-  GetEmployeeServlet.java 
     ◈ EmployeeEDMProvider :- EmployeeEDMProvider.java
     ◈ EmployeeProcessor :- EmployeeProcessor.java

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Java module is now created, build the Java module as shown below.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Now Create UI module.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

UI module is now created and the folder structure will look like as below.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Open the following files and replace the content from the mentioned path.

◈ Xs-app.json :- xs-app.json
◈ Home.view.xml :-  Home.view.xml
◈ Component.js :- Component.js

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Open the mta.yml file in the editor mode and replace the entire content with the code from the path mta.yaml.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

MTA application is now ready, build the MTA application to create the achieve file.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Once the build is successful then you can find the archive file under the mta_archives folder.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Deploy the .mtar file to the Cloud Foundry.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

You will be prompted to enter the details of the Cloud Foundry.

Once the deployment is successful then you can see three applications in the Cloud Foundry.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Click the UI application to find out the URL of the MTA App.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

Click the URL to run the application.

SAP HANA Tutorials and Material, SAP HANA Learning, SAP HANA Certifications, SAP HANA MTA, SAP HANA Studio, SAP HANA Online Exam

No comments:

Post a Comment