Showing posts with label CDS. Show all posts
Showing posts with label CDS. Show all posts

Tuesday, December 31, 2024

SAP Change Data Capture (CDC)

Change Data Capture (CDC) allows identifying and capturing changes made to data within SAP application tables with the SAP system. Those data changes can be then in real-time replicated to other systems or processes. It's a way to keep data synchronized across different environments, enabling real-time analytics, data warehousing, and other data-driven initiatives.

There are different techniques for implementing CDC in SAP environments:

Log-Based CDC: This approach reads the transaction logs of the SAP database to identify changes. It's generally considered the most efficient method with minimal impact on the source system.

Trigger-Based CDC: This method uses database triggers to capture changes as they occur. Triggers are database objects that automatically execute a predefined action in response to a specific event (e.g., an insert, update, or delete operation).

Table-Based CDC: This technique involves comparing snapshots of tables at different points in time to identify changes. It's less efficient than log-based or trigger-based methods but can be used in situations where those options are not available.

SAP has several tools and technologies that leveraging CDC, including:

SAP Data Services: A data integration and data quality platform that includes CDC capabilities.

SAP Landscape Transformation (SLT) Replication Server: A tool for real-time data replication from SAP systems to SAP HANA.

There are many 3rd party tools that uses SAP CDC as well.


Now when it comes to extracting the data via CDS (Core Data Services) aka ABAP CDS views the trigger-based CDC is used as well. Specific annotation for the CDS view needs to be specified in ABAP Development Tool (ADT Tool). The annotations allow the CDS view to use a trigger-based CDC recording mechanism to load data and record changes to the tables that belong to the view.

PS: Do not confuse SAP CDC (Change Data Capture) with other SAP products like SAP Customer Data Cloud.

Mor information:

Online documentation


Sunday, June 5, 2022

CDS views related to Analytics (BI)

A CDS (Core Data Services) concept is around for some time and it enables data models to be defined and consumed on the database server rather than the application server. The concept is important from many perspectives. It provides: semantic layer (for use cases like, analysis, operations, search etc.), a uniform data model for all transactional and analytical application areas, and brings an simplifications to the SQL database language, reducing technical complexity for the user. One of the use cases for the CDS is Analytics/Business Intelligence.

Before I dig into the Analytics related CDS view let’s define few more terms related to this area. CDS Annotations describe semantics related to the business data. The annotation enriches a definition of a model element in the CDS with metadata. It can be specified for specific scopes of a CDS objects, namely specific places in a piece of CDS source code.

The CDS annotation can be ABAP specific (means consumed by ABAP runtime) or Framework specifics ones. Particular frameworks ca be Service Adaptation Definition Language (SADL), Business Object Processing Framework (BOPF), Analytics, or Enterprise Search.

 

Let’s focus on Analytics CDS annotations now. Here we recognize two of them:

 

1 Analytics Annotations - Enable the Analytic Manager for multidimensional data consumption, performing data aggregation, and slicing and dicing data. BI front ends like Design Studio and Analysis Office can consume the data via the Analytic Manager.

2 AnalyticsDetails Annotations - Enable application developers to specify the default multidimensional layout of the query, the sequence of variables in UI consumption, and the specific aggregation and planning behavior of the data. All these annotations can only be used in views with @Analytics.query: true. Such identified CDS views are called CDS Query.

 

 

Based on Annotation Analytics.dataCategory we can distinguish between following data categories of the CDS views:

 

1. Fact View = CDS view annotated with @Analytics.dataCategory: #FACT

CDS entity is represented by fact table (center of star schema) of transactional data object. The fact table contains measures (key figures). Use case here is an replication thus this type of the CDS view should not be joined with master data views.

 

2. Cube View = CDS view annotated with @Analytics.dataCategory: #CUBE

What it is cube view? Used for reporting on BW’s InfoProviders like cubes or aDSOs. It is similar to #FACT but as reporting on only figures doesn’t bring any value such an data need to be joined with master data objects. Example.

 

3. CDS Dimension = CDS view annotated with @Analytics.dataCategory: #DIMENSION

Used for reporting in master data. No key figure fields can be defined as key fields. Only characteristic fields can be key fields. Example.

 

4. Aggregation level view = CDS view annotated with @Analytics.dataCategory: # AGGREGATIONLEVEL

Used in planning scenarios to provide write-back functionality.


Few more words about naming conventions related to CDS Views. There are three different technical names for the CDS view stored in table RSODPABAPCDSVIEW:

SQLVIEWNAME - Name of SQL View (ABAP Object), the sqlviewname is used in the ABAP dictionary can be seen in t-code SE11.

DDLNAME - Name of CDS View

STRUCTOBJNAME - Name of view defined in CDS View (Entity Name)



More information:

Core Data Services

CDS Annotations

Analytics Annotations

AnalyticsDetails Annotations

Cube View in CDS

InfoObject in CDS

CDS views: HowTo use in BW contexts

Monday, December 14, 2015

Core Data Services (CDS)

Within raising significance of SAP HANA there needed to be programming frameworks introduced to speed up accessing data in database to SAP applications. This is purpose of Core Data Services (CDS) which is an infrastructure for defining and consuming semantically rich and reusable data models. Modern SAP apps like SAP Business Suite or SAP S/4HANA are leveraging the CDS as it represents data layer for them. Framework around the CDS supports creation of reusable data models in database instead of the ABAP server. Similarly it supports consumption of these data models.

The data models are defined in ABAP programs as CDS views. By dealing with the CDS views the ABAP program has an access to the data in the data model. The view implements a semantic data model in the ABAP Dictionary. It allows to define entity types (business objects like customer, order, ...) and semantic relationships between these objects. The relationships correspond to foreign key relationships in traditional entity relationship (ER) models. Technically the CDS uses SQL-based DDL language to literally describe the relations. Moreover there are additions to DDL e.g. associations, which define the relationships between CDS views, and annotations, which direct the domain-specific use of CDS artifacts. By having described the semantics by the annotations we can use data and data types in different contexts (e.g. UI, analytics, searching).

The CDS was introduced within SPS 05 for SAP NetWeaver 7.4. In NetWeaver 7.5 there are more than 6k SAP standard view definitions that can be leveraged. This number of the CDSs keeps growing plus there more and more functionality being added in new SPS of NetWeaver 7.5.


More information