Ansicht
Dokumentation

ABENCDS_PROJ_VIEW_EXPOSE_ASSOC - CDS PROJ VIEW EXPOSE ASSOC

ABENCDS_PROJ_VIEW_EXPOSE_ASSOC - CDS PROJ VIEW EXPOSE ASSOC

PERFORM Short Reference   RFUMSV00 - Advance Return for Tax on Sales/Purchases  
This documentation is copyright by SAP AG.
SAP E-Book

- expose_assoc, Transactional Query

... association$[ [filter]$] $[AS alias$] $[: redirection $]

Effect

CDS associations from the projected entity can be exposed in the projection list of a CDS projection view. Note that only an association from the projected entity can be exposed, path expressions are not valid to expose an association.

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.

The following additions are possible:

An exposed association in a CDS projection view can be modified. That means that you can add a filter condition and in this way implicitly change the cardinality.
  • AS alias
The names of the elements of a SELECT list must be unique. 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. If no alternative element name alias is defined, the element name is defined by the name of the CDS association used in the path expression. When a CDS association with a filter condition cds_cond is exposed, an alternative element name alias using AS is mandatory.
If the original association target is also projected, you can redirect the association to the new target using the keyword REDIRECTED TO. Find details in the topic CDS DDL - projection_view, REDIRECTED TO below.

A CDS association can be exposed multiple times with various alternative element names. This makes it possible to use different filter conditions.

An exposed CDS association is part of the projection list. It is not, however, part of the result set, nor a component of the type defined in ABAP with respect to the CDS projection view.

Note

  • Projected CDS associations, CDS compositions, and CDS to-parent associations can be specified as values for the CDS annotations ElementRef and AssociationRef.
  • As alternative to exposing an association with a filter and redirection described in this topic, it is also possible to redefine an association on header level using the keyword REDEFINE ASSOCIATION. The filter and redirection is then automatically applied to all fields exposed via path expression.






General Data in Customer Master   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 4850 Date: 20240425 Time: 040229     sap01-206 ( 68 ms )