A CDS view is a data definition that defines a data structure and a data selection from one or more data sources. A CDS view consists of several parts, but two of them are:
Extension: An extension is an optional clause that allows a CDS view to extend another CDS view by adding new elements, annotations, or associations. The extension clause has the syntax EXTEND VIEW view_name WITH view_name. The first view_name is the name of the CDS view that is being extended, and the second view_name is the name of the CDS view that is doing the extension1.
Field list: A field list is a mandatory clause that specifies the elements of the CDS view. The field list has the syntax SELECT FROM data_source { element_list }. The data_source is the name of the data source that the CDS view selects data from, and the element_list is a comma-separated list of elements that the CDS view exposes. The elements can be fields of the data source, expressions, associations, or annotations2.
The following example shows a CDS view that extends another CDS view and defines a field list:
@AbapCatalog.sqlViewName: ‘ZCDS_EXT’ define view Z_CDS_Extension extend view Z_CDS_Base with Z_CDS_Extension as select from ztable { // field list key ztable.id as ID, ztable.name as Name, ztable.age as Age, // extension @Semantics.currencyCode: true ztable.currency as Currency }
The other options are not parts of a CDS view, but rather related concepts:
Partitioning attributes: Partitioning attributes are attributes that are used to partition a table into smaller subsets of data. Partitioning attributes are defined in the ABAP Dictionary for transparent tables and can improve the performance and scalability of data access. Partitioning attributes are not part of the CDS view definition, but rather the underlying table definition3.
Semantic table attributes: Semantic table attributes are attributes that provide additional information about the meaning and usage of a table. Semantic table attributes are defined in the ABAP Dictionary for transparent tables and can be used to enhance the data modeling and consumption of the table. Semantic table attributes are not part of the CDS view definition, but rather the underlying table definition4.
References: 1: Extending CDS Views | SAP Help Portal 2: SELECT List - ABAP Keyword Documentation 3: Partitioning Attributes - ABAP Keyword Documentation 4: Semantic Table Attributes - ABAP Keyword Documentation