2008 Jan 22 11:22 AM
hi,
i have retrieved data into diff itab's called ita,itb, itc.
i have created a final table called itd.
how to move the data from ita,itb,itc into itd.
urgent.
pls help.
regards,
kb
2008 Jan 22 11:24 AM
hi,
u want to add data according to matching value or just want to append?
2008 Jan 22 11:26 AM
Hi,
Do like this
Sort: itb,itc.
Loop at ita into waa.
read table itb into wab with key f1 = waa-f1 binary search.
if sy-subrc = 0.
read table itc into wac with key f1 = waa-f1 binary search.
if sy-subrc = 0.
move: waa-f1 to wad-f1,
waa-f2 to wad-f2,
wab-f3 to wad-f3,
wac-f4 to wad-f4.
append wad to itd.
clear wad.
endif.
endif.
endloop.
Regards,
Satish
2008 Jan 22 11:27 AM
Hello,
Do like this.
LOOP AT ITA.
READ TABLE ITB with key field = ITA-FIELD.
if sy-subrc = 0.
Move the field to final table.
endif.
READ TABLE ITC with key field = ITA-FIELD.
if sy-subrc = 0.
Move the field to final table.
endif.
APPEND FINAL TABL.
ENLOOP.
Cheers,
Vasanth
2008 Jan 22 11:28 AM
If the structure of all the tables is same, then you can do like this.
Append lines of ita to itd.
append lines of itb to itd.
append lines of itc to itd.
ELSE use...
Loop at ita
move-corresponding ita to wa_itd.
read table itb with key ita-key.
move-corresponding itb to wa_itd.
append wa_itd to itd.
Endloop.
Lokesh
Edited by: Lokesh Aggarwal on Jan 22, 2008 11:30 AM
2008 Jan 22 11:32 AM
if itabs are related by common field(s) then,
loop at itab1.
itab4-f1 = itab1-f1.
read table itab2 with key f1 = itab1-f1 binary search.
if sy-subrc = 0.
itab4-f2 = itab2-f2.
endif.
read table itab3 with key f1 = itab1-f1 binary search.
if sy-subrc = 0.
itab4-f3 = itab3-f3.
endif.
append itab4.
clear itab4.
endloop.
*---if itab1,itab2 and itab3 have same structure then....
append lines of itab1 to itab4.
append lines of itab2 to itab4.
append lines of itab3 to itab4.
Regards
Vasu
2008 Jan 22 11:37 AM
Hi,
Try like:
append lines of itab1 to itab2.
Regards,
Renjith Michael.
2009 Jan 14 10:13 PM