With ABAP release 7.55, a new type of CDS view has been released: the CDS view entity. CDS view entities are an improvement over the “classic” CDS DDIC-based views.
New migration tool available
Now, a new migration tool is available that automates many steps of a migration from a CDS DDIC-based view to a CDS view entity. But that’s not the only helper to facilitate a migration. The following support has been released:
This blog post first provides some general information about migration and then gives details on each helper tool.
View entities are by design incompatible with DDIC-based views. The advantages of CDS view entities can only be realized based on incompatible changes to the concepts and implementation of existing CDS views. The most prominent example is the deletion of the CDS-managed DDIC view, that means, the ABAP Dictionary SQL view that is attached to each DDIC-based view. This DDIC SQL view is deleted during a migration to a CDS view entity and all scenarios which rely on the DDIC SQL view no longer work. No automatic migration will take place. During migration, semantics of a view might change. Because of this, each developer needs to decide whether they want to migrate their views. Reverse migration To reverse-migrate from view entity back to DDIC-based view just open a support ticket on BC-DWB-DIC.
Program for migration analysis
Since ABAP On-Premise Release 7.55, an ABAP program is available that evaluates whether a migration from a CDS DDIC-based view to a CDS view entity is possible: RUTDDLS_MIGRATION_CANDIDATES You can select DDLS sources to be analyzed directly by name or indirectly by original system, person responsible, package, and so on. As a result, all DDLS sources specified are classified into one of the following categories (column Overall Status):
Moreover, details on the sources of the errors are provided. Currently, the following aspects are checked for each migration candidate:
Entity and DDLS name of the migration candidate must be identical. Otherwise, migration is not possible.
The decimal shift function DECIMAL_SHIFT cannot be used in a migration candidate, since it is not supported in CDS view entities. CDS view entities offer the following functions instead:
The data source of the migration candidate cannot be a DDIC external view, since DDIC external views are not allowed in CDS view entities.
Buffering annotations cannot be used, since they are not supported in CDS view entities.
Certain obsolete data types are not supported in CDS view entities. If the migration candidate uses one of the obsolete types, you need to change this before a migration is possible.
SELECT * is not supported in CDS view entities. You need to formulate an explicit element list instead.
The annotation @AbapCatalog.compiler.compareFilter is not supported in CDS view entities. In CDS view entities, this annotation is always implicitly set to true and this default can’t be changed. During a migration, you need to remove this annotation and this might result in a behavior change:
If the migration candidate uses this annotation with the value false and you remove it as part of your migration, then the value is implicitly set to true.
If the migration candidate doesn’t use this annotation at all, then the implicit default value is false and during a migration, the implicit default behavior is changed from false to true.
The annotation @ClientDependent is not supported in CDS view entities. Client handling is done automatically and implicitly in a CDS view entity by filtering the session variable $session.client. You need to remove the annotation @ClientDependent during a migration and this might result in a behavior change.
The syntax $EXTENSION.* is not supported in CDS view entities.
The DDIC SQL view of the migration candidate is used by other objects or ABAP programs. These dependent objects will no longer work after a migration.
If the migration candidate includes input help, the direct assignment is lost during a migration.
For more information on an error, including how to solve it, select an error category and click F1.
Manual migration support
Since ABAP 7.56, ABAP Platform 2021, manual migration from a CDS DDIC-based view to a CDS view entity is supported. To perform a manual migration, follow these steps: 1. Check whether a migration is possible using the migration analysis report RUTDDLS_MIGRATION_CANDIDATES. 2. Open the DDLS source in ADT and perform the following steps: i. Remove the header annotation sqlViewName.ii. Add the keyword ENTITY.iii. Perform additional changes if required. The migration analysis report and the syntax check provide feedback on the required adjustments. 3. Activate the view entity.
A migration tool is available since ABAP 7.56, ABAP Platform 2021: RUTDDLSV2MIGRATION The migration tool automatically performs many adjustments that are required for a migration and creates an inactive version of the migrated DDLS. It also includes many checks and in case of issues, indicates which lines of the migration candidate must be changed before a migration is possible. The last step of the migration – the final activation of the CDS view entity – must be done by the developer. When using the migration tool, follow these steps: 1. Start the ABAP program RUTDDLSV2MIGRATION.2. Select the DDLS sources to be migrated. Objects can be selected directly by name or indirectly by package, original system, person responsible, and so on.3. Choose the execution mode. We recommend that you first perform a migration in simulation mode and afterwards execute the actual generation of an inactive view entity.4. Choose Execute. The migration consists of four phases: i. Initial Consistencyii. Precheck Note: To see the embedded help, double-click on one of the prechecks.The same checks are performed as with the migration analysis report RUTDDLS_MIGRATION_CANDIDATES. See the explanation above. iii. Rule Processingiv. Post Check The tool provides an overview of the differences between the CDS view before the migration and the CDS view entity after the migration. It also gives feedback on each phase and indicates errors that must be solved manually (if applicable). 5. Activate the view entity. The following list explains the rules that are applied to a CDS view to turn it into a CDS view entity in chronological order: