With ABAP release 7.55, a new type of CDS view is available: in official terminology, it's called CDS view entity. And it has come to replace the "classic" CDS DDIC-based views that have been around for years.
This blog post provides the following information:
A CDS DDIC-based view is defined using the statement DEFINE VIEW. This kind of CDS view was first released with release 7.40, SP05 and it was for many years the only available kind of CDS view.
Since release 7.55, CDS view entities are available. They are defined using the statement DEFINE VIEW ENTITY. They have evolved from CDS DDIC-based views, serve the same purpose and have the same structure as their predecessor. But they offer several advantages over the "classic" CDS DDIC-based views, such as the following:
CDS view entities are a new and improved version of CDS DDIC-based views. Although very similar, CDS view entities are easier to use, and offer many small improvements and enhanced features.
Here are some principal ways in which CDS view entities differ from CDS DDIC-based views:
Please note that the name of the annotation is a bit misleading. Of course, a view entity has an SQL view on the database, but now the intermediate DDIC view is not needed any more.
Additional features, such as typed literals to enhance type safety, and optimized buffer handling, are planned for future releases.
The following example compares a CDS DDIC-based view with a CDS view entity:
CDS DDIC-based view | CDS view entity |
@AbapCatalog.sqlViewName: 'DEMO_CDS_JOIN' @AbapCatalog.compiler.compareFilter: true @ClientHandling.algorithm: #SESSION_VARIABLE @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #NOT_ALLOWED define view demo_cds_scarr_spfli as select from spfli join scarr on scarr.carrid = spfli.carrid { key spfli.carrid as id, key scarr.carrname as carrier, key spfli.connid as flight, spfli.cityfrom as departure, spfli.cityto as destination } | . . . . @AccessControl.authorizationCheck: #NOT_ALLOWED define view entity demo_cds_scarr_spfli_2 as select from spfli join scarr on scarr.carrid = spfli.carrid { key spfli.carrid as id, key scarr.carrname as carrier, key spfli.connid as flight, spfli.cityfrom as departure, spfli.cityto as destination } |
Differences:
For a comprehensive description of CDS view entities, refer to ABAP Keyword Documentation (F1 Help in SAP GUI and ADT).
Since ABAP Release 7.56, ABAP Platform 2021, it is possible to migrate existing DDIC-based views to CDS view entities. Details are described in the following blog post: A new generation of CDS views: how to migrate your CDS views to CDS view entities. Migration is voluntary and can be done to benefit from the enhanced functionality of CDS view entities. "Classic" CDS DDIC-based views are supported, but not further developed. For new development scenarios, it is recommended to create only CDS view entities.
Info: SAP will continue to support classic CDS DDIC-based views. CDS DDIC-based views will not be retired, and customers will not be forced to use CDS view entities. SAP protects investments.
Update May 2022: Since ABAP release 7.88, CDS view entities are feature complete. An overview of all new features, improvements, and differences is provided in the blog series CDS view entities are feature complete. Overview of new features, improvements, and differences | SA....
Further information:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 |