I want to join 4 tables T001, KNKK, KNB1 and KNA1, to get all customers from KNB1/KNA1 and their Risk Category in KNKK.
We need a left join from KNKK but the join condition is based on 2 tables: the T001-KKBER and KNA1-KUNNR.
But I get the syntax error:
Unable to compare with "T001~KKBER". A table can be joined with a maximum of one other table using LEFT OUTER JOIN.
The select is:
SELECT knb1~kunnr kna1~name1 kna1~lifnr knb1~akont
INTO TABLE git_kunnr_tab
FROM kna1
INNER JOIN knb1
ON kna1~kunnr EQ knb1~kunnr
INNER JOIN t001
ON knb1~bukrs EQ t001~bukrs
LEFT JOIN knkk
ON knb1~kunnr EQ knkk~kunnr AND
t001~kkber EQ knkk~kkber
WHERE knb1~kunnr IN s_kunnr
AND knb1~bukrs = p_bukrs.
Our system is old ECC6 7.02 so we cannot implement the new features of ABAP.
Is there any way to do it in 1 select?