cancel
Showing results for 
Search instead for 
Did you mean: 

Clear_Selection method in Webdynpro ABAP

Former Member
0 Kudos

Hi experts,

Can you please tell me how to use "Clear_selection( )" method in webdynpro abap?

thank you,

Kumar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
   Hello Kumar,
clear_selection() => clears the nodes multiple selection and doesn't change the lead selection.
If you want to delete the first line in the selection, use the : set_static_attributes_null()
If you want to delete all from the node, use : invalidate()
Hope that helps you.
Former Member
0 Kudos

Hi Alexandru,

So with clear_selection() method we can clear the multiple line of records in the node i.e, like clearing work area is it.??

Can we approach this procedure like reading the table, getting elements and values into work area, then clearing the work area using "CLEAR LS_ITAB".. and setting it again.??

Is there any performance issue will come if we go using this approach??

Thank you for your reply,

with regards,

Kumar.

Former Member
0 Kudos

Hello Kumar,

I have test it now and nothing happens on the node datas when calling the clear_selection() method for a node. Clear_selection() clears just what you have selected.

You cand read the elements from the node into a table(if the node has a cardinality 0..n or 1..n), or a structure(if the cardinality of the node is 0..1, 1..1 ) change them or CLEAR them in a work area and then set them again using set_static_attributes() if it is a structure or bind_table() if it is a table.

Performance is an issue when there are a lot of entries in the table.


Former Member
0 Kudos

Hello Kumar,

As a already said it will clear your multiple selection.

take the look at code.

DATA lo_nd_reports_proj_typ TYPE REF TO if_wd_context_node.
   DATA lt_reports_proj_typ TYPE wd_this->elements_reports_proj_typ.
   DATA ls_reports_proj_typ TYPE wd_this->element_reports_proj_typ.
   lo_nd_reports_proj_typ = wd_context->get_child_node( name = wd_this->wdctx_reports_proj_typ ).

*   lo_nd_reports_proj_typ->clear_selection( ).

a have selected some record and now If i use upper statement then in next line  lt_element_set  will come empty, means all selected record is cleared. 


  lo_nd_reports_proj_typ->get_selected_elements( RECEIVING set = lt_element_set
   ).

  you can perform the same thing by clearing
lt_element_set.

Former Member
0 Kudos

Thank you Alexandru,

with regards,

Kumar

Former Member
0 Kudos

You are welcome, any time

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Kumar,

Tell us your requirement, which you want to implement, so that we can help you easily.

Former Member
0 Kudos

Hi Chandra,

I need info about how this Clear_Selection() can be used in our WD4A apps and when we should use this method..since there are so many ways to clear the selection. I just need the exact requirement when we can use this.

Thank you for your reply,

with regards,

Kumar.

Former Member
0 Kudos

Hello Kumar, As said, Clear_selection clear the all selected row/element, but if you want to remove lead selection from UI then you have to use set lead selection to null, but this can give an error if lead selection is enable.

Open this interface by se24 IF_WD_CONTEXT_NODE   here you will find all the method with description.

Former Member
0 Kudos

Thank you Chandara,

with regards,

Kumar

Former Member
0 Kudos

enjoy!!

Former Member
0 Kudos

Hi friends,

Please...I'm awaiting for your replies...

thank you,

with regards,

Kumar.

former_member197475
Active Contributor
0 Kudos

Kumar,

Go for lo_node->clear_selection( ) which will clear your selection.

BR,

RAM

Former Member
0 Kudos

Hi Ram,

Thank you for your reply,

with regards,

Kumar.