Application Development and Automation 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: 
Read only

How to select multiple lines in ALV without using the CTRL key

Former Member
0 Likes
1,647

Can someone tell me how to select multiple lines in an ALV list without using the CTRL key?

Thanks.

Sandy

Can someone tell me how to select multiple lines in an ALV list without using the CTRL key?

Thanks.

Sandy

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
638

If the lines are not beside each other, then there is no other way to do it. This is how the ALV control behaves, and you can not change it.

If you want to select multiple lines and they are beside each other, the you can simply click the first row and drag down, which will select the other lines as well.

Regards

Rich Heilman

Read only

Former Member
0 Likes
638

Hi Sandy,

I guess you could respond to, say, double clicks on a row and use this event to add the row index to your own internal table of selected rows. Then every time in your PBO you would have to use

grid->SET_SELECTED_ROWS( IT_INDEX_ROWS = <your internal table of previously selected rows> ).

But I'm sure you will run into problems with stuff like filters - (i.e the user has filtered out a previously selected entry, and then you try in your PBO to select it - I don't know what would happen then)

There are methods to deal with this (get_filtered_entries), but it will be tricky.

Also you have to decide how to clear a selection, clear all selections - pretty much everything ALV does for you as far as selecting rows you would have to implement yourself.

The best way I can think of this working without a keyboard (I assume your target user doesn't have access to one) is to have a toggle button which sends your alv into "gather rows" mode and a button to clear the selection.

Hope this helps,

Phil

Read only

kutjohn
Product and Topic Expert
Product and Topic Expert
0 Likes
638

Hi

See this to select multiple without ctrl

http://scn.sap.com/docs/DOC-41911