How To Create Delta Extraction Based ABAP CDS View... - SAP Community
How To Create Delta Extraction Based ABAP CDS View... - SAP Community
- SAP Community
m
m
Products and Technology Groups Partners Topics Events What's New Get Star
u
ni
t
y
SAP Community Products and Technology Technology Technology Blogs by Members
How to Create Delta Extraction Based ABAP CDS View...
xarodoplu
Discoverer
10-31-2018 6:58 AM
19 Kudos 40,137
It has been a serious issue to use 2LIS* delta extractors for a long time in SAP BW. To fill
a setup table was a nightmare for many consultants. SAP provided 2 methods for delta
extraction via ABAP CDS. In this blog I’ll explain how to use these methods in sales data
extraction step-by-step in parallel. We have 2 alternatives to use delta functionality.
Step 1: Create CDS view like provided below. You’ll see annotations for delta extraction
in Alternative – 1.
To define which field will trigger delta, you need to use annotation
@analytics.dataExtraction.delta.byElement.name. LastChangedAt is the field which
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 1/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
triggers delta in our example. This element can either be a date (ABAP type DATS)
or a UTC time stamp.
detectDeletedRecords means that if a key combination does not occur in the view
anymore, this will automatically generate a delete image in the extracted data. In our
example, if a combination of sales document number and sales document item will be
deleted, this annotation will generate an empty data with zero values for the
combination. It’s necessary to check your BW release and patch level on SAP Note
2529167 before using this annotation.
After creating CDS view, create datasource via CDS connection. For Alternative-1, you
need to select After Images Deletion Flag via Delta Queue delta process. Since you have
already assigned a field for delta trigger, you don’t need to assign any field anymore. For
Alternative-2, you need to select Delta with After Images delta process and then you
need to choose delta trigger field on delta properties. There are date, time and
timestamp options here. We used timestamp for our example.
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 2/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Step 3: Create datapackages for both datasources. Firstly we create datapackage for
initilization.
Step 4: Change a sales order from VA02. We changed order quantity from 12 to 14.
Step 5: We enter SE16 t-code and see updated data on our CDS view, CDPOS and
CDHDR tables.
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 3/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Step 6: Run datapackage for delta extraction and see data on PSA for both alternatives.
Please pay attention to change mod field in Alternative – 1.
Step 7: Delete this sales order on VA02 and see log in CDPOS and CDHDR tables.
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 4/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Step 8: Run datapackage for delta extraction again. You will see that the deleted data
will arrive on PSA for Alternative – 1. However no data arrives for Alternative – 2. This
means that you can miss deleted record in Alternative – 2.
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 5/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Step 9: You can also view delta queue for Alternative – 1 on t-code ODQMON.
Optional: You can use a completely different logic to supply LastChangedAt field. As
provided below, CDPOS and CDHDR tables could be used or any other table date and
time fields could be used to catch delta. See how CDHDR table can be used to catch
change log. Because of the limitations in CDS views, we had to use table function to use
subselect in our example.
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 6/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Conclusion: ABAP CDS view provides a serious flexibility for delta extraction. The
methods provided in this document could be used instead of most of extractors.
Additionally, you don’t need to use setup table for LIS extractors. Just pull init, and run
delta. However, since inventory extractor has initial stock (e.g. 2lis_03_bx) and has BW-
specific fields like BWCOUNTER, a different approach is necessary for inventory data
loads.
Alternative – 2 method could only be used for tables that has no deletion issue, e.g.
sales billing tables VBRP and VBRK. It may be necessary to consult a module consultant
to find out change log fields before starting to use delta functionality of ABAP CDS view.
Any date and time field in any table can be used to trigger delta here. Even a change in
master data is required to trigger delta. In optional step, I tried to explain this flexibility.
It’s possible to create a real-time hybrid scenario with addition of Open ODS View to
models provided above.
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 7/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Thanks..
Tags:
11 Comments
donnie_burhan
Participant
10-31-2018 9:43 AM
0 Kudos
Hi Altay,
I remember that in the old methods, there is an issue on having delta pointer on Change
Date/Time field because Create Date/Time also needs to be monitored at the same time,
or we only getting changed records only, losing newly created records.
Or maybe we need to add additional field filled with formula calculating which field
having the oldest value (Create Date or Change Date)?
Also, how is the performance for using CDHDR and CDPOS table?
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 8/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Those are tables which could expand very quickly in size and make extraction process
suffer greatly.
Regards,
Donnie
xarodoplu
Discoverer
10-31-2018 2:30 PM
0 Kudos
Hi Donnie,
Yes, we get both newly created and changed records. Actually, I didn't have any chance
to do performance test for CDHDR and CDPOS tables with large volume of data. This is
just an example to show how to enhance your LastChangedAt field.
regards,
Altay
former_member267922
Participant
11-11-2018 4:45 AM
0 Kudos
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 9/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Hi xarodoplu
Thanks for preparing such a nice step by step approach with multiple alternative and
comparison. It was helpful and learning for me.
former_member187192
Participant
01-29-2019 4:03 PM
0 Kudos
Hi Altay,
Regards,
Mayank
renjithep
Explorer
10-13-2019 11:19 PM
0 Kudos
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 10/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Hello,
Could you please clarify the timezone of the timestamp filed that you used in the
example for Alternate 1.
Do you know if it is mandatory to have a timestamp field in UTC timezone for delta to
work ?
Regards
Renjith E P
ravikiran_sap
Explorer
01-29-2020 6:11 AM
0 Kudos
Great post and thanks. cds view have created in S/4 hana or BW side? am new to
bw4hana.
marco_sposa
Participant
02-25-2022 10:10 AM
0 Kudos
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 11/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Hello Altay is it possible to send the delta extraction by odata? is there any particular
extension in the url may be?
Thank you.
pierre-yves_guillou
Explorer
10-14-2022 4:43 PM
0 Kudos
You can use a table function to create a delta mechanism with a timestamp or date, right
?
Thanks
PY
yashjangwan
Explorer
02-21-2023 6:51 AM
0 Kudos
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 12/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Hi All,
I am facing issue in STEP 2 : Create datasource via ODP – ABAP CDS Views connection.
After creating a cds view with the annotations, how to proceed to next step ? is there any
tcode for this or any option in eclipse to create datasource.
AdemGuler
Participant
08-17-2023 3:04 PM
0 Kudos
Hi Altay,
Regards,
falkste
Participant
11-24-2023 7:32 AM
0 Kudos
Hello Yash,
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 13/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
@Analytics.dataExtraction.enabled: true
To Test your Datasource you have to call the report RODPS_REPL_TEST in SE38.
From the ODP Context Dropdown Menu within that report select ABAP_CDS ABAP Core
Data Services and then you can search for your Datasource within the ODP Name.
Simply look for your SQL View Name.
Regards
Stephan
Comment
A Comprehensive Guide to Using OLE Objects in SAP ABAP 1 ABAP 28 ABAP API 1
ABAP CDS VIEW 1 ABAP CDS Views 9 ABAP CDS Views - BW Extraction 3
ABAP CDS Views - CDC (Change Data Capture) 2 ABAP class 2 ABAP Cloud 4
ABAP DDIC CDS view 1 ABAP Development 7 ABAP Environment & RAP 1
ABAP Programming 3 ABAP Push Channels 1 ABAP RAP 1 ABAP RESTFul API 1
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 14/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
abapGit 1 absl 2 access data from SAP Datasphere directly from Snowflake 1
Artificial Intelligence (AI) 1 Business Trends 363 Business Trends8 Digital Transformation… 2
Artificial Intelligence (AI) blockchain Data & Analytics Intelligent Enterprise Oil Gas IoT… 1
Artificial Intelligence (AI) blockchain Data & Analytics Intelligent Enterprise sustainability… 2
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 15/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
Related Content
create app using standard CDS View
in Technology Q&A yesterday
former_member200339
Participant
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 16/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
jeffrey_towell2
Explorer
1122554 75 331
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 17/18
8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View... - SAP Community
mstitsel
Active Participant
dylan-drummond 8
ShaikAzmathulla 5
Trademark Support
Cookie Preferences
jgleichmann 4
https://community.sap.com/t5/technology-blogs-by-members/how-to-create-delta-extraction-based-abap-cds-views/ba-p/13353445 18/18