CDC Delta Series – Part 1: Loading behavior

(Header vs. Joined Item)

Introduction

This blog series will contain detailed topics with CDC Delta within a CDS-View.

Part 1 will give you some information about the delta loading behavior between a header table versus an item table joined with the header table.

Scenario

CDS Views

To understand the loading behavior, it is important to understand the scenario behind the example.

Therefore 2 CDS views were created.

The first CDS View selects the table EKPO (Purchase Order Items)

As you can see here there is an analytic annotation with data extraction enabled is true. This means this CDS View can be extracted and consumed by SAP BW. The annotation changeDataCapture is set to automatic true which means the CDC is done automatically by the system. The select goes to the table EKPO and selects there the key fields (important for CDC automatic true) and some other fields.

Hint: The yellow message is that the CDC View is not C1 released. This can be done in the API state of the CDS View.

The second CDS view also selects the table EKPO (Purchase Order Items) including a left outer join to the table EKKO (Purchase Order Header).

SAP BW Data Flow

Here you can see the data flow of these two scenarios in BW.

The two DTP’s are loading the Data in Delta from the two defined Data Sources (based on the CDC view described above).

S/4 HANA

In the SAP S/4 HANA System we use the following purchase order.

As you can see here this purchase order contains 3 items. Item 10, 20, and 30. This is important for the test cases later.

Loading behavior – Test Case

First test case

In the first test case the quantity of the above purchase order is changed to 50 (from 48).

Having now a look at the ADSO which loads the data from the EKPO Table only. This means we consume the CDC view without the join. Following data records are loaded in the request.

As result we can see that 1 data record was loaded.

In the inbound table there is exactly the entry we changed above – Item 20 of the given purchase order.

Now let’s load the second ADSO which is loaded from EKPO table joined to the EKKO Table.

As result we can now see that 3 data records were loaded.

In the inbound table there are now three entries. The table contains all three items.

Second test case

The second test case is the same as test case one, but we just make 2 changes in the quantity of the purchase order before loading it to SAP BW. All changes are done on one item. We will change item 20 first to quantity 53 and afterwards to 58.

When we now look at the ADSO which loads the data from the EKPO Table only.

As result we can now see that 2 data record were in the data package.

In the inbound table there is still one entry we changed above – Item 20 of the given purchase order.

In the second scenario you will get some more details – what is in Data Package and a Screenshot from the Inbound Table – which are also valid for this case.

Now let’s load the second ADSO which is loaded from EKPO table joined to the EKKO Table.

As result we can now see that 6 data records were read but only 3 are updated. You see also in the temporary storage that the value changes from 50 to 53 and then to 58 for item 20. (The same would apply in EKPO only but only the changes on item 20 items would be visible).

In the inbound table there are still three entries and the quantity is set to 58.

Conclusion

In this blog the loading behavior in an CDC Delta between a Position and a Joined Position (to Header) is explained. When using different tables in one CDS View be aware that not only the changed record might be read from the Source System. This blog is the start of a mini blog series.