Ansicht
Dokumentation

ABENCDS_SELECT_LIST_ASSOCIATION_V1 - CDS SELECT LIST ASSOCIATION V1

ABENCDS_SELECT_LIST_ASSOCIATION_V1 - CDS SELECT LIST ASSOCIATION V1

CPI1466 during Backup   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

- DDIC-Based View, SELECT, expose_assoc

... path_expr $[AS alias$]

Effect

Uses a path expression path_expr to expose a CDS association, a CDS composition, or a CDS to-parent association as an element of the SELECT list of a . A path expression can consist of one or more associations, and the final CDS association is exposed for use in other CDS views or in :

  • A different CDS view can evaluate the CDS association in its path expressions.

The current view is the association source of the exposed CDS association and any join expressions created for a path expression from the CDS association use the current CDS view as their left side.

All fields of the association source of the CDS association that occur in the ON condition must also be specified as elements of the current SELECT list. Such an element must be specified by exactly the same path expression as used for exposing the association. It must contain the same associations in the same sequence and with the same attributes.

A CDS association can be exposed multiple times with various alternative element names alias defined using the keyword AS. This makes it possible to use different filter conditions cds_cond. However, this is only possible for simple CDS associations and not for compositions and to-parent associations.

Like every element, a CDS association exposed in this way is part of the SELECT list and must also be specified in a name list. It is not, however, part of the result set, a field of the CDS-managed DDIC view of a , or a component of a type defined in ABAP with respect to the CDS view. If no alternative element name alias is defined, and there is no name list, the element name is defined by the name of the CDS association named by the path expression.

Notes

  • When a CDS association is exposed, the exposing view itself is the association source of the exposed CDS association and not the data source of the exposing view. Especially when CDS associations are exposed that were already exposed by the data source of the current view, the current view replaces the original view as the association source. When a join expression is created for the current view, the left side of the join expression is the result set of the current view.
  • When a CDS association with a filter condition cds_cond is exposed, an alternative element name alias using AS must be defined in the SELECT list.
  • The name of the elements of a SELECT list must be unique. This applies in particular also for the publication of a CDS association using a path expression. There must be no other element with this name. If necessary, AS must be used to define an alternative element name alias for the CDS association.
  • Special rules apply to the publication of CDS associations in SELECT statements joined with UNION.

Example

The following CDS view exposes its own CDS association _spfli and the CDS association _sflight exposed by its association target demo_cds_assoc_spfli. The fields of the association source, which are used in the ON conditions of the CDS associations, are specified in the SELECT list. In the case of the CDS association exposed using _spfli._sflight, path expressions _spfli.carrid and _spfli.connid are specified accordingly. The element carrid occurs twice, which means that an alternative element name must be defined using AS.

Exposing CDS Associations






SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 8536 Date: 20240419 Time: 180845     sap01-206 ( 93 ms )