on 09-12-2011 6:50 AM
Hi
How to move one internal table to another internal table? I used move corresponding but it s not working. Please guide me to acheive this.
Regards
Indiranjithn
Hi,
This Question is not WDA related. Try to post only WDA related.
You can use MOVE or ITAB[] = itab2[]. OR
In loop you can transfer from Workarea to IT.
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is belongs to WDA only. Because i have created one structure same as ztable. The structure is binded with the view table. I just need to get data from ztable to structure. I did the same, now i got values in internal table of the structue. But Dump occured. Please guide me to do. The code also attached here.
DATA lo_nd_node_am_detl TYPE REF TO if_wd_context_node.
DATA lo_nd_node_am_detl1 TYPE REF TO if_wd_context_node.
DATA ls_node_am_detl TYPE wd_this->Element_node_am_detl.
DATA lt_node_am_detl TYPE wd_this->Elements_node_am_detl.
DATA lt_node_am_detl1 TYPE wd_this->Elements_node_am_detl1.
Data : WA_node_am_detl type ZAA_IN_AM_DETL.
Data : lt_detl type ZAA_AM_DETL_STR.
SELECT * INTO CORRESPONDING FIELDS OF TABLE lt_node_am_detl FROM ZAA_IN_AM_DETL.
Loop at lt_node_am_detl into WA_node_am_detl.
MOVE-CORRESPONDING WA_node_am_detl to lt_detl.
append lt_detl to lt_node_am_detl1 .
endloop.
navigate from <CONTEXT> to <NODE_AM_DETL> via lead selection
lo_nd_node_am_detl = wd_context->get_child_node( name = 'NODE_AM_DETL' ).
lo_nd_node_am_detl->bind_table( new_items = lt_node_am_detl set_initial_elements = abap_false ).
lo_nd_node_am_detl1 = wd_context->get_child_node( name = 'NODE_AM_DETL1' ).
lo_nd_node_am_detl1->bind_table( new_items = lt_node_am_detl1 set_initial_elements = abap_false ).
Note: I have added some additional fields in structure.
Thanks in Advance.
Indiranjithn
There are certain best practice steps :
1. Create Table type in se 11 with same fields as in select
2. then create context with same table type.
3. declare the table as
lo_node TYPE REF TO if_wd_context_node,
DATA : lt_ztable TYPE ztable
navigate from <CONTEXT> to <GT_PAINT_CODE_LIST> via lead selection
lo_node = wd_context->get_child_node(
name = wd_this->wdctx_gt_ztable_node).
*=> Assign table to node - Part list
lo_node->bind_elements( lt_ztable).
This will help you
Hi,
Change this..
Loop at lt_node_am_detl into WA_node_am_detl.
MOVE-CORRESPONDING WA_node_am_detl to lt_detl.
append lt_detl to lt_node_am_detl1 .
endloop.
Instead of this... use...
Loop at lt_node_am_detl into WA_node_am_detl.
wa_lt_detl = WA_node_am_detl. // Make sure lt_node_am_detl and lt_detl are same structre.
append wa_lt_detl to lt_node_am_detl1 .
endloop.
Cheers,
Kris.
Hi
Loop at lt_node_am_detl into WA_node_am_detl.
wa_lt_detl = WA_node_am_detl. // Make sure lt_node_am_detl and lt_detl are same structre.
afther this... pass those extra fields data.
for ex:
wa_lt_detl-field1 = wa_node_am_detl-field1.
wa_lt_detl-field2 = wa_node_am_detl-field2.
append wa_lt_detl to lt_node_am_detl1 .
endloop.
Cheers,
Kris.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.