on 12-02-2008 4:27 PM
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é
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.