Skip to Content
Technical Articles
Author's profile photo Venkata Saikrishna Bollineni

Consuming SAP HANA data into SAP Analytics Cloud through Live connection – End to End scenario

Hello,

I am Venkata Saikrishna, working as part of Product Management in SAP Analytics Cloud area.

A lot of colleagues, partners and customers have been often asking me questions like following:

“How easy it is to configure the live connection between SAP Cloud platform HANA to SAP Analytics Cloud?”

What are those precise list of privileges to be assigned to the user to be able to create a connection and to be able to consume the SAP cloud platform HANA data live into SAP Analytics Cloud?

Can you show us a guide which describes end-to-end process of right from creating a SCP HANA Database until consuming that content into SAP Analytics Cloud?

After going through all these questions, I wanted to put up all these topics together with and end-to-end blog post to make it easy for our community, so that all of us could learn, how powerful SAP Analytics Cloud is and how easy it is to setup the whole interoperability.

 

Disclaimer: SAP does not recommend to use the trail version of SAP HANA or any trail versions of SAP products to be used by customers for any official purposes. This is purely to showcase the possibilities around live connectivity between SAP HANA and SAP Analytics Cloud.

This blog post would help you to give an end to end understanding of how live data from SAP HANA DB cloud can be consumed and all the technical aspects involved into it.

 

Pre-requisites:

      1. SAP Analytics Cloud tenant with admin access
      2. An SAP HANA DB.

The steps involved in this process of consuming the live SAP HANA data into SAP Analytics Cloud are:

      1. Create an SAP HANA DB
      2. Create user with necessary privileges.
      3. Create a Schema & Table
      4. Load data into the table
      5. Add permissions to the SAP HANA user
      6. Create calculation view
      7. Create the live connection in SAP Analytics Cloud
        1. Caution: Select the right environment during the connection creation
        2. Use the same DB user in connection dialog.
      8. Create a model
      9. Create stories on top of the model.

 

        1. Create a SAP HANA DB:   I assume that you already have a SAP HANA DB created. If not, one must need to create a DB to execute the steps further
        2. Create user with necessary privileges:
          • Login to the cockpit : https://account.hana.ondemand.com/cockpit/#/home/allaccounts
          • Choose the SCP account
          • From the menu at the left side, choose: “Databases & Schemas”
          • Click on your DB name
          • Now click on the “SAP HANA Web-Based Development Workbench”
          • Login to the security section in SAP HANA workbench with “system” user.
          • Choose “Security” tab.
          • Right click on “Users” -> “New user” -> Enter the user name of your choice along with the password.

 

Note:  schema is automatically created in SAP HANA while creating the user.

      • Below are the Privileges you will need to add to the user:
        • Catalog privileges are to be able to create table
        • Editor privileges are to be able to create Calculation views.

 

 

Note: In SAP HANA,  I am creating the user with name ‘SAI’ and I will be using this throughout the blog post.

3. Create Table:  (Based on your data)

      • Go to Catalog in SAP HANA workbench. Login with the user created above.

 

      • Below is an example SQL statement to create the table.

 

CREATE TABLE table_name(

Order_ID DOUBLE,

Date VARCHAR(100),

Sales_Agent_Last_Name VARCHAR(100),

Sales_Agent_First_Name VARCHAR(100),

Customer VARCHAR(100),

Customer_Segment VARCHAR(100),

Country VARCHAR(100),

Latitude DOUBLE,

Longtitude DOUBLE,

Customer_Status VARCHAR(100),

Product VARCHAR(100),

Product_Type VARCHAR(100),

No_Customer_Meetings DOUBLE,

Units_Sold DOUBLE,

Order_Value DOUBLE

);

 

      • I have created the below table with the table name “SALES_REPORT”.

 

 

 

4. Load data into the table:

Now to load the data into SAP HANA tables, I am figuring our different possible ways.

For my test purpose I have just converted the records into SQL statements and inserted them.

I will update this blog post with the other possibilities of loading the data, as soon as I have the exhaustive list.

 

 

 

5. Add necessary permissions to the SAP HANA user:

      • Login to SAP HANA workbench with “SYSTEM” user.
      • Go to security tab
      • Add the below roles for “SYSTEM” user.

      • Go to catalog now again (Make sure you are going to the catalog with system user)
      • Execute the below SQL to assign INA role:  (In this example, I am assigning all the necessary roles to the user SAI that I’ve created in the beginning.)
        • Call GRANT_ACTIVATED_ROLE(‘sap.bc.ina.service.v2.userRole::INA_USER’,’SAI’);
        • grant MODELING SAI
      • Execute the following SQL statements with SAI user.
        • grant select, select metadata, execute on schema SAI to _sys_repo with grant option;

6. Create Calculation view:

      • Login to SAP HANA workbench with SAI user(SAP HANA user which is a non-system user).
      • Go to editor section.
      • Create a new package:

      • Enter Package name:

 

 

  • Create a new Calc view:

 

 

      • Calc view is now created:

 

      • Under ‘mapping’, I have added the data source:

 

      • Click on the calc view(e.g. sales report). It displays all the fields/data sources as shown below:

 

 

      • Right click on “Calc view” (e.g. sales report) and  choose “Add to output”.

 

      • It maps all the fields to output:

 

      • Now Save the calc view
      • Activate the calc view, by right clicking on the Calc view -> Activate:

 

 

Now that I am done with all the required configurations on SAP HANA, I will need to execute the further steps on SAP Analytics Cloud.

 

7. Create live connection:

 

      • Login to the SAP Analytics Cloud tenant
      • In the menu, go to Connections -> Click on ‘+’ button to create a new onnection.
      • Explore the “Connect to Live data”
      • Choose “SAP HANA”
      • Enter all the fields like shown below:

 

8. Create model in SAP Analytics Cloud:

      • Using the live connection I have just created, I will now create a live model.
      • Choose “Get from a data source” and then “SAP HANA”. As the data source on the right side of the screen.

 

 

 

      • Search for the data source. Here the data source is nothing but the calc view that I have created in the SAP HANA. (E.g. Sales report)

      • Now the modeling page opens where  the ‘meta data’ page can be seen. In case of live connection the data will stay in the data source itself and it would not be moved to SAP Analytics Cloud. Due to this fact,  I can’t see the data in SAP Analytics Cloud live model, but only the meta data.

 

      • Now save the model under a folder of your choice. Typically under public, you may create a folder with the name “Models’ and save all the models here.

 

 

9. Create SAP Analytics Cloud story:

      • Now let’s create the story. Go to Menu -> Create -> Story.

 

 

      • Choose “Add a Responsive Page”

 

      • Insert a new graph and then go to designer to add the required dimensions/measures.

 

      • I’m now good to go ahead and create any kind of visualizations to create a full story on top of the data that I have on my SAP HANA:

 

P.S. all the screenshots used above are the made by myself during the execution process of the end to end scenario

 

Conclusion: 

So, it is this simple to consume the data from SAP HANA into SAP Analytics Cloud.

 

In case if there are any questions related to this blog post or in general about SAP Analytics Cloud, connectivity, please feel free to contact us through the community and we will try our best to get your questions answered asap.

 

Thanks for reading the blog post!

 

Assigned Tags

      8 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Denys van Kempen
      Denys van Kempen

      Thanks Venkata, for this easy to follow end-to-end example.

      One question: considering the deprecation of the SAP HANA repository and the XS classic architecture since SPS 02 (2017), how can we create Live Connections alternatively?

      Will this require XSA or are other approaches being considered?

      Author's profile photo Venkata Saikrishna Bollineni
      Venkata Saikrishna Bollineni
      Blog Post Author

      Hello Denys,

      Sorry for the delayed response.

      The documentation you are referring to above is for "SAP HANA Developer Guide for SAP HANA XS Advanced Model". This is only the case when we are developing our own XS advanced application and we need to pull data out of HANA via INA queries.

      For Hana 2.0 on Cloud Foundry, we have instruction for customer to use HAA to setup live connection.

      For on-premise Hana 2.0, we still recommend customer to use XSC to setup live connection.

      Hope this clarifies.

      Best Regards,

      Sai.

       

       

       

      Author's profile photo Sreekanth Surampally
      Sreekanth Surampally

      Hi,  extension to Denys question, I would like to ask on, For on-premise Hana 2.0, we still recommend customer to use XSC to setup live connection.  Can you tell me why it is recommended to use XSC?  We already using XS advanced in HANA 2.0 SP 03, according to Lucia’s blog, we can install HANA analytics adapter to connect HANA from Analytical applications. HAA for Analytics  also HAA blog by Ingo

      Author's profile photo Antoine CHABERT
      Antoine CHABERT

      Hello Venkata, thanks for a great blog! Since Q4 2019, live stories based on SAP HANA can be augmented with predictions, also running live. You can refer to Ian Henry excellent blog here: https://blogs.sap.com/2019/12/03/sap-analytics-cloud-live-smart-predict-with-sap-hana/

      Kind regards,

      Antoine Chabert

      (product manager for Smart Predict)

      Author's profile photo Venkata Saikrishna Bollineni
      Venkata Saikrishna Bollineni
      Blog Post Author

      Hello Antoine,

      This is indeed an excellent illustration of smart predict on Live HANA data.

      Thanks for providing this blog!

      Best Regards,

      Sai.

      Author's profile photo Natalia FERRARO
      Natalia FERRARO

      Hi Venkata, thanks for that excellent explanation!

      I was able to follow each of the steps you detailed. But when I try to connect SAC to Hana cp it gives me the error that I attach in the screenshot.

      The error says that the user is not assigned the role “sap.bc.ina.service.v2.userRole :: INA_USER” but he has, and even if the error continues.

      Could you please help me understand how to solve this problem.

      Kind regards

       

      Error%20live%20connection%20to%20hana%20cp

      Error live connection to hana cp

       

      Rol%20INA_USER%20assigned%20to%20user

      Rol INA_USER assigned to user

      Author's profile photo Karthik Gangahanumaiah
      Karthik Gangahanumaiah

      Hello Venkata, thanks for a great blog!

      We are currently having a live connection setup between our HAAS 1.0 SP12 on NEO to SAC. Since, the HAAS 1.0 SP12 is seeing end of life by June 30th this year, we are preparing to upgrade to HAAS 2.0 SPS5 rev 53 on NEO and as a 1st we would also perform the MDC conversion.

      We were trying to assess compatibility between the new HAAS 2.0 SPS5 on NEO and the SAC but unfortunately do not see any documentation on the same. There is no mention about compatibility for 2.0 on NEO but only for cloudfoundry. Hence, can you please clarify if this will still be supported.

      https://assets.sapanalytics.cloud/production/help/help-release/en/11b4e5ff76eb4747bc255d7037be1f01.html

      SAP Cloud Platform (SAPCP)

      Note

      Cloud connections to SAP HANA 1.0 are supported.

      Note

      Cloud connections to SAP HANA 2.0 are supported, via the SAP HANA Analytics Adapter for Cloud Foundry.

       

      Author's profile photo Renato Bernardo
      Renato Bernardo

      Great Article, Venkata. I have a question: When we have this kind of connection, data access control is not enabled in the model level, have you ever configured Hana Clud so SAC would receive parameters that show specific information to specific users?Or have any reference? Thank you so much!