ABAP Keyword Documentation → ABAP Dictionary → ABAP CDS in ABAP Dictionary → ABAP CDS - Views → ABAP CDS - DDL Statements → ABAP CDS - DEFINE VIEW → ABAP CDS - SELECT
ABAP CDS - SELECT, data_source
Other versions:
7.31 | 7.40 | 7.54
Syntax
... entity[parameters]|path_expr [AS alias]
[join] ...
Effect
Defines a data source of a CDS view in ABAP CDS. A data source can be a database table defined in ABAP Dictionary or a view. In the latter case, the view can be an external view or another CDS view.
- The data source is specified either directly using its name entity or using a path expression path_expr in which associations are evaluated.
- If the data source is a CDS view with a list of input parameters, actual parameters must be passed to these using parameters.
- AS can be used to define an alternative name alias for a directly specified data source. An alternative name must be defined if a path expression is used. The name must comply with the naming rules for names.
Note
Only transparent tables can be accessed using CDS views. A
pooled table or cluster table can be specified as a data source; in this case, no
CDS database view is generated at activation. When the
CDS
entity is accessed with Open SQL statement SELECT
, an exception occurs.
Example
The CDS view business_partner is defined for the database table snwd_bpa, for which an alternative name partner is specified. This name is used in the SELECT list.
define view business_partner as
select from snwd_bpa as partner
{ key partner.bp_id,
partner.company_name,
partner.bp_role }