Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Deleting Duplicate entries from Internal tbale

Hi All,

I have used this code to delete duplicate entries from an internal table.

DELETE ADJACENT DUPLICATES FROM IT_KOSTL COMPARING KOSTL hours.

After this statment, still the internal table will remain with a duplicate row.

Earlier table content before the delete statement:

Lno KOSTL PRCTR hours hours1

1 2081010205 0000208101 5525.000 1574.500

2 2081010105 0000208101 105162.000 73854.750

3 2081010105 0000208101 105162.000 73854.750

4 2081010205 0000208101 5525.000 1574.500

The Table gets modified after execution of DELETE statement as follows.

Lno KOSTL PRCTR hours hours1

1 2081010205 0000208101 5525.000 1574.500

2 2081010105 0000208101 105162.000 73854.750

3 2081010205 0000208101 5525.000 1574.500

Why the line 3 is still present in the table?

I hope as per that syntax, this line too should get delete.... Is it right?

Basically i would like to delete both line 3 and line 4 from....

How to resolve this issue?

Please help me out....

Regards

Pavan

What might be the reason?

Tags:
Former Member
Former Member replied

Hi,

Sort the internal table first.

I think you haven't used COMPARING <fields> addition thats why duplicate records are not getting deleted.

Regards

Abhijeet

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question