0% found this document useful (0 votes)
68 views52 pages

Data Architecture For SAP HANA

Uploaded by

Sepideh Jalili
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views52 pages

Data Architecture For SAP HANA

Uploaded by

Sepideh Jalili
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

User Guide | PUBLIC

SAP PowerDesigner
Document Version: 16.7.06 – 2022-07-01

Data Architecture for SAP HANA


SAP PowerDesigner Documentation Collection
© 2022 SAP SE or an SAP affiliate company. All rights reserved.

THE BEST RUN


Content

1 PowerDesigner and HANA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Modeling for HANA Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6


2.1 HANA Packages (HANA). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Virtual Tables (HANA). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 System-Versioned Tables (HANA). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4 Dynamic Tiering / Extended Storage (HANA). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.5 Calculation Views (HANA). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Creating a Calculation View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Performing an Impact Analysis on a Calculation View. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
2.6 Table Placement (HANA). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.7 Exporting Objects to the HANA Repository. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.8 Importing Objects from the HANA Repository. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.9 SAP HANA Database Extensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3 Modeling for Core Data Services (CDS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33


3.1 HANA Packages (CDS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2 Contexts (CDS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.3 Entities (CDS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.4 System-Versioned Tables (CDS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
3.5 Associations (CDS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.6 Views (CDS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
3.7 Simple Types (CDS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.8 Structured Types (CDS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.9 Constants (CDS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.10 Extensions (CDS). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.11 Exporting CDS Objects to the HANA Repository. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.12 Generating CDS Files for Repository or HDI Environments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

Data Architecture for SAP HANA


2 PUBLIC Content
1 PowerDesigner and HANA

SAP® PowerDesigner® provides a design-time environment for modeling tables and supporting objects for
generation to SAP HANA®, and supports reverse-engineering your HANA environment for inclusion in impact
analysis of your global data landscape and across other modeling domains. PowerDesigner supports round-trip
reverse-engineering and generation of HANA tables and other catalog objects directly or via CDS entities for
SAP HANA® 1.0 and 2.0 databases. In addition, for SAP HANA® 1.0 environments, PowerDesigner supports
initializing and reverse-engineering graphical calculation views (including the XML definition and projection list)
for inclusion in impact analysis.

PowerDesigner serves the following principal use cases in your HANA environment:

● [HANA 1.0 and 2.0] Modeling a HANA database, including migration from another DBMS (see Modeling for
HANA Database [page 6]):

Tasks HANA 1.0 Database HANA 2.0 Database

Design Generation of a CDM or LDM to an SAP Generation of a CDM or LDM to an SAP


HANA 1.0 Database PDM. HANA 2.0 Database PDM.

Generation of any PDM to an SAP HANA Generation of any PDM to an SAP HANA
1.0 Database PDM for migration pur­ 2.0 Database PDM for migration pur­
poses. poses.

Modeling of the following catalog objects: Modeling of the following catalog objects:
○ Tables ○ Tables
○ Virtual tables ○ Virtual tables
○ SQL Views ○ SQL Views
○ Dynamic tiering ○ Dynamic tiering

Generation / Reverse Supported, including round-trip. Supported, including round-trip.

● [HANA 1.0 and 2.0] Modeling a HANA database as CDS artifacts, including migration from another DBMS
(see Modeling for Core Data Services (CDS) [page 33]):

Data Architecture for SAP HANA


PowerDesigner and HANA PUBLIC 3
Tasks HANA 1.0 Classic Repository HANA 1.0 and 2.0 HDI

Design Generation of a CDM or LDM to an SAP Generation of a CDM or LDM to an SAP


HANA 1.0 CDS Repository PDM. HANA 1.0 CDS HDI or SAP HANA 2.0
CDS HDI PDM.
Generation of any PDM to an SAP HANA
1.0 CDS Repository PDM for migration Generation of any PDM to an SAP HANA
purposes. 1.0 CDS HDI or SAP HANA 2.0 CDS
HDI PDM for migration purposes.
Modeling of the following CDS artifacts:
○ Contexts Modeling of all classic HANA Repository arti­
○ Entities facts, and:
○ Associations ○ Constants
○ Views ○ Extensions (for entities) - SAP HANA
○ Simple and structured types 2.0 CDS HDI only

Not supported: view joins, anonymous types,


enumerations.

Generation Generation and activation of CDS artifacts. Generation of CDS files for activation.

Reverse Not supported. As per classic HANA Repository.

Catalog tables activated from your CDS enti­


ties can be reversed to an SAP HANA 1.0
Database PDM.

● [HANA 1.0] Visualization and impact analysis for HANA graphical calculation views and their dependencies
(see Calculation Views (HANA) [page 12]):

Tasks HANA 1.0 Classic Repository HANA 1.0 HDI

Design Modeling of graphical calculation views, their As per classic HANA Repository.
sources, and projection lists in an SAP HANA
1.0 Database PDM.

PowerDesigner allows you to specify the busi­


ness purpose of your calculation views and
their points of contact with other artifacts,
while their internal logic and technical details
are completed in HANA Modeler or Web IDE.

 Note
To model calculation views based on CDS
artifacts, you must first generate your en­
tities to HANA, activate them as tables,
and then reverse the tables to an SAP
HANA 1.0 Database PDM.

Data Architecture for SAP HANA


4 PUBLIC PowerDesigner and HANA
Tasks HANA 1.0 Classic Repository HANA 1.0 HDI

Generation Support for initialization only. No updating of As per classic HANA Repository.
calculation views present on the HANA server.

Reverse Read-only objects (including the XML defini­ Not supported.


tion, data sources, and projection list) linked
to their sources for inclusion in impact analy­
sis. Other properties, such as variables, pa­
rameters, hierarchies, and internal nodes are
not reversed.

Data Architecture for SAP HANA


PowerDesigner and HANA PUBLIC 5
2 Modeling for HANA Database

PowerDesigner supports round-trip reverse-engineering and generation of HANA tables and other catalog
objects directly or via CDS entities for SAP HANA® 1.0 and 2.0 databases. In addition, for SAP HANA® 1.0
environments, PowerDesigner supports initializing and reverse-engineering graphical calculation views
(including the XML definition and projection list) for inclusion in impact analysis.

Context

This procedure describes migrating a database to HANA. PowerDesigner also supports:

● Reverse-engineering catalog objects manually via File Reverse Engineer Database .


● [HANA 1.0 Classic Repository only] Reverse-engineering calculation views and their associated catalog
objects from HANA via File Reverse Engineer HANA Repository (see Importing Objects from the
HANA Repository [page 22]).
● [HANA 1.0 and 2.0] Migrating a database to HANA via CDS artifacts (see Modeling for Core Data Services
(CDS) [page 33]).

Procedure

1. Open your source CDM, LDM, or PDM and select Tools Generate Physical Data Model .
2. Select SAP HANA 1.0 Database or SAP HANA 2.0 Database in the DBMS field, modify as appropriate
the other options on this and the other tabs, and click OK to generate your HANA PDM.
3. Review the generated model and perform any appropriate modeling tasks. The following HANA­specific
tools are available in the SAP HANA Database toolbox:

Tool Description Can Create In

[HANA 1.0] HANA Package - An organizing container for HANA artifacts. See HANA Anywhere

Packages (HANA) [page 7].

Virtual Table - A mapping to a table located in a remote data source. See Virtual Ta­ Model Root

bles (HANA) [page 8].

[HANA 1.0] Calculation View - A view that can consume tables, SQL views and other HANA Package

calculation views and perform complex calculations. See Calculation Views (HANA)
[page 12].

The following standard PDM tools are available in the Physical Diagram toolbox:

Data Architecture for SAP HANA


6 PUBLIC Modeling for HANA Database
Tool Description Can Create In

Table - A collection of rows (records) that have associated columns (fields).. Model Root

Reference - A link between a primary or an alternate key in a parent table, and a for­ Model Root

eign key of a child table.

View - A data structure that results from a SQL query and that is built from data in Model Root

one or more tables.

Procedure - A precompiled collection of SQL statements stored under a name in the Model Root

database and processed as a unit.

4. Generate your model to HANA:

○ HANA 1.0: [catalog and repository objects] Use the wizard (see Exporting Objects to the HANA
Repository [page 18]).
○ HANA 2.0: [catalog objects only] Use the Database Generate Database command.
5. Review and complete the definition of your calculation views in HANA Modeler or Web IDE.

2.1 HANA Packages (HANA)

[HANA 1.0] HANA packages group together related information objects in a structured way. In an SAP HANA®
1.0 Database PDM, tables are stored in the catalog (represented by the model root), while calculation views
must be created in a HANA package.

Context

 Note

PowerDesigner support for SAP HANA® 2.0 is restricted to catalog objects. HANA packages are not
supported.

Procedure

1. Select the HANA Package tool and click in the diagram.


2. Open the property sheet tab, and complete properties as appropriate.

The following properties are available on the General tab:

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 7
Name Description

Name/Code/ Identify the object. The name should clearly convey the object's purpose to non-technical
Comment users, while the code, which is used for generating code or scripts, may be abbreviated, and
should not normally include spaces. You can optionally add a comment to provide more detailed
information about the object. By default the code is generated from the name by applying the
naming conventions specified in the model options. To decouple name-code synchronization,
click to release the = button to the right of the Code field.

Scripting name: Name, Code, Comment

Use parent name­ Not for use with HANA packages.


space

Keywords Provide a way of loosely grouping objects through tagging. To enter multiple keywords, separate
them with commas.

Scripting name: Keywords

The following read-only properties are provided for information on the HANA tab:

Name Description

Structure package [read-only] Specifies that the package is a structural package.

Scripting name: Structural

Package [read-only] Specifies the HANA object name.

Scripting name: _ObjectName_

3. Click OK to complete the creation of the HANA package.

2.2 Virtual Tables (HANA)

With SAP HANA Smart Data Access, data can be merged in heterogeneous EDW landscapes (data federation),
making it possible to access data in remote sources without having to replicate it to the SAP HANA database
beforehand. PowerDesigner models virtual tables as tables with a stereotype of VirtualTable and remote
sources as extended objects with a stereotype of RemoteSource.

Procedure

1. Prepare the source PDM containing the table you want to access and have it open in your workspace.
2. In the HANA PDM, select the Virtual Table tool and click in the diagram at the model root.
3. In the object picker, select the source table and click OK.

Data Architecture for SAP HANA


8 PUBLIC Modeling for HANA Database
PowerDesigner creates the virtual table and links it to a remote source initialized to point to the source
model.
4. Open the virtual table property sheet tab, give it an appropriate Name, and set its Owner.
5. Click the Properties tool to the right of the Remote source field to open the remote source property sheet,
and complete the properties of the remote source:

Name Description

Name/Code/ Identify the object. The name should clearly convey the object's purpose to non-technical
Comment users, while the code, which is used for generating code or scripts, may be abbreviated, and
should not normally include spaces. You can optionally add a comment to provide more detailed
information about the object. By default the code is generated from the name by applying the
naming conventions specified in the model options. To decouple name-code synchronization,
click to release the = button to the right of the Code field.

Scripting name: Name, Code, Comment

Adapter Specifies the adapter, and the type of access method to be used by the SAP HANA database to
access the data.

Scripting name: RSAdapter

Configuration Specifies the connection parameters for the adapter.

Scripting name: RSConfiguration

Credential type / Specifies the type of credentials required (currently only password) and the credentials to
Credentials use

Scripting name: RSCredentialType, RSCredentials

Model Specifies the PDM that contains the definition of the remote source.

Scripting name: RSPDM

Keywords Provide a way of loosely grouping objects through tagging. To enter multiple keywords, separate
them with commas.

Scripting name: Keywords

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 9
2.3 System-Versioned Tables (HANA)

System-versioned tables, which support the tracking of changes on column store tables by capturing the
validity period of each record, are available in SAP HANA 2.0 SP03 and higher. PowerDesigner supports the
modeling of history tables in SAP HANA 2.0 Database and SAP HANA 2.0 CDS HDI PDMs.

Context

System-versioned tables require two physical tables:

● The main table of records that are currently valid


● A history table of archived records

For more information, see System-Versioned Tables in the SAP HANA Administration Guide.

● To enable system versioning for a single table:


1. Right-click the table in the Browser or diagram canvas and select Change to Versioned Table.
2. In the dialog, review the proposed names for the VALIDFROM and VALIDTO columns and for the history
table and click OK.
● To enable system versioning for multiple tables:
1. Right-click the model in the Brower and select Versioned Tables.
2. In the dialog, select the tables to be versioned and click OK.

In each case, PowerDesigner:

● Adds the VALIDFROM and VALIDTO columns to the main table.


● Displays the versioning properties of the main table on its Versioning tab.

 Note

History tables are modeled as properties of the main tables and are not created as separate objects in
the model.

To remove system versioning from a table:

● Right-click the table in the Brower or diagram canvas and select Remove Versioning, or
● Right-click the model in the Brower, select Versioned Tables, deselect the table in the list, and click OK.

In each case, PowerDesigner removes the VALIDFROM and VALIDTO columns from the main table.

Data Architecture for SAP HANA


10 PUBLIC Modeling for HANA Database
2.4 Dynamic Tiering / Extended Storage (HANA)

SAP HANA dynamic tiering is a native big data solution providing large volume, warm data management
capability. Your highest value data remains in memory, and cooler less-valuable data is saved to the extended
store.

Procedure

1. Open the model property sheet, and click the Create Extended Storage button to the right of the Extended
storage field.
2. Click the Properties button to open the extended storage property sheet and enter the following properties:

Name Description

Name/Code/ Identify the object. The name should clearly convey the object's purpose to non-technical
Comment users, while the code, which is used for generating code or scripts, may be abbreviated, and
should not normally include spaces. You can optionally add a comment to provide more detailed
information about the object. By default the code is generated from the name by applying the
naming conventions specified in the model options. To decouple name-code synchronization,
click to release the = button to the right of the Code field.

Scripting name: Name, Code, Comment

Configuration Specifies the connection parameters for the adapter.

Scripting name: ESConfiguration

Credential type / Specifies the type of credentials required (currently only password) and the credentials to
Credentials use

Scripting name: ESCredentialType, ESCredentials

Keywords Provide a way of loosely grouping objects through tagging. To enter multiple keywords, separate
them with commas.

Scripting name: Keywords

3. To specify that a table should be located in the extended storage, select the Using extended storage option
on the HANA tab of the table property sheet.

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 11
2.5 Calculation Views (HANA)

[HANA 1.0] A calculation view can perform complex calculations and can have tables, standard views, and
other calculation views as sources.

 Note

Analytic and attribute views are deprecated in HANA and should be migrated to calculation views (see SAP
Note 2325817 ).

PowerDesigner provides the following support for HANA 1.0 calculation views:

Tasks HANA 1.0 Classic Repository HANA 1.0 HDI

Design Modeling of graphical calculation views, their As per classic HANA Repository.
sources, and projection lists in an SAP HANA
1.0 Database PDM.

PowerDesigner allows you to specify the busi­


ness purpose of your calculation views and their
points of contact with other artifacts, while their
internal logic and technical details are com­
pleted in HANA Modeler or Web IDE.

 Note
To model calculation views based on CDS
artifacts, you must first generate your enti­
ties to HANA, activate them as tables, and
then reverse the tables to an SAP HANA
1.0 Database PDM.

Generation Support for initialization only. No updating of As per classic HANA Repository.
calculation views present on the HANA server.

Reverse Read-only objects (including the XML definition, Not supported.


data sources, and projection list) linked to their
sources for inclusion in impact analysis. Other
properties, such as variables, parameters, hier­
archies, and internal nodes are not reversed.

 Note

PowerDesigner support for SAP HANA® 2.0 is restricted to catalog objects. Calculation views are not
supported.

Data Architecture for SAP HANA


12 PUBLIC Modeling for HANA Database
2.5.1 Creating a Calculation View

PowerDesigner supports creation of calculation views for export to HANA. Simple calculation views with one or
two data sources can be designed within PowerDesigner, while more complex calculation views with three or
more data sources can be initialized for completion in your HANA development tool.

Procedure

1. Prepare the data sources for your calculation view in your HANA Database PDM by importing them from
HANA, generating from a CDM or LDM, or creating them manually.

 Note

PowerDesigner supports specifying tables, virtual tables, SQL views, and calculation views as sources
for a calculation view. Analytic and attribute views may not be selected as calculation view sources.

In this example, the tables SALES, REGION, and PRODUCT, and the virtual table SUPPLIER are available as
sources:

 Note

Calculation views cannot be modeled in a CDS PDM (see Modeling for Core Data Services (CDS) [page
33]). To model calculation views based on CDS artifacts, you must first generate your entities to
HANA, activate them as tables, and then reverse the tables to an SAP HANA Database 1.0 PDM.

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 13
2. Open a HANA package diagram, select the Calculation View tool in the toolbox, and click in the diagram.

 Note

You can only create calculation views under a HANA package.

3. Open the property sheet of the calculation view, and specify the following properties as appropriate on the
General tab:

Property Description

Name/Code/ Identify the object. The name should clearly convey the object's purpose to non-technical users,
Comment while the code, which is used for generating code or scripts, may be abbreviated, and should not
normally include spaces. You can optionally add a comment to provide more detailed information
about the object. By default the code is generated from the name by applying the naming conven­
tions specified in the model options. To decouple name-code synchronization, click to release the
= button to the right of the Code field.

Owner Specifies the schema that owns the calculation view.

Dimensional type Specifies the type of the calculation view:


○ Cube - [default] Used to perform a calculation using a measure.
○ Dimension - Define hierarchies of data to be consumed by a cube. HANA Modeler or Web
IDE do not permit calculation views of type Dimension to contain measures.

4. Select the Data Sources tab, click the Add Objects tool to specify your sources, and click OK.

If you select:
○ One or two data sources - You can design the calculation view in PowerDesigner and generate and
activate it directly in HANA.
○ Three or more data sources - You can initialize the definition of the calculation view in PowerDesigner,
but you must complete its definition in HANA Modeler or Web IDE.
5. Select the Columns tab, and click the Add Objects tool. Select one or more columns from the data sources
and click OK.
6. [Cube calculation views] Select a column as the measure, by selecting its checkbox in the M[easure]
column.

 Note

If the M[easure] column is not visible, click the Customize Columns and Filter tool to add it.

7. [optional] Select the Source Columns tab and review the columns listed there. To specify any additional
columns that are implicated in the definition of the calculation view, so that they are included in impact
analyses, click the Add Objects tool, select one or more columns from the data sources for the view, and
click OK.
8. Click OK to complete the creation of the calculation view.

Data Architecture for SAP HANA


14 PUBLIC Modeling for HANA Database
9. Generate the calculation view to the HANA repository (see Exporting Objects to the HANA Repository
[page 18]) where its definition can be completed in HANA Modeler or Web IDE.

2.5.2 Performing an Impact Analysis on a Calculation View

Impact analysis is a core PowerDesigner feature that allows you to trace dependencies between objects in and
across models and to understand the impact of making a change on any of the objects in the chain. You can use
impact analysis to understand the dependencies of your calculation views on the sources they consume and
their connections to objects in other types of models, including business process steps, enterprise architecture
artifacts, and data movement flows.

Procedure

1. Reverse your calculation views and supporting objects from your classic HANA Repository (see Importing
Objects from the HANA Repository [page 22]).

 Note

Your catalog objects may have been activated from CDS artifacts modeled in PowerDesigner (see
Modeling for Core Data Services (CDS) [page 33]). If this is the case, to ensure that your CDS artifacts
participate in the impact analysis, open the CDS model, select Tools Rebuild Objects Rebuild
Links to Catalog Objects , select the SAP HANA Database 1.0 PDM containing the catalog objects
activated from them, and click OK.

2. To launch an impact analysis on a table, column, or calculation view, select it in the diagram or Browser and
select Tools Impact and Lineage Analysis (or press Ctrl+F11).

The analysis generates a tree view of influencing (lineage) and dependent (impacted) objects, which
appears instantly in the dialog. The following example shows an initial analysis for the SALESREPORT
calculation view:

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 15
You can modify the types of objects and connections that are included in the analysis, and export the
analysis as a list or generate it to an impact analysis model including a diagram to visualize the analysis:

Data Architecture for SAP HANA


16 PUBLIC Modeling for HANA Database
For detailed information, see Core Features Guide > Linking and Synchronizing Models > Impact and
Lineage Analysis

2.6 Table Placement (HANA)

The Table Placement for HANA extension can help with applying group names, types, and subtypes to
tables in your SAP HANA 1.0 Database PDM to manage table distribution.

For information about table placement, see Table Placement in the SAP HANA Administration Guide.

The extension can be used to compute group names, types, and subtypes for tables so that:

● Any table referenced by a calculation view is in the same group as all other tables referenced by that view.
● [if the Analyze Stored Procedures option is selected] Any table referenced by a stored procedure has the
same subtype as all other tables referenced by that procedure.

It enables the following context menu commands on the model entry in the Browser under the Table Placement
submenu :

● Compute Groups - Open the Create Groups dialog. Select the following options as appropriate and then
click OK to create groups in your model:

Option Description

Default The options in this groupbox specify default types:


○ Type - Specifies the group type, which is applied to all tables that are assigned to a group.
Default: DDO_TYPE.
○ Subtype - Specifies a prefix for subtypes that are applied to tables that have dependencies
with stored procedures. Default: [empty]

Exceptions Specifies a list of objects to exclude from grouping. You can enter names or codes of tables,
calculation views, stored procedures, schemas, and HANA packages (namespaces) separated
by carriage returns.

Remove Existing Deletes any existing groups before recomputing them.


Groups First

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 17
Option Description

Apply Changes to Ta­ Sets the Group options property on the HANA tab of table property sheets. If you do not select
bles this property, the groups will be created and the informational HANA Group field will be popu­
lated but the group options will not be set. You can use the Apply Group Options to Tables com­
mand to do this at a later time.

Recompute CV De­ Forces a rereading of the XML Definition property for all calculation views before computing the
pendencies groups.

Create Missing Ta­ If the Recompute CV dependencies option is selected, selecting this option will create any ta­
bles bles required for a calculation view that are not already present in the model.

Create a Log File Generates a detailed log file for the creation and assignment of groups. For a summary and to
access the full log, open the Output window ( Alt + 1 ).

Analyze Stored Pro­ Specifies to set subtypes for tables based on their dependencies with stored procedures.
cedures

External File for SP Specifies a path to a CSV file, in which you supplement the stored procedure dependencies
Dependencies found in the model by listing table-procedure dependencies in the format:

StoredProcedure,Table

● Remove All Groups - Deletes all the groups and group assignments from the model.
● Apply Group Options to Tables - Sets the Group options property on the HANA tab of table property sheets
if they have been computed with the Apply Changes to Tables option not selected.

2.7 Exporting Objects to the HANA Repository

While HANA tables are generated directly to the catalog, calculation views are exported to the HANA
repository, where they will be completed and activated. PowerDesigner provides a wizard to export your
objects to a HANA 1.0 repository and catalog in a single action. Exporting calculation views to SAP HANA® 2.0
environments is not supported and no wizard is provided.

Context

In an SAP HANA® 1.0 Database PDM, the HANA catalog is represented by the root of the model, while the
HANA repository is represented by a structure of HANA packages. In order to generate your objects correctly,
you must place your tables at the root (or in standard PowerDesigner packages), and your calculation views in
their appropriate HANA packages.

 Note

You can generate tables and other catalog objects to SAP HANA® 1.0 and SAP HANA® 2.0 environments
through the standard Database Generate Database and Database Apply Model Changes to
Database commands.

Data Architecture for SAP HANA


18 PUBLIC Modeling for HANA Database
For information about the available JDBC connection parameters, see Core Features Guide > Modeling with
PowerDesigner > Getting Started with PowerDesigner > Connecting to a Database > Configuring Connection
Profiles .

Procedure

1. Select Database Apply Model Changes to HANA Repository to open the wizard, and specify your
deployment model:
○ Repository [default] - Generate directly to the classic HANA repository.
○ HDI - Generate files for loading to HANA. Enter the following parameters:

Parameter Description

Generation Path [required] Specifies the path to generate files.

HDI Namespace [required] Specifies the namespace for generated artifacts.

Generate .hdbsynonym Enables the generation of these two files for each table consumed by a calcula­
and .hdbsynonymconfig files tion view.

Generate .hdbvirtualtable Enables the generation of these two files for each virtual table consumed by a
and .hdbvirtualtableconfig files calculation view.

2. Click Next.

If you selected to check the model, the wizard reviews it for consistency and displays any errors which may
compromise the generation.
3. [repository environments] Enter your HANA repository connection parameters and then click Next to
connect:

Parameter Description

Connection Name Select an existing connection from the list or use the tools to the right of the
Connection field to create a new connection profile, review the properties of the
existing profile, or delete it. HANA connection profiles are stored in the registry.

 Note
To reverse-engineer from or generate to HANA databases running in SAP
BTP, you must install the Cloud Connector and configure an appropriate serv­
ice channel. For detailed information, see SAP BTP Connectivity > Cloud Con­
nector.

Host name Specifies the network name of the HANA appliance.

Instance number Specifies the HANA instance number.

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 19
Parameter Description

Mode If your HANA system is installed in multiple-container mode, you must specify the
container to connect to:
○ Single container - [default] Single tenancy HANA system. Sets the port num­
ber to 3<nn>15 (where <nn> equals the instance number).
○ Multiple containers - Multitenancy HANA system. You can connect to:
○ System database container - sets the port number to 3<nn>13
○ Tenant database container - Enter the Name of your container. Sets the
port number to 3<nn><xx>, where <xx> is a number greater than 40,
allocated to your database by the system.

User name/ password Specifies the credentials to connect with.

 Note
The account with which you connect must have at least the
CONTENT_ADMIN, MODELING, and PUBLIC roles.

Connection parameters Enter any appropriate connection parameters (see SAP HANA Client Interface
Programming Reference > JDBC Application Programming > Connect to SAP
HANA via JDBC > JDBC Connection Properties).

4. Select HANA packages in your model in the left pane to make their contents available to export. Select the
calculation views to export in the right pane, and then click Next.

Data Architecture for SAP HANA


20 PUBLIC Modeling for HANA Database
If you have previously imported objects from HANA, the archive model helps to determine model changes
since that point.

 Note

If the calculation view is already present on the HANA server, PowerDesigner will not overwrite it, even
if you select it here.

 Note

Tabs to select analytic and attribute views are also available. These objects are now deprecated in
HANA.

5. On the Catalog Objects tab, PowerDesigner automatically selects any catalog tables and views required by
the selected calculation views. Select additional objects to export from the lists, and then click Next.

 Note

You can select additional schemas from the list to make their objects available for selection.

6. Review the objects that will be exported and then click Finish:

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 21
○ Repository environments - PowerDesigner generates the objects to the HANA Repository and catalog
as appropriate.

 Note

If PowerDesigner detects conflicts between changes made in the model and changes to the same
objects on the server, then a merge dialog (see Core Features Guide > Modeling with PowerDesigner
> Comparing and Merging Models) will open to allow you to select, for each conflict, which of the
conflicting changes will prevail. The resolutions that you select will first be applied to the model,
and then your changes will be exported to the server.

○ HDI environments - PowerDesigner generates the appropriate files for loading and activation to the
specified path.

2.8 Importing Objects from the HANA Repository

PowerDesigner provides a wizard to import read-only graphical calculation views and their sources from an
SAP HANA® 1.0 Classic Repository for use in impact analysis. Importing calculation views from SAP HANA® 1.0
HDI or SAP HANA® 2.0 environments is not supported and no wizard is provided.

Context

 Note

You can reverse-engineer tables and other catalog objects from SAP HANA® 1.0 and SAP HANA® 2.0
environments through the standard reverse-engineering commands:

● Create new model: File Reverse Engineer Database .


● Reverse to existing HANA PDM: File Reverse Engineer Database Update Model from
Database .
For information about the available JDBC connection parameters, see Core Features Guide > Modeling
with PowerDesigner > Getting Started with PowerDesigner > Connecting to a Database > Configuring
Connection Profiles .

Procedure

1. To import into an existing PDM, select Database Update Model from HANA Repository .

or

To import and create a new PDM, select File Reverse Engineer SAP HANA Repository .
2. Click Next on the Welcome page.

Data Architecture for SAP HANA


22 PUBLIC Modeling for HANA Database
3. Enter your HANA repository connection parameters and then click Next to connect:

Parameter Description

Connection Name Select an existing connection from the list or use the tools to the right of the
Connection field to create a new connection profile, review the properties of the
existing profile, or delete it. HANA connection profiles are stored in the registry.

 Note
To reverse-engineer from or generate to HANA databases running in SAP
BTP, you must install the Cloud Connector and configure an appropriate serv­
ice channel. For detailed information, see SAP BTP Connectivity > Cloud Con­
nector.

Host name Specifies the network name of the HANA appliance.

Instance number Specifies the HANA instance number.

Mode If your HANA system is installed in multiple-container mode, you must specify the
container to connect to:
○ Single container - [default] Single tenancy HANA system. Sets the port num­
ber to 3<nn>15 (where <nn> equals the instance number).
○ Multiple containers - Multitenancy HANA system. You can connect to:
○ System database container - sets the port number to 3<nn>13
○ Tenant database container - Enter the Name of your container. Sets the
port number to 3<nn><xx>, where <xx> is a number greater than 40,
allocated to your database by the system.

User name/ password Specifies the credentials to connect with.

 Note
The account with which you connect must have at least the
CONTENT_ADMIN, MODELING, and PUBLIC roles.

Connection parameters Enter any appropriate connection parameters (see SAP HANA Client Interface
Programming Reference > JDBC Application Programming > Connect to SAP
HANA via JDBC > JDBC Connection Properties).

4. Select packages in the HANA Repository in the left pane to make their contents available to import. Select
the calculation views to import in the right pane, and then click Next.
The archive model retains a snapshot of the structure of your objects at import time to help in determining
model changes when re-exporting to HANA.

 Caution

PowerDesigner will only look for data sources for the selected calculation views in the packages you
select in the left pane. If your calculation views depends on calculation views in packages other than
those you have selected then the import will fail or be incomplete.

 Note

Tabs to select analytic and attribute views are also available. These objects are deprecated in HANA
and should be migrated to calculation views (see SAP Note 2325817 ).

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 23
5. On the Catalog Objects tab, PowerDesigner automatically selects any catalog tables and views required by
the selected analytic, attribute, and calculation views for import. Select additional objects to import from
the lists, and then click Next.

 Note

You can select additional schemas from the list to make their objects available for selection.

6. Review the objects that will be imported and then click Finish.
7. If objects are already present in the model, a merge dialog will open (see Core Features Guide > Modeling
with PowerDesigner > Comparing and Merging Models) to allow you to review the specific changes that will
be make. Approve or reject the proposed changes, and then click OK to perform the import.
PowerDesigner will import schemas, users, tables, and views to the root of the model and analytic,
attribute, and calculation views to their appropriate HANA packages. When the import is complete, click
Close to exit the wizard.

2.9 SAP HANA Database Extensions

To create a PDM with support for features specific to the SAP HANA® DBMS family, select the appropriate
version in the DBMS field of the New Model dialog. To view these extensions to the PowerDesigner metamodel
in the Resource Editor, select Database Edit Current DBMS and expand the Profile node.

The following sections list the extensions provided for SAP HANA.

Model

The following extensions are available on the General tab:

Name Description

HDI Namespace Specifies the namespace for use when generating files for HDI (see Exporting Objects to the HANA
Repository [page 18]).

Scripting name: Namespace

Extended storage Specifies the extended storage for the HANA database (see Dynamic Tiering / Extended Storage
(HANA) [page 11]). Use the tools to the right of the field to create, delete, or open the property
sheet of the external storage.

Scripting name: ExtendedStorage

Data Architecture for SAP HANA


24 PUBLIC Modeling for HANA Database
Tables

The following extensions are available on the General tab:

Name Description

Type Specifies the table type. You can choose between:

● Row - [default] If the majority of table access involves selecting a few records, with all attrib­
utes selected, ROW-based storage is preferable.
● Column - If the majority of table access will be through a large number of tuples, with only a
few selected attributes, COLUMN-based storage should be used.
● History column - Creates a table with a session type HISTORY, to support time travel
queries, which are queries against historical states of the database.
● Global temporary - The table definition is globally available while data is visible only to
the current session. The table is truncated at the end of the session.
● Local temporary - The table definition and data is visible only to the current session. The
table is truncated at the end of the session.

Scripting name: FullType

Using extended stor­ [HANA 2.0] Creates an extended table (see Dynamic Tiering / Extended Storage (HANA) [page
age
11]).

Scripting name: UseExtendedStorage

The following extensions are available on the HANA tab (HANA 1.0) or the Physical Options (Common) tab
(HANA 2.0):

Name Description

Logging Specifies whether table logging is activated. You can choose between:

● logging - [default]
● nologging - specifies that logging is deactivated. As a result, the definition of the table is
persistent and globally available and data is temporary and global. The resource manager
should therefore explicitly drop a NOLOGGING table.

Scripting name: LoggingType

Retention period [if nologging] Specifies the retention time in seconds of the table created as nologging.

Scripting name: Retention

Auto-Merge Specifies that automatic delta merge is triggered.

Scripting name: AutoMerge

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 25
Name Description

Unload priority Specifies the unload priority for the table from 0 to 9, where 0 means the table cannot be unloaded
and 9 means earliest unload.

Scripting name: UnloadPriority

Schema flexibility Specifies that the table schema is flexible.

Scripting name: WithSchemaFlexibility

Location Specifies that partitions will be created on the listed instances using round robin scheme.

Scripting name: PartitionLocation

Multiple [HANA 1.0] Specifies that the location targets multiple HANA instances. [HANA 2.0] This option is
implicitly enabled when you specify more than one instance in the Location field.

Scripting name: HasMultipleLocations

Using extended stor­ [HANA 1.0] Creates an extended table (see Dynamic Tiering / Extended Storage (HANA) [page 11]).
age
When selected, you can additionally enable support for Row-level versioning.

Scripting name: UseExtendedStorage, EnableDelta

Group options Specifies the group options.

Scripting name: GroupOptionClause

Options text [HANA 1.0] Specifies the SQL text of the table options. Options entered here will be set in their rele­
vant fields, and changes to the fields are reflected here.

Scripting name: FullTableOptions

The following extensions are available on the Partitions tab:

Name Description

Type Specifies the partition scheme type:

● Hash - Distributes rows to partitions equally for load balancing and to overcome the 2 billion
row limitation. Specify an Expression listing the columns to partition on and the Quantity of par­
titions to create. You may specify a second scheme of type Hash or Range.
● Range - Creates partitions for specific values or value ranges. Specify an Expression and
Range specifier.
● RoundRobin - Distributes rows to partitions equally without specifying partitioning columns.
Specify the Quantity of partitions to create. You may specify a second scheme of type Range.

Data Architecture for SAP HANA


26 PUBLIC Modeling for HANA Database
Columns

The following extensions are available on the Detail tab:

Name Description

Column stored data Specifies the stored data type.


type

DDIC data type Specifies the application data type.

Indexes

The following extensions are available on the General tab:

Name Description

Type Specifies the type of the index, which can be:

● <none> - [default] The server will choose the appropriate index type.
● Cpbtree - Compressed Prefix B+-Tree, which can show better performance for larger keys for
character, string, binary string, or decimal column types, or when the constraint is a composite
key, or a non-unique constraint.
● Btree - Maintains sorted data that performs efficient insertion, deletion and search of re­
cords.
● Fulltext - Creates an additional data structure to enable text search features on a specific
column in a table. Enables the Full-Text tab (see below).

Descending [HANA [btree only] Specifies that the index should be created in descending order.
1.0] / Index order
[HANA 2.0]

Fillfactor [HANA 2.0] Specifies how each node of a new index is filled as an integer percentage from 50 to
100. The default value is 90.

Nowait [HANA 2.0] Specifies that the CREATE INDEX statement returns an error immediately in case a ta­
ble lock cannot be acquired.

Online [HANA 2.0] Specifies that an intentional exclusive lock is acquired on the table during the index cre­
ation to allow other DML statements. Without the ONLINE option, an exclusive lock is acquired. The
ONLINE option is available for row store tables.

The Full-Text tab is displayed when you select Fulltext in the Type list on the General tab:

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 27
Name Description

Phrase index ratio Specifies the percentage of the phrase index between 0.0 and 1.0.

Search only Specifies whether the original document should be stored or only the search results. When se­
lected, the original document content is not stored.

Text analysis Enables text analysis capabilities on the indexed column. Text analysis can extract entities such as
persons, products, or places from documents, which are stored in a new table.

Configuration Specifies the path to a custom configuration file for text analysis.

Fast pre-process Specifies that fast preprocessing is used, and that linguistic searches are not possible.

Fuzzy search index Specifies that a fuzzy search is performed with an additional index (faster search, but higher mem­
ory consumption).

Change tracking Specifies whether the index should be built in an asynchronous or synchronous manner.

Flush every (mi­ Specify how frequently an asynchronous index should be update.
nutes) / Flush after
(documents)

Language detection / Specify the set of languages to be considered during language detection and the column where the
Language column language of a document is specified.

MIME type / Mime- Specify the default MIME type used for preprocessing (for example cf
type column M_TEXT_ANALYSIS_MIME_TYPES and the column where the MIME type of a document is
specified.

Token separators Specifies the set of ASCII characters used for token separation.

Keys

The following extensions are available on the General tab:

Name Description

Key type Specifies the key type.

Scripting name: KeyType

Data Architecture for SAP HANA


28 PUBLIC Modeling for HANA Database
Views

The following extensions are available on the Cache Options tab:

Name Description

Retention (min) Specifies the maximum staleness threshold that user can see in minutes.

Scripting name: CacheRetention

Refresh on update Specifies to refresh the cache when the related table is updated.

Scripting name: CacheRefreshOnUpdate

Projection list Specifies the list of columns that will be cached (vertical cropping).

Scripting name: Projection

Filter Specifies a filter condition to limit the cache to a subset of elements (horizontal cropping).

Scripting name: CacheFilter

Roles

The following extensions are available on the General tab:

Name Description

Global visibility Specifies that the role is available globally.

Scripting name: GlobalVisibility

Global ID [if global visibility] Specifies the external role name for the global user.

Scripting name: GlobalID

References

The following extensions are available on the HANA tab:

Name Description

Cardinality Specifies the type of cardinality.

Scripting name: HANACardinality

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 29
Name Description

Join type Specifies the join type.

Scripting name: HANAJoinType

Language Column Specifies the language column.

Scripting name: HANALanguageColumn

Users

The following extensions are available on the General tab:

Name Description

Identification Specifies the type of identification (global, local or external).

Scripting name: Identification

Distinguished name Specifies the user's distinguished name (DN) in the directory or certificate.

Scripting name: DistinguishedName

Password Specifies the clear copy of the password.

Scripting name: CopyPassword

Implicit Schema Specifies that the database generation will use the stored procedure sp_grantdbaccess instead
of a create user statement.

Scripting name: ImplicitSchema

Default Schema Specifies the first schema searched to resolve the names of objects for this user.

Scripting name: DefaultSchema

Packages (HANA 1.0)

The following extensions are available on the HANA tab of HANA packages:

Name Description

Structure package Specifies that the package is a structural package

Scripting name: Structural

Data Architecture for SAP HANA


30 PUBLIC Modeling for HANA Database
Name Description

Package Specifies the HANA object name.

Scripting name: _ObjectName_

Facts (Analytic Views) and Dimensions (Attribute Views) (HANA 1.0)

The following extensions are available on the HANA tab:

Name Description

Default Client / Member Specify the HANA default client, and (dimension only) member.

Scripting name: DefaultClient, DefaultMember

Multidimensional report­ [facts] Specifies that multidimensional reporting is enabled.


ing
Scripting name: MultidimensionalReporting

Package / Name / Ver­ Specifies the HANA package, object name, and version.
sion
Scripting name: _ObjectPackage_, _ObjectName_, _ObjectVersion_

Last Updated Date / at Specifies when the dimension or fact was last edited.

Scripting name: _LastUpdatedDate_, _LastUpdatedTime_

Dimension Attributes and Fact Attributes (HANA 1.0)

The following extensions are available on the HANA tab:

Name Description

Default Member / Info Specify the HANA default member and info object.
Object
Scripting Name: DefaultMember, InfoObject

Drill Down Enabled Specifies the drill down is enabled for the attribute.

Scripting Name: DrillDownEnabled

Hidden Specifies that the attribute is hidden.

Scripting Name: IsHidden

Data Architecture for SAP HANA


Modeling for HANA Database PUBLIC 31
Name Description

Key Attribute / Attribute [Dimension attribute only] Specify that the attribute is a key attribute and that the attribute hi­
Hierarchy Active erarchy is active.

Scripting Name: KeyAttribute, AttributeHierarchyActive

Data Type / Length / Specify the data type, length and scale of the attribute.
Scale
Scripting Name: AttributeDataType, Length, AttributeScale

Fact Measures (HANA 1.0)

The following extensions are available on the HANA tab:

Name Description

Measure type Specifies the type of the measure:

● simple - a measurable analytical element that is derived from the data foundation.
● amount - based on a combination of data from OLAP cubes, arithmetic operators, con­
stants, and functions.
● quantity - count the recurrence of an attribute.

Calculated measure Specify the data type, length and scale of the measure.

Scripting Name: MeasureDataType, MeasureLength, MeasureScale

Data Architecture for SAP HANA


32 PUBLIC Modeling for HANA Database
3 Modeling for Core Data Services (CDS)

PowerDesigner supports modeling and generation of CDS artifacts to SAP HANA® 1.0 Classic Repository and
SAP HANA® 1.0 and 2.0 HDI environments.

Context

PowerDesigner provides the following support for migrating a database to HANA via CDS artifacts:

Tasks HANA 1.0 Classic Repository HANA 1.0 and 2.0 HDI

Design Generation of a CDM or LDM to an SAP HANA Generation of a CDM or LDM to an SAP HANA
1.0 CDS Repository PDM. 1.0 CDS HDI or SAP HANA 2.0 CDS
HDI PDM.
Generation of any PDM to an SAP HANA 1.0
CDS Repository PDM for migration pur­ Generation of any PDM to an SAP HANA 1.0
poses. CDS HDI or SAP HANA 2.0 CDS HDI
PDM for migration purposes.
Modeling of the following CDS artifacts:

● Contexts Modeling of all classic HANA Repository arti­


facts, and:
● Entities
● Associations ● Constants
● Extensions (for entities) - SAP HANA 2.0
● Views
CDS HDI only
● Simple and structured types

Not supported: view joins, anonymous types,


enumerations.

Generation Generation and activation of CDS artifacts. Generation of CDS files for activation.

Reverse Not supported. As per classic HANA Repository.

Catalog tables activated from your CDS entities


can be reversed to an SAP HANA 1.0
Database PDM.

For detailed information about working with CDS, see the SAP HANA Core Data Services (CDS) Reference at
https://help.sap.com/viewer/p/SAP_HANA_PLATFORM.

Procedure

1. Open your source CDM, LDM, or PDM, and select Tools Generate Physical Data Model .

Data Architecture for SAP HANA


Modeling for Core Data Services (CDS) PUBLIC 33
 Note

You can generate from a PDM targeting any DBMS, including from SAP HANA 1.0 Database or SAP
HANA 1.0 CDS Repository.

2. Select SAP HANA 1.0 CDS Repository, SAP HANA 1.0 CDS HDI, or SAP HANA 2.0 CDS HDI in the
DBMS field, modify as appropriate the other options on this and the other tabs, and click OK to generate
your HANA CDS PDM.
3. Review the generated model and perform any necessary modeling tasks. The following tools are available
in the CDS toolbox:

Tool Description Can Create In

HANA Package - An organizing container for HANA artifacts. See HANA Packages Model Root or
HANA Package
(HANA) [page 7].

Context - An organizing container for CDS artifacts. See Contexts (CDS) [page 36]. Anywhere

Entity - A table with a set of data elements that are organized using columns and Anywhere

rows. See Entities (CDS) [page 37].

Association - A relationship between two entities. See Associations (CDS) [page Anywhere

41].

[HANA 1.0] View - A query based on one or more entities. See Views (CDS) [page Anywhere

45].

[none] Simple type - A user­defined type. See Simple Types (CDS) [page 46]. Context

Structured type - A user­defined type containing a list of attributes. See Structured Context

Types (CDS) [page 46].

[none] [HDI] Constant - A user­defined constant value. See Constants (CDS) [page 47]. Context

4. Generate directly to your classic HANA Repository (SAP HANA 1.0 CDS Repository), see Exporting
CDS Objects to the HANA Repository [page 49]) or to files (SAP HANA 1.0 CDS HDI or SAP HANA 2.0
CDS HDI), see Generating CDS Files for Repository or HDI Environments [page 50]).
5. Review and complete files in HANA Modeler (SAP HANA 1.0 CDS Repository) or in Web IDE (SAP
HANA 1.0 CDS HDI or SAP HANA 2.0 CDS HDI) and then activate them.

6. [optional] Reverse-engineer the resulting catalog tables and any calculation views consuming them to an
SAP HANA 1.0 Database PDM.

Data Architecture for SAP HANA


34 PUBLIC Modeling for Core Data Services (CDS)
 Note

To ensure that your CDS artifacts participate in any impact analysis launched from the catalog objects
or calculation views, open the CDS model, select Tools Rebuild Objects Rebuild Links to Catalog
Objects , select the SAP HANA 1.0 Database PDM containing the catalog objects, and click OK.

3.1 HANA Packages (CDS)

HANA packages group together related information objects in a structured way and are equivalent to folders in
Web IDE.

Procedure

1. Select the HANA Package tool and click in the diagram.


2. Open the property sheet tab, and complete properties as appropriate.

The following properties are available on the General tab:

Name Description

Name/Code/ Identify the object. The name should clearly convey the object's purpose to non-technical
Comment users, while the code, which is used for generating code or scripts, may be abbreviated, and
should not normally include spaces. You can optionally add a comment to provide more detailed
information about the object. By default the code is generated from the name by applying the
naming conventions specified in the model options. To decouple name-code synchronization,
click to release the = button to the right of the Code field.

Scripting name: Name, Code, Comment

Use parent name­ Not for use with HANA packages.


space

Keywords Provide a way of loosely grouping objects through tagging. To enter multiple keywords, separate
them with commas.

Scripting name: Keywords

Data Architecture for SAP HANA


Modeling for Core Data Services (CDS) PUBLIC 35
Name Description

Custom namespace Specifies a custom namespace for the package. If you enter a namespace here, a run-time
namespace configuration file (.hdinamespace) is generated.

 Note
By default, the package namespace is the full path to the package. To modify this behavior,
open the model property sheet and uncheck the Append checkbox.

Extension package [packages containing extensions] Specifies a custom name for the package, which is generated
to the CDS extension package descriptor (.package.dbcds).

The following read-only properties are provided for information on the HANA tab:

Name Description

Structure package [read-only] Specifies that the package is a structural package.

Scripting name: Structural

Package [read-only] Specifies the HANA object name.

Scripting name: _ObjectName_

3. Click OK to complete the creation of the HANA package.

3.2 Contexts (CDS)

Contexts provide a way of structuring your CDS artifacts. You can create contexts at the model root, under a
HANA package, or under another context. In HDI environments, one file is generated for each top-level context.

Procedure

1. Select the Context tool in the CDS toolbox and click in the diagram.
2. Open the property sheet, and complete properties as appropriate:

Data Architecture for SAP HANA


36 PUBLIC Modeling for Core Data Services (CDS)
Property Description

Name/Code/ Identify the object. The name should clearly convey the object's purpose to non-technical users,
Comment while the code, which is used for generating code or scripts, may be abbreviated, and should not
normally include spaces. You can optionally add a comment to provide more detailed information
about the object. By default the code is generated from the name by applying the naming conven­
tions specified in the model options. To decouple name-code synchronization, click to release the
= button to the right of the Code field.

Schema [top-level CDS Repository contexts] Specifies the schema to which the context belongs.

Use parent name­ Not for use with CDS contexts


space

3. Click OK to complete the creation of the context.


4. Press Ctrl and double-click the context symbol to open its diagram.

You can create any object (except a HANA package) inside a context.

 Note

If you define an artifact in one CDS document (top-level context) by referring to an artifact that is
defined in another CDS document, PowerDesigner will automatically insert the appropriate using
statement.

3.3 Entities (CDS)

A CDS entity is a table with a set of data elements that are organized using columns and rows. You can create
entities at the model root, under a HANA package, or under another context. One file is generated for each top-
level entity not in a context.

Procedure

1. Select the Entity tool in the CDS toolbox and click in the diagram.
2. Open the property sheet, and complete properties as appropriate:

Data Architecture for SAP HANA


Modeling for Core Data Services (CDS) PUBLIC 37
Property Description

Name/Code/ Identify the object. The name should clearly convey the object's purpose to non-technical users,
Comment while the code, which is used for generating code or scripts, may be abbreviated, and should not
normally include spaces. You can optionally add a comment to provide more detailed information
about the object. By default the code is generated from the name by applying the naming conven­
tions specified in the model options. To decouple name-code synchronization, click to release the
= button to the right of the Code field.

Schema [CDS Repository: entities created at root or in a HANA package] Specifies the schema to which the
entity belongs.

Type Specifies the type of the activated table. You can choose between:
○ Row - [default] If the majority of table access involves selecting a few records, with all attrib­
utes selected, ROW-based storage is preferable.
○ Column - If the majority of table access will be through a large number of tuples, with only a
few selected attributes, COLUMN-based storage should be used.
○ Global temporary - The table definition is globally available while data is visible only to
the current session. The table is truncated at the end of the session.

Unload priority [HDI] Specifies the unload priority for the activated table from 0 to 9, where 0 means the table
cannot be unloaded and 9 means earliest unload.

Scripting name: UnloadPriority

Group options [HDI] Specifies the group options for the activated table.

Scripting name: GroupOptionClause

3. [optional] Click the Data Protection tab to specify that the entity stores personal data:

Property Description

Personal Data Specifies that personal data, which may need to be anonymized or be subject to special regulation,
is being stored.

Retention Specifies the period for which the data should be retained.

4. Click the Columns tab to specify the entity elements.

For each element, enter an appropriate Name and then select a type from the Data type field list (or click
the ... tool to the right of the list to select a simple or structured type).

 Note

Anonymous types and enumerations are not supported.

To specify an element as a key, select the checkbox in its P column.

[optional] Click the Data Protection tab to specify that the element stores personal data:

Data Architecture for SAP HANA


38 PUBLIC Modeling for Core Data Services (CDS)
Property Description

Personal data Specifies the type of personal data that is being stored:
level ○ <None> [default]
○ Private (Identifying) - Information such as a name or id number that can directly
identify an individual.
○ Sensitive - Information such as a salary or illness that an individual may not want known
about them.
○ Quasi-Identifier - Information such as gender, age, or town that, while not sufficient to
directly identify an individual, could do so if combined with other quasi­identifiers.

The following extensions are available on the Detail tab of column property sheets:

Name Description

Column stored data Specifies the stored data type.


type

DDIC data type Specifies the application data type.

5. Click the entity Indexes tab to specify any indexes.

The following extensions are available on the General tab of index property sheets:

Name Description

Type Specifies the type of the index, which can be:


○ <none> - [default] The server will choose the appropriate index type.
○ Cpbtree - Compressed Prefix B+-Tree, which can show better performance for larger
keys for character, string, binary string, or decimal column types, or when the constraint is
a composite key, or a non-unique constraint.
○ Btree - Maintains sorted data that performs efficient insertion, deletion and search of re­
cords.
○ Fulltext - Creates an additional data structure to enable text search features on a spe­
cific column in a table. Enables the Full-Text tab (see below).

Descending [HANA [btree only] Specifies that the index should be created in descending order.
1.0] / Index order
[HANA 2.0]

Fillfactor [HANA 2.0] Specifies how each node of a new index is filled as an integer percentage from 50 to
100. The default value is 90.

Nowait [HANA 2.0] Specifies that the CREATE INDEX statement returns an error immediately in case a
table lock cannot be acquired.

Data Architecture for SAP HANA


Modeling for Core Data Services (CDS) PUBLIC 39
Name Description

Online [HANA 2.0] Specifies that an intentional exclusive lock is acquired on the table during the index
creation to allow other DML statements. Without the ONLINE option, an exclusive lock is ac­
quired. The ONLINE option is available for row store tables.

6. [HDI] Click the entity Partitions tab and specify the partition scheme:

Name Description

Type Specifies the partition scheme type:


○ Hash - Distributes rows to partitions equally for load balancing and to overcome the 2 bil­
lion row limitation. Specify an Expression listing the columns to partition on and the
Quantity of partitions to create. You may specify a second scheme of type Hash or Range.
○ Range - Creates partitions for specific values or value ranges. Specify an Expression and
Range specifier.
○ RoundRobin - Distributes rows to partitions equally without specifying partitioning col­
umns. Specify the Quantity of partitions to create. You may specify a second scheme of
type Range.

7. Click OK to complete the creation of the entity.

To preview the code to be generated:

3.4 System-Versioned Tables (CDS)

System-versioned tables, which support the tracking of changes on column store tables by capturing the
validity period of each record, are available in SAP HANA 2.0 SP03 and higher. PowerDesigner supports the
modeling of history tables in SAP HANA 2.0 Database and SAP HANA 2.0 CDS HDI PDMs.

Context

For more information, see System-Versioned Tables (HANA) [page 10].

Data Architecture for SAP HANA


40 PUBLIC Modeling for Core Data Services (CDS)
3.5 Associations (CDS)

Associations define relationships between entities.

Procedure

1. Select the Association tool in the CDS toolbox and draw a link from the source to the target entity.
PowerDesigner adds a new attribute with the name of the target entity to the source entity and sets its data
type to <target entity>.
2. Double-click the association link to open its property sheet and click the Joins tab to specify additional
properties.
3. Review the following properties in the Info tab General section:

Property Description

Name Identifies the object.

Associated ele­ Specifies the element containing the association, its parent entity, and the cardinality at the source
ment / Source end of the association.
entity / Cardinal­
ity

Target entity / Specifies the entity to which the association points and the cardinality at the target end of the as­
Cardinality sociation.

4. You can specify either a managed or unmanaged association.

In this example, the six Address elements are created through managed associations drawn from the
Person entity to the Address entity (which uses the StreetAddress and CountryAddress structured
types):

Data Architecture for SAP HANA


Modeling for Core Data Services (CDS) PUBLIC 41
Association Type/Steps Join Properties/Generated Code

[default] Implicitly use the


target entity's primary key
as foreign key.

Code:

Address_1: Association to Address;

To explicitly specify the tar­


get entity's primary key (e.g.
id), as the foreign key, se­
lect it in the Parent Table
Column column.

Code:

Address_2: Association to Address { id };

To specify one or more


other elements from the
target entity as foreign key
elements, select them (e.g.
zipcode, street, and
country) in the Parent
Table Column column.

Code:

Address_3: Association[1] to Address { zipCode, street,


country };

Data Architecture for SAP HANA


42 PUBLIC Modeling for Core Data Services (CDS)
Association Type/Steps Join Properties/Generated Code

To specify a cardinality for


the association (e.g. 0..*),
select or enter it in the CDS
Cardinality field.

Code:

Address_4: Association[0..*] to Address { zipCode };

To specify sub-elements
from structured types as
foreign key elements, enter
them manually (e.g.
street.name) in the
Sub-Element column.

Code:

Address_5: Association[*] to Address { street.name };

Data Architecture for SAP HANA


Modeling for Core Data Services (CDS) PUBLIC 43
Association Type/Steps Join Properties/Generated Code

To specify an alias for any of


the foreign key elements,
enter it in the Alias column.

Code:

Address_6: Association[*] to Address { street.name as


streetName,
country.name as countryName };

In this example, the inhabitants element is defined by an unmanaged association, drawn from the Room
entity to the Employee entity:

Association Type/Steps Join Properties/Generated Code

○ Select the Unmanaged


association checkbox.
○ Select an element from
the target entity in the
Parent Table Column
column.
○ Select an element from
the source entity in the
Child Table Column col­
umn. Code:
○ [optional] Specify a
inhabitants: Association[*] to Employee on id =
cardinality. inhabitants.officeId;

5. Click OK to complete the creation of the association.

Data Architecture for SAP HANA


44 PUBLIC Modeling for Core Data Services (CDS)
3.6 Views (CDS)

A view is a virtual table based on the dynamic results returned in response to an SQL statement.

Procedure

1. Select the CDS View tool in the toolbox and click in the diagram.

You can create views at the model root, under a HANA package, or under a context.
2. In the selection dialog, select one or more tables and views to use as sources for the view and click OK.

 Note

For views with multiple sources, only joins of type Union are supported.

3. Double-click the view symbol to open its property sheet. To edit the underlying query, select the Query tab
and click the Properties tool.

○ Columns tab - lists the columns in the SELECT clause. You can add or delete columns in the list, specify
aliases for them, and reorder the list using the arrows at the bottom of the tab.
○ Where tab - lists the expressions in the WHERE clause. You can add or delete expressions in the list, and
reorder the list using the arrows at the bottom of the tab. For each line, select a column in each of the
two Expression columns (or click the ellipsis button to specify a more complex expression), and select
the appropriate operator between them. You can optionally enter a prefix and suffix.
○ Group By tab - lists the columns in the GROUP BY clause. You can add or delete columns in the list, and
reorder the list using the arrows at the bottom of the tab.
○ Having tab - lists the expressions in the HAVING clause. You can add or delete expressions in the list,
and reorder the list using the arrows at the bottom of the tab. For each line, select a column in each of
the two Expression columns (or click the ellipsis button to specify a more complex expression), and
select the appropriate operator between them. You can optionally enter a prefix and suffix.
○ Order By tab - lists the columns in the ORDER BY clause. You can add or delete columns in the list, and
reorder the list using the arrows at the bottom of the tab. For each line, select a column (or click the
ellipsis button to specify a more complex expression), and select ASC or DESC for the sort direction.
4. Click OK to complete the creation of the view.

Data Architecture for SAP HANA


Modeling for Core Data Services (CDS) PUBLIC 45
3.7 Simple Types (CDS)

A simple type is a user­defined data type for your entity elements. Simple types can be created inside a
context.

Procedure

1. Open a context diagram, select Model Simple Types , click the Add a Row tool, and then click the
Properties tool.

 Note

You can only create simple types under a context.

2. Enter an appropriate Name for the type and then select a type from the Data type field list (or click the ...
tool to the right of the list to select another simple or structured type or constant).
3. Click OK to complete the creation of the simple type, which is now available for selection as a data type for
other objects.

3.8 Structured Types (CDS)

A structured type is a data type comprising a list of attributes, each of which has its own data type.

Procedure

1. Open a context diagram, select the Structured Type tool in the CDS toolbox and click in the diagram.

 Note

You can only create structured types under a context.

2. Enter an appropriate Name for the type and then click the Columns tab to define its attributes.
3. For each attribute, click the Add a Row tool, enter an appropriate Name for the attribute, and then select a
type from the Data type field list (or click the ... tool to the right of the list to select a simple or structured
type or constant).
4. Click OK to complete the creation of the structured type, which is now available for selection as a data type
for other objects.

Data Architecture for SAP HANA


46 PUBLIC Modeling for Core Data Services (CDS)
3.9 Constants (CDS)

Constants are named values to assign to columns. You can define constant values under a context when
working with HANA CDS HDI. PowerDesigner models CDS constants as columns in a special Constants table.

Procedure

1. Open a context diagram, select Model Constants to open the List of Constants, click the Add a Row
tool, and click OK to create the Constants table.
2. Double-click the Constants table to open its property sheet and click the Columns tab.
3. Click the Add a Row tool to create a constant and then click the Properties tool to open its property sheet.
4. Enter the following properties on the General tab:

Property Description

Name/Code/ Identify the object. The name should clearly convey the object's purpose to non-technical users,
Comment while the code, which is used for generating code or scripts, may be abbreviated, and should not
normally include spaces. You can optionally add a comment to provide more detailed information
about the object. By default the code is generated from the name by applying the naming conven­
tions specified in the model options. To decouple name-code synchronization, click to release the
= button to the right of the Code field.

Data type Specifies the data type of the constant. Depending on the type, you may also need to enter a
Length and Precision.

5. Click the Standard Checks tab and enter the value of the constant in the Values groupbox Default field.
6. Click OK to complete the creation of the constant, which is now available for selection as a data type for
other objects.

3.10 Extensions (CDS)

CDS extensions support delivering updates to database artifacts without modifying the original artifacts.
PowerDesigner supports extensions for CDS entities.

Context

For more information about CDS extensions, see Create a CDS Extension in the SAP HANA Core Data Services
(CDS) Reference and the SAP HANA blog post CDS extension feature in HANA .

Data Architecture for SAP HANA


Modeling for Core Data Services (CDS) PUBLIC 47
 Note

PowerDesigner supports extensions for CDS entities only. Extensions cannot be created for other CDS
artifacts.

Procedure

1. Prepare your environment. You will require:

○ A base entity.
○ An entity to extend the base entity - this must be in a different HANA package or a different model.
2. Open the diagram containing your extension entity and add your base entity to the diagram as a shortcut.

In this example, the Banking Customer entity in the Banking package will extend the Customer entity in
the CRM package:

3. Use the Extension tool to draw a link from your extension entity to your base entity:

Data Architecture for SAP HANA


48 PUBLIC Modeling for Core Data Services (CDS)
3.11 Exporting CDS Objects to the HANA Repository

In SAP HANA® 1.0 Classic Repository environments, PowerDesigner provides a wizard to allow you to export
your CDS entities and other objects to the HANA Repository.

Context

 Note

In SAP HANA® 1.0 and 2.0 HDI environments, you must generate CDS files, see Generating CDS Files for
Repository or HDI Environments [page 50].

Procedure

1. Select Database Apply Model Changes to HANA Repository to open the wizard, and click Next on the
Welcome page.
The wizard checks your model for consistency and displays any errors which may compromise the
generation.
2. Enter your HANA Repository connection parameters (see Exporting Objects to the HANA Repository [page
18]) and then click Next to connect.
3. Select HANA packages in your model in the left pane to make their contents available to export. Select the
contexts, entities, and views to export in the right pane, and then click Next.
Any supporting objects, such as types and associations are exported as necessary.

 Note

If you have previously imported objects from HANA, the archive model helps to determine model
changes since that point.

4. Review the objects that will be exported and then click Finish to generate them to the HANA Repository.

 Note

If PowerDesigner detects conflicts between changes made in the model and changes to the same
objects on the server, then a merge dialog (see Core Features Guide > Modeling with PowerDesigner >
Comparing and Merging Models) will open to allow you to select, for each conflict, which of the
conflicting changes will prevail. The resolutions that you select will first be applied to the model, and
then your changes will be exported to the server.

Data Architecture for SAP HANA


Modeling for Core Data Services (CDS) PUBLIC 49
3.12 Generating CDS Files for Repository or HDI
Environments

PowerDesigner supports generating CDS files for loading to HANA.

Procedure

1. Select Database Export CDS Objects to open the Generation dialog.


2. Enter a directory in which to generate the files, and specify whether you want to perform a model check.
3. On the Selection tab, select the objects to generate files for. The following sub-tabs may be available:

○ HANA Packages - Lists any top level HANA packages.


○ Contexts - Lists top-level contexts. One file is generated for each selected context.
○ CDS Entities - Lists entities defined at the model root. One file is generated for each selected entity.
○ CDS Views - [HANA 1.0] Lists views defined at the model root. One file is generated for each selected
view.
○ Physical Data Models - Lists the model node. Select the model if you want to generate a namespace
file.
4. [optional] Click the Generated Files tab to review the files to generate. By default, one file is generated for
each object selected on the Selection tab.
5. Click OK to begin generation.

When generation is complete, the Generated Files dialog opens, listing the files that have been generated to
the specified directory. Select a file in the list and click Edit to open it in your associated editor, or click
Close to exit the dialog.

Data Architecture for SAP HANA


50 PUBLIC Modeling for Core Data Services (CDS)
Important Disclaimers and Legal Information

Hyperlinks
Some links are classified by an icon and/or a mouseover text. These links provide additional information.
About the icons:

● Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your
agreements with SAP) to this:

● The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.
● SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any
damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.

● Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering a SAP-hosted Web site. By using such
links, you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this
information.

Videos Hosted on External Platforms


Some videos may point to third-party video hosting platforms. SAP cannot guarantee the future availability of videos stored on these platforms. Furthermore, any
advertisements or other content hosted on these platforms (for example, suggested videos or by navigating to other videos hosted on the same site), are not within
the control or responsibility of SAP.

Beta and Other Experimental Features


Experimental features are not part of the officially delivered scope that SAP guarantees for future releases. This means that experimental features may be changed by
SAP at any time for any reason without notice. Experimental features are not for productive use. You may not demonstrate, test, examine, evaluate or otherwise use
the experimental features in a live operating environment or with data that has not been sufficiently backed up.
The purpose of experimental features is to get feedback early on, allowing customers and partners to influence the future product accordingly. By providing your
feedback (e.g. in the SAP Community), you accept that intellectual property rights of the contributions or derivative works shall remain the exclusive property of SAP.

Example Code
Any software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax
and phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of
example code unless damages have been caused by SAP's gross negligence or willful misconduct.

Bias-Free Language
SAP supports a culture of diversity and inclusion. Whenever possible, we use unbiased language in our documentation to refer to people of all cultures, ethnicities,
genders, and abilities.

Data Architecture for SAP HANA


Important Disclaimers and Legal Information PUBLIC 51
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.

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.

Please see https://www.sap.com/about/legal/trademark.html for


additional trademark information and notices.

THE BEST RUN

You might also like