Professional Documents
Culture Documents
SAP AG
Agenda
1. Definition 2. Creation 3. Loading and compression 4. Validity table 5. Query execution 6. Modeling guidelines 7. Information resources
Definition
Cumulative values are those key figures that are cumulated using all characteristics, thus also using time. Example: sales revenue, weight, etc.
Non-cumulative values are those key figures that are measured in relation to a period in time; that is to say they cannot be meaningfully cumulated over time. Non-cumulative values are summarized over time using so-called exception aggregation. Example: stock quantities/-values, number of employees, account balances, etc.
Agenda
1. Definition 2. Creation 3. Loading and compression 4. Validity table 5. Query execution 6. Modeling guidelines 7. Information resources
Creation
+/"Non-cumulative Non-cumulative key figure" key figure with = cumulative key associated single figure with excep. delta (cumulative) aggregation
The non-cumulative key figure is used in the definition of the InfoCube, but does NOT exist in the facttable. In the fact table only the delta or inflow/outflow key figures exist.
SAP AG 2004, Non-cumulatives / Stock Handling, 7
Creation
Special treatment for NCUM InfoCubes: time reference characteristic validity objects
SAP AG 2004, Non-cumulatives / Stock Handling, 9
A time reference characteristic is a time characteristic which determines the values of all other time characteristics
An NCUM InfoCube can contain several time characteristics, but there must be a time reference characteristic (checked during InfoCube activation) time reference characteristic can be determined using the following hierarchy: 0CALMONTH 0CALYEAR 0CALDAY 0CALWEEK
0FISCPER
0FISCYEAR
incomplete time characteristics like e.g. 0CALMONTH2, 0CALQUART1,... can be used but can not be time reference characteristic ("normal characteristics")
SAP AG 2004, Non-cumulatives / Stock Handling, 10
Update rules
Example: Stock key figure: 0BLOCKEDSTK (blocked stock) Assigned movement key figures: 0ISSBLOSTCK (Issued quantity blocked stock) = outflow 0RECBLOSTCK (Received quantity blocked stock) = inflow
InfoCube 0IC_C03
Stock key figures 0BLOCKEDSTK is not a InfoObject (field) on the InfoCube. During the creation of the opening balance the initial stock (0CPQUABU from 2LIS_03_BX) is updated into the inflow key figure (0RECBLOSTCK in 0IC_C03). So the stock key figure is never available in update rules!
Please note that the application examples in these slides are based on the R/3 Inventory Management use case! But all the technics are also deployable for other scenarios (accounts, headcounts, etc.).
SAP AG 2004, Non-cumulatives / Stock Handling, 11
Creation
Aggregates
It is possible to define aggregates on NCUM InfoCubes BW 2.x Aggregates must include all the time characteristics Expert-mode to define aggregates without the need to include all time characteristics. These aggregates are only used when cumulative key figures are read. NCUM Queries with several column-restrictions are not split into several sub-queries no optimal usage of aggregates Improvements in 3.0: BW 3.0 * Splitting of query into several sub-queries possible * Aggregates which aggregate over time can be used for LAST- and FIRST-key figures * Aggregates without reference time characteristic may be used for non-cumulative query
SAP AG 2004, Non-cumulatives / Stock Handling, 13
Creation
MultiCubes
NCUM InfoCubes can be used in a MultiCube Restrictions: the time-dimension of a MultiCube have to match exactly the time-dimension of every NCUM InfoCube which is part of the MultiCube all NCUM InfoCubes which belong to the same MultiCube have BW 2.x to have identical time-dimensions the time-dimension of normal InfoCubes have to contain at least the time-characteristics of the MultiCube
Aggregation over multicubes / validity objects is consistent Time-dimension of NCUM-InfoCubes can differ, but there must be one reference time characteristic for the MultiCube Example: C1 contains 0CALDAY, C2 contains 0CALWEEK and C3 contains 0CALMONTH as reference time characteristic. BW 3.x M1 = C1 + C2 + C3 is allowed but M2 = C2 + C3 is not allowed
SAP AG 2004, Non-cumulatives / Stock Handling, 15
Agenda
1. Definition 2. Creation 3. Loading and compression 4. Validity table 5. Query execution 6. Modeling guidelines 7. Information resources
Data/InfoSources InfoPackage Update rules Business Content Data/InfoSources Compression Upload scenario Reference point (marker)
Data/InfoSources
Two Data/InfoSources possible: Loading of initialization: Only ncum key figures (optional) Loading of deltas: Only cum key figures Remarks / Restrictions: Initialization is not necessary Initialization has to take place before loading of deltas For every key combination only one initialization is possible Loading of initialization via delta DataSource is possible
Data/InfoSources InfoPackage Update rules Business Content Data/InfoSources Compression Upload scenario Reference point (marker)
Data/InfoSources InfoPackage Update rules Business Content Data/InfoSources Compression Upload scenario Reference point (marker)
Update rules
Recommendation: Because of the necessity to derive all other time characteristics from the reference time characteristic, only the reference time characteristic should be filled via the InfoSource and all other time characteristics should be computed via automatic time conversion.
Data/InfoSources InfoPackage Update rules Business Content Data/InfoSources Compression Upload scenario Reference point (marker)
0MATERIAL
Material Master Data
0IC_MC01
MultiCube Slow Movers
Material Movements
2LIS_03_BF
Material Movements (as of BW 2.0B)
0IC_C03
Material Movements
0IC_MC02 0PP_C05
Plan/Actual Comparison Material Consumption MultiCube Days of Supply components
Revaluations
2LIS_03_UM
Revaluations (as of BW 2.0B)
0IC_MC03
BW 3.0
SAP AG 2004, Non-cumulatives / Stock Handling, 27
0PP_C02
Period-Specific Order/Material View
1. Consumer Products: 0CP_IC_C1 2. Retail: 0RT_C35-39 3. AFS: 0AFMM_C02 Old: InfoCubes 0IC_C01/02 and Data/InfoSource 2LIS_40_S278
Data/InfoSources InfoPackage Update rules Business Content Data/InfoSources Compression Upload scenario Reference point (marker)
Compression
Reference point (marker) Start point for all calculations - when building an inventory scenario the first reference point might be the opening balance. Technically, the reference point is the value per characteristic combination after having compressed your Info Cube. When compressing an InfoCube containing non-cumulatives, the reference point is (per default) updated.
Administrator Workbench
InfoProvider (InfoCube)
Manage
Data/InfoSources InfoPackage Update rules Business Content Data/InfoSources Compression Upload scenario Reference point (marker)
R/3 source system transaction MCNB Always currents stock No postings during this run
SAP AG 2004, Non-cumulatives / Stock Handling, 35
R/3 source system transactions OLI1BW (material movements) and OLIZBW (revaluations) By selections it has to be guaranteed that the values of the documents lie before the initialization run for the opening balance (if still no postings take place all documents can be selected).
BW system
SAP AG 2004, Non-cumulatives / Stock Handling, 38
Note: - For simplification without plant! - Initial stock will be updated into the receipt movement key figure!
This mode is only available if it is a stock InfoCube. A stock InfoCube has a validity table. This is created by the addition of a stock key figure in the InfoCube definition.
BW system
Inventory InfoCube
Manage
BW system
Validity table : 0REQID || -1 || 1234 || 1235 || InfoCube: Material RT 4711 1 1 4712 4711 4711 4712
BW system
Inventory InfoCube
Manage
R/3 source system LO cockpit (transaction LBWE) Prerequisite: successful initialization of DataSources 2LIS_03_BF and 2LIS_03_UM (check with transaction RSA7 after this new postings can take place)
SAP AG 2004, Non-cumulatives / Stock Handling, 44
BW system
BW system
Inventory InfoCube
Manage
Data/InfoSources InfoPackage Update rules Business Content Data/InfoSources Compression Upload scenario Reference point (marker)
Reference point 1
20 = 35 + 10 + 5 = 35 = 35 - 5 = 30
100
Oct
Nov
Dec
Jan
Feb
Mar
Time
Reference point 1
100
No marker update!
Oct
Nov
Dec
Jan
Feb
Mar
Time
Compressed requests
SAP AG 2004, Non-cumulatives / Stock Handling, 50
Reference point 2
130
Oct
Nov
Dec
Jan
Feb
Mar
Time
Compressed requests
SAP AG 2004, Non-cumulatives / Stock Handling, 51
Agenda
1. Definition 2. Creation 3. Loading and compression 4. Validity table 5. Query execution 6. Modeling guidelines 7. Information resources
Motivation
For normal key figures: the query result only contains entries which have been loaded into the InfoCube before. As the NCUM value of a key figure is computed by reading a reference point and then using a backward computation with the deltas, it is possible to compute a value for every point in time. Define an interval which limits the validity (by default the minimal and the maximal value of the time characteristic of all entries which have been loaded into the InfoCube) Sometimes a single interval is not sufficient (besides the most detailed time characteristic, additional characteristics for the InfoCube can be included in the validity table):
plan/actual indicator (the plan values are valid for the whole year, actual values are loaded monthly) = add the plan-actual sign to the validity table) plants, or branches which open resp. close at different points in time or plants, or branches which deliver their data at different points in time (the values for different plants are loaded at different times) = add characteristic plant to the table
Definition
Validity-Determining Characteristics: Characteristics that determine the temporal validity period of the non-cumulative in an InfoCube.
"initial stock"
"final stock"
Example IV:
plant A:70 [+10 plant B: plant C: SUM: SUM: +5 90 [ +10 80 [ +5 265 185 +10 +20 +5 +5 ] +30 ] +10 ] 350 350 100 150 100 (without validity) (with validity) infinite time
- time reference characteristic is mandatory (determined in the InfoObject definition of the stock key figure) - additionally besides the stock relevant characteristic 0MATERIAL an additional non-cumulative value parameter, like 0PLANT, can be defined (see example for the necessity one slide before)
SAP AG 2004, Non-cumulatives / Stock Handling, 55
/BI0/L0BWVC_C04
SID_0REQUID SID_0VC_NUMC11 SID_0CALDAY_F SID_0CALDAY_T MODEFROM MODEFROM
5 2 2 0 0 -1 -1 -1 -2 -2
3 3 1 2 1 1 2 3 2 3
F R
1.) Initial definition of the validity table during InfoCube definition 2.) If InfoCube is filled then adaptation of validity table (remove/addition of validity objects) possible with report RSDG_CUBE_VALT_MODIFY 3.) If validity table is wrong, then rebuild possible using the function module: RSDV_VALID_RECREATE I_REBUILD_FROM_FACT = space : recomputation of the values for request -1 by aggregation of all reporting relevant requests (only reading of validity table) = X : recomputation of all non-user (complete facttable must be read)
Example V:
Jan Plant A: Plant B: Plant C: +30 Feb Mar +20 +10 Apr +40 +20 +20 May +10 +30
With validity object (filter on Plant B): object: LAST Without validity object: LAST Plant A: 30 30 50 90 100 | 100 Plant B: [120][120] 130 150 [150] | 150 120 120 150 Plant C: [0] [0] [0] 20 50 | 50 0 0 0 -------------------------------------------SUM: 150 150 180 260 300 | 300
SAP AG 2004, Non-cumulatives / Stock Handling, 59
BW 3.0
Agenda
1. Definition 2. Creation 3. Loading and compression 4. Validity table 5. Query execution 6. Modeling guidelines 7. Information resources
tupel +
Requid > 0
tupel -
tupel
Algorithm to compute inventory value: last value = reference point + non compressed requests value in month x = last value - all months larger than x
Ref. point
Reference point 2
130
last value
Stock (End of Jan) = 130 + 10 10 10 = 120
Oct
Nov
Dec
Jan
Feb
Mar
Time
Compressed requests
- stock key figure (Assumption: expeptional aggregation "last value" in InfoObject definition) - is calculated by OLAP processor by inflow and outflow key figures (key figure is not stored physically on the InfoCube)
- Such a report is possible although there are only three data records stored in the InfoCube for Material 4711 (if you do not use this technology calculating stocks you would need to keep the stock on a daily basis in the InfoCube this would mean five data records here). - The time slice in the validity table determines the time range where stocks can be calucated (see chapter before how this validity table works).
Agenda
1. Definition 2. Creation 3. Loading and compression 4. Validity table 5. Query execution 6. Modeling guidelines 7. Information resources
Modelling Guidelines
Inflow 30 10 20 30 20
Query:
BW 3.0
Modelling Guidelines
InfoCubes
Compression
General rule: Creation of opening balance has to be compressed with marker update, movements that have lead to this stock have to be compressed with no marker update, new movements can be compressed, if they are compressed then mandatory with marker update. If this is not considered, query results get wrong (see example VIII). Combination of characteristics values in the historical movements have to match the combination of characteristics values in the opening balance. Otherwhise some stock markers are missing. Then stock values can not be caluclated (with this combination in query drill down). As requests with historical movements can only be compressed without stock marker update it is not possible to produce them automatically (see example IX).
SAP AG 2004, Non-cumulatives / Stock Handling, 74
PSA 2LIS_03_BF INIT -> compression with no marker update Date Quantity +/-
PSA 2LIS_03_BF Delta -> compression with marker update Date Quantity +/-
InfoCube Result after compression WRONG Date Quantity ISS Quantity REC 0 0 -100 RecordType 0 0 1
InfoCube Result after compression RIGHT Date Quantity ISS Quantity REC 0 0 0 RecordType 0 0 1
Issue 100 0 0
Receipt 0 0 0
The historical stock gets wrong by the amount of the historical movement !!! The error of all calculated stocks has the value of the wrong compressed historical movements (in this case 100) !!
SAP AG 2004, Non-cumulatives / Stock Handling, 77
As these request can only be compressed with no marker update, marker procuction incl. storage location is not possible!
Value +1000
Cannot be handled! Solution: make sure that the char. value combination of the movements fits to the stock init char. Value combination!
InfoCubes
Update rules
- calculate all other time characteristics automatically from the reference time characteristic
InfoCubes
Validity table
Use validity objects only if you really need them Do never use fine granular objects like e.g. material, customer, ... as validity object (No Termination!) Do never aggregate over validity objects
Example X:
Plant A: Plant B: SUM: [ 10 [ 30 ] 40 Jan.
SAP AG 2004, Non-cumulatives / Stock Handling, 84
50 ]
50 Feb.
InfoCubes
Data Model
If you want to look at reference points with transaction LISTCUBE , you have to include the technical characteristic 0RECORDTP into the list of fields for selection and you have to add a restriction of 0RECORDTP=1.
Sometimes it might be more feasible to use a snapshot scenario than the non-cumulative values approach. Please follow the guideline in the how to paper mentioned in the last chapter to decide on this.
No ODS support for non-cumulative values, only with a snapshot scenario ODS usage makes sense. If the amount of data is very huge think about a "logical" partitioning to spread data over several InfoCubes (but don't use time characteristics, this is not supported due to the stock marker logic). Use therefore ideally an additional non-cumulative value parameter of the validity table like 0PLANT.
Modelling Guidelines
Query definition
No difference between normal key figures and NCUM key figures If a query contains normal and NCUM key figures both parts are processed separately by the OLAP-processor but this is transparent for the user. virtual key figures (OLAP BADI) can only use key figures which have the same type (normal or NCUM)
Modelling Guidelines
Performance guidelines
All requests or at least most of the requests should be compressed. Use as few validity objects as possible. Use tight restrictions on the time characteristics. If possible do only request the actual value. If you have a drill down by time, key figures with First/Last aggregation can be processed more efficiently than key figures with AVG aggregation if possible use different queries for key figures with First/Last resp. AVG aggregation (separate First/Last/etc. key figures from other key figures into separate queries if semantically possible). Do not misuse validity objects for termination. Do not use partial times (like e.g. 0FISCPER3) if not needed. If not needed suppress the lines with the sum.
Agenda
1. Definition 2. Creation 3. Loading and compression 4. Validity table 5. Query execution 6. Modeling guidelines 7. Information resources
Validity table
Data Warehousing InfoCube Additional Functions in InfoCube Maintenance Non-Cumulative Value Parameter Maintenance Administrator Workbench Modeling
Compression
Data Warehousing Data Warehouse Management Managing InfoCubes Process Management Managing Data Targets Compressing InfoCubes
Aggregation
Data Warehousing Administrator Workbench Modeling InfoObject Creating InfoObjects: Key Figures Tab Page: Aggregation
SAP AG 2004, Non-cumulatives / Stock Handling, 92
CSN Note
586163 - Composite SAP Note on SAP R/3 inventory management in SAP BW
Central entry point, from there all relevant notes are mentioned!!!
How to paper
http://service.sap.com alias BW
in the right navigation area: SAP BW InfoIndex (N) Non-cumulatives How to Handle inventory management scenarios in SAP BW 3.x (pdf)
click: