SAP PATH EXPR IN FROM CLAUSE ABEXA



Get Example source ABAP code based on a different SAP table
  



Path Expressions, Use in the FROM Clause
This example demonstrates path expressions in the FROM clause in AB_SQL .

ABAP_SOURCE_CODE
DEMO CL_DEMO_SELECT_FROM_PATH

ABAP_DESCRIPTION
The first SELECT statement accesses the CDS view entity demo_cds_assoc_sairport_tz:
DDLS DEMO_CDS_ASSOC_SAIRPORT_TZ
This view entity exposes its CDS association _spfli in its SELECT list. The CDS association _spfli uses the view entity demo_cds_assoc_spfli_scarr as an association target:
DDLS DEMO_CDS_ASSOC_SPFLI_SCARR
This view exposes its CDS association _scarr in its SELECT list, making it possible to specify it in path expressions after _spfli. This CDS association uses a DDIC database table as a data source and always closes a path expression.
In the FROM clause, the first SELECT statement uses a path expression with the CDS associations _spfli and _scarr after the name of the CDS view. The names of all carriers are read that depart from airports in a specific time zone. The time zone is a parameter of CDS view demo_cds_assoc_sairport_tz, and a value is passed to it. Further restrictions apply to the local currency of the airline in a filter condition for the CDS association _scarr and on the flight time in a filter condition for the CDS association _spfli
The second SELECT statement demonstrates which joins and conditions must be created in AB_SQL to achieve the same result. This is guaranteed by an assertion.