2008 Aug 06 8:34 AM
hey...i wanna kno ..is there any way to exclude functions in the toolbaal in alv grid..i wanna exclude functions like cut,add row,delete row etc...
hey...i wanna kno ..is there any way to exclude functions in the toolbaal in alv grid..i wanna exclude functions like cut,add row,delete row etc...
2008 Aug 06 8:39 AM
we have one parameter in the fm is_exclude like u have to pass the
internal table which is appended with ok-codes which u want to exclude in tool bar.
go to salv function group get all the function codes from standard toolbar.(gui status)
2008 Aug 06 8:40 AM
2008 Aug 06 8:40 AM
2008 Aug 06 8:43 AM
Hi,
you have to fill table to exclude buttons, please follow code below
*--- Excluding buttons
DATA gt_toolbar_excluding TYPE ui_functions.
PERFORM exclude_tb_functions CHANGING gt_toolbar_excluding.
CALL METHOD gr_alvgrid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
it_toolbar_excluding = gt_toolbar_excluding
CHANGING
it_outtab = gt_list[]
it_sort = gt_sort
it_fieldcatalog = gt_fieldcat
* IT_SORT =
* IT_FILTER =
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4 .
*---------------------------------------------------------------------*
* FORM exclude_tb_functions *
*---------------------------------------------------------------------*
* To exclude some of standard buttons of ALV *
*---------------------------------------------------------------------*
* --> PT_EXCLUDE *
*---------------------------------------------------------------------*
FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions .
DATA ls_exclude TYPE ui_func.
ls_exclude = cl_gui_alv_grid=>mc_fc_maximum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_minimum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_subtot .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_sum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_average .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_mb_sum .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_mb_subtot .
ENDFORM .
Regards,
Karol
2008 Aug 06 8:47 AM
Hi,
Here is the piece of program to remove the buttons on the toolbar of ALV Grid
DATA:ls_exclude TYPE ui_func,
pt_exclude TYPE ui_functions.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy .
APPEND ls_exclude TO pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row .
APPEND ls_exclude TO pt_exclude.
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'MARA'
is_layout = gs_layout
is_variant = gs_variant
i_save = x_save
it_toolbar_excluding = pt_exclude
is_print = is_print
CHANGING
it_outtab = jtab[]
it_sort = it_sort
it_filter = it_filt
it_fieldcatalog = fcat.
just go through this i hope this will help u
Thanks & Regards
Ashu Singh
2008 Aug 06 8:47 AM
Yes you can exclude them you have to pass an internal table into exporting parameter of "IT_TOOLBAR_EXCLUDING" of method set table for first display
and fill this internal table with this code
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>MC_FC_LOC_DELETE_ROW.
append ls_exclude to pt_exclude.
ls_exclude = cl_gui_alv_grid=>MC_FC_DELETE_FILTER.
pass this pt_exclude to the method.
Thanks
Anirudh Saini
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |