ABAP Keyword Documentation → ABAP - Dictionary → ABAP CDS in ABAP Dictionary → ABAP CDS - Data Definitions
ABAP CDS - Views
A CDS view is defined for existing database tables and any other views or CDS views in ABAP Dictionary using the statement DEFINE VIEW in the CDS DDL in ABAP Core Data Services (CDS). This is done in the DDL source code of a CDS data definition in the ABAP Development Tools (ADT). DCL source code in a CDS view can also be displayed in Repository Browser in ABAP Workbench. When the CDS data definition of a CDS view is activated, two ABAP Dictionary objects area created:
- The CDS entity
- In ABAP CDS, the CDS entity can be used as a data source of other CDS entities.
- In ABAP, the CDS entity can be used as a data type and in ABAP SQL read statements.
- The CDS entity cannot be used as a data type for definitions of classic dictionary objects in ABAP Dictionary.
- In ABAP Dictionary, the CDS database view can be used like any classic structure, such as the type of a substructure, as an include structure, or as the row type of a table type.
- The CDS database view should not, however, be used in ABAP. It can be used wherever database tables
or classic database views can also be specified (using its name CDS_DB_VIEW),
such as after the
TYPEaddition, in ABAP SQL read statements and also in Native SQL, AMDP, or after the
TABLESstatement (but this is not recommended). More particularly, the use of the CDS database view in ABAP SQL read statements is obsolete and forbidden in strict mode from Release 7.50. Instead, the CDS entity should be accessed in ABAP, which covers all attributes of the CDS view.
Both names, cds_entity and CDS_DB_VIEW, are in the namespace of the data types in ABAP Dictionary and of the global object types in the class library. The view is also known under both names within the CDS DDL of the ABAP CDS. Furthermore, only the CDS entity should be accessed in other CDS entities using its name cds_entity and not the CDS database view using the name CDS_DB_VIEW.
A CDS view has two types of keys:
- For CDS entities, KEY can be used to define key elements. This key is the semantic key of the CDS view.
- The key of the CDS database view is determined implicitly, as in a classic database view. This key is the technical key of the CDS view.
In ABAP SQL, the key used is determined according to whether the name of the CDS entity or the name of the CDS database view is used to access a CDS view.
The following sections describe client handling and table buffering for CDS views:
7.31 | 7.40 | 7.54
- The programming of CDS views using the DDL of the Core Data Services is one of the tasks included in the implementation of data models in ABAP Dictionary and is not usually the responsibility of regular ABAP application programmers. Once created, CDS views are used in ABAP programs using ABAP SQL read statements and must be stable enough to allow this.
- As well as the specific functions available for CDS views, such as the definition of CDS associations, the options for the regular SQL DDL of the CDS DDL are far more comprehensive than the form-based ABAP Dictionary tool in ABAP Workbench used to define classic views.
- For CDS views, CDS view enhancements are a separate way of making enhancements without making modifications.
ABAP CDS - Client Handling in CDS Views