data modelling
TRANSCRIPT
SAP BW Data Modeling
SAP University AlliancesVersion 2.0Authors Klaus Freyburger g
Peter Lehmann
Abstract:This chapter covers the basic aspects and concepts of data modeling with SAP Business Information Warehouse (SAP BW).
ProductSAP Netweaver BI 7.0
LevelUndergraduateBeginner
© 2010 All Rights Reserved. SAP UA
SAP BI Curriculum
SAP UA
A dBI2-M2 SAP BW Data Modeling
• Overview
Agenda
Overview• InfoObjects
– Key Figures– Characteristics
• InfoProviders– DataStore Objectsj– InfoCubes
Page 2© 2010 SAP AG
SAP BI Curriculum
SAP UA
SAP BW A hit t O iBI2-M2 SAP BW Data Modeling
SAP BW Architecture Overview
Page 3© 2010 SAP AG
SAP BI Curriculum
SAP UA
SAP BW Data Modeling Architecture Objects andBI2-M2 SAP BW Data Modeling
SAP BW Data Modeling Architecture Objects and Data Structures
Page 4© 2010 SAP AG
SAP BI Curriculum
SAP UA
Wh t i I f Obj t?BI2-M2 SAP BW Data Modeling
What is an InfoObject?
• InfoObjects are used to focus on business requirements• InfoObjects are used to focus on business requirements.– Note:
• The original product name was “SAP Business InformationWarehouse.”
• The abbrevation “BIW” conflicted with another product name, so “BW” was chosen.
• InfoObjects are the “bricks” to build data structures inside SAP BWBW.– InfoObjects represent business objects from an end user’s
view.– The most important InfoObject types used for business analysis
are Characteristics and Key Figures.
Page 5© 2010 SAP AG
SAP BI Curriculum
SAP UA
I f Obj t Ch t i tiBI2-M2 SAP BW Data Modeling
InfoObject: Characteristics
• A Characteristic represents a business object (or concept• A Characteristic represents a business object (or concept, business term, business entity).– A Characteristic may have attributes which describes the
b i bj i d ilbusiness object in more detail.– Example: InfoObject “Customer” is a characteristic with
attributes such as “Customer Number”, “ZIP Code”, “Region”, , , g ,etc.
– The attributes “Customer Number”, “ZIP Code”, “Region”, etc. are also managed as Characteristics and may have their ownare also managed as Characteristics and may have their own attributes.
Note: What SAP calls a Characteristic is often referred to in the data warehouse community as a Dimension.
Page 6© 2010 SAP AG
SAP BI Curriculum
SAP UA
I f Obj t K FiBI2-M2 SAP BW Data Modeling
InfoObject: Key Figures
• A Key Figure (or variable measure) is oftenly used to document• A Key Figure (or variable, measure) is oftenly used to document the performance of a business process over time.– It can be found in document records such as invoice, delivery
h d d inote, purchase order, or goods receipt.– Example: InfoObject “Revenue” or “Sales Amount”, etc.
• Note: InfoObjects are unique inside SAP BW, and they are used to build the data structures for analysis requirements.– Conceptually unique: the semantics (meaning) of an
InfoObject is uniquely defined system-wide inside SAP BW.– Logically unique: the data type value range or field length isLogically unique: the data type, value range or field length is
uniquely defined system-wide inside SAP BW.– From the technical point of view, an InfoObject can viewed as a
d t b fi ldPage 7© 2010 SAP AG
database field.
SAP BI Curriculum
SAP UA
Evolution from a SAP ERP Database Object to anBI2-M2 SAP BW Data Modeling
Evolution from a SAP ERP Database Object to an SAP BW InfoObject
R/3 BW ExtraktorSAP ERPSAP BW InfoObjects
SAP BW DataSource
Table Costcenter
BW Extraktor
InfoObject"0COSTCENTER"
COAccounting
COAccounting COSTC ...
Table Costcenter
DataSourceCostCenter
D fi iti
HRHumanHR
Human
Table EmployeeEMPLO COST CENTER ...
Definition&
Mapping
SAP Business Information Warehouse!!
HumanRessources
HumanRessources
O COS _C
Page 8© 2010 SAP AG
SAP BI Curriculum
SAP UA
I f Obj t A “B i k ” f D t St tBI2-M2 SAP BW Data Modeling
InfoObjects Are “Bricks” for Data Structures
Page 9© 2010 SAP AG
SAP BI Curriculum
SAP UA
I f P id “P id ” A t D t R dBI2-M2 SAP BW Data Modeling
InfoProviders “Provide” Access to Data Records
InfoProviders:InfoProviders:• Are data storage inside SAP BW• May store data records physically (persistent)• May also be used to access data stored outside SAP BW virtually
(transparent views)• May be accessed with front end tools such as SAP• May be accessed with front end tools such as SAP
BusinessExplorer
Note: A query is a “view” to data within an InfoProvider and does not contain physical dataand does not contain physical data.
Page 10© 2010 SAP AG
SAP BI Curriculum
SAP UA
I f P idBI2-M2 SAP BW Data Modeling
InfoProviders
• InfoProviders with physical data: p y– InfoCubes
• Contain data optimized for fast multi-dimensional analysis.DataStore Objects– DataStore Objects
• Contain detailed data.• Used for high data volumes stored in normal database tables.
Oft d “d t ” f I f C b• Often used as “data source” for InfoCubes.
• InfoProviders with virtual data:– MultiProviders
• Often used to create “views” above two or more InfoCubes with the same Characteristics but different Key Figures.
• Data resides in the InfoCubes involved and data redundancy is avoided.– VirtualProviders
• Data stored somewhere outside SAP BW. • Some ERP systems provide data storage which may be accessed directly
Page 11© 2010 SAP AG
y p g y yby SAP BW without changing the end user ‘s view to the data.
SAP BI Curriculum
SAP UA
I f C bBI2-M2 SAP BW Data Modeling
InfoCubes
• Provide data storage used for reporting and online• Provide data storage used for reporting and online analysis.
• Consist of Key Figures and Characteristics.• Contain data stored multi-dimensionally and often aggregated
(week, month).• Use star database schema consisting of a fact table surroundedUse star database schema, consisting of a fact table surrounded
by dimension tables.• Use a maximum of 3 + 13 dimension tables.
– 3 dimension tables are pre-defined by SAP.• Time, Unit and DataPackage (for technical information)
– 13 dimensions may be used by InfoCube developers– 13 dimensions may be used by InfoCube developers.
Note: In practice, good InfoCube design should not exceed 6 8 dimensions (+ the 3 above) so 13 dimensions are plenty
Page 12© 2010 SAP AG
6-8 dimensions (+ the 3 above) so 13 dimensions are plenty.
SAP BI Curriculum
SAP UA
D t St Obj tBI2-M2 SAP BW Data Modeling
DataStore Objects
• Contain single data records such as invoices, g ,purchase orders or customer order items.
• Consist of key fields (such as “order number”, “order position number”) and data fields (Key Figures andorder position number ) and data fields (Key Figures and Characteristics such as “sales amount”, “ net value”, “customer id”, “material number”).
• Store data records in relational database tables.• Often contain massive volumes of data.
Page 13© 2010 SAP AG
SAP BI Curriculum
SAP UA
I f C b D t St Obj tBI2-M2 SAP BW Data Modeling
InfoCube versus DataStore Object
• Data Warehouse• Data Warehouse, Operational Data Store and Data Marts are general layers in a Datageneral layers in a Data Warehouse Architecture.
BI1-M2-01-Data Warehouse
• Data Warehouse and Operational Data Store may be implemented with DataStoreObjects.
• Data Marts will be implemented withimplemented with InfoCubes.
Page 14© 2010 SAP AG
SAP BI Curriculum
SAP UA
A dBI2-M2 SAP BW Data Modeling
• Overview
Agenda
Overview• InfoObjects
– Key Figures– Characteristics
• InfoProviders– DataStore Objectsj– InfoCubes
Page 15© 2010 SAP AG
SAP BI Curriculum
SAP UA
I f Obj tBI2-M2 SAP BW Data Modeling
InfoObjects
• InfoObjects• InfoObjects– Key Figures
• Revenue, Sales Amount, Net Value, ….– Characteristics
• Customer, Region, Zip Code, …Units– Units
• Unit of Measurement, Currency, …– Time
• Calender Year, Fiscal Year, Month, Day, Quarter, ….– Some Technical Stuff
DataPackageID RequestID• DataPackageID, RequestID, …
Page 16© 2010 SAP AG
SAP BI Curriculum
SAP UA
K Fi D fi iti RBI2-M2 SAP BW Data Modeling
Key Figure Definition: Revenue
Amount, Quantity, .. …Amount, Quantity, .. …
Data Type: integer,Data Type: integer, float, char(10), …
EUR, USD, … (fix)
Pieces, inch, %, … (fix)
Page 17© 2010 SAP AG
Unit / Currency (fix) / Currency reference
SAP BI Curriculum
SAP UA
K Fi D fi iti R ( t )BI2-M2 SAP BW Data Modeling
Key Figure Definition: Revenue (cont.)
Last valueNo Employee per Month
Last value
500520 515 520 520 521
Aggregation: Last Value,
Jan Feb Mar Apr May Jun
gg g ,Maximum, Average…
Reference Characteristic e g Quarter
Aggregation: S ti
Reference Characteristic, e.g. QuarterThe reference characteristic allows the use of a function to aggregate data instead of
tiSummation, Minimum, Maximum
summation.Example: Number of Employees at the end of the quarter. Sum does not make
Page 18© 2010 SAP AG
sense!
SAP BI Curriculum
SAP UA
K Fi D fi iti R ( t )BI2-M2 SAP BW Data Modeling
Key Figure Definition: Revenue (cont.)
If the Key Figure is non-cumulative (e.g., warehouse stock), this field defines an InfoObject representing non-cumulative change. This InfoObject is either positive or negative. So, the stock amount can be calculated f itfrom it. Two fields are used to
calculate the non-cumulative amounts. Inflow is the InfoObject which represents the stock inflow amount. Outflow is
Page 19© 2010 SAP AG
vice versa.
SAP BI Curriculum
SAP UA
K Fi D fi iti R ( t )BI2-M2 SAP BW Data Modeling
Key Figure Definition: Revenue (cont.)
Page 20© 2010 SAP AG
SAP BI Curriculum
SAP UA
Ch t i ti D fi iti S l O i tiBI2-M2 SAP BW Data Modeling
Characteristic Definition: Sales Organisation
Data Types: Num, Char DateChar, Date, …
Page 21© 2010 SAP AG
SAP BI Curriculum
SAP UA
C i R tiBI2-M2 SAP BW Data Modeling
Conversion Routine
Database values• Are stored in internal format
appropriate to the database– Date as YYYYMMDD
• Are presented to a user in external format according to his local settings, e.g., in g ,– Europe
• Date: DD.MM.YYYYN mbers 1 234 56• Numbers: 1.234,56
– US• Date: MM/DD/YYYY• Numbers: 1,234.56
Transformation external internal format is
Page 22© 2010 SAP AG
performed by a conversion routine
SAP BI Curriculum
SAP UA
ALPHA C i R tiBI2-M2 SAP BW Data Modeling
ALPHA Conversion Routine
Alphanumeric database fieldsAlphanumeric database fields• Datatype CHAR in SAP• Can store character and number values• Have conversion exit ALPHA as default
– Eliminates leading blanks after user input• User input of ‚RB0010‘ and ‚ RB0010‘ refers to same objectp j
– Stores numbers with leading 0s in database• Numeric values are stored in natural order in database, e.g. 0002
first then 0010first, then 0010
Material Group in SAP Business Content has numerical l ith t ili bl kvalues with trailing blanks
Conversion exit ALPHA must not be used
Page 23© 2010 SAP AG
SAP BI Curriculum
SAP UA
MATN1 C i R tiBI2-M2 SAP BW Data Modeling
MATN1 Conversion Routine
Database field Material often requires special treatmentDatabase field Material often requires special treatment.• Datatype CHAR in SAP• Conversion exit MATN1 is used• Edit format can be defined in transaction OMSL
– E.g. _ _-_ _ _ _ User Input RB-0010 is stored as RB0010
Since the OMSL format setting is system-wide, we do not use it in the Bike Company Curriculum.
Page 24© 2010 SAP AG
SAP BI Curriculum
SAP UA
Ch t i ti D fi iti S l O i ti ( t )BI2-M2 SAP BW Data Modeling
Characteristic Definition: Sales Organisation (cont.)An InfoObject may
have attributes!
Texts:Descriptive textsMulti-language textsg gTime dependent texts
Page 25© 2010 SAP AG
SAP BI Curriculum
SAP UA
Ch t i ti D fi iti S l O i ti ( t )BI2-M2 SAP BW Data Modeling
Characteristic Definition: Sales Organisation (cont.)
Attributes
Usable for OLAP operations
Page 26© 2010 SAP AG
Usable for OLAP operations or display only
SAP BI Curriculum
SAP UA
Ti Ch t i tiBI2-M2 SAP BW Data Modeling
Time Characteristics
• Time characteristics are always• Time characteristics are always necessary and define the time-related reference point for data analysis purposesanalysis purposes.
• Time characteristics are predefined by SAP and cannot be changed.
Page 27© 2010 SAP AG
SAP BI Curriculum
SAP UA
U it /C iBI2-M2 SAP BW Data Modeling
Units/Currencies
• Units and Currencies are used to define Key Figures in more detail• Units and Currencies are used to define Key Figures in more detail.• A Unit may be an InfoObject which defines the Unit of a Key Figure.• A Currency may be an InfoObject which defines the Currency of a
Key Figure• Examples:
0CURRENCY– 0CURRENCY – 0BASE_UOM
Page 28© 2010 SAP AG
SAP BI Curriculum
SAP UA
A dBI2-M2 SAP BW Data Modeling
• Overview
Agenda
Overview• InfoObjects
– Key Figures– Characteristics
• InfoProviders– DataStore Objectsj– InfoCubes
Page 29© 2010 SAP AG
SAP BI Curriculum
SAP UA
5 St t D fi D t St Obj tBI2-M2 SAP BW Data Modeling
5 Steps to Define a DataStore Object
5 steps to Define an DataStore Objectp j1) Define a name for a
DataStoreObject2) Choose the key fields2) Choose the key fields3) Choose the data fields4) Define attributes used for data
l ianalysis5) Activate the DataStoreObject
Page 30© 2010 SAP AG
SAP BI Curriculum
SAP UA
Ch i I f Obj t t B ild D t St Obj tBI2-M2 SAP BW Data Modeling
Choosing InfoObjects to Build a DataStore Object
• Select the relevant InfoObjects• Select the relevant InfoObjects– Direct InfoObject name input (1) or– Choose InfoObjects by InfoObjectCatalog and drag & drop the
I f Obj t (2)InfoObjects (2)
Page 31© 2010 SAP AG
SAP BI Curriculum
SAP UA
7 St t D fi I f C bBI2-M2 SAP BW Data Modeling
7 Steps to Define an InfoCube
7 Steps to Define an InfoCube7 Steps to Define an InfoCube1) Choose a name for an InfoCube2) Create Dimensions as needed3) Assign Characteristics to Dimensions4) Choose Time Characteristics5) Choose Key Figures5) C oose ey gu es6) Define Navigational Attributes7) Activate InfoCube
Page 32© 2010 SAP AG
SAP BI Curriculum
SAP UA
C t N Di i If N d dBI2-M2 SAP BW Data Modeling
Create New Dimensions If Needed
Page 33© 2010 SAP AG
SAP BI Curriculum
SAP UA
Wh t i Di i I id SAP BW?BI2-M2 SAP BW Data Modeling
What is a Dimension Inside SAP BW?
• A dimension is a group of characteristics which belong to the• A dimension is a group of characteristics which belong to the same business object (semantically).
• Each characteristic may contain additional attributes which are l f d l i !!!relevant for data analysis – or not!!!
Navigational attributes are InfoObjects which are used to perform data analysis.Display attributes are InfoObjects for which data analysis does
not make sense (e.g. a house number or a family name)This has an impact to cube design!This has an impact to cube design!
Note: In data warehouse community, the term Dimension isNote: In data warehouse community, the term Dimension is used for what SAP calls Characteristic .
Page 34© 2010 SAP AG
SAP BI Curriculum
SAP UA
E i SAP BW E h d St S hBI2-M2 SAP BW Data Modeling
Excursion: SAP BW - Enhanced Star Schema
• Attributes are not part of a dimension!• Attributes are not part of a dimension!
DimensionCharacteristic as part
of a dimensionDimension of a dimension NAV
Characteristic as i i ib
NAV
NAV
Page 35© 2010 SAP AG
navigation attribute
SAP BI Curriculum
SAP UA
Di l d i th F t d T lBI2-M2 SAP BW Data Modeling
Displayed in the Frontend Tool
Page 36© 2010 SAP AG
SAP BI Curriculum
SAP UA
B i Ch t i ti d It N i ti Att ib tBI2-M2 SAP BW Data Modeling
Basic Characteristic and Its Navigation Attributes
1 Dimension1. Dimension
3 N i ti Att ib t3. Navigation Attributes are ready to be used in analysis.
2. Characteristic
Page 37© 2010 SAP AG
SAP BI Curriculum
SAP UA
St t C t I f C bBI2-M2 SAP BW Data Modeling
Steps to Create an InfoCube
• Define the InfoObjects needed• Define the InfoObjects needed.– Key Figures– Characteristices
• Define which Characteristics may be chosen to create a semantic cluster for semantic dimensions.– Examples are: Sales, Production, Material Management, Finance, etc.Examples are: Sales, Production, Material Management, Finance, etc.
• Define which attributes are appropriate to perform data analysis– OLAP attributes define them as “navigational” attributes – Non-OLAP attributes define them as “display” attributes
• Done! Deploy the InfoCube inside SAP BW!
Page 38© 2010 SAP AG
SAP BI Curriculum
SAP UA
SBI2-M2 SAP BW Data Modeling
Summary
• Key Figures and Characteristics are defined as InfoObjects• Key Figures and Characteristics are defined as InfoObjects.• InfoObjects are the smallest “bricks” to define InfoProviders
within SAP BW.• InfoProviders are used to store data within SAP BW or allow SAP
BW to access data stored somewhere else.• The most important InfoProviders are InfoCubesThe most important InfoProviders are InfoCubes
and DataStore Objects.• The definition of an SAP BW InfoCube is
Wit h !no Witchery!
Page 39© 2010 SAP AG