Populating internal tables
Given the following internal table.
TYPES: BEGIN OF ty_sflight, sflight LIKE sflight, perocc(4) TYPE p DECIMALS 2, END OF ty_sflight. DATA: gt_sflight TYPE TABLE OF ty_sflight.
First of all, what's the difference between using TYPE and LIKE, eg in sflight LIKE sflight. Both seem to work the same when I tried debugging.
Secondly, how do I populate the internal table? I tried the following but got an error:
SELECT sflight~carrid sflight~connid INTO (gt_sflight-sflight-carrid, gt_sflight-sflight-connid) FROM sflight UP TO 50 ROWS. ENDSELECT.