cancel
Showing results for 
Search instead for 
Did you mean: 

How to process multiple row selection in ALV table in Wendynpro ABAP? Help!

gopalkrishna_baliga
Participant
0 Kudos

Hi Experts,

I have Webdynpro for ABAP application that shows a ALV table. I am using SALV_WD_TABLE for ALV output.

1. Now I want multiple row selection on the ALV table. How to setup this? Any coding is required? Please provide code snippets for this.

2. What is 'Lead selection'?

3. If the user selects 10 rows from the ALV then I want to fetch column data for each row and based on that do some processing. Repeat the same of each row selected.

How to do this? Any code sample will be really helpfull.

Note that: I am using webdynpro for ABAP.

Thanks

Gopal

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Gopal,

WD ALV examples can be found in packages SALV_WD_DEMO or SALV_WD_TEST.

Now to your questions (i can help you further if you send me an email: michelle.braun@sap.com):

<b>1. multiple row selection:</b>

in your applicatiopn you have a context node holding the data which is to appear in the ALV table. The context node holds a property "SelectionCardinality". This is the basis for the WD ALV selection mode (explain it later). Next you can set the selection mode in class cl_salv_wd_config_table method if_salv_wd_table_settings~set_selection_mode( ).

If your context node SelectionCardinality is set to 1..1 then you can not set the ALV Table selection mode to higher values such as 1..n. since the context node is the basis. (because when rows of the ui element table are selected the information has to be written back to your context node - therefore this must be possible in your context node)

<b>(2) LeadSelection</b>

in WebDynpro a leadSelection is a selection however a special type of selection.

<u>application perspective:</u>

This can be better understood in the pattern world for instance in OIF where often two lists are displayed. The upper table containing objects and the lower table containing itmens of an object. Here the leadSelection has an important functionality -> processing of objects.

From a <u>UI Design</u> view the leadSelection is displayed in a very dark yellow color. Whreas selected rows are diplayed in a not so dark yellow.

<u>Technically</u> the leadSelection also has special behavior: fires an event onLeadSelectionChanged when the lead selection is removed or changed, deletes selections when leadSelection is changed.

(3) retrieving row information

The ALV uses the context node of WebDynpro for exchanging following information:

- new sort of your internal table

- selections

- changes

- messages

in your component controller or view in WebDynpro where the context node holding the data to be handed over to the ALV is contained, retrieve your context node:

data:

lr_node type ref to if_Wd_context_node.

lr_node = wd_context->get_child_node( 'DATA' ).

*(1) retrieve lead selection

lr_node->get_lead_selection( ).

*(2) retrieve selected elements

lr_node->get_selected_elements( ).

*(3) retrieve selected elements and lead selection

lr_node->get_selected_elements(

including_lead_selection = abap_true ).

More coding in WebDynproComponent SALV_WD_TEST_TABLE_SELECT in view TABLE...

- Michelle

Former Member
0 Kudos

Okay, I'm still novice at ABAP and WD, but I'll try to share what I know (or think I know ). Feel free to add/correct anything.

1. set both the cardinality and the selection attribute of the context node of the ALV data to 0..n.

2. refer to http://help.sap.com/saphelp_erp2005/helpdata/en/7a/787e40417c6d1de10000000a1550b0/content.htm .

3. I'm afraid I can't help with that at the moment.