2023 Nov 10 10:51 AM
Hi Experts,
Can you explain, whats the differences between two blocks? Which one should be preferred in which situation?
SELECT mara~matnr
FROM @lt_itab as it
LEFT JOIN mara ON mara~matnr eq it~matnr
INTO TABLE @DATA(lt_matnr).
SELECT matnr
FROM mara
INTO TABLE @DATA(lt_matnr)
FOR ALL ENTRIES IN @lt_itab
WHERE matnr eq lt_itab-matnr.
2023 Nov 10 12:50 PM
I guess it's an interview question. In that case, it's more important to know what you think, to have a discussion, because the interviewers want to evaluate your perspicacity.
FROM lt_itab?
Do you mean:
SELECT ...
FROM @lt_itab ...
Avoid FOR ALL ENTRIES anyway.
FOR ALL ENTRIES corresponds to a INNER JOIN.
Recent ABAP versions allow AMDP, FROM @itab, WITH, GTT...