cancel
Showing results for 
Search instead for 
Did you mean: 

List

Former Member
0 Kudos

Hi,

I have a list. In that list I have checkboxes corresponding to the rows of internal table. I also have a select all button. I want to check all the checkboxes at select all button click,

Please guide me.

Thanks,

Saroj

Accepted Solutions (1)

Accepted Solutions (1)

Pawan_Kesari
Active Contributor
0 Kudos

You will have to write similar code on user command of select all. Just check the position of X in list and change 'my_lisel+1(1)' accordingly


 do.
   read line sy-index field value input_entry.
   if sy-subrc ne 0.
     exit.
   endif.
   read line sy-index field value sy-lisel into my_lisel.
   if my_lisel+1(1) = ' ' and my_lisel+1(1) ne '-'
                        and sy-index ne 1
                        and sy-index ne 3.
     my_lisel+1(1) = 'X'.
     modify line sy-index field value sy-lisel from my_lisel.
   endif.
 enddo.

Answers (2)

Answers (2)

Former Member
0 Kudos

You should perhaps consider using the REUSE_ALV_LIST_DISPLAY function to produce your report. it can be set to include checkboxes on each line and comes with automatic select all, deselect all, sort, filter, etc functionality. This is a lot easier than writing such code yourself, and while it may be a bit slower the first report you write, once you are used to ALV you will find yourself saving 50% of the time on each report.

There are lots of posts and sample code available on using ALV.

Andrew

Former Member
0 Kudos

Hi,

For checking all checkboxes whenever u click on select all button u have to modify the field value of the checkbox field in the internal table.

First u must assign a function code to select all button.

U must handle this select all functionality in the at user-command event. When ever user click on the select all button control triggers at user-command event. In that u have to handle the function code. When ever user clicks on select all field value of the check box in the internal table must be modified to 'X'.

Regards,

Sankar