Tuesday 2 January 2018

Creating SAP Analytics Cloud Live Connection to SAP HANA Database on SAP Cloud Platform

SAP Analytics Cloud (SAC) has the capability to connect to various types of cloud and on-premise data sources via live and import connections

In this blog post, we focus on connecting from an SAP Analytics Cloud tenant to a cloud data source that is an SAP HANA database on SAP Cloud Platform (SCP) via a live connection.

In general, there are 3 ways to create live connections from an SAP Analytics Cloud tenant to an SAP HANA database:

1. Direct – CORS
2. Path – Reverse Proxy
3. SAP Cloud Platform
For the SAP HANA database that is on SAP Cloud Platform, there are two authentication method – (1) User Name & Password and (2) SAML Single Sign On. This blog post only shows the connection with User Name & Password authentication method.

Note: The SAP HANA database and SAP Analytics Cloud tenant (SAC) do not need to be on the same SCP landscape.

Before we jump into the steps to create the live connection, you have to be an admin user for (1) an SAP HANA database instance deployed on an SAP Cloud Platform landscape, and (2) an SAP Analytics Cloud tenant. In the steps below, both are on US2 SCP landscape. Additionally, you need to have HANA Studio installed on your machine.

These are the parts of this guide to set up the live connection:

1. Log into SCP Cockpit – to get the HANA database info.
2. Configure HANA Studio – to connect to cloud system.
3. Connect HANA Studio to HANA Database.
4. Import Info Access service to HANA Database.
5. Import Info Access Toolkit and SINA API to HANA Database.
6. Configure HANA Database User’s Roles – to allow data access.
7. Create Connection from SAP Analytics Cloud Tenant.

Part 1 – Log into SAP Cloud Platform (SCP) Cockpit


The screenshot below shows my SCP account with US West SCP landscape. My SAC tenant is also deployed on the same SCP landscape. The SCP Cockpit contains information associated with your SCP account. Logging into this page is not the same as logging into the SAP HANA database.

You may look at the URL of your SCP Cockpit to know the SCP landscape your HANA database is deployed on.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

After selecting the subaccount, you can see the name under the “subaccount information” section.

This information is useful for later steps.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

After selecting “Database Systems”, you can see the SAP HANA database name that is deployed.

This information is useful for part 3 & part 6 of this guide.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Select the database system -> select the tenant in the “Tenant Databases” field -> select the tenant on the “Database ID” column.

You can see the overview of the database.

If you have not already created a user for the HANA database, you can select “Database User” to create an user. A database user is required for part 3 of this guide.

*Important: A database user is needed to log into the HANA database and to create the connection on the SAC tenant.

The “SAP HANA Web-based Development Workbench” link brings you to the login page of this HANA database instance.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

You can use the database user created to log into the HANA database.

This web interface allows you to perform workflow similar to that of HANA Studio. However, HANA Studio is required for the upcoming steps.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Part 2 – Configure HANA Studio


In your HANA studio, open “Window” -> “Preference”.

Expand “General”, then select “Network Connections”.

Select the following settings, then click “OK” to close the setting.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Open “Help” -> “Install New Software”.

Install the “Eclipse Plug-in Development Environment”.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Then, install the “SAP Cloud Platform Tools for Connecting to SAP HANA Systems”.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Part 3 – Connect HANA Studio to HANA Database


After restarting HANA Studio, right click at the blank space in the “Systems” view, and select “Add Cloud System”.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Select the SCP landscape host in the “Region host” field.

*Tip: type “h” to show the list of available hosts.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Enter the subaccount name of the SCP account. Step to find this information can be found in part 1 of this blog post. Then, enter your SAP ID and password. This set of credential may not be the same as the ones used to log into the HANA database.

*Tip: The username and password should be the credential you used to log into your machine.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

After clicking “Next”, enter the HANA database information.

Step to find this information can be found in part 1 of this blog post.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Part 4 – Import Info Access service to HANA Database


After establishing the connection from HANA studio to the HANA database, Information Access service and user permission need to set up to allow connection from SAC tenant.

In your HANA Studio, open “File” -> “Import”.

Expand “SAP HANA Content” -> select “Delivery Unit” -> choose “Next”.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Under “Target System”, choose your database instance. Choose “Next”.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Select “Server”.

From the dropdown list, select the “SYS/global/hdb/content/HCO_INA_SERVICE.tgz” delivery unit.

Select both actions and choose “Finish”.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

After importing the delivery unit to the HANA database, you can verify the import in the SAP HANA modeler. In the “SAP HANA Systems” view, under “Content”, check that the following package is available: sap\bc\ina\service

*Tip: The button to switch to “SAP HANA Modeler” is at top right in HANA Studio.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Part 5 – Import Info Access Toolkit and SINA API to HANA Database


*Tip: If you do not have the authorization to download the INA UI toolkit from the SAP Software Download Centre, contact Product Support to help you acquire the INA UI toolkit.

After importing the delivery unit to the HANA database, you can verify in the SAP HANA modeler. In the “SAP HANA Systems” view, under “Content”, check that the following packages are available.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Part 6 – Configure HANA Database User’s Roles


Use the SCP XS Admin tool to log into the HANA database. The URL format for login is https://[DatabaseSystemName][SubaccountName].[SCPLandscape].ondemand.com/sap/hana/xs/admin

With the SCP account and HANA database in this guide, the URL is: “https://sacpmhs001d64afd459.us2.hana.ondemand.com/sap/hana/xs/admin”.

Use the same credential to login as the ones for “SAP HANA Web-based Development Workbench” in part 1 of the instruction.

Select the “Menu” icon top left and select “XS Artifact Administration”.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

In the “Packages” area, select “sap> bc > ina > service > v2”

*Important: Make sure you are in that v2 package or you may affect the authentication to your XS Admin tool.

Select “Edit” at the bottom right to update configuration as shown below.

Then, choose “Save”.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Go back to HANA Studio.

In the “SAP HANA Systems” view, under “Security”, expand “Users”.

Select the database user used in part 3 from the list.

Select the “add” icon to add the three roles to the user.

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Part 7 – Create Connection from SAP Analytics Cloud Tenant

Log into the SAC tenant that is deployed on the same SCP landscape as the HANA database.

Select the “Menu” icon, and choose “Connection”

Select the “Add” icon on the top right. Select “Live Connection”, then select “SAP HANA”.

In the prompt, specify the connection name in the “Name” field.

*Tip: The “Name” field is an internal name to the SAC tenant.

Choose “SAP Cloud Platform” as the “Connection Type”. Use the information from part 1 to fill in other connection details.

Choose “User Name and Password” as the “Authentication Method”. Use the database user and password as the credentials.

Choose “OK”

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

Congratulations! You have successfully created a live connection from an SAP Analytics Cloud tenant to a HANA database!

SAP HANA Studio, SAP HANA Guides, SAP Analytics Cloud, SAP Cloud Paltform

After creating this live connection between your SAC tenant and the HANA database, you would be able to leverage the content in the HANA database to create models and stories in the SAC tenant.

No comments:

Post a Comment