cancel
Showing results for 
Search instead for 
Did you mean: 

SALV ON_LEAD_SELECT & SORT

AlexGiguere
Contributor
0 Kudos

Hi guys, here is my problem.

I'm using 2 ALV component usage in my web dynpro application. When the user click on a line on the first ALV, details information is display on the second ALV. I create an event handler method implementing the event on_lead_select to populate my second ALV. My problem is that if we sort the first ALV, the lead selection will change but the event on_lead_select is not called, so my second ALV is displaying wrong information.

Any idea how can achieve that, or how I can I trigger the on_lead_select manually,

thanks

Alex

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Do you have to manually populate the second context node? Why not just structure your context such that the secondary table is a non-singleton child node of the first. You can use a supply function if necessary to populate it on demand. But by structuring your contexts in such a way - you don't have program the change of the lead selection - it will be taken care of for you by the framework.

AlexGiguere
Contributor
0 Kudos

Hey hi Thomas, yep, I know, but I'am using 2 ALV component usage, it's not like using 2 table UI element. Using the ALV component, you can't have nested context node, so that's why I have to populate manually my other context node which is bound to my second ALV component usage. I think SAP should correct that, it would be much easier to work with the ALV component.

Alex

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

> ... you can't have nested context node,

>

> Alex

Are you sure about that? I have an application that does that very thing and it is working just fine. My application was written on 7.0 SP14, so perhaps that is newer functionality. I can't say that I tried it on older support package levels.

AlexGiguere
Contributor
0 Kudos

Yes I think, just to validate, I will recreate a sample application and I'll get back to you!

Check the help under

[http://help.sap.com/saphelp_nw70/helpdata/EN/03/0048413e466e24e10000000a155106/frameset.htm]

Web Dynpro ABAP: Development in Detail

--> Integration

--> SAP List Viewer in Web Dynpro for ABAP

--> Integration of ALV in Your Application

--> Providing the Data

Context Nodes

The ALV component requires a context node that can contain the data of the internal data table. This context node has the following properties:

● It has the cardinality 0..n.

● It only contains attributes and no subnodes: For each column of your internal data table, you create exactly one attribute of the same name and data type.

● All the attributes are static, not dynamic.

Alex

AlexGiguere
Contributor
0 Kudos

Thomas, I just redo a sample application and it seems to works, maybe it's my mistake! We are on SP15, but I remember to have test it and it was not working, also the help clearly says context node with no subnode, anyway, now I have a new issue, maybe you could help me on this:

I create 2 nodes (1 main node & 1 subnode) on the component controller, define the 2 component usage for the ALV, instantiate the ALV component usage in the WDDOINIT method, also in the WDDOINIT I populate my first context node,

I create a supply function for the second context. I bind my 2 context node of the component controller to the data context in the ALV component usage. Now when I execute the application, my supply function seems to be called only at startup, If I select a new lines on the first ALV the supply function is not called, what am I missing?

thanks

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Are you sure that you have unchecked the Singleton option on the child node?

AlexGiguere
Contributor
0 Kudos

My child node had the singleton property unchecked, I just checked and now it works, wonderful!

thanks for your time!

Alex

AlexGiguere
Contributor
0 Kudos

Thomas, now it works, but when I am sorting my first ALV table, I got a short dump!

My main context is called mara and my subcontext node is called marc.

The following error text was processed in the system DEV : The node specified in mapping ( MARC) could not be found

The error occurred on the application server svr09dev_DEV_00 and in the work process 0 .

The termination type was: RABAX_STATE

The ABAP call stack was:

Method: RESOLVE_MAPPING of program CL_WDR_CONTEXT_NODE_INFO======CP

Method: MAP of program CL_WDR_CONTEXT_NODE_MAP=======CP

Method: IF_WD_CONTEXT_NODE~GET_ATTRIBUTE_PROPS_FOR_NODE of program CL_WDR_CONTEXT_NODE_MAP=======CP

Method: GET_ATTRIBUTE_PROPERTIES of program CL_SALV_WD_DATA_TABLE=========CP

Method: EXECUTE of program CL_SALV_WD_SERVICE_MANAGER====CP

Method: APPLY_SERVICES of program CL_SALV_BS_RESULT_DATA_TABLE==CP

Method: REFRESH of program CL_SALV_BS_RESULT_DATA_TABLE==CP

Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE_DATA of program CL_SALV_WD_C_TABLE_V_TABLE====CP

Method: IF_SALV_WD_COMP_TABLE_DATA~MAP_FROM_SOURCE of program CL_SALV_WD_C_TABLE_V_TABLE====CP

Method: IF_SALV_WD_COMP_TABLE_DATA~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP

any idea?

thanks

alex

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Unfortunetly you may have found the source of the limitation that is documented in the online help. I tried the sorting in my system and it worked - but then again I am running a newer version of NetWeaver. However this sets you back around to your original problem in which case you aren't left with very many options. You might have to consider going back to tables instead of ALV. That way you can control what happens when you resort the parent nodes and restore or invalid the child nodes as necessary. I haven't been able to come up with another option.

AlexGiguere
Contributor
0 Kudos

ok thanks! When this version will come out? Mabye I could get an instance of the alv object model for the first alv and disabled the column sorting or like you said switch back to tables UI elements!

Alex

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Enhancement Package 1 starts its Ramp-Up within the next two weeks. It is scheduled for General Availability around Q4 of this year.

AlexGiguere
Contributor
0 Kudos

Hey Thomas, I found something interresting, maybe it's correct in your release!

Previously, the reason why it was not working, it was because I was populating my main context after the user click on a search button (this case is not possible to used nested context), but If you have nested context node and your populate your first main node in the WDDOINIT of the component controller, it works!

Solution: this is not very clean but if I insert a blank line in my main context in the WDDOINIT method, I could use nested context node!

Alex

Answers (0)