SAP ABAP CDS views and SAP HANA CDS views are not the same, but they are similar. They are two different shapings of one concept. Both are based on the same specifications, but they pursue different aims.
SAP CDS Views
SAP CDS views are part of SAP’s new programming model. The new programming model’s core idea is to push the logic from the application server to the client-side and the database. And CDS views are part of pushing the logic to the database, plus to the client-side as well.
SAP calls pushing the logic from the application server to the database ‘code-to-data’ or ‘code-pushdown’ in the context of the new programming model. SAP CDS views execute the ‘code-to-data’ or ‘code-pushdown’.
CDS views push the logic to the database because they take most of the logic from an ABAP application and execute it on the database, instead of on the application server.
Furthermore, CDS views push the logic to the client-side, because CDS views are able to control SAP UI5 Smart Controls and SAP Fiori Elements by annotations through OData services that can be generated from a CDS view. Therefore, the logic goes to the client-side as well, because CDS views can delegate the logic of certain SAP UI5 controls.
CDS views are from a similar concept to ABAP dictionary views: they provide pre-defined SQL queries to one or more database tables. This allows for effectively and comfortably connecting to and accessing data.
However, an ABAP CDS view can do a lot more than an ABAP dictionary view. An ABAP dictionary view is actually just an ABAP structure. An ABAP CDS view generates an ABAP structure as well, but also much more. Overall, an ABAP CDS view generates or can generate an
- ABAP structure,
- database structure,
- Open SQL structure, and
- OData service.
Before CDS views, ABAP code mainly held the logic of an ABAP application and that logic was processed by an application server. Now large parts of the logic of an ABAP application can be outsourced from the ABAP code to CDS views and therefore from the application server to the database.
However, that is what ABAP CDS views and HANA CDS views have in common. Now, on to the differences between ABAP CDS views and HANA CDS views.
SAP ABAP CDS Views
SAP ABAP CDS views are defined at the level of the ABAP application server. The views are created and maintained in DDL (Data Definition Language) files, which reside in the ABAP application server. They are part of the Data Dictionary (SE11) and therefore, part of the ABAP transport system, life cycle management, etc.
The views use Open SQL. ABAP CDS views aim to support the development of ABAP applications. The type of database system is irrelevant – it does not have to be a HANA database. Therefore, the main focus of ABAP CDS views is to create views.
ABAP CDS views
- reside in the application server,
- work with any database,
- use Open SQL,
- aim at ABAP applications, and
- main focus to create views.
SAP HANA CDS Views
SAP HANA CDS views are defined at the HANA database level. The views are created and maintained in DDL files, which reside at the database level in the HANA XS (HANA Extended Application Services). The views use Native SQL.
HANA CDS views aim to support the development of the native SAP HANA applications. They use features that are specific to SAP HANA. Therefore, they can only be used with a HANA database. The main focus of HANA CDS views is to create models on the HANA database itself.
HANA CDS views
- reside in the HANA database (HANA XS/XSA),
- work only with a HANA database,
- use Native SQL,
- aim at native SAP HANA applications, and
- main focus to create models.
Compatibility Between SAP ABAP CDS Views and SAP HANA CDS Views
SAP ABAP CDS views and SAP HANA CDS views are two different CDS implementations. Their technical compatibility is not guaranteed, because
- They run on different platforms: ABAP CDS views reside in the ABAP application server (ECC, S/4), but HANA CDS views reside in the HANA database (HANA XS).
- They have different requirements: ABAP CDS views support the development of ABAP applications, but HANA CDS views support the development of native SAP HANA applications.
Therefore, ABAP CDS views and HANA CDS views have different functionalities and release cycles.
Differences between SAP ABAP CDS Views and SAP HANA CDS Views
|ABAP CDS Views||HANA CDS Views|
|Reside||Application server||HANA XS|
|Database||Any database||Only HANA|
|SQL||Open SQL||Native SQL|
|Aim||ABAP applications||Native HANA applications|
|Main focus||Create views||Create models|
See here for best practices for SAP ABAP CDS views.