04-29-2008 6:04 AM
Hi Guys!
Here's the scenario, I have this syntax in my report..
delete adjacent duplicates from it_itab comparing matkl sptag+0(6)
The values inside the it_tab is as follows..
20080301|01010402
20080301|02024301
20080305|01010402
20080310|01010402
when I debug it, and used the syntax delete adjacent duplicates from it_itab comparing matkl sptag+0(6),
the output will be like this....
20080301|01010402
20080301|02024301
20080305|01010402
I dont know why this output showed up. I'm expecting do have this output
20080301|01010402
20080301|02024301
Could someone explain why this happened? Is there a problem or loop hole in delete adjacent duplicate?
Please help! thanks so much!
Regards,
Mackoy
04-29-2008 6:06 AM
sort it with the fields u want to compare and delete, before delete adjacent duplicates statement...
04-29-2008 6:06 AM
sort it with the fields u want to compare and delete, before delete adjacent duplicates statement...
04-29-2008 6:08 AM
You should sort in the same order of fields that you compare with, before you use the DELETE ADJACENT DUPLICATES statement. Otherwise the statement is ineffective.
Reward if useful,
Thanks,
Rahul
04-29-2008 6:09 AM
hi
do this:
sort it_itab by matkl sptag.
delete adjacent....
delete adjacent will always look for the adjacent entries, and if a dupliacte is found then it deletes the 2nd records.
for ex , u have,
var1
123
123
124
125
123
in this case....2nd record is deleted and the output will be
123
124
125
123 . if it was sorted by var1 and then delete adjacent duplicates was used then it will have unique records.
regards,
madhumitha
04-29-2008 6:13 AM
You should sort the fields before that..
sort it_itab by matkl sptag.
delete adjacent duplicates from it_itab comparing matkl sptag+0(6)
04-29-2008 6:13 AM