This article was originally published in 2020. It has since been updated for 2025.
You may have heard of SAP ABAP CDS Views, or perhaps you are curious what modern development on the SAP S/4HANA system looks like? In this blog post, our experts explain what ABAP CDS views are, why SAP introduced them, how they can act as data providers for different kinds of applications, and features from the most recent 7.58 Release.
Have a question or need help with your SAP system? Get in touch!Â
Table of Contents
What are SAP ABAP CDS Views?
Built on SAP’s custom-developed programming language, ABAP CDS Views are an essential technology for modern application development on SAP systems and should not be overlooked. They provide enhancements in data modelling and enable improved performance when combined with the SAP HANA database.
ABAP CDS Views allow developers to create semantically rich data models which the application services expose to UI clients. It is the central pillar of S/4HANA development and is used as the core technology in most of SAPâs programming models.
Whether it is ABAP Programming Model for SAP Fiori, ABAP RESTful Application Programming Model, Â SAP Cloud Application Programming Model or S/4HANA Embedded Analytics CDS Views is the main technology used for data querying and modelling.
Created using an enhanced version of openSQL syntax, ABAP CDS Views reside in the application server (data dictionary) but process the logic in the database.
While the data in SAP is still physically stored in transparent tables, CDS Views are an abstraction layer on top of the tables for data modelling purposes. They understand the relationship between database tables and hide the complexity from the ABAP programmer.
ABAP Dictionary Views vs. ABAP CDS Views
If you are familiar with ABAP Dictionary views, then you can think of CDS Views as a much more sophisticated version.
ABAP Dictionary views just link database tables, whereas CDS views bring many more features. Such features include calculations, aggregations, more variations of table joins, and they can also be stacked with each other. The comparison is illustrated by the diagram below:
Why ABAP CDS Views? - Classic vs Code Pushdown Approach
The classic SAP development approach has been to keep the unnecessary load away from the database. Developers would select the required data from a database and do further processing and manipulation on the application server. Coding would become complex (as the majority has been built for performance reasons) through indexes, adding no value to core business functions.
With the invention of the SAP HANA database and the consequent introduction of ABAP CDS Views, this approach has changed. The new programming paradigm is called âcode pushdownâ or âcode to dataâ. The rule-of-thumb is to âdo as much as possible in the database to get the best performanceâ.
And âas much as possibleâ means: all expensive calculations, aggregations and string operations should be done on the database level with only the resulting sets to be transferred to the application layer. SAP HANA database is optimised to complete such tasks. This leads to performance gains and reduced complex coding within the application. For comparison, huge amounts of data had to be transferred for processing with the classic approach. In some cases this could cause short dumps due to memory consumption limits.
SAP HANA is capable of aggregating on the fly. There is no need for pre-built aggregates and indexes since the data is organized using column stores. Also, in an S/4HANA system the data model has been simplified, by getting rid of tables necessary for aggregations and indexes.
The classic vs code pushdown (data centric approach) comparison can be represented by the following diagram:
Code Pushdown â Example
So, what does âcode pushdownâ really mean? In this example, we are using a CDS View below to explain:Â
Apart from regular fields selection from database table SBOOK this CDS view:
- Uses a cases statement, based on the value of CLASS field it will return a corresponding value: âEconomyâ, âBusinessâ, âFirstâ.
- Does a currency conversion from source currency to USD using a built-in function
- Calculates the difference between order date and flight date using a built-in function
Â
In the classic approach, all these calculations and conversions would have been done on the application server in ABAP. With CDS Views it is possible to do so on the database level.
Consumption of CDS Views
CDS Views can be consumed in many ways as a data source. Whether it is a well-known ALV report using ALV with Integrated Data Access (IDA) or a modern SAP Fiori application with the CDS view exposed using SAP Gateway in the oData format. You can also quickly build FIORI apps on top of CDS Views with SAP FIORI Elements templates. CDS Views also work very well with SAPâs analytical apps using analytics-related annotations and the analytical engine. Below is a simplified diagram of CDS Views consumption:
The Power of Annotations
As already mentioned, CDS views are created with openSQL, which can be enriched with annotations. These annotations fall into different categories: semantic (used for S4HANA Embedded Analytics), analytical (used by analytical tools like Bex, Lumira), UI annotations (used for FIORI applications). The UI annotations are an interesting case. By marking the CDS view with relevant annotations and the use of SAP FIORI Elements, we can generate a FIORI app without writing a single line of JavaScript code. The CDS View and the UI annotations drive the whole UI generation.
There are some drawbacks, however, e.g. only specific floorplans are supported, and it is not as flexible as a freestyle SAPUI5 app. On the other hand, it is a great tool to quickly generate reports with filter bars. This is demonstrated by the illustration below. On the left-hand side, you can see a CDS View with UI annotations, and on the right-hand side is the generated FIORI app.
- The search annotation enables a search dialogue
- Annotation responsible for adding the Sales Order ID field in the selection dialog (filter bar)
- Annotation which sets the position of the Sales Order ID field in the output table.
System Requirements
The runtime for CDS views is ABAP SAP NetWeaver stack. CDS Views are also database agnostic. This means that technically any SAP ERP system that runs on SAP NetWeaver 7.4 SP05 can make use of CDS Views. Having said that, this is not always recommended. The natural environment for CDS Views is SAP HANA Database. Therefore, even though you can (technically) use any database, you may run into performance issues if running complex SQL statements. That is because CDS views are primarily optimised and tested on the SAP HANA Database.
The CDS Views features you can use also depend on your SAP NetWeaver version. They were introduced in SAP NetWeaver ABAP 7.4 SP05, but the features were very limited in that release. The safest system version to start using CDS Views is SAP NetWeaver ABAP 7.5. Developing CDS Views on lower versions may cause issues regarding what can be technically achieved due to lack of necessary features.
Development Environment
It is not possible to create CDS views in SAP GUI. The recommended tool for this task is Eclipse IDE with the ABAP Development Tools (ADT) plugin. This is a platform for modern ABAP-related development. It is not limited to CDS views and can be used to develop objects such as ABAP programs, classes, function modules, etc.
ABAP CDS vs HANA CDS
CDS Views come in two flavours: ABAP CDS Views and HANA CDS Views. They share the exact specification, but their implementations differ. ABAP CDS’ initial focus is on view building and integration into the ABAP dictionary, whereas HANA CDS focuses on building models from scratch. HANA CDS is located on the SAP HANA DB and is used to develop native SAP HANA applications (SAP HANA XS), bypassing the ABAP application layer. If you are using a SAP ERP system, you should focus on ABAP CDS Views technology, which is located on the application server and fully integrated in the ABAP dictionary and the ABAP transport system, as its purpose is to support the implementation of ABAP applications.
ABAP Release 7.58 - What's New?
The current version of ABAP – 7.58, released in 2023 – introduces several enhancements to improve developer productivity and system performance. Key updates include:
ABAP SQL Enhancements: Introduced new syntax for specifying join cardinality, allowing for more precise control over data relationships. Additionally, ABAP SQL expressions can now be used on the right side of conditions, enhancing query flexibility
Internal Tables Optimisation: The compiler now performs deeper analysis of WHERE conditions, enabling better optimisation through key access, even when using operators like BETWEEN
CDS Access Control Improvements: Introduced a new type of access rule for CDS projection views and added new DCL functions, enhancing security and access management
Enhanced RETURN Statement: The RETURN statement now allows setting return values directly within functional methods, streamlining code and improving readability
These updates in ABAP 7.58 provide developers with more powerful tools for building efficient and secure applications.
To learn more about how the Absoft team can make your system safer and more secure, please reach out now!
Did you find this article useful? View more detailed articles and use cases on: