CDS view entities are feature complete, Part lll: Differences
Since ABAP release 7.88, SAP BTP ABAP Environment 2205, CDS view entities are feature complete. In this blog series, you find a complete list of new features, improvements, and differences of CDS view entities compared to CDS DDIC-based views.
Part lll: Differences
Part lll: Differences
- Features and syntax not supported in CDS view entities
- Differences in header annotations
- New syntax requirements
1. Features and syntax not supported in CDS view entities
The following features and syntax elements are supported in CDS DDIC-based views, but not in CDS view entities:
- The built-in function DECIMAL_SHIFT is not supported in CDS view entities.
- Post element annotations, using the syntax @<anno, are not supported. Element annotations must be specified before the element in a CDS view entity.
Example: The following post annotation is valid in a CDS DDIC-based view, but not in a CDS view entity.
... element @<EndUserText.label: 'anno', next_element, ...
- The syntax $EXTENSION.* is not supported in CDS view entities.
- SELECT * to select all elements from a data source is not supported in CDS view entities.
- Name lists are not supported in CDS view entities.
- @Semantics.currencyCode and @Semantics.unitOfMeasure are not required and not supported in CDS view entities.
- Parameters can be accessed only via $parameters.pname in a CDS view entity. Using the syntax :pname to access a parameter is not supported.
- Domain fix values as literal prefix are not supported in CDS view entities.
2. Differences in header annotations
The following header annotations are supported in CDS DDIC-based views, but not in CDS view entities:
- @AbapCatalog.sqlViewName: CDS view entities do not have a DDIC view attached.
- @AbapCatalog.sqlViewAppendName: CDS view entities do not have a DDIC view attached.
- @Client.Dependent: Client handling is done automatically and implicitly in CDS view entities.
- @AbapCatalog.buffering.status: Entity buffering works via CDS tuning objects in CDS view entities.
- @AbapCatalog.buffering.type: Entity buffering works via CDS tuning objects in CDS view entities.
- @AbapCatalog.buffering.numberOfKeyFields: Entity buffering works via CDS tuning objects in CDS view entities.
- @AbapCatalog.compiler.compareFilter: In CDS view entities, the filter is implicitly and automatically compared.
- @AbapCatalog.dbHints: In CDS view entities, this annotation was replaced by the framework-specific annotation @Consumption.dbHints.
- @AbapCatalog.preserveKey: This annotation serves the definition of key fields of the CDS-managed DDIC view in CDS DDIC-based views. Since there is no CDS-managed DDIC view in CDS view entities, it is obsolete here.
3. New syntax requirements
The following syntax elements have been reworked or stricter checks have been introduced:
- Prefixing: if a CDS view entity selects data from more than one data source (by means of a join or an association), each single element in the SELECT list must have a source prefix. Otherwise, a syntax check error occurs. Each element must be uniquely identifiable to avoid later inconsistencies, for example in an extension scenario.
- Average function: The average function has the following syntax in a CDS view entity:
AVG( [DISTINCT] operand AS dtype )
In a CDS DDIC-based view, the addition AS dtype is optional. In a CDS view entity, it is mandatory.
- The DDLS name and the STOB name must be identical: In a CDS DDIC-based views, the name of the DDL source and the name after the DEFINE VIEW statement may be different. In a CDS view entity, they must be identical.
- In a CDS view entity, the annotation @Semantics.amount.currencyCode is mandatory for elements of data type CURR. The annotation @Semantics.quantity.unitOfMeasure is mandatory for elements of data type QUAN. In a CDS DDIC-based view, both annotations are optional.
- Alias names must be specified using AS. AS must not be left out.
- The annotation @Metadata.ignorePropagatedAnnotations: true is mandatory in union views.
- In a union view, the key elements of all SELECT lists must match. Otherwise, a syntax check error occurs.
- In a union view, element annotations are allowed only in the SELECT list of the first SELECT statement. In all subsequent branches, element annotations are forbidden.
ABAP Keyword Documentation: ABAP CDS – View Entities