cancel
Showing results for 
Search instead for 
Did you mean: 

Select ALL/ Deselect ALL ALV

Former Member
0 Kudos

Hi - I have the selection 0.N and the multi selection in the ALV. At the top left in the ALV there's a box that have the options SELECT ALL/ DESELECT ALL and my issue is the following.

When I select ALL all the lines are selected (highlighted with a light yellow color) but no LEAD SELECTION so when I want to do an Action with the select all action is not grabbing all the records. I can fix this by adding a LEAD SELECTION if LEAD SELECTION is none but then I have another requirement to do something else when the index is 0.

How I can read all the values that are in the SELECT ALL?

When I do Deselect ALL is stopping in the event ON_LEAD_SELECT but Select ALL is not stoping there.

THanks!

Jason P-V

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Any ideas on how this SELECT ALL works? is Standard feature of the ALV if I select the selection 0.n and selection multi.

thanks!

Jason P-V

Former Member
0 Kudos

Hi Jason,

what do you want to achieve?

If you want to check whether a row is selected, you can loop over the context node elements using method IS_SELECTED.

kind regards

Stefanie

Former Member
0 Kudos

I still dont know how to catch the METHOD that is trigger when I do SELECT ALL from the top left box (select all / deselect all)

I just need to know which method is getting trigger so then I can read the IS_SELECTED.

My issue is that if LV_INDEX <> 0 and I click a button I have to do something, but if LV_INDEX = 0 and I click the same button I have to do something else, my issue is that I dont have lead selection by default so when I select all (no lead selection the system says INDEX = 0 even that ALL is selected, so I want to know where is going so there I can do IS_SELECTED have something then do something else.

thanks!

Jason P-V

Former Member
0 Kudos

Hi,

You can use the GET_SELECTED_ELEMENTS on the node bound to the DATA node of the ALV component.

For e.g.


  DATA lo_node TYPE REF TO if_wd_context_node.
  DATA lt_selected TYPE wdr_context_element_set.

  lo_node = wd_context->get_child_node( name = <Name of your node> ).
  lt_selected =  lo_node->get_selected_elements( ).

Best Regards,

Loveline Thomas.

Former Member
0 Kudos

L. Thomas - thank you for your inputs, I need to know in which method I can put the code in, because I put breakpoints in methods (ON_LEAD_SELECT and is not stopping) I wish to know which method is getting trigger so I can read the context node.

thanks!

Jason P-V

Former Member
0 Kudos

On which action do you what to know the selected rows of the table, place the code in the event handler for that action.

For e.g. if it is on click of particular button that you what to know the selected rows and process them, place the code in the action for the button click.

Best Regards,

Loveline Thomas.

Former Member
0 Kudos

L. Thomas - Is not a custom button or Action, you know when you select 0.N selection and allow multi selection of rows, a small box in the top left corner of the ALV appears (standard) with two option SELECT ALL and DESELECT ALL, when I do SELECT ALL is not stopping in any breakpoint and I want to know where the web dynpro is going to select all rows of the alv available.

I dont have the option LEAD SELCTION in the context node because I dont want lead selection by default, if I select all with out lead selection the ALV is highlighting all the rows of the ALV with a lighter yellow than regular LEAD SELECTION yellow.

I want to know where is the code going to select all the rows from the standard box in the top left corner .

thanks!

Jason P-V

Former Member
0 Kudos

Hi,

I guess no event is triggered to ABAP application server for Select All / Deselect All, these events are handled in the client side.

Best Regards,

Loveline Thomas.

Former Member
0 Kudos

L. Thomas - so there's no way I can add code in any method in order to read those values?

Jason P-V

Former Member
0 Kudos

Hi,

I believe your intention is to do some process on the selected rows. You can create a button for e.g. which the user have to click after he is done with his selection. In the action for this button you can determine the rows selected (earlier code sample) and process it accordingly.

Best Regards,

Loveline Thomas.

Former Member
0 Kudos

thanks! you were right!

PV

Answers (0)