May 2019
Beginner to intermediate
548 pages
12h 39m
English
SELECT and ENDSELECT are used when we want to create a loop on a database:
SELECT carrid connid planetype FROM sflight INTO CORRESPONDING FIELDS OF gs_sflight.ENDSELECT.
This means that this SELECT statement gets one row following a single execution and the loop ends when SELECT cannot get the next rows with the defined key.
This is helpful when we want to make changes directly to data after SELECT. In this example, we delete leading zeros from connid before appending them to the main gt_sflight table:
SELECT carrid connid planetype FROM sflight INTO CORRESPONDING FIELDS OF gs_sflight. SHIFT gs_sflight-connid LEFT DELETING LEADING '0'. APPEND gs_sflight TO gt_sflight. ENDSELECT.
We can also get data in a loop on a database, ...
Read now
Unlock full access