可以同时存在20个detail lists,每个list都有自己的内存空间,这块儿空间称为list buffer,detail lists中可以使用的功能跟basic lists一样,通过Back或Cancel可以结束当前的list并返回到上一个list,通过Exit可以回到selection screen。START-OF-SELECTION,GET,END-OF-SELECTION,TOP-OF-PAGE,END-OF-PAGE都是用来创建basic list的,一旦创建了basic list这些事件便不会再被触发,AT LINE-SELECTION和AT USER-COMMAND是创建detail list的基础事件,TOP-OF-PAGE DURING LINE-SELECTION用来创建detail list的header。当应用显示多个detail list通过case语句通过sy-dynnr来决定那个secondary headings会被显示。Sy-lsind表示当前的list level,在AT LINE-SELECTION或者AT USER-COMMAND被触发的时候这个值就会增一。程序员可以控制detail lists的最大数量,只要其在某个sy-lsind之后不再运行语句:WRITE,ULINE或SKIP。通过HIDE把变量和值存储起来,通常hide用来存储key fields,或者需要的其他额外信息。Hide语句应紧跟在最后一个write语句之后出现。当碰到一个line-feed character或output line由于line size不够被折成两行时,sy-lilli都会自增一。这样的话必须保证detail line不会被wrap,以保证所hide的变量用户选择的行保持一致。大于当前detail list level的list的list buffer都会自动被删除。每个list level都有自己的hide area。如果你选择的行没有任何hide area存储,那么就称为invalid line selection。Invalid lines包括header和footers。必须保证对于invalid line selection没有detail list创建。示例代码如下:
REPORT ZTESTDETAILLIST.
NODES: spfli.
GET SPFLI.
WRITE: / spfli-carrid,
spfli-connid.
HIDE: spfli-carrid,spfli-connid.
END-OF-SELECTION.
CLEAR: spfli-carrid.
AT LINE-SELECTION.
CHECK NOT spfli-carrid IS INITIAL.
WRITE: 'OL'.
CLEAR: spfli-carrid.
粗体红色部分保证了这一点。
Title name的长度为20个字符,并且字母必须大写,title始终为激活状态年直到设置下一个title。SET TITLE <TITLE> WITH中可以带最多9个变量。所有的变量的长度不能够超过70个字符。TOP-OF-PAGE DURING LINE SELECTION用来创建detail list的header,可以通过sy-lsind来确定在不同的detail list上创建不同的header。当用户选择一行时,所选择的行号就会被存储在sy-lisel中,可以用它在detail list的page header中来显示那一行被选中了。可以通过WINDOW STARTING AT <C1> <R1> ENDING AT …来把detail list显示到模式对话框中。如果<R1><= 0,detail list仍然显示在full screen中而不是model dialog box中。可以通过SET TITLEBAR来为模式对话框创建title。由于系统为所有的model dialog box指定了标准的gui,所以指定custom gui status是没有意义的。可以通过GET CURSOR STATEMENT来根据鼠标的位置来创建detail list。FIELD提供了output field的名称,VALUE提供了output field的值。值得注意的是不要将value得到的值放到SELECT的WHERE CONDITIONG中,对于这种case还应当使用hide technique。
跟interactive list相关的系统字段列表:
SY-LSIND Index for the current list |
SY-LISTI Index of the last list displayed |
SY-LILLI Absolute number of a selected line in the list displayed |
SY-CPAGE Number of the upper-most displayed line in the list displayed |
SY-CUCOL Number of the column in the window where the cursor was last positioned in the list displayed |
SY-CUROW Number of the line in the window where the cursor was last positioned in the list displayed |
SY-STACO Number of the first column displayed in the list displayed |
SY-STARO Number of the first visible line in the top displayed page (SY-PAGE) in the list displayed (not including header lines) |
SY-UCOMM Function code that triggered the interactive event in the list displayed |
SY-PFKEY Status of the list displayed |