Question:
hi all,
I am using some alv functionality with objects and once I show the output of the report is showing a toolbar that would like to remove some of the buttons
how can I do that? For instance I would like to remove the Insert row, Delete row etc...
CALL METHOD grid1->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = it_pidh[]
it_fieldcatalog = gt_fieldcat100[].
_________________
SoCal
Answer:
You can find useful examples in the transaction SE83 about adding buttons to the toolbar
(SE83 --> SAP Technology --> Controls --> ALV Grid control --> Examples --> Toolbar')
Removing buttons is very similar... you delete them from the toolbar table, not append them.
The standard function codes you will find in the attributes of class CL_GUI_ALV_GRID. They all start with MC_FC_
Regards, Polle.
Answer:
Hi All,
CALL METHOD grid1->set_table_for_first_display, this will not solve your problem as it is used to display data in a grid using the custom control or other control.
Go to class CL_ALV_EVENT_TOOLBAR_SET and look for the table type which is MT_TOOLBAR. Whenever the alv is displayed using Oops this table always get populated with all the buttons that you see on your alv grid. Now if you want to do any modifications in the standard toolbar like removing or adding, you can do it in your code.
If you want to remove some buttons from your standard toolbar, then first of all you have to recognise which button needs to be removed, using the ok_code you can delete it from table MT_TOOLBAR which is internally of type stb_button, you will find various properties of stb_button that you can play around with.
Better way is to look for any standard or customized program or report which uses Oops concepts and displays ALV grid, then see in the debuggin how logic flows for toolbar.
Thanks
Pindropsilence
_________________
Forget past, live in today, think for tomorrow.