tables: scustom, scarr, spfli, sflight, sbook.
*nodes: spfli, sflight, sbook.
data: begin of gt_logic occurs 0,
carrid type scarr-carrid,
carrname type scarr-carrname,
connid type sflight-connid,
fldate type sflight-fldate,
cityfrom type spfli-cityfrom,
cityto type spfli-cityto,
bookid type sbook-bookid,
customid type sbook-customid,
name type scustom-name,
paymentsum type sflight-paymentsum,
end of gt_logic.
data: v_book_num type i value 0.

* get sflight late.
* get spfli late.
* select carrid cityfrom cityto into corresponding fields of table gt_logic from spfli.
selection-screen begin of block blk1 with frame title text-002.
selection-screen begin of line.
selection-screen comment 1(30) text-003.
parameters p_books type i obligatory.
selection-screen end of line.
selection-screen end of block blk1.
start-of-selection.
write:/(20) 'Carrier name',
(15) 'Connection Id',
(15) 'Flight date',
(10) 'City from',
(10) 'City to',
(10) 'Book number',
(20) 'Passenger name',
(15) 'Amount in local currency'.
get spfli.
gt_logic-carrid = spfli-carrid.
gt_logic-cityfrom = spfli-cityfrom.
gt_logic-cityto = spfli-cityto.
get sflight.
v_book_num = 0.
gt_logic-connid = sflight-connid.
gt_logic-fldate = sflight-fldate.
gt_logic-paymentsum = sflight-paymentsum.
get sbook.
v_book_num = v_book_num + 1.
check v_book_num le 10.
gt_logic-bookid = sbook-bookid.
gt_logic-customid = sbook-customid.
write:/(20) gt_logic-carrname,
(15) gt_logic-connid,
(15) gt_logic-fldate,
(10) gt_logic-cityfrom,
(10) gt_logic-cityto,
(10) gt_logic-bookid,
(20) gt_logic-name,
(15) gt_logic-paymentsum.
* append gt_logic.
get sflight late.
format color 3.
write:/ 'Plane type: ', sflight-planetype,
/ 'Occupied seats:', sflight-seatsocc,
/ 'Total of current booking:',sflight-paymentsum.
uline.
format color off.