ABAP join syntax is available for transparent tables and IDocs on SAP 4.x systems. When you generate the ABAP program using ABAP join syntax, the ABAP program can perform either an inner join or an outer join. You choose the join type in the ABAP Program Flow dialog box. Each table in the ABAP program flow must have a key relationship with at least one table above it. If a relationship does not exist between the tables you want to join, you can specify a join condition in the ABAP Program Flow dialog box.
For example, you have two tables, KONP and KONH. You generate the ABAP program with ABAP join syntax and choose inner join for the join type. The following sample ABAP program is generated to join KONP and KONM using an inner join:
SELECT KONH~MANDT [...]
INTO (KONH-MANDT, [...]
FROM KONP
INNER JOIN
KONH
ON KONH~KNUMH = KONP~KNUMH
WHERE
(KONP_clause) and
(KONH_clause)
ORDER BY KONP~MANDT KONP~KNUMH KONP~KOPOS
KONH~MANDT KONH~KNUMH KONH~ERNAM .
endselect.
You can also choose outer join for the join type. The following sample of the ABAP program is generated to join KONP and KONH using an outer join:
SELECT KONH~MANDT [...]
INTO (KONH-MANDT, [...]
FROM KONP
LEFT
OUTER JOIN
KONH
ON KONH~KNUMH = KONP~KNUMH
WHERE
(KONP_clause) and
(KONH_clause)
ORDER BY KONP~MANDT KONP~KNUMH KONP~KOPOS
KONH~MANDT KONH~KNUMH KONH~ERNAM .
endselect.
To use ABAP join syntax, clear both the Force Nested Loop option and the Exec SQL option in the Application Source Qualifier transformation. You cannot use ABAP join syntax to join hierarchies.
When you have a mapping with inner/outer joins between multiple SAP ECC tables and you use a dynamic filter on an outer join table, the session fails. This occurs due to ABAP join restrictions on certain combinations of inner and outer joins between SAP tables. SAP produces the following error message:
[CMRCV: 18 Illegal access to the right-hand table in a LEFT OUTER JOIN].