Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Mayank Jaiswal
more by this author
BW (SAP Business Warehouse)
share 0
share 0
tweet
share 0
Follow
Although there are many documents present in SCN and other sites explaining the
importance of 0RECORDMODE infoobject but here I am taking it to different level of
understanding by considering a complete Scenario with respect to data flow as well as
Query:
1) Importance of 0RECORDMODE field with respect to DSO.
2) How the data flows from DSO to Cube using Change Log Table.
3) How to handle the Deleted records using 0RECORDMODE infoobject when the
data is coming from third Party or Generic Data Source created in SAP ECC or in
other SAP systems.
4) How to handle these deleted records at Query Level.
5) Comparison with the Standard Data Source.
1) Importance of 0RECORDMODE field with respect to DSO:
Here I am loading data from a flat file to DSO to understand what happens when the data
is loaded with modified records.
a) Data loaded from Generic Data Source to DSO: Generic Data Source is
created within BW file Source System and the data is loaded to DSO to store
the file data in BW. Customer Sales data is loaded.
b) File data is as follows:
d) Once we activate the data goes from New Table to Active and Change log Table as
shown below:
g) Once we activate the above data in DSO the records will be overwritten as we
have Customer, Sales Order and Order Item as key fields, so for same set of key it will
overwrite the existing values.
Fig 7 Active Data of DSO after modified records
h) Now we will see the Change Log Table data which is our main focus area.
N –> Stands for New Value i.e. any record which is first time loaded in DSO.
X –> Stands for Before Image of the record (for same key what was the earlier
value). Before Image will always result in negative value of the earlier record.
‘ ‘ –> Stands for After Image of a record (for same key the new modified value).
D –> Stands for Deleted Records (if the Recordmode value is D it will delete the
record for the same key)
R –> Stands for Reverse Image (if the RecordMode value is R it will delete the
record for the same key).
Here we can see that corresponding to Modified records C1 S1 10 there are two
entries in Change log table one with 0RecordMode X and other with 0RecordMode ‘ ‘
(space). This is how Delta records are handled within SAP BW.
As explained above RecordMode with X will give us Before Image with negative
value of the key figure for the records and RecordMode with ‘ ‘ will give After Image of the
record.
2) How the data flows from DSO to Cube using Change Log Table
a) Data goes from DSO to Cube: Since it’s a second delta load DTP will pick the
data from Change log table.
Here we can see that corresponding to four entries in Change log table we get
only two entries in cube i.e.
Customer Sales Item Quantity
Order
Existing C1 S1 10 50
Record
New Record C1 S1 10 40
Existing C3 S3 10 25
Record
New Record C3 S3 10 35
Hence when the data goes from Change log table of DSO to Cube it gets
the difference of the after image and before image records.
Active Table Data:
Customer Sales Item Quantity
Order
C1 S1 10 90
C3 S3 10 60
Fig 13 DSO entries showing modified records
This is how 0RECORDMODE plays important role when the data is loaded in
DSO and from DSO to Cube.
1) 3) How to handle the Deleted records using 0RECORDMODE infoobject
when the data is coming from third Party System or Generic Data Source created
in SAP ECC or in other SAP systems:
Ta a) Taking the case of Generic Data Source where a particular records get deleted,
in our case we have Deletion Indicator field which will hold values as ‘X’ or ‘D’.
b) We can change the default setting of Query in Query Designer as shown below:
Fig 22 Query Global Setting Suppress Zeroes for All Active Values.
NOTE: This setting will not show any record for which all the key figures have
zero values.
c) We can also compress the Cube with zero elimination to delete all the records
which have 0 value for all the key figures.
Fig 23 Fact table of Cube before compression.
We can see here that for same records there are multiple entries in the cube which
also slows down the query output
Once we compress the cube data moves from F table to E table since we have
compressed the cube with with zero elimination Dimension Table 1 doesn’t have the DIM
ID 7which is having 0 as key figure value.
Hence the record with Deletion Indicator as D is not present in Cube nor in DSO.
a) There is one field ROCANCEL (Extractor builds the logic to populate this field)
which usually contains values as ‘ ‘, X, R depending upon the Data Source behavior. This
field is mapped to 0RECORDMODE.
b) Data source supports different types of delta. You can check it in table
ROOSOURCE (also RODELTAM) table for the type of delta supported by the Data Sources.
Taking the case when the Data source is of type ABR (most commonly used LO
Data Sources are of type ABR):
Now based on the type of document ROCANCEL can have different values: