list report的一般结构

*&---------------------------------------------------------------------*
*& Report ZDDDD *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*

REPORT ZDDDD no standard page heading
line-size 100
line-count 8(3)
.


* TABLE ******************** "table declare
TABLES : scarr,spfli.

* Constants************* "define constant
constants: char(30) value 'i am zhongming'.

* TYPES *************** "define type
TYPES : QUAN(15) TYPE P DECIMALS 3. "basic type
types: begin of t_stru, "structure type
carrid like scarr-carrid,
count type quan,
end of t_stru.

* DATA TABLE ********** "internal table
data: begin of it_data occurs 0,
mandt like scarr-mandt,
carrid like scarr-carrid,
carrname like scarr-carrname,
currcode like scarr-currcode,
url like scarr-url,
end of it_data.
data: it_data2 type t_stru occurs 0 with header line.

* DATA ********* "define variable
data: carrid type s_carr_id,
carrname like scarr-carrname.

* PARAMETERS OF SELECT-OPTIONS **** "define input parameters
parameters: p_carrid like scarr-carrid.
select-options: so_id for scarr-carrid.

* PERform INI_SELECTION_SCREEN. "perform before initializing first screen
INITIALIZATION.
p_carrid = 'AA'.

* PERform INI_DATA. "perform before executing start-of-selection
AT SELECTION-SCREEN.
p_carrid = 'DL'.

* PERform PRECESS_DATA. "main program
START-OF-SELECTION.
select * into table it_data
from scarr
* where carrid = p_carrid
.

* PERform PRECESS_END_DAT. "perform after executing start-of-selection
END-OF-SELECTION.
data: count type i,
check(1).
loop at it_data.
write: / check as checkbox,'line no:',it_data-carrid,'line name:',it_data-carrname.
count = count + 1.
endloop.

it_data2-carrid = p_carrid.
it_data2-count = count.

append it_data2. "add-on data to it_data2

new-page. "display in next page(new page)
loop at it_data2.
write: / 'parameter line no:',it_data2-carrid,'line counter is:',it_data2-count.
endloop.


set pf-status '100'.

* PERform PRECESS_LINE_SELECTED. "perform while double click a line
AT LINE-SELECTION.
write / 'at line-selection'.

* PERform PRECESS_USER_COMMAND. "perform while user command
AT USER-COMMAND.
case sy-ucomm.
when 'LIST1'.
write / 'view 0001'.
when 'LIST2'.
write / 'view 0002'.
when 'EXIT'.
leave to screen 0.
endcase.

* PERform PAGE_HEADER. "page top
TOP-OF-PAGE.
format color col_heading intensified on.
write: / 'header and color is col_heading'.
format color col_heading intensified off.

write: /12 'this is top-page of sample report'.
format reset.

* PERform PAGE_FOOT. "page tail
END-OF-PAGE.
write: /10 'this is end-page of sample report'.


注意:
1、列表没有一页以上,看不到END-OF-PAGE显示结果,NEW-PAGE不算
2、status 100,必需创建,且参数与AT USER-COMMAND中对应
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值