05-16-2006 12:44 PM
Hi all,
I have 2 internal tables containing records from 2 different database tables.
How can i compare the 2 internal tables and produce result that the record exists in one table
but not in the second table.
Thanks,
/
Reddy.
05-16-2006 12:51 PM
05-16-2006 12:47 PM
05-16-2006 12:49 PM
HI Prabhakar,
do this way,
sort it_mseg2.
LOOP AT it_ekpo.
READ TABLE it_mseg2 binary search WITH KEY ebeln = it_ekpo-ebeln.
IF sy-subrc = 0.
it_ekpo1 = it_ekpo.
append it_ekpo1.
clear it_ekpo1.
ENDIF.
ENDLOOP.
Regards,
Santosh
05-16-2006 12:51 PM
05-16-2006 12:51 PM
Loop at one internal table1 .
Read theinternal table2 with some ctiteria to compare(Decide the deletion criteria based on some fields).
Then delete the rwo from internal table 2.
05-16-2006 12:54 PM
loop at table1 .
read table table2 with key ....
if sy-subrc eq 0 .
*record is there
else .
move the record to result tab .
endif .
endloop .
loop at table2 .
read table table1 with key ....
if sy-subrc eq 0 .
*record is there
else .
move the record to result tab .
endif .
endloop .
Regards
Raja
05-16-2006 12:54 PM
if there are comman fields in the 2 internal tables ,
add one more flag to itab2 of length 1
loop at itab1.
read table itab2 with key keyfield1 = itab1-keyfield1 ....
if sy-subrc = 0.
itab2-flag = 'X'.
modify itab2 transporting flag.
endif.
endloop.
now depending on flag value u can distinguish them