how to combine 2 internal table into 1 [resolved]

Question: hi,

I want to combine 2 internal table(A/B) into 1(C), and I use

LOOP AT A.
READ TABLE B WITH KEY XXX = A-XXX.

but always some data missing,

anyone who can help me ?

Thanks

Answer:
Hi rayu,

Obviously the READ statement will return only 1 record from itab b if there is a matching from itab a.

For your case, simplest way is:


data in internal table A: 1,2,3.
data in internal table B: 2,3,4
I want to get table C : 1,2,3,4 and 2,3 is the summary for table A/B (2,3)
So, in table C, do you want to end up with entries 1, 2, 2, 3, 3, 4? Isn't that just an append table A and table B to table C? I'm not sure where you want the summary (this is the intersection?) to go.

Answer:
I test this, it works!

Thanks


If the two tables have the same structure .. the easiest will be...

append lines of itab1 to itab2.
sort itab2.
delete adjacent duplicates from itab2

Answer:
DOH
_________________
The Doc
Magna Grand Docot of the Tuly Idiot Order

2007 Basic Rules
Copyright ?2007 - 2008 www.jt77.com