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

No comments: