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 in grid display

Former Member
0 Kudos

hi all,

im using REUSE_ALV_GRID_DISPLAY in my program,when im selecting the select all button in the top left corner of my grid i need to display a text message, i tried to capture the user command using SY-UCOMM but the value is null so is there any way to do this....

3 REPLIES 3

Former Member
0 Kudos

Hi senthil,

If the icon mentioned by u is icon with magnifier glass, then its

function code: &ETA. Try this.

Else tell me abt that icon.

IF useful...................

Regards,

S.Senthil kumar

0 Kudos

hi senthil im not using any icons

the default select all icon is there and its function key also i got

'&ALL' but the thing is this key is not captured at the run time in sy-ucomm is there any other way...

0 Kudos

Hi,

In you table declare one field which will indicate which rows are selected. I.e.


data: begin of table occurs 0,
          "your fields here
          selrow type c,
        end of table.


"now in alv layout set field as the one which will row status of selection
ls_layout-box_fieldname  = 'SELROW'.

Then caputre &ALL sy-ucomm in USER_COMMAND subroutine.

NOTE!

This is not triggering AT USER-COMMAND program event.Instead write such form:


FORM user_command USING f_ucomm TYPE sy-ucomm
                                             ls_selfield TYPE slis_selfield.
  if sy-ucomm = '$ALL'.  "All button
    ...
  ENDIF.
ENDFORM.                    "USER_COMMAND

"and direct FM to use this subroutine when event is raised
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
      ...
     i_callback_user_command           = 'USER_COMMAND'
      ...

Regards

Marcin