SAP – CDS vs Calculation Views

SAP – CDS vs Calculation Views

Introduction

A company wishing to define (or redefine) its business intelligence is faced with choices of technical architecture, software and data modelling.

The SAP world is no exception to the rule and its ecosystem offers different architectures depending on the needs, the version of the ERP, the objectives and the resources of the client company.

In the context of data access, one of the choices that will be made is to define by which means the data will be read.

Will the data be accessed only by reporting and dataviz software or also by applications developed by the company?

Virtual Data Models

SAP is providing its customers with an SAP HANA environment that contains an in-memory database and tools for modelling and querying the data stored in the ERP tables.

The SAP HANA database will enable virtual data models to be created to access data in real time. Thanks to its computing power, the virtual models perform read, transformation and projection operations without the use of an ETL or table construction.

With its S/4HANA version, SAP offers two main technologies for creating virtual models (or views) based directly on the HANA database, and thus guaranteeing real-time data acquisition:

  • HANA views (Calculation Views)
  • CDS views (Core Data Service)

Both types of views offer the same performance and can be used by classic data mining or BI tools (Power BI, SAP BO, Tableau, etc.).

However, the comparison of Calculation Views and CDS Views shows significant differences in terms of architecture, creation, maintenance and security.

In the rest of this article, we will detail the disparities between these two technologies, which ultimately meet the same need: accessing data in real time for BI analysis.

Calculation Views VS CDS Views

The architecture

The first difference lies in the architecture behind the two technologies.

On the one hand with Calculation Views, the views are objects belonging to the SAP HANA database layer and not to the application layer.

CDS Views on the other hand belong to the ERP application layer (ABAP layer).

Both methods are part of the “Code-To-Data” concept, which tends to move the calculations as much as possible to the database level and no longer to the application layer.

Whereas the classic approach is to perform data processing operations in the application layer (data-to-code), the HANA and CDS views use a so-called data-centric approach and thus have the ability to query the data and perform operations directly in the database (code-to-data).

Data centric - Rapidviews
Stay connected !

Subscribe to the Rapid Views Newsletter !

Stay up to date with our latest blog posts, upcoming webinars and news!

The developments

On the Calculation Views side, the views are developed in the SAP HANA Studio (or Eclipse) using the “SAP HANA Modeler” perspective in particular.

For SAP HANA Cloud we use Business Application Tools.

These tools have the advantage of being graphical.

The different operations (union, join, projections, aggregation, rank…) are represented by “nodes” linked to each other. Calculations Views can be of the “Dimension”, “Fact” or “Star Cube” type.

Calculations views - Rapidviews

A Calculations View can read master data tables, function tables or views, and its semantics can be fed directly from the SAP dictionary or from the semantics of the views that are its source.

CDS Views are built in “script” mode.

The main development tool for CDS Views is the ABAP Development Tools (ADT), which is an alternative to the old ABAP Workbench.

CDS Views use a data definition language (DDL) of the type “Define view … as select from …”. They have additional functionalities such as :

Associations: joins for star schema
Expressions: calculated fields
Annotations: Expressions allowing to define properties, behaviours, metadata, data access authorisations…

Transport

As the Calculation Views and CDS Views do not belong to the same layer, database for one and application for the other, the transport management is different.

CDS views are ABAP objects and must therefore respect the transport conditions of STMS, SE01 transactions, etc.

For Calculation Views, the transport of views is more flexible. One can use the SAP transactions provided for this purpose such as the SCTS_HTA transaction, or use the export and import functions of the HANA Studio (delivery unit or developer mode).

The latter method offers more flexibility in terms of transport since it is possible to bypass the SAP environment flow through which ABAP objects must be transported : DEV, then QUAL, then PROD, etc.

Security

Security management is also very different between Calculation Views and CDS Views.

Indeed, the CDS Views being an ABAP object, it is able to retrieve all security assigned to users in SAP (PFCG)

Using the annotation below, CDS Views will look up the user rights before the query is executed:

Access Control CDS Views

For Calculation Views it is necessary to deploy security using Analytic Privileges via the SAP HANA Studio.

Reporting

Calculations Views and CDS Views can be used with most of the reporting tools on the market (Power BI, Tableau, SAP BO, SAP Analytics Cloud, Analysis for Office).

However, the connectors are different:

For the Calculation Views we mainly use the ODBC driver provided by the SAP HANA Client.

For some tools it is sometimes necessary to use an http connection (Analysis for Office for example).

CDS views are mainly connected with an SAP BW connector. A Transient Provider is automatically created when a CDS View is activated.

It is also possible to use an OData service to connect the CDS to the report. This OData service is created using the SAP Gateway (TCode: /n/IWFND/GW_CLIENT).

The latter method offers the possibility to use CDSs for reporting on Fiori.

Conclusion

Calculations Views offer overall more flexibility in the deployment and maintenance of views. In addition, they are much more accessible due to the graphical tool available in HANA Studio which does not require any particular knowledge of SQL.

The CDS are views in script form and therefore require mastery of the development language. They are also less manageable due to the fact that they are built in the application layer, so they are constrained to respect certain conditions specific to ABAP objects (transport, evolutions, etc.).

CDS have the advantage of recovering SAP security and also of being a data source for SAP Embedded Analytics on Fiori, a platform from which it is not possible to connect Calculation Views.

Rapid Views Newsletter
Stay up to date with our latest blog posts, upcoming webinars and news !
Latest articles