<?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 ADJACENT DUPLCATES in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplcates/m-p/1338652#M171635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to SORT the itab before using the DELETE ADJACENT DUPLCATES statement..  you can also use the option COMPARING to be more specific.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Jun 2006 15:19:42 GMT</pubDate>
    <dc:creator>suresh_datti</dc:creator>
    <dc:date>2006-06-09T15:19:42Z</dc:date>
    <item>
      <title>DELETE ADJACENT DUPLCATES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplcates/m-p/1338651#M171634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I wonder why delete adjacent duplicate sometimes&lt;/P&gt;&lt;P&gt;doesn't work and sometimes doesn't. Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rose&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 15:18:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplcates/m-p/1338651#M171634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-09T15:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE ADJACENT DUPLCATES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplcates/m-p/1338652#M171635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to SORT the itab before using the DELETE ADJACENT DUPLCATES statement..  you can also use the option COMPARING to be more specific.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 15:19:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplcates/m-p/1338652#M171635</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-06-09T15:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE ADJACENT DUPLCATES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplcates/m-p/1338653#M171636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;chk this&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATES FROM itab. &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;Extras: &lt;/P&gt;&lt;P&gt;1. ... COMPARING f1 f2 ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... COMPARING ALL FIELDS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Deletes adjacent duplicate entries from the internal table itab. If there are n duplicate entries in succession, the first entry is retained, and the following n-1 entries are deleted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two lines are regarded as duplicates if their keys are identical. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Return Code is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;At least one duplicate was found, and at least one entry was deleted. &lt;/P&gt;&lt;P&gt;SY-SUBRC = 4: &lt;/P&gt;&lt;P&gt;No duplicates found, no entries deleted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... COMPARING f1 f2 ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Two lines of the internal table itab are regarded as duplicates if they have identical contents in the fields f1, f2, ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... COMPARING ALL FIELDS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Two lines of the internal table are regarded as duplicates if all of their field contents are identical. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Notes &lt;/P&gt;&lt;P&gt;The DELETE ADJACENT DUPLICATES statement works particularly well if you have sorted the internal table itab according to the fields that you want to compare when looking for duplicates. In this case, deleting adjacent duplicates is the same as deleting all duplicates. The direction of the sort is irrelevant. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do not know a comparison expression until runtime, you can specify it dynamically as the contents of the field name in the expression COMPARING ... (name) .... If name is empty at runtime, the comparison expression is ignored. If name contains an invalid component name, a runtime error occurs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can further restrict comparison expressions - both static and dynamic - by specifying offset and length. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;Performance: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you delete a line of an internal table, index maintenance costs are incurred. These depend on the index of the table. The runtime is independent of the width of the table line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deleting a line from the middle of an internal table with 200 entries usually requires around 10 msn (standardized microseconds). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you delete a set of entries using "DELETE itab FROM idx1 TO idx2." or "DELETE itab WHERE ...", index maintenance costs are only incurred once. This means that it is considerably more efficient than deleting entries in a LOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to delete adjacent duplicate entries from an internal table, use the variant " DELETE ADJACENT DUPLICATES FROM itab." instead of a LOOP construction.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 15:20:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplcates/m-p/1338653#M171636</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-09T15:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE ADJACENT DUPLCATES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplcates/m-p/1338654#M171637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;  SORT IT_SALES_DATA BY  VBELN POSNR.

  DELETE ADJACENT DUPLICATES FROM IT_SALES_DATA COMPARING  VBELN POSNR.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you need to sort before using delete adjacent duplicates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jun 2006 15:22:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplcates/m-p/1338654#M171637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-09T15:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE ADJACENT DUPLCATES</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplcates/m-p/1338655#M171638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suresh Datti and vijay,&lt;/P&gt;&lt;P&gt;Thanks for your replies. I have figured it out myself.&lt;/P&gt;&lt;P&gt;But I am still giving you points for your very very&lt;/P&gt;&lt;P&gt;prompt reply.  I got very busy though afterwards and&lt;/P&gt;&lt;P&gt;was unable to reply soon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regrds,&lt;/P&gt;&lt;P&gt;Rose&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jun 2006 10:16:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplcates/m-p/1338655#M171638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-19T10:16:20Z</dc:date>
    </item>
  </channel>
</rss>

