2007 Jul 11 6:46 AM
Hi friends,
I wants to add and remove some buttons from ALV Grid using oops concept, can any one please give me an exact way to do it.
Thank you.
Regards,
Virat
Hi friends,
I wants to add and remove some buttons from ALV Grid using oops concept, can any one please give me an exact way to do it.
Thank you.
Regards,
Virat
2007 Jul 11 6:49 AM
For adding a button on the toolbar, you will need to handle the TOOLBAR event of the class CL_GUI_ALV_GRID. This event has a parameter E_OBJECT which is an object reference to the class CL_ALV_EVENT_TOOLBAR_SET. Using this object you can access an internal table MT_BUTTON in the class CL_ALV_EVENT_TOOLBAR_SET. Append the Function Code, Icon and Text to this internal table.
For deleting a button from the toolbar, just append the function code of the button you want to exclude to an internal table of type UI_FUNCTIONS and pass it to the method SET_TABLE_FOR_FIRST_DISPLAY through the parameter IT_TOOLBAR_EXCLUDING.
2007 Jul 11 6:54 AM
Verify BCALV_GRID_VERIFY
methods handle_toolbar_set
for event toolbar of cl_gui_alv_grid
importing e_object e_interactive.
method handle_toolbar_set.
handle toolbar
create own Menubuttons and ToolbarButtons
if e_interactive is initial.
clear gs_toolbar.
move 'DELE' to gs_toolbar-function.
move icon_delete to gs_toolbar-icon.
move 'Mein Löschen'(111) to gs_toolbar-quickinfo.
move ' ' to gs_toolbar-disabled.
append gs_toolbar to e_object->mt_toolbar.
clear gs_toolbar.
move 'REFR' to gs_toolbar-function.
move icon_refresh to gs_toolbar-icon.
move 'Mein Refresh'(112) to gs_toolbar-quickinfo.
move ' ' to gs_toolbar-disabled.
insert gs_toolbar into e_object->mt_toolbar index 1.
endmethod.
set handler event_receiver->handle_toolbar_set for grid1.
Message was edited by:
Sumi Vasu
2007 Jul 11 7:14 AM
2007 Jul 11 6:54 AM
Hi,
FIll the table parameter of the function SET_TABLE_FOR_FIRST_DISPLAY.
Add MC_FC_XXXX attributes of the class to this table.
IT_TOOLBAR_EXCLUDING.
DATa: itab type UI_FUNCTIONS.
APPEND cl_gui_alv_grid=>MC_FC_AVERAGE to itab.
Then pass itab as follows
IT_TOOLBAR_EXCLUDING = itab.
Regards,
Sesh
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |