Monday 21 September 2020

SAP Analytics Cloud live data connection to SAP Cloud Platform

Introduction:

This blog covers:

◉ Enable HANA service in SAP Cloud Platform(Neo)

◉ Creation of HANA database in Cloud Platform Cockpit

◉ Access the HANA DB

◉ Creation of live connection in SAC for Cloud Platform

◉ Creation of model and simple story in SAC

Basic knowledge of SAC and SAP cloud platform is needed to understand the concept. User should have access to SAC system.

Main Content:

Enable HANA service in SAP Cloud Platform(Neo)

Connect to SAP Cloud Platform Cockpit using your S-userid. You can sign up for a userid if don’t have one.

Link: https://cockpit.hanatrial.ondemand.com/cockpit/#/home/trial

The default one is cloud foundry. Scroll down and choose the Access Neo Trial Environment.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Cloud Platform Neo

Once logged in to SAP cloud platform cockpit, go to service.

Search for the service ‘HANA’.

Select the SAP HANA Service. Refer to the screenshot below. If its not enabled, please enable it.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
HANA service in CP

Once the service is enabled, select “Go to service”. It will lead to HANA Service in CP.

By default, there is no database assigned. We have to create database instance.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Hana service

Creation of HANA Database in Cloud Platform Cockpit


To create the DB instance in cloud platform, click on the New button.

Give the name for Database ID. I have given ‘hdb’. Select the password for SYSTEM user. That will be used later for login. By default SYSTEM user gets created. Enable the web access.

Then click on Create. Select the details as shown below.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
HANA DB creation

It will take couple of minutes to create the DB instance. You can see the progress. once its created it will be available to access.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Database

If database is stopped, you can start the database using Start button. Once its available, it will show Green status Started.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
DB Started

After the database instance is created, we have access the database and provide required roles to SYSTEM user. Its described in next session.

Access the HANA Database


We have to assign the required roles to SYSTEM user. Also need to find out the Calculation view which will be used for Model building in SAC.

Access the administration tools ‘SAP HANA Cockpit’.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
HANA Cockpit

It will open the HANA Cockpit in a different browser. We need to provide the userid and password for login. Please use SYSTEM as the user and password which was selected before.

it will open the Fiori Launchpad for HANA administration.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
DB Administration

Then goto Manage Roles and Users section. it will open the IDE security in another window.

Select the SYSTEM user from Left menu.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
SYSTEM user

It will be assigned with default roles. We need to assign XS admin roles, IDE roles and INA roles.

The list given below.

In Granted Roles tab, choose the + button and assign the roles to SYSTEM user.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Roles for SYSTEM user

Once the roles are assigned, SAVE and Close.

Now open the HANA Web IDE from Cloud Platform Cockpit.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Open Web IDE from CP Cockpit

It will open the Web IDE portal Select the Editor option to open repository objects in HANA. It will give the details of packages and views.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Open Editor

We have to find a Calculation view which will be used for model creation in SAC later on.

We will use PURCHASE_OVERVIEW calculation view. Its provided by SAP as part of demo content. Available in the below path.

Content –> SAP –> hana –> democontent –> models –> PURCHASE_OVERVIEW.calculationview.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Calculation View

This view later will be used in SAC to create the model.

Creation of live connection in SAC for Cloud Platform


User should have access to SAC subscription. Open SAP Analytics Cloud and login with the credentials.

Goto connections.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
SAC Connections

Choose add a new connection.

Select SAP HANA under Connect to Live Data section.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Live Connection for HANA

Create new HANA live connection.

Give the name, description. Choose the connection type as SAP Cloud Platform.

Give cloud platform account name You can copy the account name from Cloud platform cockpit. Its next to Europe (Rot) – Trial.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
CP Account

Database name: hdb (The name of database chosen in cloud platform)

Landscape host: Europe (Rot) – Trial

Default Language: EN

Choose authentication method ‘Username and password’.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
New live connection1

Provide the username as SYSTEM.

Give the password which was chose for SYSTEM user in hana instance.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
New live connection2

Click on OK. The connection is created.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning

Creation of model and simple story in SAC

In SAP Analytics Cloud portal, create a new model using create option.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Create model in SAC

Select the option, ‘Get data from a datasource’ and live data connection.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning

Datasource selection

Select the system type SAP HANA. Choose the connection created in above step. The name given was CPLIVE.

once its selection, system proposes option to select the datasource.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning

in the datasource selection, its gives the Calculation Views available in HANA instance in cloud platform.

choose the Purchase_Overview calculation view from the list. it gives the path also where hana view is present in hana repository.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning

Assign the group(optional) as needed. The SAVE it. Model is created.

Give the name and description for the Model.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Model Creation

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning

Now we will create a simple story on top the model.

Create a new story and choose canvas page to start with.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Create Story 1

Insert a chart and choose the model which we created before.

Select the Netamount in measures. Choose product category and product ID in dimensions. it will display the net amount per product category and product ID.

Save the story.

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Create Story 2

SAP Cloud Platform, SAP ABAP Tutorial and Material, SAP ABAP Learning, SAP ABAP Exam Prep, SAP ABAP Learning
Create Story 3

Now we can execute the story to display the values.

No comments:

Post a Comment