<?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 duplicates and Sort! in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736515#M320298</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you need to Sort the itab before you use delete adjacent duplicates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Madhu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Dec 2006 16:36:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-18T16:36:09Z</dc:date>
    <item>
      <title>delete adjacent duplicates and Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736509#M320292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a basic one, but I need to confirm from you guys. I believe whenever we use the statement 'DELETE ADJACENT DUPLICATES FROM ITAB......' we should sort itab before that on the field we are comparing. If not the delete adjacent duplicates statement will not work correctly. Am I right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 16:23:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736509#M320292</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T16:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: delete adjacent duplicates and Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736510#M320293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you are right.&lt;/P&gt;&lt;P&gt;The logic is simple, the statement DELETE ADJACENT DUPLICATES. So unless the data next to each other it cannot delete the duplicates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note - Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 16:25:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736510#M320293</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T16:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: delete adjacent duplicates and Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736511#M320294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, absolutely,  otherwise, the duplicates would not be adjacent, right?  &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 16:25:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736511#M320294</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-12-18T16:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: delete adjacent duplicates and Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736512#M320295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Buddy.&lt;/P&gt;&lt;P&gt;Always do a SORT on Itab before applying DELETE ADJASCENT DUPLICATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Surya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 16:25:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736512#M320295</guid>
      <dc:creator>surya_gupta3</dc:creator>
      <dc:date>2006-12-18T16:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: delete adjacent duplicates and Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736513#M320296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Somen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep cursor on Key DELETE in Se38.&lt;/P&gt;&lt;P&gt;Do F1 on.. Read details from SAP documentation. &lt;/P&gt;&lt;P&gt;Will learn more about the Options and limitations.&lt;/P&gt;&lt;P&gt;&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;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope This helps in future.&lt;/P&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Manish Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 16:26:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736513#M320296</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T16:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: delete adjacent duplicates and Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736514#M320297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From F1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;The DELETE ADJACENT DUPLICATES statement works particularly well if you &lt;/P&gt;&lt;P&gt;have sorted the internal table itab according to the fields that you want to compare &lt;/P&gt;&lt;P&gt;when looking for duplicates. In this case, deleting adjacent duplicates is the same &lt;/P&gt;&lt;P&gt;as deleting all duplicates. The direction of the sort is irrelevant. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 16:27:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736514#M320297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T16:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: delete adjacent duplicates and Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736515#M320298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you need to Sort the itab before you use delete adjacent duplicates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Madhu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 16:36:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736515#M320298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T16:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: delete adjacent duplicates and Sort!</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736516#M320299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the replies.....Points awarded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 16:39:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-adjacent-duplicates-and-sort/m-p/1736516#M320299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T16:39:03Z</dc:date>
    </item>
  </channel>
</rss>

