Describing the Role of a CDS Analytical Projection View

Objective

After completing this lesson, you will be able to describe the role of the CDS analytical projection view

CDS analytical projection view

A CDS Analytical Projection View is a type of ABAP CDS view that defines an analytical query. An analytical query expresses the business logic to prepare a focused data set that is consumed by an analytical application, such as SAP Analytics Cloud, to provide the business user with insight.

The position of the analytical query between the cube and the analytical apps

The analytical query is the connection between the basic data layer and the consumption layer. Without an analytical query between the basic data layer and the consumption layer, the business user would be overwhelmed with a large volume of unrefined data that had no meaning, and would be difficult to navigate.

CDS Analytical Projection Views are defined using text (code) as opposed to using graphical development tools. CDS Analytical Projection Views use a mixture of standard SQL-like language and additional ABAP language elements. CDS Analytical Projection Views are developed in the ABAP environment using the ABAP Development Tools (ADT) of Eclipse.

CDS Analytical Projection Views are supported by on-premise or cloud ABAP environments.

CDS Analytical Projection Views are typically used to generate a query result from one or more ABAP tables.

Although CDS Analytical Projection Views can be developed in any ABAP-based solution, one of the most popular use-cases is in SAP S/4HANA embedded analytics where CDS Analytical Projection Views play a key role as the top layer in the virtual data model (VDM) of SAP S/4HANA. With the virtual data model of SAP S/4HANA, SAP provides a large number of ready-made CDS Analytical Projection Views that are ready to be consumed by analytical applications. You can also create your own custom CDS Analytical Projection Views.

Note

CDS Analytical Projection Views are often referred to as analytical queries or query views.

A CDS Analytical Projection View always sits at the very top of the CDS view modeling stack and is always built on top of a cube CDS view. A CDS Analytical Projection View generates a multidimensional data set to a consuming application for presentation and further processing. A CDS Analytical Projection View is referred to as a consumption view and can be identified in the virtual data model of SAP S/4HANA with the prefix C_.

The diagram shows the position of the CDS Analytical Projection View, which is at the top of the modeling stack of the virtual data model of SAP S/4HANA. The analytical applications consume the CDS Analytical Projection View.

Let's review the journey of data from the tables to the analytical application.

Data originates in the ABAP tables and is consumed by a analytical data model. Between the tables and the analytical data model, there are often intermediate CDS views that add basic business semantics to the raw transactional and master data. For example, to assign a currency code to an basic amount field, or to assign a description column to an attribute. These intermediate views are not shown in the diagram above. We do not need to concern ourselves with these intermediate views and we should focus on the analytical data model.

Next, we see the CDS views that form part of the analytical data model known as the star schema. The basic components of the star schema are the cube view and multiple dimension views. The fact view is not part of the star schema but is used as a data source for the cube view.

Finally, we see the CDS analytical projection view that adds the OLAP features.

Note

Online Analytical Processing (OLAP) is an industry-standard approach to building analytical queries on multi-dimensional data.

Examples of OLAP features include:

  • multi-dimensional analysis (slice and dice)
  • sorting
  • subtotals
  • hierarchies
  • exception aggregations
  • currency and unit of measurement handling
  • formula calculations

CDS Analytical Projection Views are used to express all of these OLAP features and more, in an ABAP programming entity. The syntax of an CDS Analytical Projection View is similar to other types of CDS views, but adds the additional query-specific OLAP capabilities.

Here is a simple example of a CDS Analytical Projection View.

The diagram presents an example of a CDS Analytical Projection View highlighting the most important settings

Due to their code-based construction, the creation of CDS Analytical Projection Views is usually a task associated with a developer role and not a business user role. However, the business user plays a key role in defining the business logic implemented in the CDS Analytical Projection View. The business user must work with the developer to provide the business knowledge.

Technically, a CDS Analytical Projection View is a subcategory of a CDS Projection View. What defines a CDS Projection View as a CDS Analytical Projection View is the setting Provider Contract : analytical_query. There are other types of CDS Projection View that use different provider contract settings such as transactional_query which can be used for list reporting. In this course, we focus only on CDS Analytical Projection Views.

CDS Analytical Projection Views can only consume an underlying CDS view which has been defined as a cube. They cannot consume tables or other types of CDS view directly. No other CDS view can be built on top of a CDS Analytical Projection View.

CDS Analytical Projection Views cannot be queried directly using SQL because this type of view does not generate a persistent SQL database object. This means that CDS Analytical Projection Views provide added security to sensitive data compared to using other types of CDS view.

Note

In this lesson, you learned that a CDS Analytical Projection View defines an analytical query. But you can also define an analytical query using a simple, Fiori-based, graphical application called Custom Analytical Queries and Services. This Fiori app is delivered with SAP S/4HANA and is aimed at the business user and provides basic analytical query functionality. To access the full range of analytical query features and functions, you should create CDS Analytical Projection Views in ADT.

Enabling the Business User

This course begins by identifying the key components of the underlying data model that provides a data source to the analytical query. The course then covers the development of the analytical query. In the following diagram, these are the first two layers of the stack.

However, the course does not cover the business user enablement tasks. Also, the course does not cover the consumption of the analytical query using various business user tools. These areas are indicated in the upper four layers of the diagram.

the complete modeling stack is shown including the user enablement tasks

At the end of this course, you will be able to create analytical queries. You will also be able to explore the underlying data model. You will learn how to check the results of your analytical queries using the built-in Data Preview tool of the development environment.

To fully enable the business user, once you have created your analytical query, you must then define or configure the following:

  • Service Definition - here you group related analytical queries that are exposed to the business user.
  • Service Binding - once you have defined the service you must then bind it to the InA protocol (as opposed to OData or SQL).
  • IAM app, Business Catalog and Business Role - add your service binding to an IAM app, then add the IAM app to a business catalog and then add a business catalog to a business role and assign the business role to a business user.
  • Consuming app - connect to your chosen consuming app, for example SAP Analytics Cloud or a Fiori app such as SAP S/4HANA Review Booklets.

These tasks are covered in other SAP courses that deal with user administration and analytical query consumption.

Log in to track your progress & complete quizzes