Ansicht
Dokumentation

ABENCDS_EXPOSE_ASSOCS_ABEXA - CDS EXPOSE ASSOCS ABEXA

ABENCDS_EXPOSE_ASSOCS_ABEXA - CDS EXPOSE ASSOCS ABEXA

RFUMSV00 - Advance Return for Tax on Sales/Purchases   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

- Exposing CDS Associations

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

Source Code

Execute

Description

It also demonstrates how CDS associations are accessed that are exposed in their SELECT list using CDS views. For each view, a use of the exposed CDS association as a data source of a SELECT statement in a path expression is shown. As a comparison, the explicit join expression that produces the same result is shown.

  • The following CDS view 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\_demo_join2 is accessed, the subsequent access creates an instance of the explicitly used inner join and produces its result.
  • The following CDS view matches the preceding view, but has an additional WHERE condition.
When the CDS association demo_cds_expose_assoc_1a\_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 accesses the view demo_cds_expose_assoc_1 above. It does not have its own CDS association, but it does expose the CDS association of its data source demo_cds_expose_assoc_1._demo_join2. Here, the field demo_cds_expose_assoc_1.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\_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_2 is not subject to any further restrictions, which means the result is the same as when demo_cds_expose_assoc_1\_demo_join2 is accessed.
  • The following CDS view matches the preceding view, but has an additional WHERE condition.
When the CDS association demo_cds_expose_assoc_2a\_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\_demo_join2. The CDS association defined in demo_cds_expose_assoc_1a is exposed, but the association source is demo_cds_expose_assoc_2a with a different WHERE condition.
  • The following CDS view accesses the view demo_cds_expose_assoc_1a above. It does not have its own CDS association, but it does expose the CDS association of its data source demo_cds_expose_assoc_1a._demo_join2.
When the CDS association demo_cds_expose_assoc_3\_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 is not subject to any further restrictions, which means the result is the same as when demo_cds_expose_assoc_1a\_demo_join2 is accessed.
  • The following CDS view matches the preceding view, but has an additional WHERE condition.
When the CDS association demo_cds_expose_assoc_3a\_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 means that no matching rows are found, however, and the result set of the left side of the join is empty.





Vendor Master (General Section)   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 6640 Date: 20240425 Time: 074510     sap01-206 ( 87 ms )