Download as pdf or txt
Download as pdf or txt
You are on page 1of 57

CREATING DATABASE OBJECTS

IN SAP HANA CLOUD WITH


SAP BUSINESS APPLICATION STUDIO
SESSION #2: How to build up a federated
scenario
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

GET STARTED
Welcome to the Digital Hands-on Workshop Series on SAP HANA Cloud! We’re excited to offer you a detailed,
hands-on introduction into your SAP HANA Cloud!

WELCOME! 3

CONTENT OVERVIEW 4

PRE-REQU ISITES FOR SESSION # 2: 6

ADDITIONAL RESOU RCES 7

TOOLS TO WORK WIT H YOU R SAP HA NA CLOUD, HANA DATABASE 8

SAP BUSINESS APPLICATION STUDIO BASICS 10

BUILDING UP T HE FED ERATED SCENARIO 11

PREPARATIONS IN T2 (ONLY FOR REFERENCE) 11


CREATING A REMOTE SOURCE TO T2 15
CREATING A VIRTUAL TABLE AND MANAGING PRIVILEGES FOR USERS TO ACCESS IT 20
IMPORTING DATA AND MANAGING PRIVILEGES 22

PREPARING CALCULATION VIEW AND FLOWGRAPH 24

CREATING A NEW PROJECT IN SAP BUSINESS APPLICATION STUDIO 24


USE A CALCULATION VIEW TO AUTO-GENERATE .HDBSYNONYM
AND .HDBGRANTS FILES FOR ACCESS TO OTHER HDI-CONTAINERS 25
PREPARATIONS FOR CREATING A FLOWGRAPH 29
ADJUST THE HDBGRANTS FILE 29
CREATE A UPS CONNECTION 30
CREATE A SECOND HDBGRANTS FILE 32
CREATE SYNONYMS 33

1
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

CREATING A FLOWGRAP H 34

LOAD 2020 DATA TO TLOG_F_C WITH A FLOWGRAPH 34


CREATE A DESIGN-TIME VIRTUAL TABLE VT_TLOG_F_O 42
USE A FLOWGRAPH TO LOAD DATA TO REMOTE SOURCES (FOR REFERENCE ONLY) 45

ACCESSING THE DATA WITH A CALCULATION VIEW 49

COMPLETING THE CALCULATION VIEW: ADDING THE LOCAL TABLE TLOG_F_C 49


ADDING THE REMOTE TABLES TO THE CALCULATION VIEW 52
CREATE A REFERENCE STATEMENT FOR SESSION 3 55

saphanajourney.com/hana-cloud
© 2020 SAP SE or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.

The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors. National product
specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable for errors or omissions with
respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein
should be construed as constituting an additional warranty.

In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality mentioned therein. This document,
or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are all subject to change and may be changed by SAP SE or its
affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. All forward-looking statements are
subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are cautioned not to place undue reliance on these forward-looking statements, and they should not be relied
upon in making purchasing decisions.

service names mentioned are the trademarks of their respective companies. See www.sap.com/copyright for additional trademark information and notices.

2
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

WELCOME!
Learn in this session how to add remote sources and virtualize data from these sources to your SAP HANA Cloud,
HANA database as well as how to use flowgraphs to load data to different tables. You will also learn how to manage
the roles and privileges necessary for these steps. This includes:

· Managing roles and privileges


· Using flowgraphs to distribute data
· Adding remote sources and virtualizing data
· Creating a simple calculation view

Your presenters:

Volker Saggau Jan Zwickel


Product Manager, SAP HANA Cloud | SAP Product Manager, SAP HANA Cloud | SAP

3
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Content overview

In session 1, you have created a development project with an empty table and three roles. You then deployed this
project on your trial instance of SAP HANA Cloud, HANA database. In session 2, we will bring data into this table
and make use of the roles you have created.

This is the federated scenario we will build in session 2:

We have prepared an SAP HANA Cloud, HANA database instance T2 that is connected to an SAP HANA Cloud, data
lake. In this session, you will watch us first while we prepare objects in this instance. You will then connect to it with
your own SAP HANA Cloud, HANA database trial instance that we will refer to as 'T1'. In T1, you will set up a remote
source and virtual tables that point to T2 and the SAP HANA Cloud, data lake.
4
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

In the second phase of session 2, we will create a flowgraph to distribute data to the different data sources that will
then be used in a simple calculation view. This calculation view will be created in your development project in SAP
Business Application Studio and deployed on your SAP HANA Cloud, HANA database.

5
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

PRE-REQUISITES FOR SESSION #2:


1. Completion of Session 1.

a. Watch session 1 on-demand here.

b. Download the workbook here.

2. Make sure your SAP HANA Cloud, SAP HANA database is running in your trial account.

3. Make sure your development space is running in SAP Business Application Studio.

4. All code necessary for this session can be found in this workbook. You can also access it via:

a. The public github repository SAP-samples/hana-cloud-workshop-create-database-artifacts.

b. Download as a txt file from here.

5. For this session, you will also need a sample dataset, which you can access via:

a. The public github repository SAP-samples/hana-cloud-workshop-create-database-artifacts.

b. Download as a zip file from here.

If you need help with the preparation, post your questions in the SAP community using the hashtag
#saphanacloud.

Note that during your trial, your instance will be automatically stopped overnight, according to the server
region time zone. That means you need to restart your instance before you start working with your trial
every day.

6
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

ADDITIONAL RESOURCES
· SAP HANA Cloud Product Page
· Data and Analytics Learning Center featuring free in-depth content:
o SAP HANA Cloud Onboarding Guide
o Interactive learning mission on SAP HANA Cloud
· Recommended related Learning Tracks:
o Moving a project with calculation views from XS Advanced to SAP HANA Cloud
o How to create a CAP development project in SAP Business Application Studio and bind it to SAP
HANA Cloud
· Related Technical Documentation:
o SAP HANA Cloud
o SAP HANA Cloud Deployment Infrastructure Reference Guide
o SAP HANA Cloud Modeling Guide for SAP Business Application Studio
· Get a Demo of Implementation Services from SAP

7
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

TOOLS TO WORK WITH YOUR SAP


HANA CLOUD, HANA DATABASE
Once your instance is created, you can access all tools you need to work with your instance right on this tile.

Click on Actions in the bottom right corner of the tile and you can see the following options:

Monitor landscape will open the SAP HANA Cloud Central. There, you can start and stop your instances and check
on their status.

Administer <instance name> will open the SAP HANA Cockpit in a new tab. There, you can monitor your databases,
create users and assign roles as well as set up replication services.

8
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Execute SQL and explore objects will open the SAP HANA Database Explorer. There, you can access your data and
interact with your databases.

To access SAP Business Application Studio, you can click on Trial Home at the top bar in SAP BTP cockpit. Then,
under Quick Tool Access, you will find SAP Business Application Studio. Alternatively, you can find it in the Service
Marketplace on your Subaccount level.

9
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

SAP Business Application Studio Basics


On the left side of your workspace you can see your files in the panel that has the name of your project. Here you
can interact with the files that describe your design time objects. For example, you can copy or delete the files. You
can also start the editors from here.

At the bottom you find the SAP HANA PROJECTS panel where you can deploy your project and for example open
the HDI container in the SAP HANA Database Explorer. Whenever you add a new database object that can be
deployed to your HDI container, it will appear in this panel and you can deploy it. In this area you can also check the
database connections of your project.

Moving your cursor to the name of an object, folder, or connection in this panel, you will see different icons:

· This icon will open the HDI container in SAP HANA Database Explorer

· This icon will deploy an object, folder, or the whole project to the HDI container.

· This icon (only on the Database Connections level) allows you to create or add a database service.

· This icon / allows you to bind (green colour) or unbind (grey colour) a service connection .

10
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

BUILDING UP THE FEDERATED


SCENARIO
Preparations in T2 (only for reference)

You do not have to follow the steps in this section; they are only for your reference to understand the
preparations we have made in the instance T2, you will connect to later on.

In this section, we will show you what preparations we have made beforehand so you can connect to our instance
T2. The steps illustrate how you can prepare an instance that you want others to connect to.

1. In the SAP HANA Database Explorer, we used the database connection of our database user DBADMIN.

2. First, we created a user T2 that you can later use to connect to this instance.

create user T2 password "DnATBG!1" NO FORCE_FIRST_PASSWORD_CHANGE set


usergroup default;

When you connect to this database later, you will need the credentials of this user for connecting to this
instance.

Username: T2
Password: DnATBG!1

3. We then granted this user permissions to create tables in SAP HANA CLOUD, data lake, to create schemas,

and to create virtual tables in T2.

grant execute on "SYSRDL#CG"."REMOTE_EXECUTE" to T2;


grant create remote source to T2;
grant create virtual table on remote source "SYSRDL#CG_SOURCE" to T2;
grant create schema to T2;

11
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

4. Next, we added a database connection using this new user. To do that, we clicked on the DBADMIN

database connection in the catalog and selected Add Database with Different User and put in the

credentials of the user T2.

5. With this new database connection as the user T2, we opened a new SQL Console and created a table

TLOG_F_O in the schema T2. We used the same table definitions as you did in session 1 for creating the

table TLOG_F_C.

CREATE TABLE T2."TLOG_F_O"(


"Index" NVARCHAR(200),
"ClientID" NVARCHAR(200),

"ItemTotalSoldPrice" DECIMAL(10, 2)
);

12
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

6. To create a table in the SAP HANA Cloud, data lake, we used a procedure that allows creating the table

TLOG_F_H with the same table definitions as TLOG_F_C and TLOG_F_O.

CALL SYSRDL#CG.REMOTE_EXECUTE ('


CREATE TABLE "TLOG_F_H"(
"Index" NVARCHAR(200),
"ClientID" NVARCHAR(200),

"ItemTotalSoldPrice" DECIMAL(10, 2)
)'
);

7. For you to be able to connect to this table in our SAP HANA Cloud, data lake, we created a virtual table in

our instance T2: We have created a table VT_TLOG_F_H that is pointing to the table TLOG_F_H in the

connected SAP HANA Cloud, data lake. To keep our tables organized, we first created a schema for this

virtual table:

create schema VT_DATALAKE_T2;

8. To then create the virtual table VT_TLOG_F_H in the schema VT_datalake_T2, we clicked on Remote

Sources in the catalog of our database connection with T2.

9. There, we clicked on the remote source SYSRDL#CG_Source (the SAP HANA Cloud, data lake), selected

the schema SYSRDL#CG, selected the table TLOG_F_H and clicked on Create Virtual Object(s).

10. In the wizard to create the virtual object, we named it VT_TLOG_F_H (VT for virtual table) and selected the

schema VT_DATALAKE_T2, the schema we have created in step 7.

13
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

What data will we be working with and what do the table names indicate?

We will use sample data with sales data of different items that have been sold in the years 2016-2020. The
three tables we have created will later be populated with data from different date ranges. The table names
indicate what year the sales data is coming from:

TLOG_F_C: C=Current; this table that is located in your SAP HANA Cloud, HANA database trial instance T1
will contain the data from 2020
TLOG_F_O: O=Online; this table that is located in our SAP HANA Cloud, HANA database instance T2 will
contain the data from 2019
TLOG_F_H: H=History; this table that is located in the SAP HANA Cloud, data lake that is connected to our
instance T2 will contain the data from before 2019

With that, our preparations are complete, and you can now connect to the database T2 using the credentials of the
user T2 and access the tables we have created.

14
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Creating a remote source to T2

The following steps are for you to follow along with your own trial account, which we will refer to as "T1".

Open your trial instance in the SAP HANA Database Explorer


1. Make sure your SAP HANA Cloud, HANA database instance is running.

2. Open your trial instance in the SAP HANA Database Explorer. You can get there via several ways:

· In BTP Cockpit, navigate to your trial instance and click on Actions at the bottom right of your instance tile.
Select Execute SQL and explore objects in SAP HANA Database Explorer.
· In SAP HANA Cloud Central, where you started your instance, click on the three dots in the column Actions
and select Open SAP HANA Database Explorer.

3. In your catalog, right-click on the database connection of your trial instance and select Open SQL Console.

Create users

To avoid working with the powerful user DBADMIN, we will first create two users with fewer authorizations:

1. A user UPS, who will be used in a user-provided service later. Paste this code to your SQL console and

execute it:

create user UPS password "DnATBG!1" no force_first_password_change set


usergroup default;

2. And a user T1, who will do all the setup. To do that, paste and execute this statement next:

create user T1 password "DnATBG!1" no force_first_password_change set


usergroup default;

3. For the user T1 to be able to do all the necessary steps, we need to grant this user the privileges to create

schemas and remote sources as well as the role admin privilege. Execute these three statements next:
grant create schema to T1;
grant create remote source to T1;
grant role admin to T1;

15
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Create a PSE and add a remote source certificate

1. Next, we will create a PSE (personal security environment) and name it FOR_REMOTE_SOURCES. This PSE

will store your certificates for remote source connections. Execute this statement in your SQL console:

CREATE PSE FOR_REMOTE_SOURCES;

2. Create a certificate for the SAP HANA Cloud connection using the certificate string provided and add the

comment 'for remote sources' by executing this statement:

CREATE CERTIFICATE FROM '

-----BEGIN CERTIFICATE-----
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG
EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw
HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw
MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3
dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq
hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn
TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5
BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H
4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y
7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB
o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm
8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF
BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr
EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt
tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886
UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=-----END CERTIFICATE-----'

COMMENT 'for remote sources';

3. To add this certificate to the PSE, you need to find the certificate ID of this certificate. You can get it by

executing the following statement:

SELECT CERTIFICATE_ID FROM CERTIFICATES WHERE COMMENT = 'for remote


sources';

4. Copy the certificate ID from the results panel to your clipboard.

5. Using the ALTER PSE command, add the certificate and insert the certificate ID you have just copied.

ALTER PSE FOR_REMOTE_SOURCES ADD CERTIFICATE <ENTER_CERTIFICATE_ID>;

6. Set the PSE for the purpose remote sources using this next statement:

SET PSE FOR_REMOTE_SOURCES PURPOSE REMOTE SOURCE;

Now your certificate store will use this certificate whenever you establish a remote source connection.

16
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Connect with user T1


1. The next steps will be done by our user T1. In your catalog, right click on your database connection and

select Add Database with Different User.

2. In the prompt that opens, enter the credentials of the user T1.

Username: T1
Password: DnATBG!1

17
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

3. We recommend that you enter T1 (T1) in the field Display Name of this new connection to easier distinguish

it from your DBADMIN connection.

4. With a right-click on this database connection, open a SQL console. You will see at the top bar that you are

now connected with T1.

5. We will create a virtual table on our remote source next. Before we do that, we will create the schema

VT_DATALAKE_T1. This is where the virtual table we will create next in your own instance T1 will be placed

in.To do so execute this statement:

create schema VT_DATALAKE_T1;

18
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Establish the remote source to T2

Now, we will create a remote source to the SAP HANA Cloud, HANA database instance T2 and call this remote
source connection T2.

1. In your catalog under the database connection of user T1, click on Remote Sources and select Add Remote

Source. A wizard will open.

2. In the field Server enter the SQL endpoint of our instance T2:

a6a3218c-472b-4e6c-9be5-d2db786bc8fd.hana.prod-jp10.hanacloud.ondemand.com

3. In the field Port, enter 443.

4. In the field Credentials Mode, select Technical User.

5. Enter the credentials of the user T2 that we have prepared previously.

Username: T2
Password: DnATBG!1

6. Click on Create.
19
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Creating a virtual table and managing privileges for users to access it

Create the virtual table VT_TLOG_F_H

For you to access the table in the SAP HANA Cloud, data lake, you next need to create a virtual table that is pointing
to the virtual table VT_TLOG_F_H in T2, which is pointing to the table TLOG_F_H in the SAP HANA Cloud, data lake.

1. Click on Remote Sources in your catalog. There you will now see the remote source T2 you have just

created.

2. Click on the Remote Source T2. A new panel will open on the right side of the screen.

3. Select the schema VT_DATALAKE_T2 in the dropdown menu and click on Search. You should now see the

object VT_TLOG_F_H there.

4. Click on the check box on the left to select it and click on Create Virtual Objects.

5. A wizard will open. Enter the object name VT_TLOG_F_H, select the schema VT_DATALAKE_T1 from the

drop-down menu and click on Create.

6. Your virtual table is now created that you can find in your catalog under tables.
20
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Managing privileges for users to access the virtual table

To be able to work with this new virtual table VT_TLOG_F_H, we need to grant privileges to our application users
and object owners of projects in SAP Business Application Studio.

1. Close the remote source window and go back to the SQL console of the connection with the user T1.

2. First, the user UPS should get privileges to INSERT; UPDATE; DELETE and SELECT on the table

VT_TLOG_F_H. For that, we first need to create a role, which we will call LOAD_VT_TLOG_F_H, assign the

privileges to this role and grant that role to the user.

Paste and execute this code to do that:

create role LOAD_VT_TLOG_F_H;


grant insert,update,delete on VT_DATALAKE_T1.VT_TLOG_F_H to
LOAD_VT_TLOG_F_H;
grant LOAD_VT_TLOG_F_H to UPS with admin option;

The system generated object owner user should get SELECT privileges on the table with grant option. For that, we
will create another role, which we will call SELECT_ON_VT_TLOG_F_H_WITH_GRANT, assign the privilege to this
role and assign the role to a role that is assigned to all object owners of Business Application Studio projects per
default:

3. Again, you can paste and execute this prepared statement:

create role SELECT_ON_VT_TLOG_F_H_WITH_GRANT;


grant select on VT_DATALAKE_T1.VT_TLOG_F_H to
SELECT_ON_VT_TLOG_F_H_WITH_GRANT with grant option;
grant SELECT_ON_VT_TLOG_F_H_WITH_GRANT to
"_SYS_DI#BROKER_CG"._SYS_DI_OO_DEFAULTS;

4. The system generated application users should get SELECT privileges without grant option. Similarly, we

will create a role named SELECT_ON_VT_TLOG_F_H, assign the privilege to this role and grant the role to

the role “RT_DEFAULTS” that is assigned to application users of Business Application Studio users pers

default.

5. Paste and execute this statement:


create role SELECT_ON_VT_TLOG_F_H;
grant select on VT_DATALAKE_T1.VT_TLOG_F_H to SELECT_ON_VT_TLOG_F_H;
grant SELECT_ON_VT_TLOG_F_H to BROKER_USER.RT_DEFAULTS;

21
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

6. Lastly, the user UPS is assigned a role that allows the creation of virtual tables on the remote source. We will

call this role createVTOnT2. As before, paste and execute the statement:
create role "createVTOnT2";
grant create virtual table on remote source T2 to "createVTOnT2";
grant "createVTOnT2" to UPS with admin option;

Importing data and managing privileges

Download and import the sample data


1. Download the sample data from here.

2. After downloading the zip file, unpack it to a directory on your local machine.

3. Switch back to the SAP HANA Database Explorer.

4. In the catalog, right-click on your database connection of the user T1.

5. Select Import Catalog Objects.

6. The Import Catalog Objects wizard will open.

7. In the drop-down menu Select Import Objects From, select Local Computer

8. In the field Local Archive (*tar.gz), click on Browse… and select the file from the directory it has been

downloaded to.

22
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

9. Click on Open and wait for the metadata to load. Once the upload is finished, you should see the Catalog

Object BASKETANALYSISDATA_ALL in the list.

10. You don’t have to check any of the other boxes, simply click on Import.

Create a role that provides access to this data and grant it to the user UPS
1. Lastly, to access this imported data later, we need assign one last role to the database user UPS.

2. We will call this role SELECT_ON_BASKETANALYSIS_ALL and grant this role SELECT privileges to this role.

3. Again, execute this prepared statement:

create role SELECT_ON_BASKETANALYSISDATA_ALL;


grant select on COMBINEDBASKETANALYSISDATA.BASKETANALYSISDATA_ALL to
SELECT_ON_BASKETANALYSISDATA_ALL;
grant SELECT_ON_BASKETANALYSISDATA_ALL to UPS with admin option

With that, we are finished preparing on the SAP HANA Database Explorer side and are ready to switch to SAP
Business Application Studio.

23
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

PREPARING CALCULATION VIEW


AND FLOWGRAPH
Creating a new project in SAP Business Application Studio
We will first create a new project in SAP Business Application Studio.

1. Open SAP Business Application Studio (if you have not bookmarked it last session, go to SAP BTP cockpit,

click on Trial Home at the top bar and under Quick Tool Access, you will find SAP Business Application

Studio).

2. Start your development space from session 1 if you have not done so prior to this session.

3. Enter your workspace once it is running by clicking on the name of the dev space.

4. On the Welcome Screen click on New Project from Template

5. Click on SAP HANA Database Project and click on Start.

6. In the first step of the wizard (Add Basic Information), enter a name for your project on the Project Name

field (for example "Federation") and click on Next.

7. In the next step of the wizard (Set Basic Properties), keep db as a default name in the Module Name field

and click on Next.

8. In the next step of the wizard (Set Database Information), leave the optional fields Namespace and Schema

Name empty for the purpose of this workshop.

9. In the dropdown menu SAP HANA Database Version, select HANA Cloud.

10. In the field Bind the database module to a Cloud Foundry service instance?, select Yes and click on Next.

11. In the next step of the wizard (Bind to HDI Container service), you need to provide your credentials to bind

this project to an HDI container unless the credentials are still saved in your browser cache. Click on the

login icon and your organization and space will be filled automatically.

12. In the field Create a new HDI service instance?, select Yes.

13. In the next field you can keep the default service instance name.

14. Select Yes in the last field as well to use the default database instance of the Cloud Foundry space.

15. Click on Finish. Your new project will be generated

24
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Use a calculation view to auto-generate .hdbsynonym and .hdbgrants files


for access to other HDI-containers

16. In your workspace, click on the db folder, there, select the src folder.

17. Press F1 to open the Find Command prompt at the top of the screen.

18. Enter HANA and select Create SAP HANA Database Artifact.

19. Click on the folder icon in the field Choose path where you want to create the artifact.

20. A wizard will open in which you can select the directory for the calculation view.

21. Click on home, user, projects, your project name (Federation), db and then src and click on Open.

22. In the Artifact Type field, select Calculation View

23. In the Artifact Name field, give a name to your file (Federation).

24. Keep the other options selected as they are (unchecked).

25
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

25. Click on Create.

26. The file will appear on the left panel in the src folder.

27. Click on the calculation view file in the src folder to open the calculation view editor.

28. Click on the icon on the left side and drag it to the editor to add a union node.

29. Click on the node Union_1 to see the editing options of this node.

30. Click on the plus icon to add a datasource.

26
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

31. The Find Data Sources wizard will open.

You see here that the wizard can only add objects to the calculation view that are already in the project, there is
no option to select External Services, since there are no database connections in this development project yet.
Since we want to use the objects from the HDI container from session 1, we first need to connect this project to
the project from session 1.

Connect this project to the HDI container from session 1


1. On the left, in the SAP HANA Projects panel, expand your project so you can see the src folder and

Database Connections.

2. Move your cursor to the line Database Connections and click on the plus icon.

3. In the wizard that opens, in the field Select Connection type, select Existing HDI Container

4. In the field Select SAP HANA HDI Service instance, select the name of the container you have created in

session 1 (HANACLOUD_WORKSHOP2).

5. Click on Add at the bottom of the screen and the connection will be established

6. A message will appear on the bottom right corner telling you the connection has been created, and the

service has been bound.

27
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Add a Data Source to the Union Node


1. In the calculation view, click on the Union Node and the plus icon. The Find Data Sources wizard opens.

2. Now you have the option to select External Services.

3. Select the service connection you have just created from the drop down menu.

4. On the search bar, enter ** to search for all objects in this database connection. You should see there the

table TLOG_F_C that you have created in session 1.

5. Select the table TLOG_F_C from the list by clicking on the check box on the left.

6. Click on Create Synonym.

7. In the next step of this wizard, check the options Synonym for HDI Container and Generate .hdbgrants File.

8. On the Object Owner Role field, enter SELECT_ON_TLOG_F_C_WITH_GRANT#

9. In the Application User Role field, enter SELECT_ON_TLOG_F_C

10. Click on Finish.

11. Once this step is finished, you will see in your src folder that the hdbgrants and hdbsynonym files have been

created.
28
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Preparations for creating a flowgraph


For the calculation view to report on data, we first need to have data in the tables we have created. As indicated in
the beginning, we will use a flowgraph to distribute data from our sample data BASKETANALYSIS_ALL into the
three different tables. These three tables will then be accessed by the calculation view.

To create a flowgraph, we need to make a few preparations.

Adjust the hdbgrants file

1. Click on the hdbgrants file that was created while the service connection was established.

2. The code editor will open. There, you can see the authorizations involving the two roles specified in the

previous step.

We need to slightly adjust the hdbgrants file to also authorize us to load data into the table. Adjust the hdbgrants file
as follows:

3. Add a comma and line break in line 5 after "SELECT_ON_TLOG_F_C_WITH_GRANT#"

4. Enter "LOAD_TLOG_F_C".

5. Do the same below, add a comma, line break and "LOAD_TLOG_F_C" after the line that contains

"SELECT_ON_TLOG_F_C_WITH_GRANT#".Here you can see the complete adjusted code (adjusted parts

marked red), which you can also simply copy and paste in the file replacing the previous code (if you do

that, make sure the service connection name matches the one you chose in your project):

{
"<enter connection name, e.g. HANACLOUD-WORKSHOP2-hdidb-ws-wk598>": {
"object_owner": {
"container_roles": [
"SELECT_ON_TLOG_F_C_WITH_GRANT#",
"LOAD_TLOG_F_C"
]
},
"application_user": {
"container_roles": [
"SELECT_ON_TLOG_F_C",
"LOAD_TLOG_F_C"
]
}
}
}

6. Lastly, click on the rocket icon at the top right corner to deploy this file. Alternatively, you can deploy it

from the SAP HANA Projects panel on the left.


29
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Now the object owner and application user can insert data into this table. Since later we will also load data into table
TLOG_F_O, we will next create a connection to a hdi container. This means we need to create a user-provided
service connection that will allow us to do so.

Create a UPS connection

Since the workshop has aired, there was a change introduced in this step. You can now directly choose to
create a user-provided service using the deployment target container database information. By default, the
option Use target container database information should be selected for you, which you can leave selected
for this example. If you do need to change host and port information, you must select the option Connect to
database.

1. On the left, in the SAP HANA Projects panel, click on the plus icon on Database Connections.

2. In the Select Connection Type field, click on Create user-provided service instance.

3. In the field Enter service instance name, enter UPS.

4. To establish the connection, you need the SQL endpoint of your own trial instance T1.

5. Open SAP BTP cockpit or SAP HANA Cloud Central and navigate to your SAP HANA Cloud, HANA database

instance. On your SAP HANA Cloud instance tile/line, click on the three dots/Actions and select Copy SQL

endpoint.

30
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

6. Paste it in the field Enter host name and remove the last four characters(":443")

7. In the field Enter host port, enter the three last digits from the host name (443)

8. In the field Enter User name, enter UPS.

9. In the field Enter Password, enter the password you gave this user earlier: DnATBG!1

10. Select Connect to the database securely and click on Add.

31
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Create a second hdbgrants file


With this user-provided service connection, we can grant roles and privileges. What exactly will be granted, needs to
be specified in a different hdbgrants file, which we will create next.

1. In your project folder, right click on the src folder and select New File.

2. Enter the file name loading.hdbgrants and click on OK.

Info: By adding the suffix ".hdbgrants", SAP Business Application Studio will automatically recognize that
this file is an hdbgrants file, similar to when you create an SAP HANA Database Artifact via the Find
Command prompt. The same applies for all different kinds of SAP HANA Database Artifacts, like
.hdbsynonym, .hdbtable, .hdbcalculationview, .hdbanalyticprivilege, and so on.

3. The file will appear on the left panel, click on it to open the code editor.

4. Copy and paste the following code in the code editor:

{
"UPS": {
"object_owner": {
"roles": [

"SELECT_ON_BASKETANALYSISDATA_ALL",

"LOAD_VT_TLOG_F_H",

"createVTOnT2"
]
}
,

"application_user": {
"roles": [

"SELECT_ON_BASKETANALYSISDATA_ALL",

"LOAD_VT_TLOG_F_H",

"createVTOnT2"
]
}

}
}

5. This code will grant the roles specified to the application users and object owners.

6. Click on the rocket icon in the top right corner or in the SAP HANA Projects panel to deploy this file.

32
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Create synonyms
To be able to add objects to the calculation view that are not in the project, these objects need to be represented by
.hdbsynonyms, which we will create next.

1. In your project folder, right click on the src folder.

2. Create new SAP HANA Database Artifact by either pressing F1 and selecting SAP HANA: Create SAP HANA

Database artifacts and naming this artifact loading and select the artifact enter synonym. Or by right

clicking on the src folder, selecting New File and naming it loading.hdbsynonym.

3. Right click on the file and select Open with Synonym Editor.

4. The synonym editor will open in the workspace.

5. In the field Synonym Name click on <Click to Add>. Name it S_COMBINED.

6. In the field Object Name, enter BASKETANALYSISDATA_ALL.

7. In the field Schema Name enter COMBINEDBASKETANALYSISDATA.

8. In the same way, add a second synonym and name it S_VT_DL. For the Object Name field, enter

VT_TLOG_F_H and enter the schema VT_DATALAKE_T1.

9. Click on the rocket icon on the top right corner to deploy the synonyms

Now you are ready to create the flowgraph that will load data from the sample dataset you imported in SAP HANA
Database Explorer and write it into the different tables in your own trial instance T1, our instance T2 and the SAP
HANA Cloud, data lake.

33
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

CREATING A FLOWGRAPH
In this section, you will create your own flowgraph first to load data from the dataset BASKETANALYSIS_ALL to
your table TLOG_F_C. After that, we will show you for reference how we will also write data into the tables in our
own SAP HANA Cloud, HANA database T2 and its corresponding SAP HANA Cloud, data lake. You will then be able
to connect to these tables and read the data in your calculation view.

Load 2020 data to TLOG_F_C with a flowgraph

1. Click on the src folder in your project and press F1 to open the find command prompt.

2. Enter HANA and select SAP HANA: Create SAP HANA Database artifacts.

3. In the Artifact Type field, select Flowgraph (hdbflowgraph).

4. In the Artifact name field, enter Load2TLOG_F_C and click on Create.

5. The file will appear on the left panel. Click on it to open the flowgraph editor.

6. Click on the plus icon on the left side of the Flowgraph editor. A menu will open.

34
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

7. Click on Data Source and move your cursor to the white canvas and click to place the Data Source. A Data

Source tile will appear.

8. Click on the cogwheel icon.

9. A new window will open. Click on HANA Object.

35
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

10. A wizard will open to select the object for your data source

11. Click on the drop-down menu External Services, where you should see the HDI container connection and

the UPS connection. Select the UPS connection.

12. On the Search field, enter S_COMBINED or ** to see all objects.

13. Click on BASKETANALYSISDATA_ALL and click on Finish.

36
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

14. Click on apply on the top right corner.

15. Click on the plus icon on the Terminal and select Projection and drag it to the canvas.

16. Connect the Data Source box and the Projection box: Click on the arrow icon on the S_COMBINED tile and

drag it to the IN field of the Projection tile.

37
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

17. Click on the wheel icon on the Projection tile.

18. Click on Filters.

19. Enter year("OrderDate")=2020 to select only the data from 2020 to be loaded into your data target.

20. Press Validate Syntax to check if the syntax is correct.

21. Click on Apply on the top right corner.

38
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

22. Click on the plus icon to now add a Data Target. Click on Data Target and move it to the canvas.

23. Click on the cogwheel icon on Data Target.

24. Again, select HANA Object.

25. In the Search field, enter TLOG_F_C. Click on it and then click on Finish.

26. Click on Apply.

39
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

27. Now connect the Projection and the Data Target: Click on the OUT field on the Projection tile and drag it to

the IN field of the Data Target tile.

28. And with that the flowgraph is complete. Click on the rocket icon in the top right corner of the screen or

in the SAP HANA Projects panel to deploy the flowgraph.

29. Before you execute this flowgraph, you can have a look at the table in your HDI container.

Preview the data in the SAP HANA Database Explorer and execute the flowgraph
1. In the SAP HANA PROJECTS panel, click on the HDI container icon on the level of your project.

2. The SAP HANA Database Explorer will open in a new tab with the HDI container connection already open in

the catalog.

3. There, click on Synonyms and search for TLOG_F_C.

4. Right click on it and select Open Data and you will see that the table is still empty.
40
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

5. Switch back to your tab with SAP Business Application Studio.

6. In the flowgraph editor, click on Execute in the top left corner to have this dataflow executed on your table.

7. A prompt will open to confirm that you want to execute the latest build of this flowgraph. Select OK.

8. Switch back to the tab with SAP HANA Database Explorer where you opened the data of the table

TLOG_F_C.

9. Click on the Refresh icon in the top right corner.

41
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

10. You should now see the data from 2020.

Now, there is only the data from 2020 available as the data from the other HANA Cloud instance and its data lake
have not yet been loaded into the tables and have not been added to the view. We will now also fill the other tables
with data.

Before that, we need to prepare one more object in our project that points to the remote table TLOG_F_O.

Create a design-time virtual table VT_TLOG_F_O


As we want to report on the table in the remote source T2, we need a virtual table. We already showed you how you
can create a virtual table in SAP HANA Database Explorer, but the next virtual table we will create directly in the
project in SAP Business Application Studio as a design-time artifact.

1. Switch back to SAP Business Application Studio.

2. On the left panel, in your Workspace, click on the src folder.

3. Press F1 to open the Find Command Prompt.

4. Enter HANA and select SAP HANA: Create SAP HANA Database artifacts.

5. In the field Choose path where you want to create the artifact, click on the folder icon and navigate to the

src folder of this project.

6. In the Artifact Type field, select Virtual Table (hdbvirtualtable).

7. Click on Create.

8. The Create Virtual Object wizard will open.

42
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

9. In the step Remote Source Selection, select the remote source T2 and click on Next.

10. In the step Remote Object Selection, from the Schema dropdown, select the schema T2.

11. Click on Search, which will show you the object TLOG_F_O in the schema T2. Select it and click on Next.

43
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

12. In the next step (Virtual Object Naming), enter VT_TLOG_F_O in the Object Name field and click on Finish to

create the virtual table.

13. In the SAP HANA PROJECTS panel, in the src folder of your project, you can now see this new object. Click

on the rocket icon next to the table or on the project level to build the virtual table.

14. The virtual table is now deployed to your hdi container. This was possible because of the hdbgrants files we

have created that authorizes the object owner to create virtual tables on remote source T2.

44
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Use a Flowgraph to Load Data to Remote Sources (for reference only)

You do not have to follow the steps in this section; they are only for your reference to understand how the
flowgraph can be used to load data into remote sources as well. Once we have completed these steps, you
will be able to load the data from our instance via the connections you have made earlier.

1. First, we will show you how we will load data from the BASKETANALYSIS_ALL table to our table in the SAP

HANA Cloud, HANA database T2 and the SAP HANA Cloud, data lake.

2. We create a new .hdbflowgraph artifact, which we called "load2T2".

3. We open the file in the flowgraph editor.

4. As a Data Source we add from the UPS connection the synonym S_COMBINED, which represents the

source BASKETANALYSISDATA_ALL.

5. Next, we add a Projection to the flowgraph and connect it to the Data Source.

45
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

6. We add this filter to the Projection: year("OrderDate")=2019

7. We then add a Data Target and connect it to the Projection.

8. As target we specify VT_TLOG_F_O, the virtual table we have just created. Now the data from 2019 will be

loaded into the virtual table VT_TLOG_F_O and the table TLOG_F_O in instance T2 respectively.

9. Next, we want to load the data from before 2019 to the SAP HANA Cloud, data lake connected to the SAP

HANA Cloud, HANA database T2.

10. To add a different filter for a different data target, we place another Projection in the flowgraph, which we

connect to the Data Source.

46
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

11. In this Projection, we specify the filter as follows: year("OrderDate")<2019

12. We then add a second Data Target: the synonym S_VT_DL, which is representing the table VT_TLOG_F_H.

13. We connect the second Projection and this Data Target and then deploy and execute the flowgraph.

Now you know how we managed to use the flowgraph to write data from a table in our development project into the
tables in the remote source SAP HANA Cloud, HANA database T2 and the SAP HANA Cloud, data lake.

47
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Check the data in Database Explorer

These following steps you can again follow along with your own instance and development project.

Since you have created a remote source and virtual tables in your own instance T1, the data we have just loaded to
the table in the SAP HANA Cloud, HANA database T2 and the SAP HANA Cloud, data lake will now be accessible to
you as well.

1. Switch back to the SAP HANA Database Explorer with the connection of your HDI container.

2. In the catalog, click on Tables and right click on the table VT_TLOG_F_O.

3. Select Open Data. You will now see the data from 2019 in this table.

4. Click on Synonyms in the catalog.

5. Right click on S_VT_DL and select Open Data. There you will now see the data from before 2019.

48
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

ACCESSING DATA IN ALL THREE


TABLES WITH A CALCULATION VIEW
We will now use this data in the calculation view we started to create in the beginning.

Completing the calculation view: Adding the local table TLOG_F_C

1. Switch back to the tab with SAP Business Application Studio.

2. In the src folder of your project, click on the file federation.hdbcalculationview.

3. Double click on the node Union_1 .

4. A new panel will open on the right side of the screen.

5. In the tab Mapping on the left side under the field Data Sources, double click on com.sap::TLOG_F_C. This

will automatically map all columns from the Data Sources to the respective Output columns. Alternatively,

you can click on the Auto Map by Name icon on the right of the icon bar at the top.

49
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

6. Connect the Union node to the Aggregation node by clicking on the arrow icon at the union node and

dragging it up to the Aggregation Node.

7. Double click on the Aggregation Node.

8. Under Mapping, in the Data Source column, double click on Union_1 on the left side to automatically map all

columns from the Data Source to the Output Columns.

9. Double click on the Semantics Node and in the panel that opens, click on the tab Columns.

10. There, scroll down to the column OrderYear and select it.

11. Click on the Attribute icon at the top bar to change the column type from measure to attribute. This

corrects the default assumption that integer columns are treated as measures.

12. Click on the on the rocket icon, on the top right corner to deploy the calculation view.

50
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Preview the data in SAP HANA Database Explorer


1. After successful deployment, switch back to the SAP HANA Database Explorer tab to your HDI container

connection.

2. In the catalog of the HDI container, click on Column Views.

3. Right click on the Column View you have just created (Federation) and select Open Data.

4. In the Analysis tab of the data preview, we will create a diagram to quickly look at the data.

5. Under Available Columns, click on ItemPrice and drag and drop it on the Value Axis field

6. Under Available Columns, click on OrderYear and drag and drop on the Label Axis column.

7. In the diagram, you can see data from the year 2020, as the only table we added to the calculation view was

TLOG_F_C, the table that we loaded the data from 2020 to with the flowgraph. We will now add the other

data sources to the calculation view.

51
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Adding the remote tables to the calculation view

1. Switch back to SAP Business Application Studio and go to the calculation view.

2. Click on the Union node and click on the plus icon.

3. The Find Data Sources wizard will open.

4. Search for the synonym S_VT_DL, select it from the list and click on Finish.

5. In the Mapping tab of the Union Node, select this source and click on the Auto Map by Name icon at the

top bar to map all source columns to the output columns.

6. Click on the rocket icon to deploy the updated calculation view.

52
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

7. Switch back to the SAP HANA Database Explorer and go to the diagram you have created in the previous

step.

8. Click on the Refresh icon at the top right corner.

9. Now you will also see the data from the years before 2019 which have been loaded to the table in the SAP

HANA Cloud, data lake via the flowgraph.

10. Switch back to SAP Business Application Studio and go to the calculation view.

11. Click on the Union node and click on the plus icon.

12. In the Find Data Sources wizard, search for the table VT_TLOG_F_O.

13. Select it from the list and click on Finish.

53
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

14. In the same manner as with the table in the SAP HANA Cloud, data lake, click on the Union Node, navigate

to the Mapping tab, and click on the Auto Map by Name icon at the top bar to map all source columns to

the output columns based on names.

15. Click on the rocket icon to deploy the updated calculation view.

16. Switch back to the SAP HANA Database Explorer.

17. Click on the Refresh icon at the top right corner.

18. Now you will also see the data from the year 2019.

54
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

Create a reference statement for session 3

19. In session 3, we will use different techniques to improve query performance. For that, we will use a

reference query that we will compare after various model changes.

20. The reference query we will use will be based on this data preview.

21. So, click on the SQL button on the top right corner of the diagram.

22. A window will open with the SELECT statement that queries the same data sources

23. Copy this statement to your clipboard or your notes for the next session.

24. In your catalog, right click on your database connection and select Open SQL Console.

25. Paste the statement to this console. When you log back in for session 3, it should still be saved.

55
SAP HANA Cloud Workshop Series | Creating database objects in SAP HANA Cloud with SAP Business Application Studio

And that is all for session 2 of this workshop series.

Now you know how to build up a federated scenario to use multiple sources, and how to create flowgraphs and
calculation views with SAP Business Application Studio in SAP HANA Cloud.

In the next session, you will learn how to improve calculation views with union pruning, handle analytic privileges
and use caching for efficient queries.

Excellent! You’ve completed Session 2 of the Digital Hands-on Workshop!


Thank you!

56

You might also like