SAP报表选择屏幕使用tab页签

1、样式
SAP报表选择屏幕使用tab页签
SAP报表选择屏幕使用tab页签
2、代码

selection-screen begin of screen 1001 as subscreen.

parameters: p_file type rlgrap-filename default ‘C:\模板.XLSX’.

selection-screen:skip.
selection-screen:skip.
selection-screen pushbutton 1(10) btn1 user-command cli1 .
selection-screen end of screen 1001.

selection-screen begin of screen 1002 as subscreen.
select-options: s_matnr for ztcor081-matnr,
s_cplb for ztcor081-cplb,
s_cx for ztcor081-cx.
selection-screen end of screen 1002.

selection-screen: begin of tabbed block mytab for 10 lines,
tab (20) but1001 user-command push1,
tab (20) but1002 user-command push2,
end of block mytab.
parameters g_type type c modif id gtp.

initialization.
but1001 = ‘数据批导’.
but1002 = ‘数据查询’.
btn1 = ‘模板下载’.

at selection-screen output.
loop at screen.
if screen-group1 = ‘GTP’.
screen-active = 0.
modify screen.
endif.
endloop.
if g_type is initial.
g_type = ‘1’.
endif.
case g_type.
when ‘1’.
mytab-dynnr = 1001.
mytab-activetab = ‘PUSH1’.
when ‘2’.
mytab-dynnr = 1002.
mytab-activetab = ‘PUSH2’.
endcase.
mytab-prog = sy-repid.

at selection-screen on value-request for p_file.
perform frm_get_filename.

at selection-screen.
case sy-dynnr.
when 1000.
case sy-ucomm.
when ‘PUSH1’.
mytab-dynnr = 1001.
g_type = ‘1’.
when ‘PUSH2’.
mytab-dynnr = 1002.
g_type = ‘2’.
when ‘CLI1’.
perform frm_download.
endcase.
endcase.

start-of-selection.
if g_type = ‘1’.
perform frm_getdata.
else.
perform frm_select_db.
endif.

end-of-selection.
perform frm_display_data.