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: 

ALV : Select all rows on ALV screen

Former Member
0 Kudos

Hi,

I am displaying an ALV grid using REUSE_ALV_GRID_DISPLAY.............................I have a editable checkbox against each row which is selectable by user. Also i have an 'Select all' and 'Deselect all' button to select/deselect all rows..................I have coded the functionality to select/deselct all table rows when theses button are clicked

Now the issue I am facing....................Using filter function user can filter the rows in the ALV gird.................In this scenario, when user click on the 'Select all' button then only for the rows displayed in the ALV grid should be selected (i.e checkbox checked)......................But with my current code, all rows of ALV grid (visible and hidden) rows are selected....................

Does any one know how to read the visible rows of the ALV grid......................Or an idea/experience how to solve this

Thanks and have a good day.....................................

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Use method [get_filtered_entries|http://help.sap.com/saphelp_46c/helpdata/en/0a/b552fdd30911d2b467006094192fe3/frameset.htm] of class [CL_GUI_ALV_GRID|http://help.sap.com/saphelp_46c/helpdata/en/22/a3f5ecd2fe11d2b467006094192fe3/frameset.htm] you will get all indexes that are currently hidden on the screen, do not update the selection box value for those records.

To get a reference variable to CL_GUI_ALV_GRID instance, use FM GET_GLOBALS_FROM_SLVC_FULLSCR in your USER_COMMAND form.

Regards,

Raymond

PS: Why did you code yourself what looks like a standard function of ALV Grid ?

2 REPLIES 2

raymond_giuseppi
Active Contributor
0 Kudos

Use method [get_filtered_entries|http://help.sap.com/saphelp_46c/helpdata/en/0a/b552fdd30911d2b467006094192fe3/frameset.htm] of class [CL_GUI_ALV_GRID|http://help.sap.com/saphelp_46c/helpdata/en/22/a3f5ecd2fe11d2b467006094192fe3/frameset.htm] you will get all indexes that are currently hidden on the screen, do not update the selection box value for those records.

To get a reference variable to CL_GUI_ALV_GRID instance, use FM GET_GLOBALS_FROM_SLVC_FULLSCR in your USER_COMMAND form.

Regards,

Raymond

PS: Why did you code yourself what looks like a standard function of ALV Grid ?

Former Member
0 Kudos

Thanks Raymond Giuseppi for the speedy and needy tip....................

This ALV grid is used in a workflow..................based on the user selection the next process are determined.......................Also apart from selection these CB has more business functionalitywhich detemines the subsequent process.............................