10-07-2007 4:40 AM
Hi All,
I want to find out the duplicate entry in the internal table. I have used,
Delete Adjacent duplicates from itab.
It is straight away deleting the record.
I want the user to correct that duplicate record.
May be some error message.
I have tried, with read,
Read table itab with key bzirk = itab-bzirk vkorg = itab-vkorg kunnr = itab-kunnr
matnr = itab-matnr comparing bzirk vkorg kunnr matnr.
But it's giving sy-subrc = 0 for the first record also.
Even, I have tried like, but it's giving syntax error.
Loop at itab where bzirk = itab-bzirk vkorg = itab-vkorg kunnr = itab-kunnr
matnr = itab-matnr.
Endloop.
Any method in case on Table control entries.
Thanks & Regards,
Kalyan Chandramouli
SAP Consultant
10-07-2007 4:58 AM
Hi,
Create a new internal table and assign the all the records of itab1 to itab2.
1.Sort Itab2.
2.delete adjacent duplicates.
3. loop at itab2.
loop at itab1 where <conditon you want....>
count = count + 1.
endloop.
if count GT 1.
append the iatb2 records for user correction....
endif.
endloop.
If the hint is useful Say thanks by reward .
Regards,
Prabhu Rajesh
10-07-2007 4:58 AM
Hi,
Create a new internal table and assign the all the records of itab1 to itab2.
1.Sort Itab2.
2.delete adjacent duplicates.
3. loop at itab2.
loop at itab1 where <conditon you want....>
count = count + 1.
endloop.
if count GT 1.
append the iatb2 records for user correction....
endif.
endloop.
If the hint is useful Say thanks by reward .
Regards,
Prabhu Rajesh
10-07-2007 6:15 AM
data it_dupl...
if bzirk ne 0.
it_dupl[] = itab[].
delete adjacent duplicats from it_dupl.
if sy-subrc = 0.
message e111(zs1) 'Duplicate Record!'.
endif.
endif.