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: 

How to select all checkbox by clicking one button

Former Member
0 Kudos

Hi all,

I have ALV with one column as checkbox.

I have pushbutton on menubar.

No i want that on clicking on that button all checkbox should get checked.

can u pl. tell me how can i achive this...

Thanks,

Chintan

3 REPLIES 3

Former Member
0 Kudos

In the event handler for the button, loop at output internal table for the ALV and set the field for checkbox as 'X'. Modify the internal table and refresh the grid display.

loop at itab.

itab-check = 'X'.

modify itab index sy-tabix.

endloop.

Manoj

0 Kudos

1. You will have to make the field editable. In the field catalog set the EDIT = 'X' for the check box field.

2. Once the check box is checked, call the method CHECK_CHANGED_DATA of the grid in the PAI of the screen which will update the internal table. (in ur Push button coding).Use modify statement in loop at ur itab to update the internal table data.

3) then u can refresh ur grid display.

Former Member
0 Kudos
In the user_command subroutine you can write the code

FORM USER_COMMAND USING P_UCOMM LIKE SY-UCOMM....
 
CASE P_UCOMM.
  WHEN 'SELALL'.                      " SELALL is the FCODE of ur push button
        loop at itab into wA_itab.
             itab-check = 'X'.
             modify itab from wa_itab.
        endloop.
ENDCASE.

ENDFORM.