Ansicht
Dokumentation

ABENCDS_ELEMENT_ANNOTATIONS_PV - CDS ELEMENT ANNOTATIONS PV

ABENCDS_ELEMENT_ANNOTATIONS_PV - CDS ELEMENT ANNOTATIONS PV

Vendor Master (General Section)   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

- element_annot, Transactional Query

... @annotation ...

Effect

Specifies an annotation annotation in the definition of an element of a projection list in a CDS projection view as element annotation. Element annotations must be specified before the element they belong to, and the character @ must be placed in front of the name annotation of the annotation.

For CDS projection views, there are strict checks that all element annotations used must be defined as a CDS object in a CDS annotation definition. Otherwise, a syntax error occurs.

All available element annotations are listed in topic element_annot.

Propagation of Element Annotations in CDS Projection Views

  • Projected elements and exposed associations from the projected entity inherit the element annotations from the projected entity. Any annotations defined in the projected CDS entity cds_entity at element level are passed to the CDS projection view projection_view. This means that the CDS projection view has the same annotation values as the projected entity. Only if an annotation is defined explicitly for the same element in the CDS projection view, the values are overwritten and only the new values are valid for the element in question. Framework-specific annotations can be used to give the element specific semantic attributes for other SAP frameworks.
If you use an annotation with an element reference ElementRef in the projected entity and the reference element is aliased in the projection entity, the reference is not drawn to the element in the projection view, due to the name change. In such a case, you have to redefine the annotation in the projection view and use the alias name of the element in the annotation value.
In an analytical projection view, the annotation Aggregation.default that defines an analytical measure is inherited from the underlying cube view and it cannot be overwritten.
  • If a field is not directly projected but used in an expression or built-in function, element annotations are not inherited.
If a field is used in the CAST PRESERVING TYPE expression, element annotations are inherited.

Example

The CDS projection view DEMO_SALES_PV_SO_I_LIST (see example above) is a projection of the CDS view DEMO_SALES_CDS_SO_I. Even though the projected entity uses a semantics annotation to connect the gross amount to the currency and the quantity field to the respective unit, the projection view repeats these annotations. This is required because of the alias name of the currency and unit fields.






General Data in Customer Master   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.

Length: 4952 Date: 20240511 Time: 183820     sap01-206 ( 62 ms )