Ansicht
Dokumentation
ABENCDS_PUBLISH_ASSOCS_ABEXA - CDS PUBLISH ASSOCS ABEXA
TXBHW - Original Tax Base Amount in Local Currency ROGBILLS - Synchronize billing plansThis documentation is copyright by SAP AG.
ABAP CDS - Publishing Associations
This example demonstrates how associations are published in the SELECT list of a CDS view.
Source Code
Description
It also demonstrates how CDS associations are accessed that are published in their SELECT list using CDS views. For each view, a use of the published 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 publishes its association _demo_join2, which associates its data source demo_join1 with the database table demo_join1. The field d used in the ON condition of the source data source must also be an element of the SELECT list.
- When the association demo_cds_publish_assoc_1\_demo_join2 is accessed, the subsequent access creates an instance of the explicitly used inner join and produces the result of this join.
- The following CDS view matches the preceding view, but has an additional WHERE condition.
- When the association demo_cds_publish_assoc_1a\_demo_join2 is accessed, the results set of the left side of the join is restricted by the WHERE condition in the source data source of the path expression.
- The following CDS view accesses the view demo_cds_publish_assoc_1 above. It does not have its own association, but it does publish the association of its data source demo_cds_publish_assoc_1._demo_join2. Here, the field demo_cds_publish_assoc_1.d of the source data source used in the ON condition must again be part of the SELECT list.
- When the association demo_cds_publish_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_publish_assoc_2 is not subject to any further restrictions, which means the result is the same as when demo_cds_publish_assoc_1\_demo_join2 is accessed.
- The following CDS view matches the preceding view, but has an additional WHERE condition.
- When the association demo_cds_publish_assoc_2a\_demo_join2 is accessed, the results set of the left side of the join is restricted by the WHERE condition in the source data source of the path expression. This is different from accessing demo_cds_publish_assoc_1a\_demo_join2. The association defined in demo_cds_publish_assoc_1a is published, but the source data source is demo_cds_publish_assoc_2a with a different WHERE condition.
- The following CDS view accesses the view demo_cds_publish_assoc_1a above. It does not have its own association, but it doers publish the association of its data source demo_cds_publish_assoc_1a._demo_join2.
- When the association demo_cds_publish_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_publish_assoc_3 is not subject to any further restrictions, which means the result is the same as when demo_cds_publish_assoc_1a\_demo_join2 is accessed.
- The following CDS view matches the preceding view, but has an additional WHERE condition.
- When the association demo_cds_publish_assoc_3a\_demo_join2 is accessed, the results set of the left side of the join is restricted by the WHERE condition in the source data source of the path expression. The disjoint WHERE condition in demo_cds_publish_assoc_1a means that no matching rows are found, however, and the results set of the left side of the join is empty.
ABAP Short Reference BAL_S_LOG - Application Log: Log header data
This documentation is copyright by SAP AG.
Length: 6066 Date: 20240420 Time: 155524 sap01-206 ( 87 ms )