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

selected rows sequence in ALV

Former Member
0 Likes
787

Dear Fnds,

My requirement is, Iam displaying output data in ALV. in the output ALV i have 10 rows.

in the 10 rows if i select 5 rows(any rows), Example 3,7,1,2,5, Do we have any function module or class to determine the selected row sequence (which one we have selected as first, second and thrid etc.)

Dear Fnds,

My requirement is, Iam displaying output data in ALV. in the output ALV i have 10 rows.

in the 10 rows if i select 5 rows(any rows), Example 3,7,1,2,5, Do we have any function module or class to determine the selected row sequence (which one we have selected as first, second and thrid etc.)

5 REPLIES 5
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
714

If you selecting using the standard alv row(left most box column) selection i dont think so there is any event which triggers when you click it.. Instead you can place a check box in a field and while clicking a row you can trigger an event and maintain the sequence of selected records in the internal table.

Kesav

Read only

0 Likes
714

Hi,

Hope you are using SET_TABLE_FOR_FIRST_DISPLAY method. If so, pass 'D' to SEL_MODE field of LAYOUT structure and pass LAYOUT structure to above method. Now, use GET_SELECTED_ROWS method in CL_GUI_ALV_GRID class. The table which you import from ET_INDEX_ROWS parameter will be having row numbers that you selected in the output table.

Regards,

Naveen Inuganti

Read only

0 Likes
714

HI Kesav,

Even if i maintain check box, when multitle check boxs are selected, which event i have to use...?

Read only

0 Likes
714

You can refer this example . Next time please search yourself for the contents. Almost everything can be solved if we search clearly

Read only

Former Member
0 Likes
714

Dear Fnds,

>

> My requirement is, Iam displaying output data in ALV. in the output ALV i have 10 rows.

>

> in the 10 rows if i select 5 rows(any rows), Example 3,7,1,2,5, Do we have any function module or class to determine the selected row sequence (which one we have selected as first, second and thrid etc.)

Hi,

I think you can achieve this thru GET CURSOR statement which will tell you current cursor position. I don`t think you can store it in a internal table to know the sequence.

Try, have a look at this document. http://help.sap.com/saphelp_470/helpdata/en/9f/dbabf135c111d1829f0000e829fbfe/content.htm

Hope, you find this useful.

Reetesh