SAP CDS TRANSITIONS



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS - Changing the Type of a CDS Entity
A CDS entity can be changed into another type of CDS entity by replacing the source code. This can be done even after the respective CDS entity has been activated and transported.
Example: You have an active CDS view entity and want to change it into a CDS custom entity.
Steps: Replace the statement DEFINE VIEW ENTITY CDSEntityName AS SELECT FROM ... by DEFINE CUSTOM ENTITY EntityName.... Adapt the source code to comply with all rules for CDS custom entities. Activate the custom entity.
Result: The entity is changed from CDS view entity to CDS custom entity.
The following type changes are supported: FromTo
CDS view entity- CDS custom entity lbr - CDS abstract entity
CDS projection view - CDS custom entity lbr - CDS abstract entity
CDS hierarchy - CDS custom entity lbr - CDS abstract entity
CDS custom entity - CDS view entity lbr - CDS projection view lbr - CDS abstract entity lbr - CDS hierarchy lbr - CDS DDIC-based view (obsolete)
CDS abstract entity - CDS view entity lbr - CDS projection view lbr - CDS custom entity lbr - CDS hierarchy lbr - CDS DDIC-based view (obsolete)
CDS DDIC-based view (obsolete) - CDS view entity lbr - CDS projection view lbr - CDS custom entity lbr - CDS abstract entity
CDS view extension lbr (EXTEND VIEW ) CDS view entity extensions lbr (EXTEND VIEW ENTITY)
The documented ABAP program RUTDDLSV2MIGRATION supports the migration from ABAP_CDS_V1_VIEWS to CDS view entities.
The names of elements from the element list, associations, annotations, and clauses can be changed freely and without any restrictions, as long as consumers of the respective CDS entity are not affected.

ABAP_RESTRICTIONS
CDS table functions cannot be turned into any other entity type after activation.
Changing a CDS view into a non-SQL CDS entity is possible only if there are no consumers. The reason is that view building on CDS custom entities and CDS abstract entities is not supported. Example: A CDS view entity which serves as data source of another CDS view entity must not be changed into a CDS custom entity.
ABAP_RESTR_END



Latest notes:

Certain type changes are not supported, for example, a CDS view entity cannot be changed into a CDS hierarchy. As a workaround, the CDS view entity can first be changed into a CDS custom entity and as a second step, it can be changed into a CDS hierarchy.
NON_V5_HINTS
ABAP_HINT_END