cancel
Showing results for 
Search instead for 
Did you mean: 

Lead selection change in the component controller

Former Member
0 Kudos

Hello everybody,

I am using an alv grid and try to set the selected row in the grid via lead selection.

The tricky part is, that I want to do this from within a component controller. I thought this is no big deal, but it seems that it is not possible to set the lead selection from another controller then a view controller.

I tried it in my code:

- I set the lead selection directly in a component controller method: Nothing happens. The lead selection does not change (I checked it n the debugger)

- I set the lead selection from an action handler on my view controller: It works. Even the selected row is set. (In fact, the view controller has nothing to do with the logic at all. I had to map the context to it, to test this!)

- I set the lead selection in an eventhandler within the view controller. The event is triggered by the component controller: Nothing happens!

I debuged down to the ON_LEAD_SELECTION_CHANGE method. Here is no entry in the table m_subscription_list for my context node. I assume, this could be the reason. But I have no idea how to solve this issue.

Any ideas?

Best Regards

Daniel

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Daniel,

did you get a solution? I`ve got the same problem with internal table "m_subscription_list".

Cheers

Dieter

Former Member
0 Kudos

Hi Dieter,

unfortunately not. There is still an open call at the SAP, but no real solution.

If I got anything new, I will let you know.

Regards,

Daniel

Former Member
0 Kudos

Hi Daniel,

thanks for the answer - I`ve got the solution and missed to post it here - sorry.

My problem was not the initial tabe "m_subscription_list" - I haven`t connected my 2nd table  properly to context. m_subscription_list is still initial - so I guess this is not the problem.

Cheers

Dieter

former_member199125
Active Contributor
0 Kudos

Let me rephrase your query.

You are unable to lead select the row of alv table from component controller ?

In view controller properties we will use the alv interface controller, so that we can perform alv operations from view controller.

- I set the lead selection from an action handler on my view controller: It works. Even the selected row is set. (In fact, the view controller has nothing to do with the logic at all. I had to map the context to it, to test this!)

Row selection and lead selections are different.

Regards

Srinivas

Former Member
0 Kudos

Hello,

first of all, thanks for your replies.

You are unable to lead select the row of alv table from component controller ?

Exactly. If there is another way to change the selection of the ALV, its also ok. But I did not find anything in the ALV Interface controller methods.

Best Regards

Daniel

former_member199125
Active Contributor
0 Kudos

I didn't understnad, why dont u use the method se_lead_selection method?

Lo_nd_nodename->set_lead_selection ( lo_el_element )

or set by index value

set_lead+Selection( index = 3 )

Regards

Srinivas

Former Member
0 Kudos

This is the problem. It does not work when I call it from the component controller. Maybe this is realy a bug of the release (SAP_BASIS 702 0008)?

former_member199125
Active Contributor
0 Kudos

Check note 138950 and 875986, those will be helpful to you

And I forget to ask u, U said u wrote the lead selection code in component controller method, did you call that method from view controller?

Regards

Srinivas

Edited by: sanasrinivas on Dec 22, 2011 1:11 PM

Edited by: sanasrinivas on Dec 23, 2011 6:03 AM

Former Member
0 Kudos

Hi,

Check note 138950 and 875986, those will be helpful to you

Is there a typo in the numbers? The first note is about a problem with process orders (from 1999) and the second one is about the Note assistant which does not even apply to the release of my system.

Nevertheless:

And I forget to ask u, U said u wrote the lead selection code in component controller method, did you call that method from view controller?

The Method is called by the Component Controller from another Component.

Maybe I should explain a little bit about the architecture of the software: Basically there are three compoentent. A list component (which embedds an ALV - and where I have the problem), a detail component and a main component, which embedds the other components. The detail component displays information to the selected element in the alv.

When I save something in the detail component an event is raised and caught by the main component. This component calls two methods in the list component. The first one is a refresh of the list (which also kills the current selection in the Context/ALV). The second one should set the lead_selection to a certain context element if it is still present.

And this is the problem. I can determine the index of the element. But I can not set the lead_selection.

Best Regards

Daniel

muhammed_nishad
Participant
0 Kudos

Hi,

I suppose you use "SALV_WD_TABLE" as a used component in you WD Compponent. If you use this SALV_WD_TABLE and when you select on different records of the ALV the lead selection will change.

There cant be any flaws in this. Because, we are directly mapping the component controller in the ALV, so when a context change happens it will also get reflected.

Regards,

Muhammed Nishad J