<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Delete Duplicates without Sorting in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675174#M1290232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are not doing sorting it will not delete all the records but if you sort it the data output will be not according to u r requirements. so keep the loop to the internal table and delete each and every record.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 May 2009 03:56:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-25T03:56:39Z</dc:date>
    <item>
      <title>Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675171#M1290229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   I need to &lt;STRONG&gt;delete duplicates&lt;/STRONG&gt; from my ITAB and that too &lt;STRONG&gt;without sorting&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Is there any way I can do it ??  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Will appreciate a faster response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chandan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 03:30:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675171#M1290229</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T03:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675172#M1290230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can use &lt;STRONG&gt;clear&lt;/STRONG&gt; statement..Y u don't want to sort itab?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Karthik R on May 25, 2009 9:13 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 03:43:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675172#M1290230</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T03:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675173#M1290231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cant do SORT because my requirement is like that, I can't afford to change the Order of entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please tell me the Syntax for CLEAR statement in order to remove the duplicates ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normal Clear I know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 03:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675173#M1290231</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T03:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675174#M1290232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are not doing sorting it will not delete all the records but if you sort it the data output will be not according to u r requirements. so keep the loop to the internal table and delete each and every record.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 03:56:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675174#M1290232</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T03:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675175#M1290233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before appending the table ..just write the read statement on the same internal table to check whether the record is available with the same key or not. IF it is found dont append ..thats it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar Bandanadham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 03:57:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675175#M1290233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T03:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675176#M1290234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below logic will resolve your problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZDUPLICATE&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZDUPLICATE.&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ty,&lt;/P&gt;&lt;P&gt;  a TYPE C,&lt;/P&gt;&lt;P&gt;  b TYPE C,&lt;/P&gt;&lt;P&gt;END OF ty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: itab TYPE TABLE OF ty,&lt;/P&gt;&lt;P&gt;      wa LIKE LINE OF itab,&lt;/P&gt;&lt;P&gt;      wa1 LIKE LINE OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: v_tabix like sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-a = 'r'.&lt;/P&gt;&lt;P&gt;wa-b = 's'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-a = 'g'.&lt;/P&gt;&lt;P&gt;wa-b = 'l'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-a = 'r'.&lt;/P&gt;&lt;P&gt;wa-b = 's'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-a = 'r'.&lt;/P&gt;&lt;P&gt;wa-b = 's'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-a = 'r'.&lt;/P&gt;&lt;P&gt;wa-b = 's'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO wa.&lt;/P&gt;&lt;P&gt;v_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;add 1 to v_tabix .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP at itab FROM v_tabix INTO wa1 where a = wa-a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DELETE itab INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Peranandam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 04:08:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675176#M1290234</guid>
      <dc:creator>Peranandam</dc:creator>
      <dc:date>2009-05-25T04:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675177#M1290235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this one.For example it_tab is the table you are having. Now create a dummy int tab it_dmy same as it_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;it_dmy = it_tab.

sort it_dmy by field1 ... .

delete adjacent duplicates from it_dmy comparing field1 ... .

loop at it_tab into wa_tab.
w_index = sy-tabix.
read table it_dmy with key field1 = wa_tab-field1 transporting no fields.
if sy-subrc &amp;lt;&amp;gt; 0. "If the entr not exists in dummy table then delete it from original table
delete it_tab index w_index.
endif.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj Kumar P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Manoj Kumar on May 25, 2009 6:14 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 04:13:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675177#M1290235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T04:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675178#M1290236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi chandan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ztest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;      name TYPE string,&lt;/P&gt;&lt;P&gt;      num TYPE i,&lt;/P&gt;&lt;P&gt;      END OF itab,&lt;/P&gt;&lt;P&gt;      itab1 LIKE itab OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      wa LIKE itab,&lt;/P&gt;&lt;P&gt;      wa1 LIKE itab,&lt;/P&gt;&lt;P&gt;      f TYPE i VALUE 1,&lt;/P&gt;&lt;P&gt;      count TYPE i VALUE 0,&lt;/P&gt;&lt;P&gt;      f1 TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-name = 'ram1'.&lt;/P&gt;&lt;P&gt;wa-num = '1'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-name = 'ram2'.&lt;/P&gt;&lt;P&gt;wa-num = '2'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-name = 'ram3'.&lt;/P&gt;&lt;P&gt;wa-num = '3'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-name = 'ram4'.&lt;/P&gt;&lt;P&gt;wa-num = '4'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-name = 'ram5'.&lt;/P&gt;&lt;P&gt;wa-num = '5'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-name = 'ram2'.&lt;/P&gt;&lt;P&gt;wa-num = '6'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1[] = itab[].&lt;/P&gt;&lt;P&gt;CLEAR: wa, wa1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab INTO wa.&lt;/P&gt;&lt;P&gt;  LOOP AT itab1 WHERE  name = wa-name.&lt;/P&gt;&lt;P&gt;    IF f NE 1.&lt;/P&gt;&lt;P&gt;      count = count + 1.&lt;/P&gt;&lt;P&gt;      IF count &amp;gt; 1.&lt;/P&gt;&lt;P&gt;        f1 = f - 1.&lt;/P&gt;&lt;P&gt;        DELETE itab INDEX f1.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    f = f + 1.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  CLEAR count.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 04:25:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675178#M1290236</guid>
      <dc:creator>awin_prabhu</dc:creator>
      <dc:date>2009-05-25T04:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675179#M1290237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM itab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 05:47:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675179#M1290237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T05:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675180#M1290238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can directly use :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete adjacent duplicates from ITAB comparing your fields. But this will not ensure all the duplicates will be deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please ellaborate on the requirement. it seems to me that you have scenario like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;F1  F2  &lt;/P&gt;&lt;P&gt;A     2   &lt;/P&gt;&lt;P&gt;A     1&lt;/P&gt;&lt;P&gt;A     6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to retain the first entry what so ever is the sequence (i.e. A 2). You need to delete the entries A 1 and A 6. But if you sort it it will change the sequence to A 1, A 2 and A 6.  &lt;/P&gt;&lt;P&gt; If yes, then use "stable sort"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;sort itab by f1 f2 stable.
delete adjacent duplicates from itab comparing f1.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it will retain your sequence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last ioption is move the contants of ITAB[] to temporary table TEMP[]. Sort temp and delete adjacent duplicates. After that loop at ITAB and compare the  results of two table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 05:57:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675180#M1290238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T05:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675181#M1290239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u dont want to sort the ITAB, use a local internal table L_ITAB. Sort this table and delete the adjacent duplicates. Then check the entries in the ITAB with L_ITAB and delete the values from the ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Move the data from ITAB to L_ITAB.&lt;/P&gt;&lt;P&gt;2. Sort L_ITAB and delete adjacent duplicates from it.&lt;/P&gt;&lt;P&gt;3. Loop the ITAB.&lt;/P&gt;&lt;P&gt;      Read the L_ITAB&lt;/P&gt;&lt;P&gt;        if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;          delete ITAB.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this may be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sharin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 05:58:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675181#M1290239</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T05:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675182#M1290240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this code for sure your issue will be resovled....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data wa1 like line of itab.
data w_index type sy-index.
LOOP AT itab INTO wa.
w_index = sy-tabix.
LOOP AT itab into wa1 FROM w_index WHERE field1 = wa-field1.
"  in the where clause you can give more than one field condition depending on the uniqueness of the record
" due to which there are duplicates....
count = count + 1.
IF count &amp;gt; 1.
DELETE itab.
ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 06:09:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675182#M1290240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T06:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Duplicates without Sorting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675183#M1290241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just add one field to itab.&lt;/P&gt;&lt;P&gt;update the filed by tabix .&lt;/P&gt;&lt;P&gt;then sort the table as per the key and delete adjacent duplicates.&lt;/P&gt;&lt;P&gt;and again sort as per the new field, so that your sequence will remain as it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Kimaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 May 2009 06:10:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-duplicates-without-sorting/m-p/5675183#M1290241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-25T06:10:09Z</dc:date>
    </item>
  </channel>
</rss>

