Multi Level Data

54
205: Implementing a Multi-Level Data Model BW Solution at Steelcase Mark Veach Steelcase, Inc.

Transcript of Multi Level Data

Page 1: Multi Level Data

205: Implementing a Multi-Level Data Model BW Solution at SteelcaseMark VeachSteelcase, Inc.

Page 2: Multi Level Data

2

”If confusion is the first step to knowledge, I must be a genius.” - Larry Leissner

Page 3: Multi Level Data

3

What we will cover ...· Corporate ODS Layer & Data Mart Strategy· Multi-Level Purchasing Schedule Line· Multi-Level Material Stocks & Movements· Custom Hierarchies for Many-To-Many

What you will gain ...· Understanding· Direction· Comfort Level Boost· Improved Chances for Success

Page 4: Multi Level Data

4

Agenda ...

1. Start Up 2. Extraction 3. Data Model 4. Custom Hierarchies

Page 5: Multi Level Data

5

Agenda ...

"There is no terror in the bang, only in the anticipation of it.” - Alfred Hitchcock

1. Start Up• System Landscape• Business Needs• Data Design• Business Content

Page 6: Multi Level Data

6

System Landscape

Develop. Current

BW

R/3

2.0B

4.6BPI 2001.2

3.0B

4.6BPI 2002.2

HPunix

&Oracle8.1.7.4

Sta

rt U

pS

tart

Up

Sys

tem

Lan

dsca

peS

yste

m L

ands

cape

Page 7: Multi Level Data

7

Business Needs ...

• MRO Materials

– Maintenance, Repairs and Operations

– Plant Maintenance

• Purchasing

• Materials & Inventory Management

• Custom Data Requirements

Sta

rt U

pS

tart

Up

Bus

ines

s N

eeds

Bus

ines

s N

eeds

Page 8: Multi Level Data

8

Business Needs ...

• Reporting Requirements:– Standardized Yet Flexible– Long Data Life for Trending– Summary and Details– Focus on:

• Basic Purchasing Information• Basic Stock Information• Basic Material Movement Info• Inventory by Vendor• Inventory and Cost

Sta

rt U

pS

tart

Up

Bus

ines

s N

eeds

Bus

ines

s N

eeds

Page 9: Multi Level Data

9

Data Design ...

Basic Data Design/Mapping Steps• List Fields by Report

– Indicate R/3 Source• Clarify Discrepancies• Eliminate Redundancies• Organize by Business Process:

– Purchasing– Inventory

• Map Key Figures and Characteristics

Sta

rt U

pS

tart

Up

Dat

a D

esig

nD

ata

Des

ign

Page 10: Multi Level Data

10

Business Content ...

Best DataSource Fit• Purchasing

– Purchasing Schedule Line (2LIS_02_SCL)• Inventory

– Transfer BW: Stock (2LIS_40_S278)– Material Movements (2LIS_03_BF)

Not a Perfect Fit• Summary Targets (InfoCubes) - No ODS• Need To:

– Create Custom Data Targets– Extend And/Or Create Data Sources

Sta

rt U

pS

tart

Up

Bus

ines

s C

onte

ntB

usin

ess

Con

tent

Page 11: Multi Level Data

11

Agenda ...

"Any sufficiently advanced technology is indistinguishable from magic.” - Arthur C. Clarke

2. Extraction• Logistics Cockpit• Process Keys• DataSources

Page 12: Multi Level Data

12

Logistics Cockpit

• Transaction LBWE

• Set Update Mode for Entire Application

• Original Design & Construction Used “V3 Update”

• Chose “Queued Delta” When Made Available in PI 2002.1

Ext

ract

ion

Ext

ract

ion

Logi

stic

s C

ockp

itLo

gist

ics

Coc

kpit

Page 13: Multi Level Data

13

Process Keys• R/3 Applications Create Many Key Figures

• Process Keys Are Assigned Based on the Business Process in Logistics Extractors

• Generic Key Figures (Value & Quantity)

• In BW, Process Keys Make Transaction Key Figures Meaningful

• Process Keys Must Be Activated Via R/3 Transaction MCB_

- Extensive Reference White Paper from SAP Service

Marketplace, “Business Content 2.0B - Retail/CP”

Ext

ract

ion

Ext

ract

ion

Pro

cess

Key

sP

roce

ss K

eys

Page 14: Multi Level Data

14

Example #1 - Purchase Order

Process Key = 1 (Purchase Order)

Generic Key Figure “Value” = 4,000.00 (PO Value)

Generic Key Figure “Quantity” = 40.000 (PO Qty)

Ext

ract

ion

Ext

ract

ion

Pro

cess

Key

sP

roce

ss K

eys

Page 15: Multi Level Data

15

Process Key = 2 (Goods Receipt)

Generic Key Figure “Value” = 4,000.00 (PO Receipt Value)

Generic Key Figure “Quantity” = 40.000 (PO Receipt Qty)

Ext

ract

ion

Ext

ract

ion

Pro

cess

Key

sP

roce

ss K

eys

Example #2 - Goods Receipt

Page 16: Multi Level Data

16

Process Key002

CharacteristicsValue100.00

Quantity1

Process Key001

CharacteristicsValue100.00

Quantity1

PO ItemEntry

Process Key001

CharacteristicsValue100.00

Quantity1

Update Rule Routines

Process Key002

CharacteristicsValue100.00

Quantity1

PO Value$100.00

PO Quantity1

GoodsReceiptEntry

CharacteristicsPO Rcpt Value

$100.00PO Rcpt Qty

1

R/3

BW

PO DataTarget

Process Key001

CharacteristicsValue100.00

Quantity1

Process Key002

CharacteristicsValue100.00

Quantity1

PSAGeneric

Key Figures

Specific Key

Figures

Generic Key

Figures

Illustration

Characteristics

Ext

ract

ion

Ext

ract

ion

Pro

cess

Key

sP

roce

ss K

eys

Page 17: Multi Level Data

17

Process Key Update Rules

Process Key Tests

Specific KF 0ISSVS_VAL = Generic KF

0CPPVLC

Ext

ract

ion

Ext

ract

ion

Pro

cess

Key

sP

roce

ss K

eys

Page 18: Multi Level Data

18

DataSource Overview

Purchasing• Purchasing Schedule Line (2LIS_02_SCL)• MRO PO Data (Custom)

– Additional Fields Specific to MRO Only– Transparent Table Populated by ABAP

Material Movements & Stocks• Transfer: BW Stock (2LIS_40_S278)

– Initialize Stock Levels– LIS Structure S278– New DataSource As of PI 2002.2 (2LIS_03_BX)

• Goods Movements (2LIS_03_BF) -- Extend.– Additional Fields for All Uses

Ext

ract

ion

Ext

ract

ion

Dat

aSou

rces

Dat

aSou

rces

Page 19: Multi Level Data

19

Extending 2LIS_03_BF• Execute RMCSBWCC to Check for Possible Errors

– Normal Errors Include Data in Setup Tables or Delta Q

– Resolve Errors (Delete Setup Tables, Process Deltas)

• Enhance Extract Structure Via RSA6 or SE11 Append

– Add New ZZ Prefix Fields to the Append Structure

• Add User Exit to Populate New Fields Via RSA6 ‘Function Enhancement’ or CMOD

– Create Project (EG: ‘ZBW’)

– Enhancement Assignment RSAP0001

– Component EXIT_SAPLRSAP_001 (Transaction)

Ext

ract

ion

Ext

ract

ion

Dat

aSou

rces

Dat

aSou

rces

Page 20: Multi Level Data

20

Ext

ract

ion

Ext

ract

ion

Dat

aSou

rces

Dat

aSou

rces

User Exit INCLUDE ZXRSAU01

Data Fields Used in

INCLUDEs

INCLUDE for DataSource

2LIS_03_BF • This Must Be a CASE Structure

• The Exit Is Executed for Every DataSource

(See Notes For Code)

Page 21: Multi Level Data

21

Agenda ..."To the man who only has a hammer in

the toolkit, every problem looks like a nail.” - Abraham Maslow

3. Data Model• Corporate ODS Layer and Data Marts

• Purchasing Schedule Line• Material Movements and Stocks

Page 22: Multi Level Data

22

• One Inbound Layer– Corporate ODS Layer

• One ODS per DataSource

• Many Application Data Marts – Derived From the

Corporate ODS Layer

Strategy ...D

ata

Mod

elD

ata

Mod

elC

orpo

rate

OD

S L

ayer

& D

ata

Mar

tsC

orpo

rate

OD

S L

ayer

& D

ata

Mar

ts

Corporate ODS Layer

Data Marts

Page 23: Multi Level Data

23

What is the Corporate ODS Layer?Corporate ODS Layer• Layer Closest To Originating System • Cleansed, Validated & Transformed Business Facts• Rawest, Most Granular Form

Attributes• Historical Foundation• One DataSource : One Data Target• Isolated Special Business Knowledge• Always Archived With Longest Retention Period• Cleansing & Transformation In PSA & Update Rules• Comprehensive Data Storage• Atomic Level Of Detail In ODS Objects

Dat

a M

odel

Dat

a M

odel

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

Page 24: Multi Level Data

24

Corporate ODS Layer Benefits• Reusable Data

– Feeds Multiple Data Marts

• Data Consistency– Single Origin & Reduced Ambiguity

• Historical Foundation– Trusted Source Across Application Areas

• Improved Implementation Speed– No Extractor Analysis For New Data Marts

• Lower Implementation Cost– Shorter Implementation Time

• Reduced Impact On Source System– Data Initialized Once

Dat

a M

odel

Dat

a M

odel

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

What is the Corporate ODS Layer?

Page 25: Multi Level Data

25

What is a Data Mart?Data Mart• Application-Specific Business Facts• Subset Of Corporate ODS Layer• Used For Data Consolidation & User Reporting

Data Mart Attributes• Business-Specific View• May Be Multi-Level, Detailed or Summarized Data

In ODS Or InfoCube• Data For Reporting At Highest Level Only• Archive Retention Optional• Retention Period Determined By Process Users• Consolidate Information From Multiple

DataSources

Dat

a M

odel

Dat

a M

odel

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

Page 26: Multi Level Data

26

What is a Data Mart?

Data Mart Benefits• Improved Reporting Performance

– Reduced Data Volume

• Agility– Easier To Modify

• Flexibility– Departmental Interpretation Of Facts

• Scalability– As Much Or As Little Data As Needed

Dat

a M

odel

Dat

a M

odel

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

Page 27: Multi Level Data

27

The Multi-Level Data ModelM

ater

ial M

ovem

ents

& S

tock

s Purchasing S

chedule Line

Consolidation & Transformation

Reporting

Corporate ODS Layer

DataSources & PSA

Page 28: Multi Level Data

28

Multi-Level Model• ODS Key Design

– Corp. ODS Layer: Enables Transactional Uniqueness– Reporting: Determines Level Of Detail

• Merging Data From Multiple DataSources– Merge in Data Mart From Corporate ODS Layer

• Preservation Of Process Key– Corp. ODS Layer: Keep Process Key For Each Trans.– Consolidation: Keep Process Key After Merge– Reporting: Interpret Process Key At this Level

• ODS Facts– BEx Reporting Flag Only Set For Report Level– Automatic Activation Flag Is Not Set– Automatic Data Target Update Flag Is Not Set– Quality Flag Is Always Set– All ODS Updates Are Overwrite

Dat

a M

odel

Dat

a M

odel

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

Page 29: Multi Level Data

29

Filters & Start Routines

• Usually Filter Between Corporate ODS & Data Mart

• Custom Extractor Selection & Filter Criteria Identical

• Filters: Update Rule Start Routine• Executed Just Before Updates• Applies to Entire Data Package

(See Notes For Code)

Dat

a M

odel

Dat

a M

odel

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

Cor

pora

te O

DS

Lay

er &

Dat

a M

arts

Page 30: Multi Level Data

30

Purchasing

Consolidation &

Transformation

Reporting

Corporate ODS Layer

All Purchasing Schedule Line Transactions

MRO Custom Characteristics

MRO Combined Standard Purchasing Schedule Line Data +

Custom Characteristics

Report-Ready MRO Purchasing Transactions

With Interpreted Key Figures

Dat

a M

odel

Dat

a M

odel

Pur

chas

ing

Pur

chas

ing

Purchasing SCL

2LIS_02_SCL

MRO Custom

ZBWPMPO

Page 31: Multi Level Data

31

Purchasing Filters

3

4

1 2

Between ODS 1 & ODS 3

• Eliminate Non-MRO Trans

• Certain Doc. Categories & Types

Between ODS 3 & ODS 4

• Keep Purchase Order Entry Transactions (Process Keys 1, 4, 11, 14, 21, 24)

Dat

a M

odel

Dat

a M

odel

Pur

chas

ing

Pur

chas

ing

(See Notes For Code)

Page 32: Multi Level Data

32

Purchasing ODS Keys

3

4

1 2

Purchase Document Number

Item Number of Purchasing Document

Schedule Line Number

Process Key

Purchase Document Number

Item Number of Purchasing Document

Schedule Line Number

Dat

a M

odel

Dat

a M

odel

Pur

chas

ing

Pur

chas

ing

Page 33: Multi Level Data

33

Purchasing Special Routine

3

4

1 2

Assigning Real Process Key

• ODS 3 Activated w/ ODS 1 Transactions

• Get Process Key From ODS 3 Records w/ Same Doc/Item/Sched

• Append to Data Package

• Delete Original “999” Records from Data Package

Situation

• No Actual Process Key from Custom DataSource for ODS2.

• Dummy Process Key set to “999” in Transfer Rules.

Dat

a M

odel

Dat

a M

odel

Pur

chas

ing

Pur

chas

ing

(See Notes For Code)

Page 34: Multi Level Data

34

Material Movements & Stocks

Consolidation &

Transformation

Reporting

Corporate ODS Layer

Report-Ready MRO Material Movements

MRO Stock Levels & Movement Summary

MRO Material Movements In “Raw”

Format

All Material Movement Transactions

Stock Levels

2LIS_40_S278

Movements

2LIS_03_BF

Dat

a M

odel

Dat

a M

odel

Mov

emen

ts &

Sto

cks

Mov

emen

ts &

Sto

cks

Page 35: Multi Level Data

35

Movements & Stocks Filters

2

3

1

Before Loading Stocks

• Include Materials With Certain Material Group Codes

Between ODS 1 & ODS 2

• Eliminate by Material Group and Purchase OrganizationD

ata

Mod

elD

ata

Mod

elM

ovem

ents

& S

tock

sM

ovem

ents

& S

tock

s

(See Notes For Code)

Page 36: Multi Level Data

36

Movements ODS Keys

2

3

1

Keys For All ODSs

• Document Number

• Document Year

• Document Item

• Stock Type

Process Key Remains Unique With These Keys

Dat

a M

odel

Dat

a M

odel

Mov

emen

ts &

Sto

cks

Mov

emen

ts &

Sto

cks

See Note 417703

Page 37: Multi Level Data

37

Movements Special Routine

2

3

1

Reversal Movements Start Routine

• RECORDMODE Set to ‘X’ For Reversal Movements (102, 202, ...)

• ODS Service API Drops Rows If RECORDMODE=X (Before Image) & OVERWRITE … Reversals Do Not Make It To ODS

• MUST Use Process Keys To Correct

• Create Start Routine To Intercept Reversals and Clear RECORDMODE

• Consider reversing COUNT sign

• See OSS Note 352344

Dat

a M

odel

Dat

a M

odel

Mov

emen

ts &

Sto

cks

Mov

emen

ts &

Sto

cks

(See Notes For Code)

Page 38: Multi Level Data

38

Stocks & Non-Cumulative Key Figures

• Stock Levels Are Only Maintained in Cube

• Stock Levels Kept in Non-Cumulatives

What’s a Non-Cumulative Key Figure?• Cannot Be Accumulated Over Time

– Day1_Stock + Day2_Stock <> Stock for 2 Days

• Measured in Relationship to Period of Time – Time Reference: 0CALDAY

• Aggregation = SUM (Summation)• Exception Aggregation = LAS (Last Value)

Dat

a M

odel

Dat

a M

odel

Mov

emen

ts &

Sto

cks

Mov

emen

ts &

Sto

cks

Page 39: Multi Level Data

39

Non-Cumulative Key Figure ExampleD

ata

Mod

elD

ata

Mod

elM

ovem

ents

& S

tock

sM

ovem

ents

& S

tock

s

Page 40: Multi Level Data

40

Stocks & Non-Cumulative In/Outflow

• Inflow/Outflow Increase/Decrease NCum Value

• Inflow/Outflow Are Cumulative Values

• Inflow/Outflow Can Be Used In Queries

• Inflow = Material Movement Receipts

• Outflow = Material Movement Issues

Outflow

(Issues)

Inflow

(Receipts)

Non-Cumulative

(Stock)

Dat

a M

odel

Dat

a M

odel

Mov

emen

ts &

Sto

cks

Mov

emen

ts &

Sto

cks

Page 41: Multi Level Data

41

Movements & Stocks InfoCube

• Stock Levels AND Movements• Non-Cumulative Key Figures For

Stock Levels• Stock Level Initialized Once• Value, Qty & Count Key Figures For

Movement Types• Initialized With 1 Year Of Movement

History• Partitioning & Compression Very

Important

Dat

a M

odel

Dat

a M

odel

Mov

emen

ts &

Sto

cks

Mov

emen

ts &

Sto

cks

Page 42: Multi Level Data

42

InfoCube Update Rules & Key Figures

• Stock Level Key Figures– Inflow (Additions to Inventory)

• Quantity Received To Consignment Stock

• Quantity & Value Received to Valuated Stock

– Outflow (Subtractions from Inventory)• Quantity Issued from Consignment Stock

• Quantity & Value Issued From Valuated Stock

• Movements Key Figures– Movement Category Groupings

• Adjustments, Issues, Receipts, Transfers, Returns

– Key Figure Types• Value, Quantity, Count (Number of Movements)

Dat

a M

odel

Dat

a M

odel

Mov

emen

ts &

Sto

cks

Mov

emen

ts &

Sto

cks

(See Notes For Code)

Page 43: Multi Level Data

43

Movements & Stocks Initialization

• Work With R/3 DBAs

• Coordinate With R/3 Teams

• Stock Levels - Close of Business Day

• No Movements for Remainder of Day

• Several Hours - Plan Ahead

• 2LIS_03_BF Deltas After Activation

• Delta Queue Job Must Wait

• BW Deltas Must Wait

• Minimize Impacts (Queued Delta)

Dat

a M

odel

Dat

a M

odel

Mov

emen

ts &

Sto

cks

Mov

emen

ts &

Sto

cks

(See Notes For Details)

Page 44: Multi Level Data

44

Movements & Stocks Initialization

Tasks Performed in Advance • Determine Nbr of Movement InfoPackages

– 1 Million Max per InfoPackage– OMBT for Document Number Ranges

• Perform Full Dry Run– No Surprises– Sizing and Execution Times

• Use Events for InfoPackage Scheduling• Create Material Movement InfoPackages

– Manually Start 1st, Then Events– Initialize Delta, PSA Only– Select by Posting Date (Last Through 12/31/9999)

• Extract Old Material Movement History

Dat

a M

odel

Dat

a M

odel

Mov

emen

ts &

Sto

cks

Mov

emen

ts &

Sto

cks

(See Notes For Details)

Page 45: Multi Level Data

45

Movements & Stocks Initialization

Extract & Load Tasks (Implementation Day)• Extract Stock Levels At End Of Day (MCNB)• Extract Recent Material Movements (OLI1BW)• Load Stock Levels to PSA• Load Movements to PSA (Initialize)• Update InfoCube with Stock Levels from PSA

– Compress

• Update ODS1 with all PSA InfoPackages (Initial)– Activate After Each InfoPackage

• Update ODS2 from ODS 1 (Initial)• Update ODS3 & InfoCube from ODS2 (Initial)• Compress InfoCube -- No Marker Update

– Rolls Back Stock Level Updates From History

Dat

a M

odel

Dat

a M

odel

Mov

emen

ts &

Sto

cks

Mov

emen

ts &

Sto

cks

(See Notes For Details)

Page 46: Multi Level Data

46

Agenda ..."I have not failed. I've just found

10,000 ways that don't work.” - Thomas Edison

4. Custom Hierarchies• Why a Custom Hierarchy?

• The Solution• InfoRec Vendor Hierarchy

Page 47: Multi Level Data

47

Why a Custom Hierarchy?C

usto

m H

iera

rchi

esC

usto

m H

iera

rchi

esW

hy a

Cus

tom

Hie

rarc

hy?

Why

a C

usto

m H

iera

rchy

?

Situation• Material Activity by Supplying Vendor• Vendors Supply Many Materials• Any Material Supplied by Several Vendors

How Does BW Represent Many-To-Many?• Hierarchies

What If It Isn’t in Business Content?• Create a Custom Hierarchy!

Page 48: Multi Level Data

48

The SolutionC

usto

m H

iera

rchi

esC

usto

m H

iera

rchi

esT

he S

olut

ion

The

Sol

utio

n

• Create a Hierarchy of Vendor/Material• Use Level 1 (Vendor) as Query Filter• Create an R/3 ABAP to Extract the Data• Hierarchy Flat File Extract Layout

– Record Number;– Node Name; (Characteristic Name)– Node Value ; (Characteristic Key)– Blank;– Parent Node Record Number

Example:1;0HIER_NODE;VENDORS; ;0 (Required as 1st rec.)2;0VENDOR;123456 ; ;13;0MATERIAL;MRO12345 ; ;24;0MATERIAL;MRO67890 ; ;2

Page 49: Multi Level Data

49

InfoRec Vendor HierarchyC

usto

m H

iera

rchi

esC

usto

m H

iera

rchi

esIn

foR

ec V

endo

rIn

foR

ec V

endo

r

Construction Steps• Create ZMROMATL w/ Hier

• Create ZMROVEND

• Create & Activate Hierarchy

• Load Texts for ZMROMATL

• Load Texts for ZMROVEND

• Create an InfoSource for the Hierarchy

• Execute ABAP to Extract the InfoRec Relationship

• Load & Activate the Hierarchy

Approx. 70,000 Rows

Page 50: Multi Level Data

50

“Ideas are like rabbits. You get a couple, learn how to handle them, and pretty soon you have a dozen.”-- John Steinbeck

Closing Thoughts

Page 51: Multi Level Data

51

Key Topics

• Corporate ODS Layer + Data Marts

• Multi-Level ODS Model

• Process Keys

• Purchasing Schedule Line

• Material Movements & Stocks

• Non-Cumulative Key Figures

• Custom Hierarchies

Page 52: Multi Level Data

52

Resources & Specific DocumentsNote 079083 - Setup of Statistical Data

Note 352344 - Process Keys and Reversals

Note 417703 - 2LIS_03_BF and ODS Keys

Note 419490 - Non-cumulatives: Poor query performance

Note 492828 - Process Keys for 2LIS_03_BF

Note 586163 - Inventory Management in SAP BW (Composite)

Business Content 2.0b - Retail/CP - Extracting Logistics Data

Extracting MM (Purchasing) Transaction Data from BW 2.0B

How To…Handle Inventory Management Scenarios in BW

Non-cumulative Key Figures / Inventory Management

BW Operational Data Store

SAP BW Operational Data Store - Implementation Guidelines

Multi-Dimensional Modeling With BW - ASAP for BW

SAP Service Marketplace (http://service.sap.com/bw)

SAP Notes / OSS (http://service.sap.com/notes)

SAP Help Portal (http://help.sap.com/)

ASUG BI&A SIG (http://www.asug.com)

SAP Fan Club (http://www.sapfans.com)

Page 53: Multi Level Data

53

Time for some relevant

questions

Steelcase is a registered trademark of Steelcase, Inc.

Page 54: Multi Level Data

Thank you for attending!Please remember to complete and return your evaluation form following this session.

Session Code: 205