May 2019
Beginner to intermediate
548 pages
12h 39m
English
FOR ALL ENTRIES can be used when we have two tables and we want get data from the second table based on a field in the first table:
SELECT carrid connid FROM sflight INTO CORRESPONDING FIELDS OF gt_sflight WHERE planetype = '747-400'. IF gt_sflight IS NOT INITIAL. SELECT carrid connid counryfr cityfr airpfrom countryto FROM spfli INTO CORRESPONDING FIELDS OF TABLE gt_spfli FOR ALL ENTRIES IN gt_sflight WHERE carrid = gt_sflight-carrid AND carrid = gt_sflight-connid. ENDIF.
In the first SELECT statement, we get data about carrid and connid, but only if planetype is '747-400'. In the second table, as we do not have planetype, we can only get rows where we want them.
One thing that we need to remember when using FOR ALL ENTRIES ...
Read now
Unlock full access