ABAP Keyword Documentation → ABAP - Dictionary → ABAP CDS in ABAP Dictionary → ABAP CDS - Data Definitions → ABAP CDS - DDL for Data Definitions → ABAP CDS - DEFINE VIEW → ABAP CDS - SELECT
ABAP CDS - SELECT, select_list
Other versions:
7.31 | 7.40 | 7.54
Syntax
... element1,
element2, ...
| * ...
Effect
Defines an element of a CDS view. The elements can be specified as follows:
- * can be used to define all fields of the data source of the CDS view as elements and expose CDS associations of the current view. If another CDS view is used as a data source, the CDS associations exposed in its SELECT list are, however, not exposed by the current CDS view. The asterisk * cannot be specified if the current CDS view contains joins or union sets when the data source is specified.
The names of the elements of a CDS view must be unique. These are either
- The names of the elements taken from the data sources
- Alternative element names specified using AS
- The names specified in a name list
These names are also the names of the view fields of the CDS database view and the corresponding rules that must be kept.
Note
The maximum number of elements and the limit on the total of field lengths is determined by the corresponding limits for the associated CDS database view.
Example
The following CDS view sales_order is a view of the database table snwd_so. Three elements (so_id, currency_code, and gross_amount) are defined for this view.
define view sales_order as
select from snwd_so
{ key so_id,
@Semantics.currencyCode
currency_code,
@Semantics.amount.currencyCode: 'currency_code'
gross_amount }
Example
The following CDS view sales_order is a view of all the fields of the database snwd_so. Accessing the CDS view has the same effect as when the database itself is accessed.
define view sales_order as
select from snwd_so
{ * }