*&---------------------------------------------------------------------*
*& 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中对应
*& 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中对应