cancel
Showing results for 
Search instead for 
Did you mean: 

Lead Selection lost after wd alv table is sorted

Former Member
0 Kudos

I have three togglebuttons for selecting different data sources into my wd_salv table. The datasource from the context is set to initalize lead selection. when the wd_salv table is first displayed the lead selection is indeed set.

Choosing a different togglebutton changes the selection of data in the wd_salv table through the defined supply function and the lead selection is set.

when a sort is applied to the wd_salv table the lead selection is lost. I can get around this by reading the context and setting the lead selection myself in the event handler ON_STD_FUNCTION_AFTE.

Now choosing a different togglebutton when the sort is already applied, the lead selection is lost. This time the ON_STD_FUNCTION_AFTE event handler is not called and neither is any other of the salv event handlers as far as I can tell (I checked them all).

The lack of lead selection is a factor when I have another table which relies on the lead selection in my wd_salv table, because no lead selection = shortdump.

you can see this lack of lead selection if you run salv_wd_test_simple1 and sort one of the columns.

If anyone knows how to ensure the lead selection is maintained on/after a sort is applied please could they help. Also why is this not happening by default after my context node is set to initialization lead selection?

Accepted Solutions (1)

Accepted Solutions (1)

former_member515618
Active Participant
0 Kudos

Hi Damian,

We faced a similat issue in our project. We raised a message for the same but they have come back that when ever any ALV event is raised, the entire ALV gets refreshed and built again so the lead selection is lost.

The also suggested not to keep any data modifications in WDDOMODIFY ot that view. This may lead to refreshing the ALV.

One solution to this is to capture the lead selected index, or the reference to the element selected into a temporary variable and set the lead selection when ever necessary...

Regards,

Sravan Varagani

Former Member
0 Kudos

>

> One solution to this is to capture the lead selected index, or the reference to the element selected into a temporary variable and set the lead selection when ever necessary...

>

That was my fear, I have three alv tables embedded into my view = lots of places to maintain the code. At least I now know there is not something I had overlooked.

If I want to re-set the lead selection can you suggest where I should put that code, is there one method either a view method or alv event handler I can use? I planned to use ON_STD_FUNCTION_AFTE however this is called after a sort but not when data into an already sorted table is changed.

former_member515618
Active Participant
0 Kudos

Hi Damian,

Do the capturing of the index or the reference to the element in ON_LEAD_SELECT event of that perticular ALV.

Hope the selection property of the ALV is 0:1, if yes, then when user selects a record in the ALV table

ON_LEAD_SELECT standard event is triggered. In the event handler of this, read the lead selected element and set it to a temporary variable.

Set the lead selection back in WDDOMODIFY of the view. This would also eliminate any changes to the context node in the same hook method.

Regards,

Sravan Varagani

Answers (0)