Ansicht
Dokumentation

ABENCDS_EXPOSE_ASSOC_V2_ABEXA - CDS EXPOSE ASSOC V2 ABEXA

ABENCDS_EXPOSE_ASSOC_V2_ABEXA - CDS EXPOSE ASSOC V2 ABEXA

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

- CDS View Entity, Exposing CDS Associations

This example demonstrates how CDS associations are exposed in the SELECT list of a CDS view entity.

Source Code

Execute

Description

The executable example shown above demonstrates how CDS associations are accessed that are exposed in the SELECT list of a CDS view entity. For each view, the data source in the SELECT statement is specified not directly, but as path expression, making use of an exposed association. For comparison, the explicit join expression that produces the same result is shown.

  • The following CDS view entity exposes its CDS association _demo_join2, which associates its data source demo_join1 with the DDIC database table demo_join1. The field d used in the ON condition of the association source must also be an element of the SELECT list.
When the CDS association demo_cds_expose_assoc_1_ve\_demo_join2 is accessed, the same inner join is created that is explicitly used in the subsequent access. Both produce the same result.
  • The following CDS view entity matches the preceding view, but has an additional WHERE condition.
When the CDS association demo_cds_expose_assoc_1a_ve\_demo_join2 is accessed, the result set of the left side of the join is restricted by the WHERE condition in the association source of the path expression.
  • The following CDS view entity accesses the view demo_cds_expose_assoc_1_ve above. It does not have its own CDS association, but it exposes the CDS association of its data source demo_cds_expose_assoc_1_ve._demo_join2. Here, the field demo_cds_expose_assoc_1_ve.d of the association source used in the ON condition must again be part of the SELECT list.
When the CDS association demo_cds_expose_assoc_2_ve\_demo_join2 is accessed, the same inner join is created as the subsequent explicit inner join and produces the same result. The CDS view entity demo_cds_expose_assoc_2_ve is not subject to any further restrictions, which means the result is the same as when demo_cds_expose_assoc_1_ve\_demo_join2 is accessed.
  • The following CDS view entity matches the preceding view, but has an additional WHERE condition.
When the CDS association demo_cds_expose_assoc_2a_ve\_demo_join2 is accessed, the result set of the left side of the join is restricted by the WHERE condition in the association source of the path expression. This is different from accessing demo_cds_expose_assoc_1a_ve\_demo_join2. The CDS association defined in demo_cds_expose_assoc_1a_ve is exposed, but the association source is demo_cds_expose_assoc_2a_ve with a different WHERE condition.
  • The following CDS view entity accesses the view demo_cds_expose_assoc_1a_ve above. It does not have its own CDS association, but it exposes the CDS association of its data source demo_cds_expose_assoc_1a_ve._demo_join2.
When the CDS association demo_cds_expose_assoc_3_ve\_demo_join2 is accessed, the subsequent access creates an instance of the explicitly used inner join and produces its result. The view demo_cds_expose_assoc_3_ve is not subject to any further restrictions, which means the result is the same as when demo_cds_expose_assoc_1a_ve\_demo_join2 is accessed.
  • The following CDS view entity matches the preceding view, but has an additional WHERE condition.
When the CDS association demo_cds_expose_assoc_3a_ve\_demo_join2 is accessed, the result set of the left side of the join is restricted by the WHERE condition in the association source of the path expression. The disjoint WHERE condition in demo_cds_expose_assoc_1a_ve means that no matching rows are found, however, and the result set of the left side of the join is empty.





ROGBILLS - Synchronize billing plans   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 6715 Date: 20240418 Time: 023456     sap01-206 ( 101 ms )