‎2006 Oct 26 11:44 AM
Hi all ,
I have 2 Itables with similar structure( f1,f2,f3,f4 ).
i want to compare the field (f4) of two itables if (f1 ,f2, f3 ) is equal. if (f4) is not same then i should move this to itable c.
Example : itab1
A B C X
c c d X
itab2
A B C Y
A B C Z
c c d X
Finally i have to display it as A B C X
A B C Y
A B C X
A B C Z
__________
I did like this.
***loop at itab1 .
loop at itab2 into w_itab
**********where f1 = itab1-f1
****************f2 = itab1-f2
****************f3 = itab1-f3.
********append w_itab to itab3 .
*******endloop. (itab2)
******if sy-subrc eq 0 .
*********loop at itab3 .
************if itab1-f4 NE itab3-f4 .
***************Error-f1 = itab1-f1 .
***************Error-p1 = itab3-f1 .
***************.
***************append Error.
***************endif.
********endloop.(itab3)
endif.
**endloop. (itab1)
********
i got the performence issue here . can anybody suggest alternate solution for this.
Thanks.
‎2006 Oct 26 11:46 AM
Press buton "code" to retrieve the structure of the code.
and don't ask two times the same question
thanks
‎2006 Oct 26 11:47 AM
Hi,
use sorted table for itab2
data: itab2 type sorted table of ty_1 with non-unique key f1 f2 f3.
A.
Message was edited by: Andreas Mann
‎2006 Oct 26 2:30 PM
Read this:
/people/rob.burbank/blog/2006/02/07/performance-of-nested-loops
Rob