0% found this document useful (0 votes)
76 views29 pages

04 Introduction To SAP HANA Chapter 3 Data Modeling Slides en

SAP HANA -PASOS
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)
76 views29 pages

04 Introduction To SAP HANA Chapter 3 Data Modeling Slides en

SAP HANA -PASOS
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/ 29

SAP HANA Data Modeling

Version SP12, August 2016


Author Sonja Hecht, Vassilena Banova
Technische Universität München

Focus: This module provides an introduction on the topic data modeling using SAP HANA.

© ©©2016
© 2016All rights
. All reserved.
rights reserved. 1
SAP HANA Data Modeling
AGENDA

 HANA data modeling overview


 Data structures used in in-memory databases
 Impact of in-memory databases on data modeling

© © 2016 All rights reserved. 2


Data Modeling Process
HANA DATA MODELING OVERVIEW

Requirements Conceptual Logical Physical


analysis modeling modeling modeling

 Semantic
 Star Schema
DWH Model
 Top-down  Extended Star
 Multidimensional  Storage structure
 Bottom-up Schema
ERM  Index mechanism
 Combined  Galaxy Schema
 Dimensional Fact  Database tuning
approach  Snowflake
Modeling
Schema
 ADAPT

© © 2016 All rights reserved. 3


HANA Data Modeling Overview
HANA DATA MODELING OVERVIEW

Front-End Web Access


Reporting & Analysis
Administration & Data Modeling
SAP Lumira, SAP Bobj Explorer,
SAP Hana Web Workbench
Crystal Reports, etc.

SAP HANA Database

Views

Tables

ETL-based Replication
Data
Provisioning SAP Smart Data Integration

Source Systems 3rd


ERP SCM Flatfile DWH
Party

© © 2016 All rights reserved. 4


SAP HANA Platform
HANA DATA MODELING OVERVIEW

Source: SAP SE (2016), SAP Product Road Map – SAP HANA, Road Map Revision: 2016.07.20, Retrieved from http://service.sap.com

© © 2016 All rights reserved. 5


SAP HANA Web-based Development Workbench
HANA DATA MODELING OVERVIEW

http://hostname:port/sap/hana/ide/

© © 2016 All rights reserved. 6


SAP HANA Web Workbench – Catalog
HANA DATA MODELING OVERVIEW

Database
schema

Physical
tables

© © 2016 All rights reserved. 7


SAP HANA Web Workbench – Editor
HANA DATA MODELING OVERVIEW

Package

Data flow definition

Table definition

Calculation view
definition

© © 2016 All rights reserved. 8


SAP HANA Data Modeling Process
HANA DATA MODELING OVERVIEW

• Analyze and select master data and transaction


Select source system data tables from source system
tables • Source system: ERP, SCM, Flat File..

• Create physical tables in SAP HANA


Create physical tables • Table definition and granularity can resemble to
source system tables

• Calculation Views
Create information • Type CUBE
models
• Type DIMENSION

Deploy information • Column Views are generated on the database


models

© © 2016 All rights reserved. 9


SAP HANA Data Modeling
AGENDA

 HANA data modeling overview


 Data structures used in in-memory databases
 Impact of in-memory databases on data modeling

© © 2016 All rights reserved. 10


Database Tables - Example
DATA STRUCTURES USED IN IN-MEMORY DATABASES

Table name
Database schema
Table type

Field length

Table fields
Data type

© © 2016 All rights reserved. 11


Data Types used in Tables
DATA STRUCTURES USED IN IN-MEMORY DATABASES

Classification Data Type

Datetime types DATE, TIME, SECONDDATE, TIMESTAMP

Numeric types TINYINT, SMALLINT, INTEGER, BIGINT, SMALLDECIMAL, DECIMAL, REAL, DOUBLE

Character string types VARCHAR, NVARCHAR, ALPHANUM, SHORTTEXT

Binary types VARBINARY

Large object types BLOB, CLOB, NCLOB, TEXT

Boolean type BOOLEAN

Multi-valued types ARRAY

Spatial types ST_GEOMATRY, ST_POINT, ST_MULTIPOINT, ST_Line-STRING, etc…

Source: SAP SE (2016), SAP HANA SQL and System Views Reference. SAP HANA Platform SPS 12. Document Version: 1.0 - 2016-05-11, p. 30

© © 2016 All rights reserved. 12


Levels of Modeling In SAP HANA
DATA STRUCTURES USED IN IN-MEMORY DATABASES

Calculation Views Calculation View


Fact Data
(type DIMENSION) (type CUBE)
i.e. Sales, Revenue
Master Data , i.e. Material, Product Multidimensional information model

Data operation
Calculation Views – type DIMENSION

select
Calculation View
Calculation Views – type CUBE join
union
projection
Database tables
aggregation
rank

© © 2016 All rights reserved. 13


Join Operations
DATA STRUCTURES USED IN IN-MEMORY DATABASES

 Inner Join  Full Outer Join


Customer No. Name Order No. CustomerNo. Customer No. Name Order No. CustomerNo.
1000 Muller 1000233 1000 1000 Muller 1000233 1000
2000 Smith 1000234 1000 2000 Smith 1000234 1000
3000 Richard 1000235 3000 3000 Richard 1000235 3000
1000236 4000 1000236 4000

 Left Outer Join  Text Join


Customer No. Name Order No. CustomerNo. Product Product category Product Langu. Text
1000 Muller 1000233 1000 TR1100 TOURING Language = TR1100 E Touring black
2000 Smith 1000234 1000 TR2100 TOURING English TR1100 D Touring schwarz
3000 Richard 1000235 3000 TR2100 E Touring silver
1000236 4000 TR2100 D Touring silber

 Right Outer Join  Referential Join


Customer No. Name Order No. CustomerNo. Customer No. Name Order No. CustomerNo.
1000 Muller 1000233 1000 1000 Muller 1000233 1000
2000 Smith 1000234 1000 3000 Richard 1000234 1000
3000 Richard 1000235 3000 4000 Baker 1000235 3000
4000 Baker 1000236 4000 1000236 4000

© © 2016 All rights reserved. 14


Union Operation
DATA STRUCTURES USED IN IN-MEMORY DATABASES

Calculation view „Revenue – Actual“ Calculation view „Revenue – Plan“


Year Product A/P Indicator Revenue Year Product A/P Indicator Revenue
2012 DXTR1100 Actual 434.000 2012 DXTR1100 Plan 400.000

2012 DXTR2100 Actual 564.322 2012 DXTR2100 Plan 700.000

2012 DXTR3100 Actual 784.555 2012 DXTR3100 Plan 700.000

Union
Calculation view (Result set)

Year Product A/P Indicator Revenue


2012 DXTR1100 Actual 434.000
2012 DXTR1100 Plan 400.000
2012 DXTR2100 Actual 564.322
2012 DXTR2100 Plan 700.000
2012 DXTR3100 Actual 784.555
2012 DXTR3100 Plan 700.000

© © 2016 All rights reserved. 15


Calculation “Dimension” Views
DATA STRUCTURES USED IN IN-MEMORY DATABASES

 Represent master data (attributes, text, hierarchies)

 Represent reusable dimensions in a star schema

 Are based on one or several physical tables (e.g.


customer attributes and text)

 Output structure defines visible fields for a view

 Examples: Material, Product, Time

© © 2016 All rights reserved. 16


Calculation “Dimension” Views - Example
DATA STRUCTURES USED IN IN-MEMORY DATABASES

Configure key fields, show/hide fields, add


hierarchies….

Determine the final output columns

Get descriptions for the attribute „Sales


Organization“, using a text join

Get descriptions for the attribute „Country“,


using a text join

Read general customer attributes and filter


on active customers only, using a projection

© © 2016 All rights reserved. 17


Calculation “Dimension” Views - Text Join
DATA STRUCTURES USED IN IN-MEMORY DATABASES

1. The attribute Country is joined


with the Country text table

2. Dependend on the reporting


language, the English or German
text is displayed

3. If a description mapping is
performed, the text is shown as
label for field Country (and not as
separate text field)

© © 2016 All rights reserved. 18


Calculation “Cube” Views
DATA STRUCTURES USED IN IN-MEMORY DATABASES

 Multidimensional information models that join


attributes with fact data

 Represent a logical view on several physical


tables, do not store data

 Used to model a star schema, including facts


(measures) and attributes

 Can include filter on certain attributes, and


calculated or restricted measures

© © 2016 All rights reserved. 19


Calculated and Restricted Columns
DATA STRUCTURES USED IN IN-MEMORY DATABASES

 Calculated columns
• Various functions available (String, mathematical, data….)
• Use of existing attributes and measures of the output structure

© © 2016 All rights reserved. 20


Calculated and Restricted Columns
DATA STRUCTURES USED IN IN-MEMORY DATABASES

Revenue ist restricted


by Product category
„Ebikes“ to show the
revenue for EBikes

 Restricted columns
• Restrict columns using attributes from the output structure
• Used e.g. to transform an account model into a key figure model

© © 2016 All rights reserved. 21


Deployment
DATA STRUCTURES USED IN IN-MEMORY DATABASES

Save and activate


 When you save, your model is stored and activated
 Errors in activation can be analyzed in the console
 Activation creates a column view in the system schema _SYS_BIC
 For reporting, the Column View of this schema is used

© © 2016 All rights reserved. 22


Deployment
DATA STRUCTURES USED IN IN-MEMORY DATABASES

Data Preview
 Available for tables and views
 Can be used to confirm the correctness of the data model and the data loaded

© © 2016 All rights reserved. 23


SAP HANA Data Modeling
AGENDA

 HANA data modeling overview


 Data structures used in in-memory databases
 Impact of in-memory databases on data modeling

© © 2016 All rights reserved. 24


Physical Database Tables
IMPACT OF IN-MEMORY DATABASES ON DATA MODELING

Country Customer Product Sold Pieces

USA 3000 DXTR1100 5

USA 4000 DXTR1100 21

Germany 23000 DXTR3100 12

Germany 17000 DXTR3100 34

Row table Column table

Row 1 USA 3000 DXTR1100 5 Column1 Column2 Column3 Column4


USA 3000 DXTR1100 5
Row 2 USA 4000 DXTR1100 21
USA 4000 DXTR1100 21

Row 3 DE 23000 DXTR3100 12 Germany 23000 DXTR3100 12

Row 4 DE 17000 DXTR3100 34 Germany 17000 DXTR3100 34

© © 2016 All rights reserved. 25


Impact of In-Memory databases on Data Modeling
IMPACT OF IN-MEMORY DATABASES ON DATA MODELING

Can be used to model simple reporting


Column scenarios that require only one table
table

Row Recommended only for write-intensive


scenarios, not for read-operations on mass
table
data

Recommended option for reporting,


Calculation provides a high performance for read
view operations on mass data

© © 2016 All rights reserved. 26


When to use which table view for Reporting
IMPACT OF IN-MEMORY DATABASES ON DATA MODELING

 Fast aggregation on database level


 It is not required to save data physically on different aggregation levels
 Data is saved once on the most detailed level required
 Data is aggregated on-the-fly when requested
 Views are used to cover specific reporting requirements

 Fast calculations on database level


 Calculations are moved from the application layer to the database layer
 Implement calculations in views rather then in end user tools/reports

General recommendation: Reduce data transfer between different layers (tables, views, end user
tools), e.g. through filtering, aggregation on the lowest possible level.

© © 2016 All rights reserved. 27


SAP HANA Data Modeling
REFERENCE SLIDE - ABBREVIATIONS

 BICS – BI Consumer Services


 BO – Business Objects
 BW – Business Warehouse
 DWH – Data Warehouse
 ERM – Entity Relationship Model
 ERP – Enterprise Resource Planning
 ETL – Extract Transfer Load
 HANA – High-Performance Analytic Appliance
 MDX – Multidimensional Expression
 SCM – Supply Chain Management

© © 2016 All rights reserved. 28


SAP HANA Data Modeling
REFERENCES

SAP SE (2016): SAP Product Road Map – SAP HANA, Road Map Revision: 2016.07.20, Retrieved from
http://service.sap.com

SAP SE (2016): SAP HANA Master Guide. SAP HANA Platform SPS 12. Document Version: 1.0 - 2016-05-11.

SAP SE (2016): SAP HANA SQL and System Views Reference. SAP HANA Platform SPS 12. Document Version: 1.0 - 2016-
05-11.

SAP AG (2012): SAP HANA Database – Development Guide – How to use SQL and SQLScript for Data Modeling, SAP HANA
Appliance Software SPS 04, document version 2.0.

© © 2016 All rights reserved. 29

You might also like