‎2008 Jan 11 12:18 PM
is there any function module which compares two internal tables.
‎2008 Jan 11 12:22 PM
‎2008 Jan 11 12:24 PM
‎2008 Jan 11 12:25 PM
Hi,
there is no such function module is available....u can see the difference in the program itself.
Regards,
Nagaraj
‎2008 Jan 11 12:28 PM
Hi,
If you just want to check both are equal you can try like;
if itab1[] eq itab2[].
write:/ 'OK'.
else.
write:/ 'Not OK'.
endif.
Regards,
Renjith Michael.
‎2008 Jan 11 12:32 PM
‎2008 Jan 11 12:36 PM
Hi madhu,
Try this function module
COMPARE_TABLES
This gives you the result "F" if the tables have different data and "T" if the data matches
Reward if useful.
‎2008 Jan 11 12:41 PM
Hi Madhu,
Here is a example of internal table processing... i think it may be helpful to you...
t_itab: f1 f2 f3 f4 f5
t_itab1: f1 f3 f7 f8 f9 (f1 & f3 common field)
t_itab2: f1 f2 f3 f7 f9 (match the common field of t_itab & t_itab1)
loop at i_tab.
t_itab2-f1 = t_itab-f1
t_itab2-f2 = t_itab-f2
t_itab2-f3 = t_itab-f3
append t_itab2.
endloop.
sort t_itab1 by f1 f3.
sort t_itab2 by f1 f3.
loop at t_itab2.
read table t_itab1
with key f1 = t_itab2-f1
f3 = t_itab2-f3.
if sy-subrc = 0.
t_itab2-f7 = t_itab1-f7.
t_itab2-f9 = t_itab1-f9.
modify t_itab2.
endif.
endloop.
if it is helpful reward points
Regards,
Sayak..