(Glue-2311) Q: How do I replicate CDS Views? Can SNP Glue handle it?

Core Data Services (CDS) is a new data modeling infrastructure introduced by SAP to cover data modeling needs in SAP HANA.

SNP Glue supports the replication of multiple types of CDS Views.

The key is to understand, what type of CDS view we are trying to replicate and pick the correct approach.

 

CDS view as View

A typical example of this CDS view type is the MSEG or MKPF view in S/4 HANA. These tables no longer exist as tables when it comes to availability in DDIC. SAP is covering the demand for backward compatibility by introducing so-called compatibility views. These are available in DDIC and share the structure of original ECC tables. However, in the definition of this view in SE11, you would notice, that the result is returned from the MATDOC table with certain filters applied. Important annotation here is @AbapCatalog.sqlViewName. When replicating CDS views of this type, the procedure is the same as when replicating data from any other view that is available in DDIC. You can find the view in SE11 under the name of the @AbapCatalog.sqlViewName mentioned before. In this case, the fetcher type is the SAP table fetcher.

Delta capabilities for replication of such a view are limited to:

  • CDC trigger delta - based on another table

  • Any from the generic delta types (date, timestamp, value, distinct value)

Using SAP table fetcher:

  1. Create a Glue table using import fields From the table.

  2. Create SAP table Fetcher on top of view AbapCatalog.sqlViewName.

  3. Create Glue table Consumer for Glue table created in step 1.

  4. Create Extraction Process.

 

 

CDS view as Query

In this case, the CDS view is used as a Query. Specific of this type is, that it can contain input parameters (or variables). It can be run through Query monitor(t-code RSRT). In this case, using SNP Glue - BEx Query fetcher (BICS) will enable data replication from this type of CDS view.

Necessary basic annotations in this type of CDS view are:

@VDM.viewType: #CONSUMPTION

@Analytics.query: true

When consuming this query, you need to remember the naming convention used within ABAP - the same as in SNP Glue. The resulting name consists of the concatenation of 2C and the name of the CDS view available within annotation @AbapCatalog.sqlViewName. Simply: 2C<@AbapCatalog.sqlViewName>

In this case, use Bex Query Fetcher (BICS):

  1. Create Bex Query Fetcher (BICS) on top of the query 2C<@AbapCatalog.sqlViewName>.

  2. Create a Glue table using import fields from Bex Query (BICS) and using Navigational State from step 1.

  3. Create Glue table Consumer for glue table created in step 1.

  4. Create Extraction Process.

 

 

CDS view as Extractor - using ODP framework

For the extractor type of CDS views is possible to utilize the ODP framework to feed delta records automatically. SNP Glue offers the functionality of an ODP fetcher to consume such objects. Provisioning delta records is handled by the ODP framework and the logic behind deriving delta records depends on the definition within the CDS view (below are links from SAP about the delta capabilities of CDS views).

The following annotations make it possible to use the ODP framework for CDS view:

@Analytics.dataCategory

@Analytics.dataExtraction.enabled

Compatibility of ODP-enabled CDS can be verified by running a report RODPS_REPL_TEST in SE38, entering the CDS view name + respective data category, and executing a test data extract display.

The ODP Name equals the @AbapCatalog.sqlViewName and is suffixed by the data category classification @Analytics.dataCategory in the CDS view:

  • $P for master data attributes

  • $T for texts

  • $H for hierarchies

  • $F for facts/transaction data

  • $E for other/without data category

 

In this case, use the ODP fetcher:

  1. Create a Glue table using import fields from ODP selecting ABAP CDS as Context and <@AbapCatalog.sqlViewName>$<@Analytics.dataCategory> as object name, i.e.: ZCDS_SALES$F. This will also import ODP technical fields.

  2. Create ODP Fetcher for ODP queue <@AbapCatalog.sqlViewName>$<@Analytics.dataCategory>., i.e.: ZCDS_SALES$F.

  3. Create Glue table Consumer for Glue table created in step 1.

  4. Create Extraction Process.

 

 

Useful links on how it works:

https://blogs.sap.com/2019/12/13/cds-based-data-extraction-part-i-overview/

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

https://blogs.sap.com/2019/12/20/cds-based-data-extraction-part-iii-miscellaneous/