0% found this document useful (0 votes)
34 views18 pages

How To Create Delta Extraction Based ABAP CDS View... - SAP Community

delta extraction using CDS View

Uploaded by

smith kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views18 pages

How To Create Delta Extraction Based ABAP CDS View... - SAP Community

delta extraction using CDS View

Uploaded by

smith kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

8/1/24, 12:23 PM How to Create Delta Extraction Based ABAP CDS View...

- 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...

Technology Blogs by Members


Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP
products, technology, and events. Get in the mix!

Blog  What are you looking for today?

How to Create Delta Extraction Based ABAP CDS Views

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.

Alternative – 1: Delta extraction with delta queue and CDS annotation

Alternative – 2: Delta extraction without delta queue and CDS annotation

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.

maxDelayInSeconds means maximum possible time delay between UTC time


stamp and the database commit.

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.

Step 2: Create datasource via ODP - ABAP CDS Views connection.

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..

SAP Managed Tags:

BW (SAP Business Warehouse), BW Operational Data Provisioning (ODP)

Tags:

abap cds view extraction to sap bw s4 embedded analytics sap hana

11 Comments

donnie_burhan
Participant

‎10-31-2018 9:43 AM

 0 Kudos

Hi Altay,

Thank you for the new approach.

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.

Does your approach already cover this scenario?

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,

Thanks for sharing the useful information in detail.

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

Hi, Just to make sure I understand the way it works:

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.

Thanks & Regards.

AdemGuler
Participant

‎08-17-2023 3:04 PM

 0 Kudos

Hi Altay,

Thanks for sharing the useful information.

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

the Datasource is directly created with the Annotation

@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

 You must be a registered user to add a comment. If you've already registered,


sign in. Otherwise, register and sign in.

Comment

Labels In This Area


"automatische backups" 1 "regelmäßige sicherung" 1

"SAP VARIANT CONFIGURAITION 1 "TypeScript" "Development" "FeedBack" 1

505 Technology Updates​53 1

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 Extensibility 2 ABAP in Eclipse 3 ABAP Platform Trial 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

ABAP RESTful Application Programming Model 1 abap technical 1 abap to xml 1

abapGit 1 absl 2 access data from SAP Datasphere directly from Snowflake 1

Access data from SAP datasphere to Qliksense 1 Accrual 1 action 1

adapter modules 1 ADDING LEAN SERVICES 2 Addon 2

Adobe Document Services 1 ADS 1 ADS Config 1 ADS with ABAP 1

ADS with Java 1 ADT 3 Advance Shipping and Receiving 1

Advanced Event Mesh 4 Advanced formula 1 Advanced SAP Techniques 1

Advanced Scripting in SAC 1 Advanced Workflow 1 AEM 1 AI 11

AI Launchpad 2 AI Optimizer 1 AI Projects 1 AIML 11 AL11 1

Alert in Sap analytical cloud 1 alm 1 ALV 1 Amazon S3 1 AMDP 3

Analytic Models 1 Analytical Dataset 1 Analytical Model 1 Analytics 2

Analyze Workload Data 1 Android 1 annotations 1 anthropic 1 API 4

API and Integration 5 API Call 2 API security 1

APIODatas4 hana public cloudS4HANA Clouds4hana public cloudSAP S4HANA CLOUD… 1

App Dev and Automation 1 Application Architecture 1 Application Development 6

Application Development for SAP HANA 1

Application Development for SAP HANA Cloud 3

Applications and Business Processes (AP) 1 Architecture 2 Artificial Intelligence 3

Artificial Intelligence (AI) 8

Artificial Intelligence (AI) 1 Business Trends 363 Business Trends​8 Digital Transformation… 2

Artificial Intelligence (AI) blockchain Data & Analytics 2

Artificial Intelligence (AI) blockchain Data & Analytics Intelligent Enterprise 1

Artificial Intelligence (AI) blockchain Data & Analytics Intelligent Enterprise Oil Gas IoT… 1

Artificial Intelligence (AI) blockchain Data & Analytics Intelligent Enterprise sustainability… 2

Artificial Intelligence role in shaping the future of Energy Industry 1 AS Java 1

ASAPIO 2 ASE 1 ASR 2 ASSET MANAGEMENT 4 Associations in CDS Views 1

ASUG 1 Asynchrnous message 1 Attachment Handling. Create Attachment 1

Attachments 2 audit trail 1 Authentication 1

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

Webdynpro Application "Create Maintenance Notification" Enhancement to add


authorization chechs 
in Technology Blogs by Members yesterday

Harness the Power of Generative AI for Enterprise Automation! 


in Technology Blogs by SAP Tuesday

Extraction of CDS Views from s4hana system to Datasphere 


in Technology Q&A Tuesday

Embedded Analytics Architecture and Integration 


in Technology Blogs by Members Thursday

Popular Blog Posts

SAP PI for Beginners

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

 705862  153  385

ABAP 7.40 Quick Reference

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

Fiori: technical installation and configuration of one app from A - Z

mstitsel
Active Participant

 198868  133  300


Top Kudoed Authors Follow

dylan-drummond  8

Privacy Terms of Use


Matt_Fraser  5
Copyright Legal Disclosure

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

You might also like