Friday 27 August 2021

CAP: Access the HANA DB behind (via HANA Explorer)

When you create a CAP application with HANA as the database, it is not very intuitive to find how to explore tables/views of the application (being a developer). This method can also be used for loading initial data (via xlsx, csv files) to your tables during production cutover.

In this short blog, I will explain how to do that.

What won’t work?

If you go to your HANA Cloud instance ( in the Space ) and open the HANA explorer, this actually tries to open the explorer via the HANA Cockpit so it requires you to know the DBADMIN credentials which as a developer you will not have. Moreover sharing DBADMIN credentials is not safe as this single HANA instance can be serving Sandbox, Dev, QA landscapes and DBADMIN can edit/view tables of all applications in all of those landscapes.


As a developer of the CAP application, all you need is specific tables of the CAP application within the Space (Landscape).

What do you need?
All you need is this URL

https://hana-cockpit.cfapps.<Region ID>.hana.ondemand.com/hrtt/sap/hana/cst/catalog/cockpit-index.html 
Here Region ID is the region where your subaccount (containing the HANA Cloud Instance) was created. For example us21, ca10 etc.

It requires you to log in with the platform user ( user with which you would log in to your sub-account cockpit). Once you log in, the explorer opens but there are no databases to explore.

Click on the + icon, remember to search by ‘HDI Container’. CAP applications create HANA DBs via the HDI Container so you can view your tables via this HDI container. The name of the HDI Container will be the same as the one you gave in the mta.yaml of your CAP application.


Now you can open the database, navigate to tables, view contents, import CSV etc.

No comments:

Post a Comment