Ansicht
Dokumentation

ABENCDS_EXTEND_ABSTRACT_ENTITY - CDS EXTEND ABSTRACT ENTITY

ABENCDS_EXTEND_ABSTRACT_ENTITY - CDS EXTEND ABSTRACT ENTITY

General Material Data   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

- EXTEND ABSTRACT ENTITY


EXTEND ABSTRACT ENTITY cds_abstract_entity
       WITH
            { element_list_extension }


Effect

Extends an existing CDS abstract entity cds_abstract_entity using a CDS abstract entity extension in the CDS DDL. An existing CDS abstract entity can have one or more CDS abstract entity extensions.

As a prerequisite for the enhancement of the CDS abstract entity with the statement EXTEND ABSTRACT ENTITY, the base entity must allow extensions. Extensions are allowed per default or can be explicitly allowed with the annotation AbapCatalog.extensibility.extensible with the value true. If the value false is specified, extensions are not allowed.

Components of an Abstract Entity Extension

Abstract entity extensions can make additions to the original entity, but they can't modify, overwrite, or delete elements from the original entity. An abstract entity extension can specify only features that are possible within abstract entities, but with some limitations. The following can be specified in an abstract entity extension:

It is not allowed to define new CDS to-parent associations in an abstract entity extension. New CDS composition associations are allowed under the condition that the composition target is also defined as composition child and has the required to-parent association. The composition target is the extended abstract entity, not the extension itself.
  • Each appended element must have a unique name.

  • CDS abstract entity extensions themselves cannot be extended.
  • It is not possible to specify new input parameters in an abstract entity extension.
  • No addition ROOT can be specified in the statement EXTEND ABSTRACT ENTITY to transform a regular entity to a root entity.
  • An appended element cannot be defined as a KEY element.
  • In an abstract entity extension, header annotations are not supported. That means that no annotations are allowed in front of the statement EXTEND ABSTRACT ENTITY.

Example

The following CDS abstract entity extension

adds a new element and a new association to the existing CDS abstract entity.

The program DEMO_CDS_ABSTRACT_EXTEND evaluates the structure of the enhanced CDS abstract entity using RTTI methods.






Addresses (Business Address Services)   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 5419 Date: 20240329 Time: 165146     sap01-206 ( 69 ms )