*---------------------- 隐藏掉GUI上的某个按钮 --------------------------------
append '&ADD' to rt_extab."同样也适合菜单项
append '&DEL' to rt_extab.
set pf-status 'GS_100' excluding rt_extab.
设置'GS_100',goto->attributes->pushbutton assignment->display all就可以了.
display all会显示灰掉的或不灰的。或直接点一下绿点就可以
*---------------------------- CLASS方式的ALV --------------------------------
data : lt_excl_func type ui_functions.
append cl_gui_alv_grid=>mc_fc_loc_copy to lt_excl_func.
append cl_gui_alv_grid=>mc_fc_loc_copy_row to lt_excl_func.
append cl_gui_alv_grid=>mc_fc_loc_cut to lt_excl_func.
call method go_grid->set_table_for_first_display
exporting
is_variant = gs_variant
i_save = 'A'
is_layout = sla
it_toolbar_excluding = lt_excl_func
changing
it_outtab = itab[]
it_fieldcatalog = gt_fieldcat[]
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
*------------------------------- Function方式的ALV --------------------------
type-pools: slis.
data: i_excluding type slis_t_extab.
append '&ILT' to i_excluding .
append '&OUP' to i_excluding .
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = i_repid
it_fieldcat = gd_fieldcat[]
is_layout = sla
it_excluding = i_excluding
tables
t_outtab = itab
exceptions
program_error = 1
others = 2.
如果你要隐藏全部的工具条,你可以把layout中的no_toolbar设置为"X".
评论