Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

excluding alv grid toolbaar functions

Former Member
0 Likes
9,287

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...

6 REPLIES 6
Read only

Former Member
0 Likes
3,779

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)

Read only

Former Member
0 Likes
3,779

hiii

refer to following link

regards

twinkal

Read only

Former Member
0 Likes
3,779

for salv funtion group u hav to go to se80 ok

Read only

karol_seman
Active Participant
0 Likes
3,779

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

Read only

Former Member
0 Likes
3,779

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

Read only

former_member745780
Active Participant
0 Likes
3,779

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