Skip to Content
Author's profile photo Lucia Subatin

Consume Calculation Views from XS Advanced via Information Access

This previous post explained how to install the EPMMDS plugin to consume information views from tools like Lumira, Analysis for Office or anything that uses the Information Access (InA) service to et live data from HANA (express edition, in my case).

Following are some steps to create and consume information models using modelling on XS Advanced. We assume you already have a system with XS Advanced installed. If you don’t, you can get one from any of these options.

Because we will be using XS Advanced, by “information views” I no longer mean the retiring attribute or analytical views, but the different flavors of calculation views:

I will assume you will want to create a new space to develop on the tenant database, so that will be the first step.

Create a space on XS Advanced

Well… where else would you create a space on HANA; right?

The steps to create and enable a new space are documented in the following tutorial. You will need a powerful user, like XSA_ADMIN and the steps on the following tutorial:

https://www.sap.com/developer/tutorials/xsa-setup-new-space.html

You may wonder what a space is and I’ll try to make it short: This concept is inherited from Cloud Foundry and refers to a group of resources (applications or services) visible to each other. You can have different roles in a space (Auditor, Developer, Manager) and could use, for example, different spaces to isolate different projects. A space belongs in an organization, together with other spaces.

Do you have your new space? Is your developer user assigned as a developer to that space?

Let’s move on…

Link a tenant database to your space

Another very simple task that also requires admin rights.

When you go into Web IDE to create a new multi-target application, you will be asked for your space. Linking a space to a tenant database allows you to develop on that tenant. You need the tenant in this case because, as of now, you are running the InA service through the XS Classic engine, which is now by default embedded in the index server.

In order to use that tenant DB through your space, you need to link them:

https://www.sap.com/developer/tutorials/xsa-tenant-db-space.html

Speaking of index servers, guess who does not have its own one? The system database (systemdb)!

In the system database, the name server covers the index server in only some of its functions, but not all of them. If you want full SQL capabilities and some cool stuff like predictive analytics or smart data streaming, you need a tenant database. That’s actually where your application development should be happening, anyways.

This mapping will be handy for those scenarios too.

Let the HANA modelling begin

Before you can do any modelling you will need to create a multi target app. From SAP Web IDE for SAP HANA (yeah.. I did that on purpose...), Some options to achieve this:

  • You can right-click on Workspace –> New –> Project from Template. You will be prompted to choose your space. If you’ve done it correctly, you should find your space on the list.
  • You can also clone an initialized repository from Github (as explained in this very simple tutorial) to create a new MTA.
  • In my case, I had already created an MTA with a database module and nothing else (if I had created, for example, a UAA service instance on my original space, i would have needed to create it in my new space). So I could just right-click on the project –> Project Settings. There I chose my new space and rebuilt the app.

Coming from years of modelling in HANA Studio, and just like any other human being would, I had an adaptation period of like… two hours. In terms of modelling, there are some new features that clearly make life easier and change, in this case, was easy for me to embrace.

Here are two tutorials explaining how to create dimension and cube calculation views on Web IDE on XS Advanced.

  • Creating a Dimension Calculation view tutorial
  • Creating a Cube calculation view with a star join tutorial

Grant permissions

Remember how in XS Classic you used to need a schema and the creator of the schema was its owner, so it was the only one who could grant other users with permissions and sometimes you also needed to fiddle with some other repository permissions before you could do a data preview on a calculation view? Well, it got more simple here. The HDI container has its own technical users, which are created with the HDI container itself and look like this:

Those guys ( #DI and  #OO) are the owners of the schema and its objects. They have no problem accessing the schema and executing views.

You would generally create an analytic privilege (now called structured privilege) to use with a role. I’m skipping that part because it’s my party and I access it all if I want to. If you create one, you will need to assign it to the technical user.

I will create a separate user to use from the reporting tools and grant a more restricted role to it.

From Web IDE, this is the role I created (within the src folder, I created a new file called “epm.hdbrole”, inside a new folder called “roles”):

{
	"role":{
		"name": "epm_ina",
		"schema_privileges": [{
		   "privileges": ["SELECT METADATA", 
		    			  "SELECT"
		   ]
		}]
      }
}

You can create new users and grant them permissions from the XSA Administration Cockpit (in HXE, with the default port, it’s https://hxehost:51041/sap/hana/cockpit/landscape/index.html ) or use SQL statements from the DB explorer like I did (i.e.,  grant “PNL_1″.”epm_ina” to “INA_USER” )

Connect to the reporting tools

Lumira

It’s still requesting an “XS Classic” connection. For now, that’s what I’m feeding it:

 

Ta-da! Here are my cube type calculation views, ready to be visualized:

Analysis for Office – MS Excel

I guess Excel makes people feel at home, so that’s why there is some SAP Business Objects on Excel. It is also very easy to connect to my HXE instance. The trick is to skip here so you can create a new connection:

By right-clicking and using “Create New SAP HANA connection”:

Enter the connection information:

 

And I can also see my dimension views:

There are more step-by-step, free tutorials on XS Advanced development and Lumira at the Developer Center.

Happy modelling and let’s stay in touch on  or on LinkedIn!

Assigned Tags

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

      Great Blog Lucia !
      I initially had problems with it, but once the role assigned was done, everything worked like a charm.

      Cheers

      Kiran

      Author's profile photo Shravanthi B J
      Shravanthi B J

      Great info Lucia Subatin

      I am trying to connect to a cloud foundry hana instance to consume Calculation views from external world. I was able to deploy the models and a role file from hdi as mentioned in the blog above. But i am unable to assign these roles to the db user that i created. i get an insufficient privilege error. i have logged in with the system user credentials. Is there anything that i am missing here?

      Author's profile photo Anna Geringer
      Anna Geringer

      I'm facing the same issue like you. Did you find a solution?

      Author's profile photo Lucia Subatin
      Lucia Subatin
      Blog Post Author

      Hey, sorry I missed this.

      I have not tried this scenario. I could try to reproduce it soon but you have better chances of a faster response in the Q&A.

      Author's profile photo Naresh Gadamsetti
      Naresh Gadamsetti

      Lucia Subatin

      Lumira used to connect only _SYS_BIC schema from lumira app. But in this blog post I see that you lumira directly connecting to HDI DB directly. Can you pl. clarify if this is a new feature added in lumira?

      Also if lumira directly connects to schema generated by HDI, this schema name is dynamic and changes everytime? so How lumira documents are going to handle this?

       

      Author's profile photo Lucia Subatin
      Lucia Subatin
      Blog Post Author

      Hi, Naresh,

      I am using the same trial Lumira Discovery that is available for everybody. As for what was made available when or when the HDI views will be fully supported, i recommend you keep an eye on the roadmaps for the relevant products: https://www.sap.com/products/roadmaps.html

      Best,

      Lucia.

       

      Author's profile photo Kiran Jayaram
      Kiran Jayaram

      @Lucia - I am having multiple views in different folders in my MTA container. However, only 1 view shows up in the AFO.

      In HANA studio, when I look into the schema, I find that only one view is showing up in the Column views area whereas in the "Database explorer" I can see tons of views.

      Cheers

      Kiran

      Author's profile photo Lucia Subatin
      Lucia Subatin
      Blog Post Author

      Hi Kiran,

      I am not sure I understand the problem or how HANA Studio is related. Please post questions with enough level of detail in the Q&A. You will get a faster response as there are more of us there to help.

      Best,

      Lucia.

      Author's profile photo Sunil Manjunatha
      Sunil Manjunatha

      Hi Lucia,

      Can you Please share which connection do we need to use in Tableau to connect with HANA 2.0 XSA

       

      Author's profile photo Lucia Subatin
      Lucia Subatin
      Blog Post Author

      Hi Sunil, I replied on the other blog.

      Best,

      Lucia.

      Author's profile photo Rajarshi Muhuri
      Rajarshi Muhuri

      rare and refreshing to find a tone of humor in dry technical blogs

      Author's profile photo Michael Howles
      Michael Howles

      Nice blog Lucia.  I was actually looking for some information on when the next version of Lumira will be able to access HDI containers but this is a recent enough blog and looks like a good short-term approach for me.

       

      On a related topic for HDI and XSA, do you know how easy or difficult it is to set up a DP Agent for use with SDI to an XSA HDI Container's DB Schema?  I've got this down to an art in XS Classic, but I'm considering taking the "plunge" into HDI if this is viable currently.

      Author's profile photo Rakshit Chopra
      Rakshit Chopra

      Hi while creating the calculation view in mta application. I am facing the following issue when i search for table in calculation view. it displays the error

      Incorrect service: Connect errorError: only secure connections are allowed
      Author's profile photo Ceyhun Alp
      Ceyhun Alp

      Very informative blog Lucia, thanks!

      Have you ever tried consuming Calculation Views from XS Advanced in ERP/S4HANA? I've tried but no way 🙂 Calculation Views appear as a transient provider as before but they dont work. It's still looking at _SYS_BIC schema to select the data.

      With XSC we were able to view the calculation views as a transient provider or directly in RSRT. I think same feature has to be revised for XSA Calculation Views.

      Thanks

      Author's profile photo Ashwini Deshmukh
      Ashwini Deshmukh

      Hi Lucia ,

      Thank you for the blog . It is really helpful.

      I am able to connect analysis for Microsoft excel using Webide user after granting INA_User Role from SYSTEMDB user. but objects(schema/views) are not visible in Area . could you please guide me which roles are responsible for Object access. because I am not able to grant HDN roles created using systemDB user .

       

      Regards,

      Ashwini Deshmukh

      Author's profile photo Steven Hochwart
      Steven Hochwart

      Hello Lucia,

      thank you for this blog it helped me a lot.

      Kind regards
      Steven