Professional Documents
Culture Documents
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
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)
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
Analytic Privileges
Hierarchies Masking
open@sap.com
Follow all of SAP
www.sap.com/contactsap
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)
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
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
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)
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”
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"
}
}
}
.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)
deploy
current file
development
files
Git integration
details
modeling toolbar
problem
views
SAP HANA
Projects Explorer
deployment information
(deploy /handle
add database
services)
connection
open@sap.com
Follow all of SAP
www.sap.com/contactsap
DDL/
Frameworks Schema
Direct control and full responsibility over the schema and its
object lifecycle via DDL/DML
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
Deploy,
GIT,
BTP Cockpit
DBX
open as RT
open as DT
<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?
open@sap.com
Follow all of SAP
www.sap.com/contactsap
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))
▪ 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 )
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
== migration = 3
alter table PERSON alter (STREET
varchar(200));
alter table PERSON add (HOUSENUMBER int);
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
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
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
open@sap.com
Follow all of SAP
www.sap.com/contactsap
Application
SAP BTP
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
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
https://www.npmjs.com/package/@sap/hdi
Installation
▪ npm install --save @sap/hdi
open@sap.com
Follow all of SAP
www.sap.com/contactsap
Application
SAP BTP
You can choose several ways to interact with SAP HANA Cloud.
SAP Business Application Studio
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
C1 C2 C3 C4
HDI Admin
https://www.npmjs.com/package/@sap/hdi
Installation
▪ npm install --save @sap/hdi
open@sap.com
Follow all of SAP
www.sap.com/contactsap