ABAP Keyword Documentation → ABAP - Dictionary → ABAP CDS in ABAP Dictionary → ABAP CDS - Data Definitions → ABAP CDS - DDL for Data Definitions
ABAP CDS - parameter
Other versions:
7.31 | 7.40 | 7.54
Syntax
... [@parameter_annot1]
[@parameter_annot2]
...
pname : typing
[@<parameter_annot1]
[@<parameter_annot2]
...
Addition
... @parameter_annot ... @<parameter_annot
Effect
Defines a CDS parameter called pname in one of the following:
- Parameter list of a CDS view
The name pname must comply with the naming rules for names. Furthermore, pname cannot contain any slash (/) characters and cannot be a reserved name in ABAP Dictionary. The name pname must be unique and be located in the namespace of the elements and published CDS associations of the current CDS entity. Also, the reserved name connection cannot be used in table functions. The reserved names that cannot be used are specified in the database table TRESE. They are not case-sensitive. The blanks in the comma-separated list are ignored and can be omitted. Each parameter must be typed with an elementary data type typing.
A non-abstract CDS entity for which CDS parameters are defined as input parameters can be used as
- A data source or in a path expression of a different CDS view
- A data source of a
SELECT
statement from ABAP SQL in ABAP
In these cases, each input parameter must be assigned a suitable actual parameter whose value is then used in the operand positions in which the parameter is specified. The actual parameters are assigned using a parenthesized comma-separated list as follows:
... cds_entity( pname1 : act1, pname2 : act2, ...) ...,
This list must be specified directly after the name of the view when using an entity with parameters (both within the CDS DDL in ABAP CDS and in ABAP SQL). In ABAP SQL, an equals sign
(=
) is used instead of a colon (:).
Note
It is not currently possible to define optional input parameters or replacement parameters for input parameters. The annotation @Environment.systemField can be used, however, to make ABAP SQL pass ABAP system fields to an input parameter implicitly.
Addition
... @parameter_annot ... @<parameter_annot
Effect
Specifies annotations for the parameter. The annotations can be specified before the parameter using @parameter_annot or after the parameter using @parameter_annot. The latter is possible only for CDS views, CDS table functions, and CDS hierarchies and not for abstract CDS entities.