Professional Documents
Culture Documents
1SAP HANA Prathap Reddy Introduction PDF
1SAP HANA Prathap Reddy Introduction PDF
1
WHAT is SAP HANA ????
2
WHAT is SAP HANA ????
3
WHAT is SAP HANA ????
• SAP HANA has its own Application Server (XS) only available from SP 5
• XS stands for :
• Extra Small
• Extended Application Services
• XS is a small-footprint application server, web server, and basis for an application development
platform - that livesinside SAP HANA.
4
WHAT is SAP HANA ????
5
SAP HANA Cloud
6
SAP HANA
7
What Makes SAP HANA Fast…?
8
Multicore Processing…
9
Row Store & Column Store
10
Row Store & Column Store
11
Row Store v/s Column Store
12
Column Store
13
Push Data Intensive Logic into SAP HANA
14
Partioning
15
SAP HANA Architecture ….
16
Index Server
17
SAP HANA Components
18
SAP Hana Software Specifications
19
How can we use SAP HANA ???
20
SAP HANA as Data Mart
SAP
Business
Suit BODS
SLT
DXC SAP HANA
Smart Data Access
SAP BW
SAP BW >
OLTP OLAP
7.3 SP 5
SAP HANA
SAP HANA
SAP ECC
SAP HANA
22
SAP HANA As Accelerator
SLT
Non HANA
HANA DB
DB
23
Course Contents
24
Introduction to HANA Studio
25
SAP HANA Studio
26
DATABASE Artifacts
27
DATABASE Artifacts
• Schema
• Database Table
• Row Store
• Column Store
• Synonyms
• Database View
• Sequence
• Triggers
• Indexes
• Functions
• Column Views
• Procedures
28
Schema
• Schema :
Note: By default the schema will be owned by user who creates schema.
Note: For every user we create in SAP HANA, a schema is created with same name.
29
Database Table
• Database Table:
» Set of Rows and Columns
» Goto Slide 10
30
Synonyms
• Synonyms:
Public Synonym:
31
Database View
• Database View:
32
Sequence
• Sequence:
33
Triggers
• Trigger:
BEGIN
CURRENT_TIMESTAMP
CURRENT_USER
END;
34
INDEXES
• Indexes:
35
Table User Defined Functions
– Table UDFs are read-only user-defined functions which accept multiple input parameters
and return exactly one results table.
– SQLScript is the only language which is supported for table UDFs.
RETURN <Logic>
END;
36
Procedures
• Procedures:
A := B + C;
END;
37
Column Views
38
SQL Basics
• SQL Basics
• According to ANSI (American National Standards Institute), it is the standard language for
relational database management systems.
39
SQL
• 1. Viewing Tables
• 2. Select & From
• 3. Where Clauses
• 4. Functions
• 5. Group By
• 6. Order By
• 7. Having
• 8. Top
• 9. Create
• 10. Insert
• 11. Update
• 12. Delete
• 13. Joins
• 14. Sub Selects
• 15. Unions
• 16. Drop
• 17. Views
• 18. Schemas
• 19. Table Types
• 20. Procedures
40
Schema
• Schema :
Note: By default the schema will be owned by user who creates schema.
Note: For every user we create in SAP HANA, a schema is created with same name.
41
CREATE
• From Scratch
42
ALTER
•
43
VIEWING TABLES
• View Log.
44
TABLE TYPES
• Row Store
• Column Store
• Table Type
• CREATE TYPE <Schema Name.Table type name> as table ( <Column list with data type> );
45
SELECT & FROM CLAUSES
• How to get the Select Statement from “LOG” of Open Data Preview
46
WHERE CLAUSES
• =
• LIKE WILDCARDS %
• BETWEEN … AND
47
ORDER BY
48
FUNCTIONS
• COUNT()
• SUM()
• *
• MIN()
• MAX()
• AVG()
• ROUND(…,2)
49
GROUP BY
50
HAVING
• SELECT
• FROM
• WHERE
• GROUP BY
• HAVING
• ORDER BY
51
TOP CLAUSE
• TOP 5 OR ….
• SELECT TOP N ……
52
SUBSELECTS
53
INSERT
• From Scratch
• Multiple Rows
54
UPDATE
• Multiple Rows …
55
DELETE
• Multiple Rows….
56
JOINS
• SELECT
• FROM
• WHERE
57
UINIONS
58
DROP
59
Stored Procedures
• SYNTAX:
• BEGIN
• END;
60
Stored Procedures
• Demo Examples
61
Stored Procedures
• CE-Fucntions:
62
CE Functions
63
CE Functions
64
CE Functions
65
CE Functions
66
Stored Procedures
• Demo on CE-Functions.
67
SAP HANA
68
SAP HANA Modelling
• INDEX
– Introduction to Modelling
– Packages
– Attributes & Measures
– Information Views
• Attribute View
• Analytic View
• Calculation View
» SQL Script Based
» Graphical Mode
– Analytical Privileges
– Stored Procedures
– Decision Tables
69
Introduction to Modelling
• Modeling refers to an activity of refining or slicing data in database tables by creating views to
depict a business scenario. The views can be used for reporting and decision making.
• The modeling process involves the simulation of entities, such as customer, product, and sales,
and the relationships between them.
70
Introduction to Modelling
71
Introduction to Modelling
72
Introduction to Modelling
• Attribute Views
• Analytic Views
• Calculation Views
73
Introduction to Modelling
• SAP HANA Modeler perspective supports the below object types:
Attribute View:
Similar to Master data in SAP BW
Similar to Dimension in SAP BO
Analytic View:
Similar to Infocube in SAP BW
Similar to Facttable in SAP BO
Calculation View:
Analytical Privileges:
Similar to Analysis Authorizations in SAP BW
Decision Tables:
Business Rules for Transformations.
Can be used for What if Analysis.
74
Introduction to Modelling
75
Introduction to Modelling
• Modelling Process:
76
Packages
77
Attributes & Measures
Types Of Attributes
Simple Attributes
Calculated Attributes
Local Attributes
78
Attributes & Measures
Types Of Measures
Simple Measures
Calculated Measures
Restricted Measures
Counters
79
Attribute View
• Attribute View:
Attribute views are used to model an entity based on the relationships between attribute data
contained in multiple source tables.
80
Attribute View
• Standard:
• Time:
1. You have imported SAP system tables T009 and T009B tables for creating an attribute
view whose type is Time.
2. Auto generation for Time Attribute view - we use “GENERATE TIME DATA”
• Base Attribute View: Shows the Base attribute view on which the Attribute view has been
derived. This is shown only incase of DERIVED ATTRIBUTE VIEW.
87
• Generate Concat Attributes:
• Enable History:
• Is used to enable time travel queries by using history tables.
88
• Steps Creating Attribute View:
• 4. If required create Calculated Columns. (only attributes ) Measures are not allowed in
Attribute Views.
• 6. If required “Apply Filters” to restrict the data for the View (Similar to Where Clause )
– Note:- Filtering can be made dynamic by using Input Parameters and map them with input
parameters in Analytical View or Calculation View
• 8. In Semantics Node, If Required Define Semantics for the columns / fields selected from data
foundation
90
Hierarchies
91
Attribute View
• Pre-Requisites to consume database tables from any schema while creating Information Views:
• Syntax:
92
Attribute View
93
Hierarchies in Depth
94
2 types of Hierarchies:
Parent-Child Hierarchy
95
• • Level Hierarchy:
• To create a hierarchy that is rigid in nature such that, the root and
child nodes can be accessed only in the defined order. In a level
hierarchy you define several levels which point to the view
attributes.
Country IN US
96
• • Parent Child Hierarchy:
Manager1
Employee 2 Employee 1
97
• Level Based Hierarchy: [Node Style]
•Level Name - the unique node ID is composed of the level name and node
name; for example, "[Level 2].[B2]".
•Name Only - the unique node ID is composed of level name; for example, "B2".
•Name Path - the unique node ID is composed of the result node name and the
names of all ancestors apart from the (single physical) root node; for example,
"[A1].[B2].[C3]".
98
• Level Based Hierarchy: [Level Type]
The level type is used to specify the semantics for the level attributes.
A level of the type LEVEL_TYPE_TIME_MONTHS indicates that the attributes
of the level contain month such as "January", and LEVEL_TYPE_REGULAR
indicates that a level does not require any special formatting.
99
• Level Based Hierarchy: [Order By & Sort Direction]
100
• Level Based Hierarchy: [Aggregate ALL NODES]
FALSE: TRUE:
101
• Level Based Hierarchy: [Aggregate ALL NODES]
102
103
104
Attribute View
• Points to be Noted:
• 3. We can have multiple Key Attributes – in this case all the keys attributes must be referred
from same database table.
• 4. Joins: Text join, Referential Join, Inner Join, Left Outer Join, Right Outer Join
• 6. We can use Input parameter Place holders which can be mapped with Input parameters in
Analytical view or Calculation view.
• 7. We can create Hierarchies in Attribute View which can be leveraged in analytical views.
• 8. Assign Semantics
• 9. Alias Tables
105
Attribute View
• 11 You have imported SAP system tables T009 and T009B tables for creating an attribute view
whose type is Time.
• 12. Auto generation for Time Attribute view - we use “GENERATE TIME DATA”
• In case of Gregorian Calendar –
• The system populates the generated time data in the M_FISCAL_CALENDAR table, which is
located in the _SYS_BI schema.
106
Analytic View
Analytic View:
• Analytic views are used to model data that includes measures. For example, transactional fact
table representing sales order history would include measures for quantity, price, and so on.
• Analytic views can contain two types of columns: attributes and measures. Measures are
simple, calculated or restricted. If analytic views are used in SQL statements, then the
measures have to be aggregated. For example, using the SQL functions SUM(<column
name>), MIN(<column name>), or MAX(<column name>). Normal columns can be handled as
regular attributes and do not need to be aggregated.
107
108
109
• Data Foundation:
110
• Star Join:
111
• Star Join:
112
• Semantics : Columns
113
• Semantics: View Properties
114
1825549 - Performance degradation for query on CalcView
https://websmp230.sap-
ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=6976
5F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D313
8323535343926
115
• Semantics : Hierarchies
116
117
Analytic View
118
Analytic View
• Points to be Noted:
• Data Foundation can include multiple database tables but we can use measures only from one
table (Central Table).
• Hierarchies cannot be created in Analytic view but we can use Hierarchies built in Attribute
views.
• In Star Join, we can create Calculated columns (attributes or measures) and restricted
measures
• We can create variables & Input Parameters in Analytical view (Mapping of Input Parameters)
• In Star Join– we can create Temporal Join (can not be created in Data Foundation)
• Sematic Properties
• Applying Filters
• Create calculation views to provides composites of other views. You can classify calculation
views as script-based calculation view or graphical calculation view
• They can be used in the same way as analytic views; however, in contrast to analytic views, it
is possible to join several fact tables in a calculation view.
• Set to Cube - if you want to define a calculation view that is visible in the multidimensional
reporting tools.
• Set to Dimension - The view is not available for multidimensional reporting and is only
consumable via SQL.
• Calculation views can include measures and be used for multidimensional reporting or can
contain no measures and used for list-type reporting.
• We can use Attribute View, Analytical View, Database Tables , Column Views in creating
Calculation view.
• Graphical Mode:
• We can use Nodes like Union, Join, Aggregation, ProjectioN,Rank 120
• We can create Hierarchies in calculation views.
121
122
123
Calculation View
124
Calculation View
• Points to be Noted:
125
• In Graphical Calculation View – Filtering can be applied only on Aggregation Nodes & Projection
Nodes which are not default.
• Propagate to semantics.
• Execute in SQL
• Transparent Filter
• Extract Semantics
126
Analytical Privileges
127
Decision Tables
128
Data Provisioning
129