SAP CDS ELEMENT LIST INTERFACE



Get Example source ABAP code based on a different SAP table
  


• KEY ABAP_CDS_PROJ_INTERFAC

ABAP_CDS_DDL - projection_list, Transactional Interface

ABAP_SYNTAX
... $[@element_annot1$]
$[@element_annot2$]
...
$[KEY$] ${proj_element $[AS alias$]$}
$| ${ proj_assoc $[AS alias$]$}
$| ${cast_expr AS alias$}

ABAP Addition
1 ... KEY
2 ... AS alias

What does it do?
Defines the elements of a CDS transactional interface. The elements are specified in a comma-separated list in curly brackets { }.
The feature set of a transactional interface is restricted to projecting elements from the underlying projected entity. No new associations, virtual elements, or fields can be defined.
The following elements are supported in the projection list of a transactional interface:
Element annotations can be specified. The rules for propagation of element annotations in CDS projection views apply.
proj_element exposes an element from the projected entity. AS can be used to define an alternative element name alias. ABAP_NOTE In transactional interfaces, an element from the projected entity can be exposed multiple times with different alias names.
proj_assoc exposes a CDS association, a CDS composition, or a CDS to-parent association from the projected entity. Exposed associations can be redirected to a new target when the association target is also projected. Read topic CDS DDL - CDS Projection View, proj_assoc for further details. ABAP_NOTE Adding additional filter conditions to exposed associations is not supported in CDS transactional interfaces. All elements included in the ON clause of an exposed CDS association must also be included in the projection list of the CDS projection view.
Cast expressions cast_expr are available in a reduced way:
The target data type can be specified as CDS simple type or as DDIC data element. Specifying a built-in ABAP Dictionary data type is not possible.
The addition PRESERVING TYPE is mandatory and must be used.
That means that type conversions are not supported in CDS projection views and cast expressions can only be used to derive semantic information.

ABAP_RESTRICTIONS
In a transactional interface, the following elements are not supported in the projection list: expressions, virtual elements, localized text elements, and parameters.
ABAP_RESTR_END

ABAP_EXAMPLE_VX5
The following CDS transactional interface is based on the CDS view entity DEMO_CDS_PURCH_DOC_M. The composition is redirected to the CDS transactional interface of the child entity.
Both parent and child entity should be released for system-internal use under the C1 contract.
DDLS DEMO_CDS_TRANS_INTERFACE_ROOT
The following CDS transactional interface represents the child entity:
DDLS DEMO_CDS_TRANS_INTERFACE_CHILD
ABAP_EXAMPLE_END

ABAP Addition

What does it do?
The keyword KEY is used to define the current element as a key element of the transactional interface. A transactional interface must define exactly the same key elements in the same order as key elements as the underlying projected entity.