Application Development 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: 

Select all button in ALV container

Former Member
0 Kudos

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.

3 REPLIES 3

former_member209703
Active Contributor
0 Kudos

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.

0 Kudos

Hi,

Try to check in below link:

/thread/492162 [original link is broken]

0 Kudos

Thank you! This was the answer i was looking for.