Skip to content

ABAP Keyword Documentation →  ABAP - Dictionary →  ABAP CDS in ABAP Dictionary →  ABAP CDS - Data Definitions →  ABAP CDS - DDL for Data Definitions →  ABAP CDS - DEFINE TABLE FUNCTION 

ABAP CDS - DEFINE TABLE FUNCTION, element_list

Other versions: 7.31 | 7.40 | 7.54

Syntax


... RETURNS { element1; element2; ...; } ...

Effect

Defines the elements of a CDS table function. The elements are specified in a semicolon-separated list element1; element2; ...; in curly brackets { }. The final element must also be followed by a semicolon.

These elements have the following meaning:

  • They determine the components of the structured data types represented by a CDS table function with respect to ABAP.

The ABAP data types of the components of the structured data type are derived from the dictionary types of the elements in accordance with the associated mapping rules.

In a client-specific CDS table function, the first element must be typed with the built-in dictionary type CLNT. This element is the client field of the CDS table function. It is a column of the tabular return value of the associated AMDP function implementation and is not a component of the structured data type represented by the table function.


Note

In a client-specific CDS table function, the structured data type of the table function and the row type of the return value of the AMDP function implementation are not compatible. The AMDP function implementation cannot be called as a regular function method in ABAP anyway, which means that no correspondingly structured target variable needs to be declared.


Example

The program DEMO_AMDP_FUNCTION_TYPE uses RTTI to show the following for various CDS table functions:

  • The components of the structured data type
  • The parameters of the associated AMDP function implementation
  • The row type of the return value of the associated AMDP function implementation

For client-specific table functions, a client field is defined after RETURNS. This field is a column of the return value of the AMDP function implementation and is not part of the structured data type.

Continue

ABAP CDS - DEFINE TABLE FUNCTION, element