Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

function module

Former Member
0 Likes
685

is there any function module which compares two internal tables.

7 REPLIES 7
Read only

Former Member
0 Likes
644

No. You need to build the logic for the same.

Read only

Former Member
0 Likes
644

Hi,

I think no.

Thanks,

Sri.

Read only

former_member404244
Active Contributor
0 Likes
644

Hi,

there is no such function module is available....u can see the difference in the program itself.

Regards,

Nagaraj

Read only

Former Member
0 Likes
644

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.

Read only

Former Member
0 Likes
644

Try FM ENH_COMPARE_ITABS

Regards.

Read only

Former Member
0 Likes
644

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.

Read only

RoySayak
Active Participant
0 Likes
644

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..