Ansicht
Dokumentation

ABENCDS_EXTEND_CUSTOM_ENTITY - CDS EXTEND CUSTOM ENTITY

ABENCDS_EXTEND_CUSTOM_ENTITY - CDS EXTEND CUSTOM ENTITY

ABAP Short Reference   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.
SAP E-Book

- EXTEND CUSTOM ENTITY


EXTEND CUSTOM ENTITY CustomEntity WITH
  { ElementListExtension }


Effect

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

As a prerequisite, the extended 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 a Custom Entity Extension

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

  • New associations _assoc1, _assoc2 can be defined in the CDS custom entity extension. The same rules apply that are described in topic DEFINE CUSTOM ENTITY, association.
  • New CDS compositions _compos1, _compos2 can be defined in the CDS custom entity extension 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 custom entity, not the extension itself. The same rules apply that are described in topic DEFINE CUSTOM ENTITY, Composition.
  • Each appended element must have a unique name.

  • CDS custom entity extensions themselves cannot be extended.
  • No addition ROOT can be specified in the statement EXTEND CUSTOM ENTITY to transform a regular entity to a root entity.
  • An appended element cannot be defined as a KEY element.
  • In a custom entity extension, header annotations are not supported. That means that no annotations are allowed in front of the statement EXTEND CUSTOM ENTITY.

Example

The CDS custom entity extension DEMO_CDS_EXTEND_CUSTOM

adds a new element and two new associations to the existing CDS custom entity.






BAL_S_LOG - Application Log: Log header data   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 5220 Date: 20240426 Time: 051713     sap01-206 ( 70 ms )