cancel
Showing results for 
Search instead for 
Did you mean: 

attributes lost

Former Member
0 Kudos

Dear experts,

i have a problem and i dont know how to solve it.

i select lines in a table on the ui and then i click on delete to delete them.

CALL METHOD lo_nd_worklist_tabelle->get_selected_elements

RECEIVING

set = lt_elements.

this method should return all selected items.

LOOP AT lt_elements INTO wa2_elements.

CALL METHOD wa2_elements->get_static_attributes

IMPORTING

static_attributes = ls_worklist_tabelle.

move sy-datum to ls_worklist_tabelle-endda.

APPEND ls_worklist_tabelle TO lt_worklist_tabelle.

CLEAR ls_worklist_tabelle.

ENDLOOP.

this method writes them into the itab lt_worklist_tabelle.

my Problem is that not all attributes, that appear in the database table

can be found in the itab.

All fields are equal.

Please help if you can i have no clue.

thank you very much

René

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

Hi Rene,

Couldn't quite understand as to what you intended to do. Do you want to delete the rows selected by the user from just the table or from even the underlying database table? You can use the below code to delete the selected rows from the table. (i.e, the context node to which the table is bound to)

METHOD onactiondelete_selected_rows .
  DATA:  wd_node TYPE REF TO if_wd_context_node,
         lt_node1 TYPE ig_componentcontroller=>elements_node1,
         wa_temp  TYPE REF TO if_wd_context_element,
         lt_temp  TYPE wdr_context_element_set,
         row_number TYPE i VALUE 0.


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

" Get information about the rows selected by the user
  CALL METHOD wd_node->get_selected_elements
    RECEIVING
      set = lt_temp.

" Delete the selected rows from the data present at context node
  LOOP AT lt_temp INTO wa_temp.
    wd_node->remove_element( EXPORTING element = wa_temp ).
  ENDLOOP.

" Trying to refresh the table with the new data from the context node
  CALL METHOD wd_node->get_static_attributes_table
    EXPORTING
      from  = 1
      to    = 2147483647
    IMPORTING
      table = lt_node1.

  wd_node->bind_table( new_items = lt_node1 ).
ENDMETHOD.

Regards,

Uday

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>my Problem is that not all attributes, that appear in the database table

can be found in the itab.

I'm not sure I understand your question. More details would be helpful. Are you saying that ->get_static_attributes is not restoring all the attributes? Or is it simply that the context structure doesn't actually match you underlying database structure?