Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

deleting Lines from Table UI Element

Hello guys,

ich have a Problem deleting Lines from a table UI Element.

The Situation is like this:

I have a table ui element. if i click on a line and then on a button

i want to delete the line from the table.

How can i do this ?

Thanks a lot.


Former Member

Hi Rene,

Using "LeadSelection" you can select only 1 row at a time. You will have to make use of "Selection" for achieving this. First you will have to change the selection mode of the table to multiple & also change the selection property for the related context to 0..n . Use the below coding to get the multiple rows selected by the user into an internal table . You can then loop through this new internal table and delete those corresponding records from the main internal table. Hope that this helps resolve your problem.



METHOD onactioncopy_selected_rows .
  DATA:  wd_node TYPE REF TO if_wd_context_node,
             wa_temp  TYPE REF TO if_wd_context_element,
             lt_temp  TYPE wdr_context_element_set.


  wd_node = wd_context->get_child_node( name = 'NODE1' ).

  CALL METHOD wd_node->get_selected_elements
      set = lt_temp.

  LOOP AT lt_temp INTO wa_temp.
    wd_node->remove_element( exporting element = wa_temp ).

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question