Example for COLLECT statement
DATA:
BEGIN OF seats,
carrid
TYPE sflight-carrid,
connid
TYPE sflight-connid,
seatsocc
TYPE sflight-seatsocc,
END OF seats.
DATA seats_tab
LIKE HASHED TABLE OF seats
WITH UNIQUE KEY carrid connid.
SELECT carrid connid seatsocc
FROM sflight
INTO seats.
COLLECT seats
INTO seats_tab.
ENDSELECT.
LOOP AT seats_tab
INTO SEATS.
WRITE: /
'CARRID:', SEATS-carrid,
'CONNID: ', SEATS-Connid ,
'SEATSOCC: ', SEATS-seatsocc.
ENDLOOP.
Hiç yorum yok:
Yorum Gönder