Skip to Content
Technical Articles
Author's profile photo Sreekanth Surampally

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.

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.

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.

 

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

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.

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.

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.

 

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

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

Thanks for reading.

Sreekanth Surampally

Assigned tags

      16 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Fredrick Mumali
      Fredrick Mumali

      Great blog! Thanks for sharing.

      Author's profile photo Ayala Halachmi
      Ayala Halachmi

      Great Blog, Thank you.

      On top of what you wrote I would like to mention two additional capabilities:

      • In order to add HDB artifacts, such as calculation view, you can use the command SAP HANA: Create HANA Database artifact  (you can access it through the command palette) that will help you adding different artifacts.
      • To make sure that the service was successfully created and it is bound correctly to your module, in SAP HANA Projects panel under the database connection folder you can find your hdi container. If its icon has a green plug, and you can see your service name in brackets, it also means that you are successfully bound to your service.

       

      Thanks

      Ayala

       

       

       

      Author's profile photo Sreekanth Surampally
      Sreekanth Surampally
      Blog Post Author

      Thanks Ayala, Yes, Using Wizard for Creating HDB artifacts is a good option because we don't enter any wrong extensions for the file. Thanks for adding.

      Author's profile photo Afshin Irani
      Afshin Irani

      Thanks Sreekanth, this feature just snuck up on me and a long awaited one too.

      Thanks for the blog.

      Author's profile photo sandra green
      sandra green

      Nice Post! Thanks for sharing such an amazing article, really informative, it helps me a lot.

      SAP HANA Cloud is a fully managed in-memory cloud database as a service (DBaaS). As the cloud-based data foundation for SAP's Business Technology Platform, it integrates data from across the enterprise, enabling faster decisions based on live data.

      Author's profile photo Vishnupriya Varadharajan
      Vishnupriya Varadharajan

      Thanks for this great post Sreekanth. Is there any way where we can import our calculation views created in HANA 1.0 here into BAS?

      Thanks

      Vishnupriya

      Author's profile photo Sreekanth Surampally
      Sreekanth Surampally
      Blog Post Author

      You can migrate all design time objects like calculation views using Migration assistant tool. https://blogs.sap.com/2020/05/27/hana-db-migration-from-neo-to-cloud-foundry/

      After migration, you can import the migrated content into BAS project and start building and deploying. 

      Author's profile photo Vishnupriya Varadharajan
      Vishnupriya Varadharajan

      Thanks Sreekanth. Will try.

      Author's profile photo Vishnupriya Varadharajan
      Vishnupriya Varadharajan

      Hi Sreekanth,

      I had managed to use the migration tool and create the migrated content (db,migration,mta.yaml) folders. I am trying to import it in both Web IDE and BAS. Below is the error I am encountering in Web IDE :

       

      3:44:49 PM (HDB) Requested version of @sap/hdi-deploy is 3.7.0, found in package.json.
      3:44:49 PM (HDB) You're not using the latest available version of @sap/hdi-deploy. You might want to consider upgrading to version 3.11.10.
      3:44:52 PM (HDB) @sap/hdi-deploy, version 3.7.0 (mode default), server version unknown (0.0.0.0), node version 8.12.0Detection of server version
      failed; root cause: Could not connect to any host: [ 5a9645ac-10ec-4b79-8e97-90c6f32c8a4e.hana.prod-eu10.hanacloud.ondemand.com:443 -
      certificate has expired ]
      3:44:52 PM (HDB) No ignore file at /tmp/hdi-space-deploy-5438U3pP44BR5j-content/.hdiignore.
      3:44:52 PM (HDB) Collecting files...
      3:44:52 PM (HDB) Collecting files... ok (0s 1ms)
      3:44:52 PM (HDB) 5 directories collected16 files collected0 reusable modules collectedTarget service:
      MIGVVTEF1-MIGTEL-hdi-S0011581101-w2exNqkNJMT/Ge/kF
      3:44:52 PM (HDB) Processing grants files...
      3:44:52 PM (HDB) Processing "cfg/synonym-grantor-service.hdbgrants"...
      3:44:52 PM (HDB) Error: service synonym-grantor-service not found; the service definition does not exist.
      3:44:52 PM (HDB) (3s 156ms)
      3:44:52 PM (HDB) Deployment failed with exit code: 1
      3:44:52 PM (HDB) STRUCTURED LOG CHECKSUM b5ded8d553f94f27f8acbb2e3b673763e70371f501d06faf2944deec6bb5f906
      3:44:52 PM (HDB) STRUCTURED LOG SIZE723
      3:44:52 PM (HDB) SENDING STRUCTURED LOG
      3:44:52 PM (HDB) Ended because of error: Deployment failed with exit code: 1
      3:44:52 PM (HDB) Build command failed : hdi-build operation failed: Deployment failed with exit code: 1
      3:44:52 PM (HDB) Build of /MIGVVTEF1/db failed due to The "task for hdb build" process finished with code 1.

       

      Also, have a clarification - do we need to explicitly create user-provided services for synonym-grantor-service as expected by generated db/cfg/grantor.hdbgrants files as mentioned in the image below :

      Any help would be really appreciated.

      Thanks

      Author's profile photo Sreekanth Surampally
      Sreekanth Surampally
      Blog Post Author

      You will have to adjust the grantor file, user provided service and synonyms files according to your Cloud foundry Database guidelines. if you are facing while doing the build, you can ask questions in the community forum.

      Regards

      Sreekanth

      Author's profile photo Pitchiah Bellam
      Pitchiah Bellam

      Great Blog, Thank you for Sharing.

      As you said

      By accessing HANA DB explorer I am trying to check HANA runtime objects  but I could not see in my Main user DBADMIN.

      In Fact I could not see system generated users/schemas like

      _SYS_BIC for Activated objects,

      _SYS_REPO Activated objects, Inactive Objects for this I was trying to provide access in hana-cockpit monitor and administrator by User & Role assignment but I could not get lookup(_SYS_BIC, _SYS_REPO) from the list.

      Why it is not showing any idea on this change, Where we could see runtime and design time objects(CalculatedViews)

      Author's profile photo Sreekanth Surampally
      Sreekanth Surampally
      Blog Post Author

      Hi, In this blog I am using HANA cloud database, in which _SYS_REPO and _SYS_BIC user/schemas do Not exist as XSA/Cloud foundry don't use them. All Calculation views are not created in _SYS_BIC schema instead they will be created in the hdi container you are working.

      So You are going to create calculation views as part of HDI container in the workspace(design time), after deployment they will be available as column views under the HDI container database/Schema(Run Time).

      Author's profile photo Pitchiah Bellam
      Pitchiah Bellam

      Thank you for clarifications

      Author's profile photo Former Member
      Former Member

      Hi Sreekanth,

      Great Blog! Thanks for sharing.

      I have two doubts -

      1.)I am unable to do data preview at intermediate nodes in a calculation view. Is it some thing which is not available at the moment or do we need to do some configuration?

       

       

      2.)How can we access SYS_REPO objects? I have few roles created on SYS_REPO objects like GRANT_ACTIVATED_ROLE and REVOKE_ACTIVATED_ROLE in SAP HANA 1.0 SP12 which we are accessing using PUBLIC synonyms. How can we replicate the same in BAS as I cannot see these objects in Public Synonyms in my HDI container?

       

      Author's profile photo Pitchiah Bellam
      Pitchiah Bellam

      Hi Sreekanth,

      Am also having same doubts on SAP BAS, data preview for intermediate nodes for debugging.

       

      Author's profile photo Former Member
      Former Member

      Hi Pitchiah Bellam

      Data Preview at intermediate nodes in BAS is available now.

      Please find screenshot.

      Thanks,

      Mirnal