report ztest_pfstatus_2 no standard page heading.
*—Selection screen fields
tables : sscrfields.
*—Datat and types
data:
gc_name type string,
gv_type type char1. "'1': MM02; '2': SE16;'3':Execute
data it_ucomm type table of sy-ucomm.
parameter: p_name type char100.
*—Add 3 Custom-buttons in application bar
selection-screen: function key 1,
function key 2,
function key 3.
load-of-program.
initialization.
*—output
at selection-screen output.
*—Set PF-status
"Exclude "ONLI”
append 'ONLI' to it_ucomm.
call function 'RS_SET_SELSCREEN_STATUS'
exporting
p_status = sy-pfkey
tables
p_exclude = it_ucomm.
*—Set the Text.
sscrfields-functxt_01 = 'Go to MM02'.
sscrfields-functxt_02 = 'Go to SE16'.
sscrfields-functxt_03 = 'Execute the report'.
at selection-screen.
*—Function code in Selection-screen
case sscrfields-ucomm.
when 'FC01'.
gv_type = '1'.
sscrfields-ucomm = 'ONLI'.
when 'FC02'.
gv_type = '2'.
sscrfields-ucomm = 'ONLI'.
when 'FC03'.
gv_type = '3'.
sscrfields-ucomm = 'ONLI'.
endcase.
start-of-selection.
*—Set PF-status
set pf-status 'OUTPF'.
*—output
case gv_type.
when '1'. "MM01
*—popup to display MM01
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel = 'You will be navigated to MM02'
textline1 = p_name
textline2 = 'is the Selected Material number'
start_column = 25
start_row = 6.
*—SPA: Material number
set parameter id 'MAT' field p_name.
call transaction 'MM02'.
when '2'. "SE16
*—popup to display SE16
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel = 'You will be navigated to SE16'
textline1 = p_name
textline2 = 'is the Selected table'
start_column = 25
start_row = 6.
*—SPA: Material number
set parameter id 'DTB' field p_name.
call transaction 'SE16'.
when '3'. "Execute the report
write:/ 'Result: Your input parameter is:', 30 p_name.
endcase.
at user-command.
*—Sy-ucomm
case sy-ucomm.
when 'SPOOL'.
*—popup to display SE16
call function 'POPUP_TO_DISPLAY_TEXT'
exporting
titel = 'Information'
textline1 = 'You checked the button "Spool"'
start_column = 25 "textline2 = 'is the Selected table'
start_row = 6.
endcase.
评论