Wednesday, 23 December 2020

SAP HANA Cloud modeling in Business Application Studio

SAP Business Application Studio is a new SAP Cloud Platform service available on CF environment, it has got a modern development environment to create business applications. It is available as a Cloud service and positioned as a successor to WebIDE fullstack. In the past, It has got features to support fiori and Cloud Application programming models but not the native HANA modeling models like Calculation views and HANA DB Explorer for runtime access. With that it used to be a combination of Web IDE full stack for Native HANA models(CVs) and BAS for other application developments. In the latest update to BAS, HANA modeling tools are made available to use.

Let us take a summary of what steps are performed to create a calculation view in BAS and deploy it without Web IDE full stack.

BAS is available on SCP CF subaccount as a subscription to access, then a Dev space will be created while accessing the BAS application. This space is going to provide all the tools needed for your required development, not to confuse BAS space with Cloud Foundry Org and Space. they both are completely different. When you creating a BAS space, select a SAP HANA native application category, with that we will get SAP predefined extensions for CV editor and DB explorer.

SAP HANA Cloud, SAP HANA Certification, SAP HANA Guides, SAP HANA Learning, SAP HANA Prep

In BAS Workspace, Connect to Target HANA instance from Command Palette as shown below, provide API Endpoint of HANA instance, CF login credentials, email ID and Password. Also choose the target Org and Space.

SAP HANA Cloud, SAP HANA Certification, SAP HANA Guides, SAP HANA Learning, SAP HANA Prep

In the next step, Start creating a proejct., From File menu — > choose New Project from Template. I get 2 options here., first one is MTA project and the second is HANA Database Project. Since my requirement is just modeling I am going to choose HANA DB project one. The Wizard is going to provide a sequence of steps to create a project with DB module , HDI container service and also let you a bind this to CF service.

SAP HANA Cloud, SAP HANA Certification, SAP HANA Guides, SAP HANA Learning, SAP HANA Prep

SAP HANA Cloud, SAP HANA Certification, SAP HANA Guides, SAP HANA Learning, SAP HANA Prep

Then hit finish, With that Project set up is completed as the template Wizard has taken care of most of the config work.  Now we can see the project is added to our workspace, with mta.yaml file, db module with src folder and .hdiconfig files etc.

you can also check the services created in CF space, by running CF commands in the Terminal.

cf services

Now we can start creating design time artifacts, I created a .hdbtable file in the src folder. I will be using this table source while creating a CV model.

Customer.hdbtable

SAP HANA Cloud, SAP HANA Certification, SAP HANA Guides, SAP HANA Learning, SAP HANA Prep

Customer table will need to built first, in order to be available in runtime and then can be used in HANA CV. so Let us build this file. I can do this either in CF terminal or SAP HANA Projects menu in the bottom. In this example I am doing it from the Project menu as shown below.

SAP HANA Cloud, SAP HANA Certification, SAP HANA Guides, SAP HANA Learning, SAP HANA Prep

Select Customer.hdbtable and hit deploy, you can see the log of file being deployed in Terminal. When it is completed, customer table is now available in the HDI container of Database. We can check that by accessing HANA DB explorer (it is another tool which is used to check HANA runtime objects and run SQL statements).

How to Navigate to DB explorer:   Command Palette, a new link will be opened for DB Explorer.

SAP HANA Cloud, SAP HANA Certification, SAP HANA Guides, SAP HANA Learning, SAP HANA Prep

In the next step, I can create a calculation view, by choosing a new file in src folder, provide the extension as Customer.hdbcalculationview, system will open a graphical layout for CV creation. It will be the same layout what is currently available in WebIDE fullstack, you don’t feel any difference while working in BAS.  Then, I can deploy this CV also in the same way table got deployed before.

SAP HANA Cloud, SAP HANA Certification, SAP HANA Guides, SAP HANA Learning, SAP HANA Prep

Finally, I can insert couple of records in the table and display data in the CV., in HANA Database Explorer SQL console.

SAP HANA Cloud, SAP HANA Certification, SAP HANA Guides, SAP HANA Learning, SAP HANA Prep

In Summary, We have seen how to use Business Application studio for HANA modeling and HANA SQL console actions going forward.

No comments:

Post a Comment