该代码的作用是在表ICON中拉取所有数据形成报表,并且进行分页的操作。
代码如下:
REPORT z_myreport NO STANDARD PAGE HEADING.
DATA:pageline TYPE i VALUE 10,
icontab TYPE STANDARD TABLE OF v_icon WITH HEADER LINE,
num TYPE i.
TOP-OF-PAGE.
WRITE:/2'Pages:',syst-pagno LEFT-JUSTIFIED.
ULINE AT /2(80).
WRITE:/2 sy-vline,'ID' COLOR 1,
7 sy-vline, 9'icontab' COLOR 1,
15 sy-vline,26'NAME' COLOR 1,
40 sy-vline,56 'SHORTTEXT' COLOR 1,
81 sy-vline.
ULINE AT /2(80).
START-OF-SELECTION.
SELECT * FROM icon INNER JOIN icont ON icon~id = icont~id
INTO CORRESPONDING FIELDS OF TABLE ICONTAB
WHERE icont~langu = sy-langu.
LOOP AT icontab.
WRITE:/2 sy-vline,sy-tabix LEFT-JUSTIFIED,
7 sy-vline,10 icontab-id as icon,
15 sy-vline,20 icontab-name,
40 sy-vline,50 icontab-shorttext,
81 sy-vline.
ULINE AT /2(80).
num = sy-tabix MOD pageline.
IF num = 0.
NEW-PAGE.
ENDIF.
ENDLOOP.