Inner Join in DDL Source
Aliases for tables and fields
In the element list, addition AS defines an alternative element name. The alternative element name replaces the actual name of the element from the data source data_source. The view field is created under the alternative element name in the CDS database view. Accordingly, the alternative element name must comply with the rules for names of view fields of database views, as well as the general naming rules for names, which means that it must also meet the naming conventions for component names of structures in ABAP Dictionary and cannot be a reserved component name. The reserved names that cannot be used are maintained in the database table TRESE.
Key Definition
KEY is used to define the current element as a key element of the current CDS entity. Any elements of a SELECT list can be defined as key elements that are placed without gaps at the start of the list.
The key elements of the CDS entity are evaluated as follows if they are used as a data source of a SELECT statement in Open SQL:
By default, the key elements of the CDS entity are used to document the semantics of the data model. The additional KEY is then ignored when the CDS view is activated and when other accesses are performed in program executions.
The default setting can be overridden using the view annotation AbapCatalog.preserveKey:
If the value true is specified for this annotation, the key elements defined using KEY are also used as keys of the CDS database view.
If this annotation is not specified or specified with the value false, the key elements defined using KEY are ignored by the key of the CDS database view. Like in classic views, the key fields of the database view are derived implicitly from the key fields of the basis tables and the join conditions. If this is not possible, all fields of the database view are key fields.
Selections
Addition WHERE defines a condition for the results set of a CDS view. When the CDS view is accessed, the result set contains only the data from the data source data_source that meets the condition cond_expr specified after WHERE.