Académique Documents
Professionnel Documents
Culture Documents
Summary
One of the nice things about Extractors is, they tell us what kind of delta is being produced. It might be a list of changed records with their
current values, it might be even the complete change information with the values before the change and after. Some contain deletes, other
sources cannot even be updated - only new records are added. Based on this information we want to build some useful dataflows.
SAP BW has built in methods to consume Extractors and apply the change information provided to the cubes. These methods depend on
the kind of delta the Extractor provides but also how the target structure is modeled.
Do you want to keep the latest version of the record only? Do you want to be able to see the entire history of the record?
Depending on the answer the logic how to use the delta and apply it to the target will be different entirely. In BW you have just little control
on how the data has to be applied which does simplify the task of loading the deltas greatly. When there is light, there is shadow.
After the initial load, a new sales order got created. The customer 1300 had ordered 20 stacks of lamps with material number L-80C.
The subsequent delta load at LOAD_DATE 13:14:08 did show that, one row was received with the correct sales order document number
VBELN.
Now the sales order got modified, it got moved from the default sales organization to another (and the sold to party is a different one as
well, but that is shown in another extractor).
The next delta run at LOAD_DATE 13:31:26 did present us with two rows, one saying that for the initial sales organization the row should
be deleted and a second for the same document but in a new organization.
and obviously we received one row with a delete flag (at 13:34:59).
We should delete all records with CHANGE_DATE = $G_SDATE prior to the dataflow start, this way rerunning the same delta again will
delete the previously loaded data for this delta and repopulate the same rows again. And in case of a failure, same thing will happen, we
will request the same $G_SDATE again and delete the partially loaded data before running the dataflow.
Dataflow for Extractor Delta Process Type ABR1
Summary
The method ABR1 is identical to ABR but it does not allow parallel processing, the order of the incoming data has to be retained.
The only example found is 2LIS_03_BF for the material movement data.
a new material movement document was created. For the purchase order 4500017118 from vendor AGENCY01 we received one piece
and did put it into storage location 0001, the material movement document 5000000000 got created.
The Extractor the returned this one new document as a single line with the corresponding information with the load date 13:15:20.
As no material movement can be changed later, another cancellation document got created for this movement.
A new document, the cancel document got added, a single row with the load date 13:28:56.
So as result for this vendor no item was received effectively. But the DI_OPERATION_TYPE cannot be used with this extractor, it would tell
for the cancel that the material movement document 5000000001 has to be deleted - but that is a brand new document.
The Extractor 0CO_OM_CCA_9 returns all cost center bookings on document level. As you cannot change or delete bookings, you can
only add new bookings correcting the initial one, the Extractor is of type ADD.
When a new booking got created, like this one with the document number 200152831 where we assigned costs from cost center 4230 to
cost center 4235, we will get the corresponding data.
This booking has actually two lines, one removing the costs on the old cost center, a second adding it to the new one.
And that is what we do exactly, we append the fact table with those two rows and we are done. For restart-ability reasons the bookings
$G_SDATE value will be stored in an additional column of the booking table so we can delete all rows with the requested extractor delta
prior to starting the dataflow in case the same delta is requested another time.
Warning
This particular extractor will return delta from the previous day only. This is a limitation of the Extractor itself, same thing happens in BW. So
after creating the booking, we had to wait until the next day to get the change information actually.
Dataflow for Extractor Delta Process Type ADDD
Summary
The Delta Type ADDD is an ADD delta but using the deltaqueue mechanism to store the changes. Dataflow is identical to the ADD method.
Again our system had just 2 Extractors of that kind, one is 0EC_PCA_1.
All we have to do is inserting the data into the target table, the extra column LOAD_DATE we set to $G_SDATE so we can delete records
in case a delta is to be reloaded a second time. Not sure what UPMOD is however. It is not the 0RECORDMODE column each Extractor
has.
Dataflow for Extractor Delta Process Type AIE
Summary
Extractors with delta type AIE produce an after image only, they show what the current status of the record is. As BW cubes need the
before and after image values, the DSO activation in BW is mandatory. With DataServices it depends on what you want. In the majority of
the cases you will use Table Comparison to overwrite any existing record with the new value.
For this example we use the Extractor 0FI_GL_6, one that returns the summary values per period, account and other important attributes.
During the initial load, the Extractor will aggregate all bookings as they exists of now and present you the current values. Here in this
example the Extractor said that for account 133000, period 2012/03, the credit balance (SHKZG=S) is zero.
Then a new booking was made with the amount 9999.- from the 133000 account to the 45020 account.
As result the Extractor returned a debit balance now for this account 133000 (account 45020 would show a different value as well).
The TableComparison has as input primary key columns all attributes: account, period, credit/debit indicator,... all columns except the
measures. For each input record it will try to find the matching target row, if it exists and is different, then an update row will be generated.
For brand new rows it will be flagged as insert.
The subsequent Key Generation Transform does generate new surrogate keys for the insert rows and the loader has all the information he
needs to insert or update the incoming rows in the target.
Warning
This particular extractor does not return the delta changes immediately, only the once made the day before.
Dataflow for Extractor Delta Process Type AIED
Summary
The AIED delta is the same as AIE except that deletions are sent as deletions, not updates to the amount of zero.
So the only difference to AIE is that we might get rows with ODQ_CHANGEMODE=U and ODQ_ENTITYCNTR=0. This row might not have
all columns being set other than the primary key columns.
When I checked all Extractors in the IDES system of this type I haven't found many, only 0FI_GL_10 and 0FI_GL_20. They return actual
and plan data, but only plan data can be deleted - I don't have any plan data.
Anyway, we will get a row marked as deleted for the given primary key, we don't care, we will compare it based on the primary key in the
Table Comparison transform and update it with zero values. Same dataflow as with the AIE case.
Only if a delete is truly wanted, then we split the Extractor data into a parallel path for the deletes.
Note: An enhancement request was filed so the Table Comparison transform does pass through rows marked as delete.
Dataflow for Extractor Delta Process Type AIM
Summary
The delta process type AIM is just like AIE one where we will get the current values only, so we have no information if the row is a new one
or a change to an existing one. The only difference to AIE is, this delta comes from the delta queue, but for us as end users we don't care.
Dealing with this kind of input is simple as well, we will ask DataServices to compare.
The Extractor used for this example is Accounts Payables, the one named 0FI_AP_3.
So the Extractor did return two lines, one per line item, here you can see the one for account 1000 loaded at 13:47:43.
Next the document got changed, the payment term is now ZB04, 2% discount for 10 days.
So we got the same document another time, load time was 13:57:41 with the new payment information in the three columns.
With that our dataflow is perfect, if we request the same delta again, we will compare the data with the already loaded once thanks to the
autocorrect flag. And the same is true if the previous run failed in the middle.
One Extractor of this kind is 0FI_GL_1, returning the aggregated General Ledger figures from the GLT0 table.
The first think to notice is when you import that Extractor, the Changed Data Capture item is grayed out. Of course it is, it does not support
delta!
What we do with this data is entirely up to us, we could truncate the target table and replace the old data with the new one. Very likely what
you want in this instance.
The amount of data is not that much, just 400'000 rows which took little bit more than 1.5 minutes. Note, the SAP server and DataServices
did run on a tiny VMWare image.
But we could also use TableComparison Transform to compare the data, including figuring out the deleted rows. And with an additional
History Preserving Transform we could even build the history of each booking, yesterday the account had a balance of 200 USD, today it is
300 USD, something like that. As said, standard mode of operation for any ETL tool.
Dataflow for Extractor Delta Process Type NEWD
Summary
Extractors of type NEWD only add new records. No delete, no update just inserts. Hence the dataflow is a simple Extractor to target
mapping.
The extractor for Invoice Contract Account data is an example, 0FC_INVDOC_00. You cannot delete the invoice, you cannot change an
invoice record. All you do is inserting a new one.
There is one interesting side effect however for this Extractor which is not that uncommon. When you execute the dataflow with this
Extractor you will get the error message "selection criterion BUDAT missing from data request".
So while for many Extractor the selection criteria is variable, this one forces you do pick an inventory booking date or a range. So you have
to specify that during import or rightclick the Extractor in the datastore tab of the object library and in its properties, add a condition on
BUDAT.
Delta type in BW Extractors
Each BW extractor have an delta type, it can be seen in the table ROOSOURCE. The delta type determines the datasource to have DSO
or InfoCube in the dataflow. There is an important table that maintain all the delta type.
This page will describe the content of RODELTAM table and the use of the specific delta type.
Attribute description
AIMD After-Images with Deletion Flag Via Delta Queue (e.g. BtB)
Delta management is the process of extracting only new or modified records into BI system which occured in
the source system.
0RECORDMODE :
If the datasource supports delta then the field ROCANCEL which is a part of datasource holds the changes from
r/3 side.
The field ROCANCEL assigns a data to the InfoObject 0RECORDMODE in the BI system.
After-Image ‘ ‘ :
It represents how the record look like after it has been changed.
Before-Image ‘x’ :
It represents how the record look like before it has been changed.It assigns the –ve sign of the original value.
New-Image ‘N’ :
The record provides a new image when a new record is created.
Add ‘A’ :
The record provides an additive image.Only the differences of the numeric values are available.
Delete ‘D’ :
This recordmode type signifies that the record must be deleted.
Reverse-image ‘R’ :
The record provides a reverse image.The content of this record equivalent to a before image.The only difference
occurs when updating a datastore object.
How do we identify whether the data source supports delta or not ?
Goto RSA6 or SBIW then find ur datasource and double click on it u will find the following screen.
We can find this in table ROOSOURCE(source system) or in the table RSOLTPSOURCE(data sources in bi 3.x)
or in table RSDS (data sources in BI).
We can brought the data from sap r/3 to sap bi by using one of the following delta processes.
ABR – After before and reverse image.
What is ABR ?
Once a new entry is posted or existing record is modified then after image shows the status of the after
image,before image shows status before the change with the negative sign and reverse image shows the status
–ve sign next to the record while indicating for deletion.
1. Addition.
2. Overwrite.
Yes.
What is AIE/AIM ?
Once a new entry is posted or an existing posting is changed at R/3 side, an after image shows the status after
the change.
Overwrite Only.
What is ADD ?
Once a new entry is posted or an existing posting is changed at R/3 side, an additive image shows the difference
between the numeric values.
What update type (for key figures) it supports?
Addition Only.