You are on page 1of 81

Week 1: Working Environment and Basic Concepts

Unit 1: Introduction to the Course


Introduction to the course
Agenda

▪ Calculation views: What are they?


▪ What you can expect from this course
▪ Course structure

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 2


Introduction to the course
Calculation views in a nutshell

Calculation views …
▪ Graphical option to define complex processing steps
needed during query execution
▪ Integrated development lifecycle
▪ Good performance through high integration with
SAP HANA optimization techniques
▪ Can be accessed with standard SQL queries

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 3


Introduction to the course
Calculation views

Business User Analytics Tooling


Purpose: add business relevance and context information,
highlight relevant information with sophisticated
visualizations SAC (design-time)
Objects: Story, Dataset,

Enrichment with Reporting Semantics


HANA View Modeling

Purpose: add reporting semantics, e.g., expected prompts,


generated (runtime)
information about currency, link to respective calculation views
Objects: SQL views, tables in schema _SYS_BI

Data Processing
SAP Web IDE,
Purpose: high-performance processing of data based on business SAP Business Application
requirements, include business logic, leverage database expertise Studio (design-time)
Objects: calculation views

Data Providing
Database Explorer (runtime),
Purpose: provide access to local and remote data SAP Web IDE, SAP Business
Objects: tables, SQL views, virtual tables Application Studio (design-time)

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 4


Introduction to the course
Graphical modeling

Use graphical modeling to


▪ structure large development projects
▪ foster communication about development objects
▪ achieve good performance
▪ automatically benefit from future improvements

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 5


Introduction to the course
Calculation view modeling – Integration with other components

Close integration with


▪ SQLScript via table function nodes
▪ spatial scenarios
▪ SQL hierarchies
▪ front-end tools that evaluate metadata
written to schema _SYS_BI
(details can be found in SAP Note 2934403)
▪ Java API to programmatically create large
set of calculation views

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 6


Introduction to the course
Calculation view modeling – Integration with optimization techniques

On top of SQL optimizations, calculation


views offer additional SAP HANA
optimizations
▪ Push-down of filters
▪ Join pruning
▪ Union pruning
▪ Column pruning
▪ Control of parallelization
▪ Caching

Subset of
columns are
cached
© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 7
Introduction to the course
Calculation view modeling – Analysis of models

Improve performance using


Performance Analysis Mode Debug View Mode Model Health Checks

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 8


Introduction to the course
Calculation view modeling – Insight into data

Get detailed insight into your


models by
▪ model outline
▪ auto-documentation
▪ lineage analysis
▪ various data preview options

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 9


Introduction to the course
Calculation view modeling – OLAP features

Make use of various OLAP features


▪ Restricted columns
▪ Calculated columns
▪ Currency conversion
▪ Temporal joins
▪ Ranking
▪ Star joins
▪ Window functions

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 10


Introduction to the course
Calculation view modeling – OLAP features

Input Parameters Client Handling

Analytic Privileges

Hierarchies Masking

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 11


Introduction to the course
What you can expect from this course

▪ Overview of available calculation view features


▪ Up-to-date knowledge about modeling techniques for
high-performance queries
▪ How to work efficiently in the SAP HANA Cloud
development environment
▪ Good understanding of SAP HANA Deployment
Infrastructure (HDI)
▪ Insights into inner workings of calculation views
▪ Troubleshooting knowledge
▪ Assessment questions to consolidate learning and to
receive course certification

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 12


Introduction to the course
Structure of course

Week 1: Working Environment and Basic Concepts


Week 2: Using External Objects and Modeling Topics
Week 3: Performance Techniques
Week 4: Performance Deep-Dive and Migration

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 13


Thank you.
Contact information:

open@sap.com
Follow all of SAP

www.sap.com/contactsap

© 2022 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 platforms, 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.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names
mentioned are the trademarks of their respective companies.
See www.sap.com/trademark for additional trademark information and notices.
Week 1: Working Environment and Basic Concepts
Unit 2: Development Environment
Development environment
Developing SAP HANA database objects with SAP HANA Cloud

Context
▪ SAP Web IDE for SAP HANA is the tool of choice for on-premise
customers when developing SAP HANA database objects; for
SAP HANA Cloud it is SAP Business Application Studio
▪ Synchronization between developers is done using Git concepts

Impact
▪ SAP Web IDE for SAP HANA and SAP Business Application
Studio follow the same development concepts. Thus, projects
can be re-used between on-premise and SAP HANA Cloud
▪ With Git, a powerful concept exists for versioning and
synchronizing development artifacts

Consequences
▪ Continuous development and deployment concepts are built into
the tooling
© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 2
Development environment
History of native SAP HANA development

SAP HANA studio SAP Web IDE SAP Business Application Studio
Target Runtime: XSC Target Runtime: XSA/CF Target Runtime: CF
Design-time: Repository Design-time: HDI, Git Design-time: HDI, Git
Deprecated with SAP HANA 2 Deprecated on SAP Cloud Platform Default IDE for SAP HANA Cloud
Removed in SAP HANA Cloud Default IDE for SAP HANA 2 on-premise Provides latest development feature
enhancements (cloud first)

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 3


Development environment
Development tooling: unified development environment

SAP HANA studio – Modeler Eclipse-perspective SAP Business Application Studio


Focus on SAP HANA view modeling
▪ Development tooling platform for
SAP HANA Cloud
SAP HANA studio – Development Eclipse-perspective ▪ Runs in browser (no separate
Focus on application and database design-time artifacts installation of client tool needed)
▪ Deploys via new SAP HANA
SAP HANA Web-based development Deployment Infrastructure
workbench
Focus on application and database ▪ Integrates with Git
design-time artifacts ▪ Includes calculation view modeler

Learning article how to move on-premise calculation view project to


SAP HANA Cloud
Blog Calculation View modeling in Business Application Studio
2396214 – Transition to SAP HANA Extended Services Advanced
and SAP HANA Cockpit – Fading out XS Classic and HANA Studio
2465027 – Deprecation of SAP HANA extended application services,
classic model and SAP HANA Repository

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 4


Development environment
Project setup: example

Other Git Project


Adapted Template on Git Server
on Git Server
Reuse
pull push Automated job Container
(not discussed)
Project in BAS fork
Git Project on Git
of coordinator Server
pull consume

pull Automated job push

push
Project in BAS Reuse Project in BAS
of developer 1 Container of developer 2

consume
© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 5
Development environment
Concepts

Cloud Foundry Space:


Environment in which services run. Users with developer authorizations for a space
can make use of all services in this space, that is, they can see the same data

Services:
Run in a space and can be bound to a development project to make use of them.
Examples: service used for deploying the project, service used for providing access
to data

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 6


Development environment
Concepts

HDI container:
virtual construct that contains several schemas. Most notably one for holding the deployed objects and one for offering
procedures to work on the container objects

deployed objects
procedures used by deployment
object owner (schema of user)

object_owner:
Automatically created when creating an HDI container in BAS. Will be the owner of created objects
(similar to _SYS_REPO in repository but local to container)

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 7


Development environment
Concepts

application_user:
User that is also automatically created when building a project in BAS, or when connecting in database explorer to
a container. Used, for example, for data preview from BAS, or SQL console in Database Explorer. Ends in “_RT”

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 8


Development environment
Concepts

synonyms:
Point to objects that are not defined in a current project. It is
not possible to refer directly to an external object from within
the HDI container

{
"com.sap::SalesOrderItem": {
"target": {
"object": "SalesOrderItem",
"schema": "BICERTDATA"
}
}
}

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 9


Development environment
Concepts

.hdbgrants:
Describes which privileges/roles should be assigned during
deployment to the object owner (“local _SYS_REPO”) and the
application user (ending in “_RT”) using the specific service
{
"UPSDEVWS": {
"object_owner": {

"global_roles" : [
{
"roles" : [ "genericOO#" ]
}
]
},
"application_user": {
"global_roles" : [
{
"roles" : [ "genericAP" ]
}
]
}
}
}
© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 10
Development environment
Concepts

.hdbrole:
Describes which privileges/other roles should be granted to the role during deployment. Requires that the object
owner has the GRANT privilege for the respective objects. These roles are associated with the schema of the
container. Only roles ending in “#” are allowed to contain privileges for objects of the container with GRANT option
{
"role": {
"name": "onCV1",
"object_privileges": [
{
"name": "v1",
"type": "VIEW",
"privileges": [
"SELECT"
]
}
],
"schema_analytic_privileges": [
{
"privileges": [
"apOnHA"
]
}
]
}
}
© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 11
Development environment
Concepts

Development space:
Collection of extensions that you would like to use in BAS (there is a template for SAP HANA development)

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 12


Development environment
adjust size details/
SAP Business Application Studio areas scenario area
navigate/zoom model outline

deploy
current file
development
files

Git integration

details
modeling toolbar

problem
views
SAP HANA
Projects Explorer
deployment information
(deploy /handle
add database
services)
connection

terminal for For opening Linux terminal:


branch space command line input
© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 13
Thank you.
Contact information:

open@sap.com
Follow all of SAP

www.sap.com/contactsap

© 2022 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 platforms, 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.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names
mentioned are the trademarks of their respective companies.
See www.sap.com/trademark for additional trademark information and notices.
Week 1: Working Environment and Basic Concepts
Unit 3: HDI Concepts in General
HDI concepts in general
Main decision: how to create and maintain data structures

DDL/
Frameworks Schema

CAP CDS Design time HDI Talking today

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 2


HDI concepts in general
Why schema?

SQL connection with direct access to a plain database schema

Direct control and full responsibility over the schema and its
object lifecycle via DDL/DML

Can be used as endpoint for external database schema


change management solutions

like Liquibase, Flyway, SAP PowerDesigner


▪ Supports most standard database artifacts
▪ No support for advanced SAP HANA artifacts like calculation views,
flowgraphs, and replication tasks
▪ User has to evolve runtime objects
▪ User has to re-deploy dependent objects
▪ User has to ensure transactional behavior

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 3


HDI concepts in general
Why HDI?

▪ HDI stands for SAP HANA Deployment Infrastructure


▪ HDI is integral part of SAP HANA and SAP HANA Cloud
▪ HDI is a scalable design-time \ runtime environment
▪ Supports most standard database artifacts like tables,
procedures, views, virtual tables, roles
▪ Support for advanced SAP HANA artifacts like
calculation views, flowgraphs, replication tasks…
▪ Determines correct deployment order
▪ Evolves the runtime objects
▪ Re-deployment of dependent artifacts
▪ Transactional all-or-nothing principle
▪ Can be generated from higher-level language like
CAP CDS

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 4


HDI concepts in general
Comparison to other SAP development systems

Communality Development Landscape

▪ Design Time → Runtime SAP BTP / XSA


▪ Package / Deployment Unit / ABAP System SAP HANA XSC SAP HANA HDI
Project as a grouping of SAP HANA
Versioning
(Git et.al.)
artifacts ABAP GUI Studio, Web SAP HANA
SE11, SE80 Frontend Tooling

Differences to HDI
▪ HDI introduces the usage of CI/CD (opt.)

versioning tools
▪ Higher parallelism, no DDIC:Repository _sys_repo: HDI:Repository
Repository ...
singleton for deployment
▪ Conflict resolution via
versioning tools

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 5


HDI concepts in general
Demo

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 6


HDI concepts in general
DEMO content

Open BAS with a project and show the project structure

Deploy,

GIT,

BTP Cockpit

DBX

open as RT

open as DT

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 7


HDI concepts in general
Overview of an HDI container

An HDI container has (at least) 3 schemas:

<HDI-Container>
▪ Operational Container
– Runtime objects and application data
– This schema holds all the generated objects as
HDI Container Concept
tables, views, procedure, roles,…

<HDI-Container>#DI
▪ As Deployment Infrastructure
<HDI-Container> <HDI-Container>#DI <HDI-Container>#OO
– This container holds all the design-time objects
and the SQL API to be used with DI

<HDI-Container>#OO
▪ As Object Owner
– HDI creates a technical object owner (user)
As all users, it has its own schema
© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 8
HDI concepts in general
Why HDI?

Summary of SAP HANA Deployment Infrastructure (HDI)


1. Simplifies the schema evolution or lifecycle management for
schemas
2. Isolation by default: The content is isolated by design and you
have to declare access rights explicitly
3. Leaves the rights declaration close to the developer
(or NOT – if wanted) in the context of [micro-]service
development
4. Allows many developers to develop in parallel without
interference
5. Supports the modern development styles via source code
versioning tools and allows massive acceleration of
development cycles on the database
6. Supports development for SaaS (Software as a Service) to
maintain very large numbers of instances
© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 9
Thank you.
Contact information:

open@sap.com
Follow all of SAP

www.sap.com/contactsap

© 2022 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 platforms, 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.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names
mentioned are the trademarks of their respective companies.
See www.sap.com/trademark for additional trademark information and notices.
Week 1: Working Environment and Basic Concepts
Unit 4: HDI Concepts for Tables and Rights
HDI concepts for tables and rights
Creating data structures (ANSI SQL)

A table is the base object in a database

In SQL, Data Definition Language (DDL) describes the creation of a table and other database
artifacts

When you create a table, you define the columns with their names and datatypes plus other
features
Sample for a hdbtable declaration:

/* FIRST VERSION */
/*create*/ column table PERSON (
PERSONID BIGINT NOT NULL,
FIRSTNAME NVARCHAR(100),
LASTNAME NVARCHAR(100))

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 2


HDI concepts for tables and rights
Changing data structures

▪ Over time, you also need to change the tables (a.k.a. table or schema evolution or lifecycle management)

/* SECOND VERSION */
/*create*/ column table PERSON (
PERSONID BIGINT NOT NULL,
FIRSTNAME NVARCHAR(100),
LASTNAME NVARCHAR(100),
BIRTHDATE DATE )

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 3


HDI concepts for tables and rights
HDI table creation

HDBTABLE
▪ Creates or modifies a table in SAP HANA. If the table
exists in SAP HANA, an intermediate table is created
and content copied

HDBDROPCREATETABLE
▪ Always creates a new version of the table without
copying the content

HDBMIGRATIONTABLE
▪ Allows you to alter the table

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 4


HDI concepts for tables and rights
Change strategies

▪ There are 2 fundamental concepts for changing the table structure:


– ALTER a table → HDBMIGRATIONTABLE
alter table PERSON
add (BIRTHDAY DATE);
– RECREATE a table → HDBTABLE (pseudo code)
rename table PERSON to "tmp_PERSON";
create column table PERSON (
PERSONID BIGINT not null,
FIRSTNAME NVARCHAR(100),
LASTNAME NVARCHAR(100),
BIRTHDAY DATE
);
insert into PERSON (PERSONID, FIRSTNAME, LASTNAME)
select PERSONID, FIRSTNAME, LASTNAME
from "tmp_PERSON";
drop table "tmp_PERSON" cascade;

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 5


HDI concepts for tables and rights
Example of a .hdbmigrationtable

Version Version Version


== version = 1 == version = 2 == version = 3
column table PERSON ( column table PERSON ( column table PERSON (
FIRSTNAME varchar(100), FIRSTNAME varchar(100), FIRSTNAME varchar(100),
LNAME varchar(100)) LASTNAME varchar(100), LASTNAME varchar(100),
STREET varchar(100), STREET varchar(200),
CITY varchar(100)) CITY varchar(100),
HOUSENUMBER int)
== migration = 2
alter table PERSON add (STREET varchar(100)); == migration = 2
alter table PERSON add (CITY varchar(100)); alter table PERSON add (STREET varchar(100));
rename column PERSON.LNAME to LASTNAME; alter table PERSON add (CITY varchar(100));
rename column PERSON.NAME to LASTNAME;

== migration = 3
alter table PERSON alter (STREET
varchar(200));
alter table PERSON add (HOUSENUMBER int);

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 6


HDI concepts for tables and rights
Demo

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 7


HDI concepts for tables and rights
Isolation by default

By default ONLY the Runtime User has access to


the data in the <HDI-Container>
Runtime User Design Time
(RT-User) User (DT-User)
This is a key security feature of HDI!

DT and RT users are created by SAP BTP. The SAP


HANA Service Broker gets the request to create a HDI Container Concept
service and provide a service key. If the service
already exits it will just provide the key. This key has
all essential information such as host, port, UID, and
PwD, to allow building access to the container.
<HDI- <HDI- <HDI-
Container> Container>#DI Container>#OO
Only SAP BTP users of that SPACE can see this
information.

Access_Roles
© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 8
HDI concepts for tables and rights
Getting access rights to the data

You have to explicitly define roles and grant


them to other users

An access role has to be defined and granted Runtime User Design Time
(RT-User) User (DT-User)
to a user who wants to access the data full access rights
as defined in
default access role
A Granter User should get grantable rights
and can grant roles to individual users HDI Container Concept
generated
objects

access to runtime
data according to <HDI-Container> <HDI- <HDI-
rights Container>#DI Container>#OO

Granter
Individual User grants roles Granter User Access_Roles

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 9


HDI concepts for tables and rights
Summary concept of tables and rights

HDI
▪ Table creation and lifecycle management (evolution)
with data preservation
− Different constructs are available such as
• HDBTABLE
• HDBMIGRATIONTABLE
▪ Defining roles to access the data with an HDI container
− DT/RT users are cloud-generated “technical users”
that are maintained as “SHARED SERVICE KEYS”
− Define a ”Granter Role” that is allowed to assign
these internal HDI roles

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 10


Thank you.
Contact information:

open@sap.com
Follow all of SAP

www.sap.com/contactsap

© 2022 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 platforms, 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.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names
mentioned are the trademarks of their respective companies.
See www.sap.com/trademark for additional trademark information and notices.
Week 1: Working Environment and Basic Concepts
Unit 5: HDI Deployment with SAP Business
Application Studio
HDI deployment with SAP Business Application Studio
Getting a schema or an HDI container in SAP BTP

Application

SAP BTP

HDI Container Plain Schema SAP HANA


Service Broker

HDI Container Plain Schema

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 2


HDI deployment with SAP Business Application Studio
Empty SAP Business Application Studio

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 3


HDI deployment with SAP Business Application Studio
Two different ways to deploy

a) Developers deploy to their own container


▪ Each developer has
her/his own container
▪ They can work
completely
independently from
other developers
▪ Synchronization point
of code is Git
▪ Single files could be
redeployed to have
fast feedback if the
code is valid
▪ At the end of
development the code
has to be checked in

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 4


HDI deployment with SAP Business Application Studio
Two different ways to deploy

b) Leader or developer deploys an MTA build to SAP BTP


▪ This is the project
deploy
▪ Only one instance
will be in the space
▪ If complete, this
build could also be
deployed to QA and
ultimately to PROD
(or however many
stages you have)

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 5


HDI deployment with SAP Business Application Studio
Two different ways to deploy

b) Leader or developer deploys an MTA build to BTP


▪ This is the project
deploy
▪ Only one instance
will be in the space
▪ If complete, this
build could also be
deployed to QA and
ultimately to PROD
(or however many
stages you have)

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 6


HDI deployment with SAP Business Application Studio
Demo

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 7


HDI deployment with SAP Business Application Studio
Allows to develop in parallel with many developers

SAP BTP Versioned Source


Development Code
The repository-based developer Space Synchronize with Other
Developers via Git
scenario is a bottleneck with many
developers HDI Dev1

Git-like versioning is used for modern User GIT


Provides HDI Dev2
applications and is also good for Services
database development UPS

HDI others
Every developer has her/his own Software Build
container(s) to develop and does not and Distribution
HDI
interfere with others. Conflicts are Common
resolved on Git/organizational level

QA Space CI/CD

Prod Space

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 8


HDI deployment with SAP Business Application Studio
Summary: HDI deployment with SAP Business Application Studio

With SAP BTP, the use of the database introduces further steps
▪ SAP BTP provides a service (SAP HANA Service Broker) that helps to create HDI containers and
schemas
▪ SAP BTP will generate for Schema (ex.: cf cli tool to access)
▪ SAP BTP will generate for HDI
– Container, Design Time user and Runtime user
▪ Benefits:
– A logical service with a shared service key allows you to ask for the service and its technical user
without knowing where it is running and what the credentials are.
▫ Many cloud applications could now access the service (with the respective rights) for example
− Database Explorer
− Database Administration, …
▪ This concept allows to create, rebind or delete your services
– More on this in the next unit

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 9


HDI deployment with SAP Business Application Studio
Outlook: HDI functions accessible in SQL or JavaScript

HDI functions in JavaScript

https://www.npmjs.com/package/@sap/hdi

Installation
▪ npm install --save @sap/hdi

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 10


Thank you.
Contact information:

open@sap.com
Follow all of SAP

www.sap.com/contactsap

© 2022 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 platforms, 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.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names
mentioned are the trademarks of their respective companies.
See www.sap.com/trademark for additional trademark information and notices.
Week 1: Working Environment and Basic Concepts
Unit 6: HDI Deployment – Administration Aspects
HDI deployment – Administration aspects
Overview

There are several aspects to administation in


development with HDI. Here some of the major
ones, which we will briefly cover in the content of
this session:
▪ Developers in SAP BTP, technical users in
applications, users on the database
▪ Copying HDI containers
▪ Creating / deleting HDI containers
▪ Changing users / passwords of HDI services in
SAP BTP
▪ Tooling in SAP BTP for HDI administration

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 2


HDI deployment – Administration aspects
Getting a schema or an HDI container in SAP BTP

Application

SAP BTP

HDI Container Plain Schema SAP HANA


Service Broker

HDI Container Plain Schema

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 3


HDI deployment – Administration aspects
Overview of deployment

In the previous unit we saw that you can use


SAP Business Application Studio (BAS) to
deploy content to SAP Business Technology
Platform (BTP).

BAS has some very nice built-in features that


are not immediately obvious
▪ You can create your own HDI container
▪ Allows you to “single deploy” a particular file
▪ Deletes implicitly all files in the DesignTime repo you
have deleted in your file system
▪ Allows you to deploy in the space you are in

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 4


HDI deployment – Administration aspects
Overview of deployment

You can choose several ways to interact with SAP HANA Cloud.
SAP Business Application Studio

SAP BTP cockpit

Shell with cf-cli

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 5


HDI deployment – Administration aspects
Using shared keys

One example of using shared


keys is with the Database
Explorer.

Once added to your list of favorite


databases, it will fetch the shared-
key content to access the
database.

So even if you never added the


password or the password
changed, you can access the HDI
container.

And even access to the


DesignTime(Admin) user is
planned and useful.

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 6


HDI deployment – Administration aspects
Concept of password rotation

Pseudo code:
KEYS = ʽcf sk <mySERVICE>ʼ -- get all the keys that are related to my service
FOR KEY IN KEYS DO
cf dsk KEY -- delete service-key
cf csk KEY -- create service-key
END FOR

Since the access to “myService” happens via a service key, this will be transparent for the
developer.

However: The use of local stored UID/PWORD does not make much sense.

You can use automation pilot to change the service key with any frequency you want:
▪ Quarterly, monthly, weekly, daily

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 7


HDI deployment – Administration aspects
Export or import a container

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 8


HDI deployment – Administration aspects
SAP BTP – Spaces and HDI container

▪ One or more SAP BTP applications are


running in an SAP BTP CF space BTP BTP
Space A Space B
▪ Database artifacts used by CF applications
are created in an HDI container (typical)
▪ Every HDI container belongs to one SAP BTP
application BTP User A BTP User B
▪ Access and visibility of HDI containers
in SAP BTP is managed on space level

C1 C2 C3 C4

SAP HANA Cloud

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 9


HDI deployment – Administration aspects
Demo

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 10


HDI deployment – Administration aspects
Example: Role management → more details in security workshops

Check the project, the module and mta.yaml file

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 11


HDI deployment – Administration aspects
SAP HANA Cloud – Cockpit

HDI Admin

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 12


HDI deployment – Administration aspects
HDI deployment administration aspects: For another session…

Other aspects of administation in development


with HDI: these topics will not be covered in
content of this session:
▪ Areas of responsibility and how many layers to use
▪ The number of landscapes/stages that are needed
or in use in your company and how to do this with
SAP BTP
▪ Getting testing data
▪ Backup/Restore of HDI containers
▪ Users on the database

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 13


HDI deployment – Administration aspects
Outlook: HDI functions in JavaScript

HDI functions in JavaScript

https://www.npmjs.com/package/@sap/hdi

Installation
▪ npm install --save @sap/hdi

© 2022 SAP SE or an SAP affiliate company. All rights reserved. ǀ PUBLIC 14


Thank you.
Contact information:

open@sap.com
Follow all of SAP

www.sap.com/contactsap

© 2022 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 platforms, 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.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. All other product and service names
mentioned are the trademarks of their respective companies.
See www.sap.com/trademark for additional trademark information and notices.

You might also like