SAP Datasphere is the next generation of SAP Data Warehouse Cloud and delivers a unified experience for data integration, data cataloguing, semantic modelling, data warehousing, data federation, and data virtualization. Data Integration is an essential topic in a Business Data Fabric like SAP Datasphere and Replication Flow is the cornerstone to fuel SAP Datasphere with data, especially from SAP ABAP sources.
Based on the different data sources for a Replication Flow, you have different options for replicating the data in SAP Datasphere. If your source system is an SAP S/4HANA system offering the needed data by means of CDS views, directly connecting SAP Data Intelligence to this source system and using the respective CDS views is the best approach.
In this blog, we will try to delve into the details of CDS configuration to make it Delta Load compatible for a Replication Flow based extraction:
In Replication Flow settings, we have below load types available:
The ODP framework for CDS extraction provides two options for delta handling:
Starting with SAP S/4HANA Cloud 1905 and SAP S/4HANA 1909 FPS01 (on-premise) additional delta capability of Change Data Capture is available. This delta option captures changes to the application tables based on data base triggers and enables the ODP framework to just provision these newly created/changed/deleted records to the consumers.
CDS Annotations for enabling Replication into Datasphere
A. Annotation for Data Extraction
To make the data from an ABAP CDS view available in SAP Data Intelligence Cloud(Replication engine), you need to specify annotations for the view in the ABAP Development Tool.
To load data(initial only or initial with delta) from a custom CDS view, add the following annotation to the view:
B. Annotation for CDC in simple CDS view
As mentioned before, the Change Data Capture recording mechanism uses database triggers to record any changes to the tables that belong to an ABAP CDS view. To do this, the key fields of all underlying tables need to be mapped to the fields of the CDS view.
For simple CDS views such as CDS projection views, this can be done automatically by using the following annotation:
Let’s take an example of a standard view and see how it works :
CDS view : I_SUPPLIER
Although this CDS view seems complex, all data retrieval is through association(no joins used). The main table here is LFA1. Hence CDC(delta capture) only needs to track changes on LFA1, so the simple annotation is used for automatic CDC.
C. Annotation for CDC in complex CDS view
For more complex CDS views that use joins, instead of using CDC automatic annotation we do the table key mapping manually in CDS. You will be using the following annotation to do this:
What is table key mapping? During delta capture, SAP stores the delta entries in internal logging tables and the key fields of these logging tables will be decided based on the key fields of the main tables(joins) used in CDS.
Let’s take an example of a standard view and see how it works :
CDS view : I_WBSELEMENTDATA
Screenshot I :
Screenshot II :
As per Screenshot I, we have extraction enabled, CDC mapping. Let’s have a look at the CDS design in Screenshot II to understand the mapping.
Using this mapping mentioned in the annotation, Change Data Capture framework performs logging of the delta records.
Once CDS view is created, it can be used in Replication Flow to populate data in SAP Datasphere.
SAP Datasphere has a link with the prerequisite SAP notes https://help.sap.com/docs/SUPPORT_CONTENT/datasphere/4457678727.html?q=pre%20requisite
Hope you find this blog helpful! I will write a subsequent blog to elaborate the CDC logging in more details.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
14 | |
10 | |
7 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 |