08-10-2011 2:18 PM
Hi All,
I need to add a Select All and Deselect All button in an ALV container and not in the PF-STATUS. The buttons should appear in the same line as other buttons like Refresh, Sort, etc. I also want to add them in the exclude table later on for hiding the same.
I know it is possible to add user defined buttons with the same functionality. However, I want to know if there is a standard way of adding the same. Is the standard Select All button not present for an AVL?
Regards,
Romil.
08-10-2011 2:33 PM
As far as I know, there's no 'Select All' or 'Deselect All' buttons in an OO ALV Grid standard toolbar. However if you wanna add them, it is just as simple as using the event toolbar of the standard class CL_GUI_ALV_GRID
You just need to define an appropiate event_handler and add them:
TYPE-POOLS: icon.
DATA: ls_toolbar TYPE stb_button.
CLEAR ls_toolbar.
MOVE 3 TO ls_toolbar-butn_type.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO p_object->mt_toolbar.
CLEAR ls_toolbar.
MOVE 0 TO ls_toolbar-butn_type.
MOVE 'SEL_ALL' TO ls_toolbar-function.
MOVE icon_select_all TO ls_toolbar-icon.
MOVE 'Select All' TO ls_toolbar-quickinfo.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO p_object->mt_toolbar.
CLEAR ls_toolbar.
MOVE 3 TO ls_toolbar-butn_type.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO p_object->mt_toolbar.
CLEAR ls_toolbar.
MOVE 0 TO ls_toolbar-butn_type.
MOVE 'DES_ALL' TO ls_toolbar-function.
MOVE icon_deselect_all TO ls_toolbar-icon.
MOVE 'Deselect All'' TO ls_toolbar-quickinfo.
MOVE ' ' TO ls_toolbar-disabled.
APPEND ls_toolbar TO p_object->mt_toolbar.
08-10-2011 3:15 PM
Hi,
Try to check in below link:
/thread/492162 [original link is broken]
04-06-2016 5:46 AM