Ansicht
Dokumentation

ABENCDS_PV_ASSOC_MODIFIED - CDS PV ASSOC MODIFIED

ABENCDS_PV_ASSOC_MODIFIED - CDS PV ASSOC MODIFIED

General Data in Customer Master   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

- filter, Transactional Query

... [$[cardinality:$] cds_cond ] ...

Effect

Specifies a filter for an association from the projected entity that is exposed or redefined in a CDS projection view. The filter is specified in square brackets [ ] when the association is exposed in the projection list. The filter can consist of two attributes, namely cardinality and filter condition.

Example: _Assoc[1:field1 = 5].

The following rules apply to the cardinality cardinality:

  • The cardinality can be 1 or *. The association is declared as unique or non-unique.
  • A filter can never consist of a new cardinality alone. It must always be combined with a filter condition.
  • The cardinality of an association might implicitly be changed when a filter is added. If this is the case, and only in this case, the new cardinality can be specified in square brackets.
  • The max cardinality of a filtered association must be less than or equal to the max cardinality of the original association.

The following rules apply to the filter condition cds_cond:

  • The prefix $projection. can be used within a filter to access an element from the projection list
Example: _Assoc[1:field1 = $projection.field1] as _alias

Example

The following CDS projection view DEMO_SALES_PV_SO_MODIFY is a projection of the CDS view DEMO_SALES_CDS_SO. It exposes the association _Items twice. The first time, all original properties are kept. The second time, the association is modified with a filter. The new alias name _TopItems is assigned and by using the keyword REDIRECTED TO, the specialization as composition child is lost and the association is projected as a simple CDS association.

Example

The following CDS projection view DEMO_SALES_PV_SO_PARAM is a projection of the CDS view DEMO_SALES_CDS_SO. It exposes the parameter my_parameter that is included in the associated CDS view DEMO_SALES_CDS_SO_PARAM. The parameter has to be filled upon exposure.






General Material Data   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 4038 Date: 20240419 Time: 033751     sap01-206 ( 53 ms )