How to eliminate duplicate entries in internal tables

Showing Answers 1 - 15 of 15 Answers

VijayaBhaskar Thammineni

  • Mar 15th, 2005
 

To delete all duplicate entries from a sorted internal table (e.g. just after SORT), you can use the DELETE ADJACENT DUPLICATES FROM itab statement. You can use the COMPARING adition to limit the fields that are used to test for duplicate entries e.g.SORT i_tab by matnr werks logort.DELETE ADJACENT DUPLICATES FROM itab COMPARING matnr werks.All duplicates withe same combination of matnr and werks will be deleted.Regardsvijay

Swapnil

  • Mar 25th, 2005
 

SORT itab.DELETE ADJACENT DUPLICATES FROM itab COMPARING ALL FIELDS.

pavan

  • Jun 27th, 2005
 

At the time of creation of internal table only u create as Sorted or query also has an option "DISTINCT" to eliminate duplicates

  Was this answer useful?  Yes

Norman

  • Aug 30th, 2005
 

Using DELETE ADJACENT DUPLICATES will retain the first entry. What if I want to delete all entries if duplicate is found. For example, if matnr A is found to have duplicates in the internal table, all entries with matnr A should be removed from the internal table. 
 
Any good logic that I can use?

  Was this answer useful?  Yes

SUNIL KUMAR.K

  • Oct 24th, 2005
 

Dear Friends,After fetching the data from database into internal table,just SORT the internal table using the statement"SORT ITAB WITH KEY ITAB-FIELD."after sortingDELETE ADJESENT DUPICATES FROM ITAB.now Ur internal table is with unique Identified data.if more clarifications, mail ur queries,........With RegardsSUNIL KUMAR

  Was this answer useful?  Yes

SUNIL KUMAR.K

  • Oct 24th, 2005
 

Dear Friends,After fetching the data from database into internal table,just SORT the internal table using the statement"SORT ITAB WITH KEY ITAB-FIELD."after sortingDELETE ADJESENT DUPICATES FROM ITAB.now Ur internal table is with unique Identified data.if more clarifications, mail ur queries,........With RegardsSUNIL KUMAR

  Was this answer useful?  Yes

diavakar reddy

  • Feb 28th, 2006
 

first sort the internal table and then follow the following syntax:

SORT itab <fieldname>.

delete adjcent  duplicates from itab comparing <field aname>.

  Was this answer useful?  Yes

sheetal

  • Oct 13th, 2006
 

Hi sirFor deleting the duplication entries I m trying the query" DELETE ADJESENT DUPICATES FROM ITAB " but sir this is not working could u pls let me know what is mistake in this.Thnaks & RegardsSheetal

  Was this answer useful?  Yes

Sushant Sehra

  • Nov 3rd, 2006
 

First Sort the Itab and then only delete the adjecent duplicates

  Was this answer useful?  Yes

MADHAVI BHEEMA

  • Nov 15th, 2006
 

DELETE ADJACENT DUPLICATES <ITABNAME>

  Was this answer useful?  Yes

umayaraja

  • Nov 25th, 2014
 

hi friends...........

first sort the value then use delete statement to delete the duplicate records,

sort by .
delete adjacent duplicate form comparing .

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions