第一个write语句触发了list generation,输出的内容被放入了list buffer中,当buffer完成时就会通过list buffer生成screen image。作为标准功能list中有两个header line,第一个header line在最左边是Program加program attribute中维护的program title,最右边是页码。第二个header line是一条连续的横线。当打印list时,header的格式如下:左上角系统日期,中间program title,右上角page number。事务代码libs中有各种list格式的demo,不过其在netweaver中不存在。List的默认长度是83column,每页的默认行数是60000,可以通过report语句的LINE-SIZE,LINE-COUNT来覆盖默认设置,这些值只能通过数字来设置不能是变量。可以通过NEW-PAGE LINE-SIZE LINE-COUNT来覆盖default配置,list宽度的改变只能通过创建一个新的list buffer来实现,可以把LINE-SIZE,LINE-COUNT设置成零来恢复默认设置。每页的行数包括headings,details和footer lines。在REPORT/PROGRAM语句中通过NO STANDARD PAGE HEADING可以屏蔽掉标准的header。可以通过NEW-PAGE NO-TITLE/WITH TITLE,或NEW-PAGE NO-HEADING/WITH HEADING来覆盖全局设置。TOP-OF-PAGE用来创建page header。这个事件在遇到第一个WRITE,ULINE或SKIP时就会在PRIMARY LIST BUFFER中触发。如果没有suppress标准的list buffer,它就会放在TOP OF PAGE产生的文本的上面。TOP OF PAGE中的行不受vertical scrolling 的影响。
FORMAT OPTIONS:
l COLOR <n> [ON|OFF] Colors the line background
l INTENSIFIED [ON|OFF] Intensify colors YES|NO
l INVERSE [ON|OFF] Inverse: Background/text color
l HOTSPOT [ON|OFF] Display mouse pointer as hand and single click (see AT LINE-SELECTION)
l INPUT [ON|OFF] Input field
l RESET Resets all formats to their default values
FORMAT后面的语句都会使用format设置的格式,直到FORMAT OFF或FORMAT RESET。在新的事件中FORMAT OPTION都会被重设为默认值。可以通过语句WRITE WA_SPFLI COLOR COL_KEY.为单个字段设置FORMAT OPTION。
WRITE语句;
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
可以通过write语句的AS SYMBOL在list中显示symbol,前提是需要INCLUDE <SYMBOL>,同样还有INCLUDE <ICON>。通过INCLUDE <LIST>相当于INCLUDE <SYMBOL> <LINES> <ICON> <COLOR>。ULINE,WRITE SY-ULINE可以实现下划线,WRITE SY-VLINE可以实现竖直线。右上角可以通过WRITE line_top_right_corner AS LINE来实现。通过这些元素可以用来创建table和tree。可以通过SET LEFT SCROLL-BOUNDARY COLUMN冻结左边的列,如果不给参数<number_of_columns>赋值冻结的列数就是WRITE语句所在的列(SY-COLNO)。必须在TO-OF-PAGE或者TOP-OF-PAGE DURING LINE-SELECTION中使用这个语句,因为在每页的结尾系统会自动把这个值设为0。可以通过NEW-LINE NO SCROLLING,来冻结下面的行,这样做的好处是避免SUB-HEADS被scroll。通过scroll语句可以滚动到指定list buffer的指定页的指定行。SCROLL LIST TO PAGE <page_number> INDEX sy-lsind LINE <line_number>。
其他的关于page layout的语句
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
Text element包括standard page header,text symbols和selection texts。Write text symbol的两种写法:
|
| ||||
|
|
|
|
事务代码SLIN可用来检查维护的TEXT SYMBOL是否完整。
List的有关系统变量:
|
|
| SY-LINCT Number of lines from REPORT statement (LINE-COUNT) |
|
|
| SY-LINSZ Line width from REPORT statement (LINE-SIZE) |
|
|
| SY-SROWS Number of lines in the display window |
|
|
| SY-SCOLS Number of columns in the display window |
|
|
| SY-PAGNO Page number of the current page |
|
|
| SY-LINNO Line number of the current line of the current page (SY-PAGNO) |
|
|
| SY-COLNO Column number of the current column |
EXAMPLE:
REPORT ZTESTLIST NO STANDARD PAGE HEADING
LINE-COUNT 50
LINE-SIZE 1023.
INCLUDE <list>.
TABLES: mara.
FIELD-SYMBOLS <fs_col>.
TOP-OF-PAGE.
SET LEFT SCROLL-BOUNDARY COLUMN 20.
WRITE: 'TEST'.
WRITE: SY-PAGNO.
START-OF-SELECTION.
SELECT * FROM mara.
* FORMAT INPUT ON.
IF sy-dbcnt = 10.
NEW-LINE NO-SCROLLING.
ELSE.
NEW-LINE.
ENDIF.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE mara
TO <fs_col>.
IF sy-index > 10.
EXIT.
ENDIF.
WRITE: <fs_col>.
ENDDO.
WRITE: line_top_right_corner AS LINE.
* NEW-PAGE WITH-HEADING.
ENDSELECT.
END-OF-SELECTION.
SCROLL LIST TO PAGE 10.
SCROLL LIST TO COLUMN 5.