Ansicht
Dokumentation

ABENCDS_ASSOC_JOIN_ABEXA - CDS ASSOC JOIN ABEXA

ABENCDS_ASSOC_JOIN_ABEXA - CDS ASSOC JOIN ABEXA

ABAP Short Reference   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

- Joins of Associations

This example demonstrates how to implement path expressions in joins in ABAP CDS.

Source Code

Execute

Description

This example demonstrates how joins are used for path expressions with CDS associations. The following two CDS views - DEMO_CDS_ASSOC_JOIN1_O and DEMO_CDS_ASSOC_JOIN1_I - access their own association _demo_join2 in path expressions of the SELECT list and the exposed CDS association _demo_join3 of DEMO_CDS_ASSOC_JOIN2.

LEFT OUTER and INNER are explicitly specified in the path expressions.

  • LEFT OUTER affects the implementation of CDS associations in a left outer join, which is the default behavior at these places.
  • INNER affects the implementation of CDS associations in an inner join, which overwrites the default behavior at these places.

In the DDL Source Code Editor of the ADT, the respective join can be seen in the display of the generated SQL DDL statement.

This example shows that the result sets of the CDS views DEMO_CDS_ASSOC_JOIN1_O and DEMO_CDS_ASSOC_JOIN1_I are identical to the result sets of statements SELECT with explicitly programmed left outer and inner joins. The CDS views and the DDIC database table DEMO_JOIN3 above are accessed. All involved database tables are filled with sample data. With an inner join, unlike a left outer join, only the row is returned for which the join condition t3~l = t2~d is fulfilled.






CL_GUI_FRONTEND_SERVICES - Frontend Services   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 2626 Date: 20240328 Time: 105306     sap01-206 ( 44 ms )