Skip to Content
Technical Articles
Author's profile photo Simon Kranig

CDS based data extraction – Part I Overview

Anyone interested in the state of the art extracting data in the SAP universe and beyond? This blog (series) is meant to provide a comprehensive overview of the topic, highlight the main features but also make sure you understand the meaning and implication of all available annotations related to the topic. I am aware of the fact that various documents/blogs have been published on the topic already, but for sake of completeness I will repeat parts here which you might already know.

I will update this blog series upon new developments, changes etc., so you will always get the latest news.

Quickly jump to

Part 2 (delta handling) here

Part 3 (misc topics like hierarchy extraction, testing and FAQ) here

Let’s get started…

While this blog post is focused on the Core Data Services (CDS) flavor based extraction from SAP S/4HANA Cloud Edition (CE) to SAP BW and SAP BW/4HANA please, be aware that the examples explained here are meant to be seen in a wider scope, finally provisioning all SAP solutions, may it be cloud or on-premise, with data warehouse grade extraction capabilities. This is happening in the context of the SAP Cloud Data Integration (CDI)

Possible Sources (aka Data providers):

  • SAP S/4HANA (CE/OP)
  • SAP Marketing Cloud
  • SAP Fieldglass
  • ….

Possible Targets (aka Data consumers):

  • SAP Analytics Cloud
  • SAP BW/4HANA, SAP BW
  • SAP Data Intelligence (fka SAP Data Hub)
  • SAP Datasphere

Here we go…

If you are familiar with an SAP S/4HANA system you surely will have come across CDS views as part of the Virtual Data Model (VDM), may it be in the context of operational analytics, (planning) transactions or other. To harnish the power of SAP HANA under the SAP S/4HANA, SAP has introduced CDS modeling and has spent a great deal of effort into creating CDS data models on top of all applications consistently reflecting and exposing all entities.

Why not use this as a base for data extraction, similarly to the way in which extractors have worked before?

Some time ago SAP has released CDS view annotations which enable you to use a CDS view as an extractor aka DataSource on BW side.
You can find them in the @Analytics section in the SAP help documentation. Starting with SAP S/4HANA CE1905, SAP has started rolling out extraction enabled standard CDS views and has been extending the coverage since.

In an SAP S/4HANA system CDS based extraction is handled by the Operational Data Provisioning (ODP) framework, the context is called ODP – ABAP CDS Views  (ODP_CDS). More info on ODP can be found in Rudolf Henneckes blog

On BW side your source system will need to be connected in context ABAP CDS Views (ODP_CDS).

Below you can see the architecture in detail

Extraction%20Architecture

Extraction Architecture

Availability

The enablement of ABAP CDS views for extraction has been available since SAP S/4HANA OP1808

Technically speaking this requires…
on provider side:

  • SAP S/4HANA (with integrated software component SAP BW 7.50 >= SP5)
  • SAP BW/4HANA 1.0 >= SP01 (loading from a “BW” to a “BW” sytem)
  • SAP BW 7.50 >= SP5 (loading from a “BW” to a “BW” sytem)

on consumer side (using the ODP Source System with Context ODP_CDS)

  • SAP BW > 7.3x
  • SAP BW/4HANA 1.0 >= SP00

You can find more info on the ODP availability in SAP note 2481315.

One last sidetracking before we start to get into the details:
“How can I find out, which CDS views are available for data extraction?” As I heard this question more than once and the answer had been well hidden in part III of this blog series, I will add it here as well.
Starting from SAP S/4HANA 2020 and SAP S/4HANA Cloud Edition you can use the CDS view I_DataExtractionEnabledView to identify CDS views available for data extraction.

Let’s dive into the details now.
A CDS view can be enabled for data extraction by just adding the following annotation
@Analytics.dataExtraction.enabled
or
@Analytics.dataExtraction.enabled : true
After adding this annotation, the CDS view is available for extraction by the ODP framework and visible for its data consumers.

System set up and Authorizations

Well one step back, it will not be visible by default for the data consumers. You first will have to have the proper authorizations in place for the communication arrangement / remote user.

SAP S/4HANA CE
In case of an SAP S/4HANA CE system, this comes out of the box when setting up the communication arrangement ( SAP_COM_0042) for the source system connection as described here -> Details -> Set-up instructions.

Please note: contrary to the SAP S/4HANA OP edition, in SAP S/4HANA CE you are (for now) only able to consume CDS views enabled for extraction by SAP and are not able to create custom CDS views enabled for extraction or extraction enable SAP delivered CDS views. In case you are missing a particular view that you need to have enabled for extraction, please make use of the SAP S/4HANA Cloud for CDS View Extraction Enablement campaign.

SAP S/4HANA OP
In case of an SAP S/4HANA OP system, please follow the instructions as described in SAP note 2716363 for your remote connection user (“ALEREMOTE” if you will). For the big picture concerning ODP authorizations, please have a look at note 2855052 as well. One side note regarding the authorizations for the remote connection user. The standard CDS views, enabled for extraction, that SAP delivers are bound to stability contract Contract for system-internal use (C1). You can find out more on the stability contracts for CDS views in the SAP help documentation here.

You need to make sure to set the authorizations for the connection user accordingly to only have these “C1 released”-CDS views displayed and be used as DataSources.

For customer created CDS views the authorizations need to be maintained in a similar way. It is highly recommended

  • to apply naming conventions for custom CDS views
  • to work with the API release state for these CDS views as described here

This way you will be able to only expose the CDS views to consumers that are meant for extraction.

SAP Data Intelligence (fka SAP Data Hub)
As depicted in the architecture above, leveraging SAP Data Intelligence as a consuming client is possible as well. For details please have a look at the detailed blog on this scenario by my colleague Phillip Parkinson: Part 1 on the setup and Part 2 on the CDS view consumption.

 

Classification of CDS views

Furthermore you are encouraged to classify your CDS view, i.e. are we talking about transactional data, attributes, texts, or hierarchies? This will also help the consuming applications to correctly use the view.

Either by

specifying a value for
@Analytics.dataCategory

  • #FACT for transaction data
  • #DIMENSION for master data attributes
  • #CUBE (only to be used in exceptional cases)

or specifiying a value for
@ObjectModel.dataCategory

  • #TEXT for text views
  • #HIERARCHY for hierarchy views

 

With these steps in place you have a first easy extraction enabled CDS view, in full mode.

In full mode, all available data is extracted in one data extraction run. For potentially smaller data volumes (~ < 1,000,000 data records) without any complex logic and load time considerations, a full extraction can cover the most straightforward cases.

Apart from the number of records, the breadth of the CDS view needs to be taken into consideration as well, as both factors will determine load volume and duration. Full extraction can mostly be applied for master data and text loads. For the update mode full extraction, no further annotations need to be assigned to the CDS view.

Please note that CDS views with (input) parameters only support full extraction.

After that you will be able to find this CDS view on SAP BW side, i.e. create a DataSource. Please note that you will need to search for the technical SQL view name (@AbapCatalog.sqlViewName) of the CDS view, not the CDS view name.

(Update October 2022): With the advent of CDS view entities some time ago already with all new shiny features, please be aware that CDS view entities do not need to carry the @AbapCatalog.sqlViewName anymore. Hence in case of a CDS view entity the name to search for will be the CDS view name itself. For classic CDS views it will be the @AbapCatalog.sqlViewName.

In case of the classic CDS view for Sales Organization, you will need to search for CSDSALESORGDX and not for C_SalesOrganizationDEX.

CDS View in source system:

 

Data Source view on SAP BW(/4HANA) side:

Right-click on your ODP_CDS source system in the SAP BW modeling tools. In case you do not see the New -> DataSource option please make sure you have the latest version of the BW Modeling tools installed .

 

Choose next

Choose option Proposal from Operational Data Provider

Search for the sqlViewName of your CDS view

Provide an application component and a Description. The DataSource Type is derived from the @Analytics.dataCategory/@ObjectModel.dataCategory defined in the CDS view.

Voilá, there is your DataSource.

Let me guess your next question: “What about delta handling?”  As you could already spot in the architecture overview, there is inbuilt delta handling support, namely:

  • Delta based on Date/Timestamp
  • Delta based on Change Data Capture (CDC)

To be able to cover all the details about delta handling in a digestible manner, I have put the delta topic into a separate blog post.

Assigned Tags

      32 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sumit Kumar Kundu
      Sumit Kumar Kundu

      Thanks Simon Kranig for this wonderful information. I have one doubt:

      In the availability section, it is mentioned

      “on provider side:

      • SAP BW 7.50 >= SP5
      • SAP BW/4HANA 1.0 >= SP01″

      So does the provider system also need to have BW or BW/4HANA stack?

      Regards,

      Sumit

      Author's profile photo Simon Kranig
      Simon Kranig
      Blog Post Author

      Hi Sumit,

      yes this is right, SAP BW (SAP_BW) as integrated software component of an SAP S/4HANA system as being the main use case.

      Or extracting from SAP BW and/or SAPBW/4HANA in case of a stand-alone "hub/data provider system".

      regards,

      Simon

      Author's profile photo Philipp Nell
      Philipp Nell

      Many thanks for the effort. CDS extraction is cool and consistent from a conceptual point of view. The fun starts with CDS based hierarchy extractors and the detection of deleted records. Looking forward to the next chapter. Kind regards.

      Author's profile photo Vineet Gupta
      Vineet Gupta

      Does this scenario apply for customers running Suite on HANA (ECC 6.0 EHP8, Netweaver 7.50) with BW 7.5 on HANA. I understand that there may not be any delivered CDS views, but can the customer use the technology for custom developed tables and CDS views.

       

      Author's profile photo Simon Kranig
      Simon Kranig
      Blog Post Author

      Hi Vineet,

      as far as I know the SAP_BW component as part of ECC 6.0 EHP8 would be high enough to allow for at least basic extraction, but no guarantees.

      best regards,

      Simon

      Author's profile photo Vineet Gupta
      Vineet Gupta

      Just wanted to confirm that we have successfully created ABAP CDS based extractors and subsequently data sources in BW on HANA based on these extractors in our landscape. We are able to create Open ODS views for real-time reporting as well as load data using the scenario described.

      Thanks

       

      Vineet

      Author's profile photo Simon Kranig
      Simon Kranig
      Blog Post Author

      Glad to hear that, thanks a lot for sharing Vineet.

      best regards,

      Simon

      Author's profile photo Lakshminarasimhan Narasimhamurthy
      Lakshminarasimhan Narasimhamurthy

      Thanks I tried the same and it worked in real time. 

      Author's profile photo Samin Payrosangari
      Samin Payrosangari

      Hi Simon,

      Thanks for the information. Is it possible to use CDS views to extract data from ERP systems?

      Best,

      Samin

      Author's profile photo Simon Kranig
      Simon Kranig
      Blog Post Author

      Hi Samin,

      please check my answet to Vineet above. would need to be ECC on HANA.

      best regards, Simon

      Author's profile photo Jens Schwendemann
      Jens Schwendemann

      Hi Simon,

      we are planning something similar with an Fiori Frontend Server Hub System as a data provider (NW 7.52 SAP_BASIS SP 9 / SAP_BW 7.52 9) but on AnyDB. Is HANA really necessary from a technical POV or is it just that real time capabilities will not fly due to not fitting performance of an AnyDB system?

      Many thanks and kind regards

      Jens

      Author's profile photo Jay sonchhatra
      Jay sonchhatra

      Hello Simon,

      It was a good content....But there is one scenario which i am facing currently.

      My Data flow...

      CDS view--> ODP-CDS Data source--> Open ODS view--> Composite provider--> BW query

       

      Now, User want to pass a characteristic value in to BW query variable and want to restrict data from CDS view(Source system side)...

      Is that possible through input parameter ..? because i am able to implement the data flow with input parameter till Open ODS view. but then...for composite provider its not working... and throwing error.

       

       

       

      Author's profile photo Isabelle Thore
      Isabelle Thore

      Hi Simon,

      How shall a customer enable custom CDS view to be available for extraction in Cloud. In the Custom CDS app, there is no way to set this up. Any idea?

      Best Regards

      Isabelle

      Author's profile photo Regys Mene
      Regys Mene

      Hi Simon,

       

      thank you very much for the detailed information. Perhaps it was not clear for me to understand from above, but is there a way to connect S/4HANA Cloud, SAP Marekting Cloud, SAP Service Cloud, SAP Sales Cloud to SAP BW on HANA 7.5, not BW4HANA?

       

      Thanks,

      Regys

      Author's profile photo Saroj Srivastava
      Saroj Srivastava

      Hello Simon,

      Thank you or such an informative blog.

      Can we send the data to third party cloud system via this CDS based data extraction , if so what are the Prerequisite for both system .

       

      Thanks in Advance.

       

      Author's profile photo Simon Kranig
      Simon Kranig
      Blog Post Author

      Hi Saroj,

      generally, yes you can (leveraging a tool that is able to consume the CDS views and able to write it into your target system). You can check the blogs by Philip which I have link in the blog above who basically shows the consumption part using SAP Data Intelligence.

      best regards,

      Simon

       

      Author's profile photo Biren Kalaria
      Biren Kalaria

      Hello Simon,

       

      Earlier in ECC extractors we used to write customer exit code for getting appended fields. with ABAP CDS View extractors, where and how to write those custom code and append structure code.

       

      Regards,

       

      Author's profile photo Simon Kranig
      Simon Kranig
      Blog Post Author

      Hi Biren,

      this follows the same logic as described in this blog.

      regards,

      Simon

      Author's profile photo Jaideep Adhvaryu
      Jaideep Adhvaryu

      Hi Simon,

      We are evaluating good data extraction from NW based ECC6 to SAP BW and non-SAP system. And looking at ODP and ABAP CDS.

      It seems ODP does NOT support non-SAP target systems. While I am not finding a clear statement if full featured ABAP CDS is also available in ECC6 on NW.

      Could you clarify on both ODP & ABAP CDS?

      Thanks!

      AJ

      Author's profile photo Abdullah S Shaffi Baig A K K1542
      Abdullah S Shaffi Baig A K K1542

      Hello Simon,
      Can you let me know how Ariba can be used as a Data provider?

      Regards,
      Abdullah

      Author's profile photo Henry Jones
      Henry Jones

      Hi Simon,

      Great information!

      I'm late to the game on this... Are source system is S4HANA 2021 FP0 and our target system is a separate BW7.5 (non-HANA!) system. Does this approach still work. Can you point me in another direction if necessary?

       

      Thanks

      Author's profile photo Simon Kranig
      Simon Kranig
      Blog Post Author

      Hi Henry,

      you can check this info in the section Availability in the blog (note 2481315).

      best regards,

      Simon

      Author's profile photo Henry Jones
      Henry Jones

      Thanks! I got it working thanks to your blog!!!! 🙂

      Author's profile photo Henry Jones
      Henry Jones

      Hi again. Can you offer any guidance on how to enhance the ODP?

      Author's profile photo Vivekanand Nyamagoud
      Vivekanand Nyamagoud

      Hi Simon,

      Its very good and informative blog.

      In case of direct data extraction, if data exceeds more than one billion, will it support data extraction?

      1.We need to add any logic in the CDS view to achieve huge data extraction ?

      2. Is there any provision to access data in batch wise in case of full data extraction?

      Thanks in advance,

      Best Regards,

      Vivek

      Author's profile photo Jyoti Senapati
      Jyoti Senapati

      Hi Simon,

       

      How to use CDS extractor for Delta loading from Source side. ?

       

      Regards,

      Jyoti

      Author's profile photo Christian Wittmann
      Christian Wittmann

      Maybe this is what you are looking for:

      https://blogs.sap.com/2019/12/16/cds-based-data-extraction-part-ii-delta-handling/

       

      Author's profile photo Christian Wittmann
      Christian Wittmann

      Hi Simon,

      Thanks for the great blog post!

      I have a quick question on the release contract: Does an extraction-enabled CDS-view require a release contract? (In the section "System set up and Authorizations" the link regarding release contracts is broken)

      Thanks and best regards

      Christian

      Author's profile photo Simon Kranig
      Simon Kranig
      Blog Post Author

      Hi Christian,

      thank for you for letting me know, I have adjusted the link. Regarding your question please have a look at the two notes mentioned in the section.

      best regards,

      Simon

      Author's profile photo Daniel Klein
      Daniel Klein

      Hi Simon,

      is it true that there has to be BOTH annotation @Analytics.dataExtraction.enabled AND @Analytics.dataCategory present in the CDS View?

      E.g. in view C_AccrEngineAccrAssgmtDEX only the first one is present, and I cannot see/replicate it from BW4 side.

      Thanks and Regards

      Daniel

      Author's profile photo mazlum dogan
      mazlum dogan

      Hi Simon,

      Thanks for the blog post!

      We tried to use the CDS based data extract with an access control on an authorization object (in our case F_BKPF_BUK - on company code). We respected all the recommendations for the code and user authorizations (including the recommendation note 3211519 - ODP CDS View extraction authorization information):

      SAP system S/4HANA 2020 (OP)

      When we test our extraction for the initial load or delta without Odata query filters the authorization control does not work (with a user being authorized for only 1 company code the results XML contains the values for all the company codes).

      Any idea why access control doesn't work ?

      Thanks

      Mazlum

       

      Author's profile photo Loed Despuig
      Loed Despuig

      Hi Simon Kranig

      What's the possible reason why the APPLICATION COMPONENT is grayed out?

      https://answers.sap.com/questions/13797037/move-datasource-to-another-application-component-i.html

      Would you also know how to move a datasource from NODESNOTCONNCETED to another application component?

      OR

      How can I create a custom application component?

      Thanks.

      Loed