SAP CDS DATABASE VIEW



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS - CDS-managed DDIC Views
For ABAP_CDS_V1_VIEWS defined using the statement DEFINE VIEW without the addition ENTITY, a CDS-managed DDIC view is created alongside the CDS entity when the CDS view is activated. The CDS entity represents the actual CDS view. Properties, such as access controls defined in CDS, can be defined for the CDS entity only. The CDS-managed DDIC view is used as a technical foundation for ABAP_CDS_V1_VIEWS . It is a read-only DDIC database view in ABAP Dictionary.
The name CDS_DB_VIEW of the DDIC database view is defined in the definition of a ABAP_CDS_V1_VIEW with the CDS annotation @AbapCatalog.sqlViewName, and is located in the same namespace of all global types of an AS ABAP.
BEGIN_SECTION VERSION 5 OUT The ABAP Dictionary tool in ABAP Workbench ( SE11) is able to display a CDS-managed DDIC view but the view cannot be modified here.
END_SECTION VERSION 5 OUT When the CDS view is activated, the corresponding SQL view is created with the same name.
As a data type in ABAP Dictionary, the CDS-managed DDIC view represents like all DDIC database views a flat DDIC structure with the elements of the CDS view as components. The CDS-managed DDIC view of a client-dependent CDS view always has a client column, unlike the CDS entity.
In ABAP Dictionary, the CDS-managed DDIC view can be used like any DDIC structure, such as the type of a substructure, as an include structure, or as the row type of a table type.
The CDS-managed DDIC view should not, however, be used in ABAP.
BEGIN_SECTION VERSION 5 OUT It can be used wherever DDIC database tables or DDIC database views can also be specified using its name CDS_DB_VIEW, such as after the TYPE addition, in AB-SQL read statements and also in Native SQL, AMDP, or after the TABLES statement. But this is not recommended. More particularly, the use of the CDS-managed DDIC view in AB-SQL read statements is obsolete and forbidden in ABAP_STRICT_762 strict mode from ABAP_RELEASE ABAP_762 / . Instead, both ABAP and the CDS entity should be accessed, which covers all properties of the CDS view.
END_SECTION VERSION 5 OUT
In CDS DDL too, only the CDS entity should be accessed using its name ddic_based_view and not the CDS-managed DDIC view using the name CDS_DB_VIEW.
BEGIN_SECTION VERSION 5 OUT
The key of the CDS-managed DDIC view is determined implicitly, as in a DDIC database view in ABAP Dictionary. If the name of the CDS- managed DDIC view is used to access a CDS view in AB_SQL , this key is used for the syntax check or the extended program check.
END_SECTION VERSION 5 OUT



Latest notes:

Accessing a CDS-managed DDIC view is obsolete . Instead, the CDS entity should be accessed directly.
NON_V5_HINTS
Unlike the regular DDIC table views in ABAP Dictionary, the special CDS- managed DDIC views can also access views.
ABAP_HINT_END