‎2007 Dec 06 7:47 AM
hi.
Iam having 2 itab's, and i want to compare this 2 itab.
itab1 and itab2 is a structure of CAUFVD ( so approx 300 fields).
itab1 consist of old values and itab2 consist of new values. when iam comapring this two tables the fields the difference should be stored in a new table.
SO is there any function module for this.........
Thanking you.
regards.
‎2007 Dec 06 7:50 AM
Hi!
Try out this one:
CTVB_COMPARE_TABLES
However I think you might code it faster with a line-by-line comparison, within a LOOP.
Regards
Tamá
‎2007 Dec 06 7:50 AM
Hi!
Try out this one:
CTVB_COMPARE_TABLES
However I think you might code it faster with a line-by-line comparison, within a LOOP.
Regards
Tamá
‎2007 Dec 06 7:53 AM
‎2007 Dec 06 7:56 AM
Hi Hemant
I am not sure about FM , but you can write a code , which compares line by line and if sy-subrc fails then move the record to internal table which is having similar structure as that of itab1 or 2
Regards
Hemant
‎2007 Dec 06 8:26 AM
hi,
try this code.
i had a similar application and this code worked fine.
loop at itab1.
read table itab2 with key...(fields which uniquely identify records like - field1 = itab1-field1...).
if sy-subrc <> 0.
move itab1 to itab_new.
append itab_new.
clear itab_new.
endif.
clear itab1.
clear itab2.
endloop.
itab2 is old table and itab1 contains some new/changed values.
hope this gives u some idea.
‎2007 Dec 06 8:40 AM
but my itab consist of 411 fields (columns) so how to comapre each fields.......is a structure of (CAUFVDB)
‎2007 Dec 06 9:32 AM
don't take all columns only those columns which identify each record...like primary key ...
‎2007 Dec 06 8:32 AM
sort itab1 by key fields.
sort itab1 by key fields.
Loop at itab1.
read table itab2 with key field.
if sy-subrc <> 0.
append itab1 to new_itab.
endif.
endloop.
hope thi helps you..
‎2007 Dec 06 9:42 AM
HI,
U can take a temp. table and add rows which u need to compare which are from different tables.
then use DELETE ITAB COMPARING ALL FIELDS.
then describe table temp. if it has one row then fileds are same else they are different.
‎2009 Mar 02 10:42 AM