<?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 records from table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264468#M491243</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;sort Itab by f1 f2 f3.  then&lt;/P&gt;&lt;P&gt;write&lt;/P&gt;&lt;P&gt;Delete adjacent duplicates from itab comparing f1 f2 f3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Anji Reddy Vangala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 May 2007 04:51:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-18T04:51:12Z</dc:date>
    <item>
      <title>delete records from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264466#M491241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one query regarding delete adjacent duplicates statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose I have table itab having fields f1, f2 &amp;amp; f3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f1  f2  f3&lt;/P&gt;&lt;P&gt;a   b   c&lt;/P&gt;&lt;P&gt;d   e   f&lt;/P&gt;&lt;P&gt;g   h   i&lt;/P&gt;&lt;P&gt;a   b   c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I would like to delete the fourth entry means a, b, c because it is duplicate entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used " Delete adjacent duplicates from itab."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the above statement will not delete the duplicate entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anybody will pls tell me what I need to do?/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 04:48:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264466#M491241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T04:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: delete records from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264467#M491242</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;sort the internal table first and then run the command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To delete adjacent duplicate entries use the following statement: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE ADJACENT DUPLICATE ENTRIES FROM &amp;lt;itab&amp;gt; &lt;/P&gt;&lt;P&gt;                                  [COMPARING &amp;lt;f1&amp;gt; &amp;lt;f 2&amp;gt; ... &lt;/P&gt;&lt;P&gt;                                             |ALL FIELDS].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system deletes all adjacent duplicate entries from the internal table &amp;lt;itab&amp;gt;. Entries are duplicate if they fulfill one of the following compare criteria:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without the COMPARING addition, the contents of the key fields of the table must be identical in both lines. &lt;/P&gt;&lt;P&gt;If you use the addition COMPARING &amp;lt;f1&amp;gt; &amp;lt;f 2&amp;gt; ... the contents of the specified fields &amp;lt;f 1 &amp;gt; &amp;lt;f 2 &amp;gt; ... must be identical in both lines. You can also specify a field &amp;lt;f i &amp;gt; dynamically as the contents of a field &amp;lt;n i &amp;gt; in the form (&amp;lt;n i &amp;gt;). If &amp;lt;n i &amp;gt; is empty when the statement is executed, it is ignored. You can restrict the search to partial fields by specifying offset and length. &lt;/P&gt;&lt;P&gt;If you use the addition COMPARING ALL FIELDS the contents of all fields of both lines must be identical. &lt;/P&gt;&lt;P&gt;You can use this statement to delete all duplicate entries from an internal table if the table is sorted by the specified compare criterion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think it solve your problems'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Deepak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 04:50:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264467#M491242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T04:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: delete records from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264468#M491243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;use&lt;/P&gt;&lt;P&gt;sort Itab by f1 f2 f3.  then&lt;/P&gt;&lt;P&gt;write&lt;/P&gt;&lt;P&gt;Delete adjacent duplicates from itab comparing f1 f2 f3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Anji Reddy Vangala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 04:51:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264468#M491243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T04:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: delete records from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264469#M491244</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;Suppose I don't want to sort the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So is there any way other than this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:03:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264469#M491244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: delete records from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264470#M491245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use this way - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort Itab by f1 f2 f3. &lt;/P&gt;&lt;P&gt;Delete adjacent duplicates from itab comparing f1 f2 f3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:03:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264470#M491245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: delete records from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264471#M491246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neha, &lt;/P&gt;&lt;P&gt;             Use this statement:&lt;/P&gt;&lt;P&gt;               &lt;/P&gt;&lt;P&gt;        DELETE ADJACENT DUPLICATES FROM ITAB&lt;/P&gt;&lt;P&gt;                COMPARING K.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE ITAB INDEX 1 INTO PREV_LINE.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB FROM 2 INTO WA.&lt;/P&gt;&lt;P&gt;  IF WA = PREV_LINE.&lt;/P&gt;&lt;P&gt;    DELETE ITAB.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    PREV_LINE = WA.&lt;/P&gt;&lt;P&gt;  ENDIF.&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;Reward points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:06:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264471#M491246</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: delete records from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264472#M491247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt; Sorting is not necessary in this case....&lt;/P&gt;&lt;P&gt;you can directly write like..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete adjacent duplicates from itab comparing f1 f2 f3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers..........&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:07:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264472#M491247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: delete records from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264473#M491248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if u don want to sort the table then u can write a piece of code to do this but that will be highly inefficient -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab1[] = itab[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;loop at itab where f1 = itab1-f1 and f2 = itab1-f2 and f3 = itab1-f3.&lt;/P&gt;&lt;P&gt;if sy-tabix GT '1'.&lt;/P&gt;&lt;P&gt;delete itab index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now print itab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:09:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264473#M491248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: delete records from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264474#M491249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If u wont sort internal table , then u cannot use "delet adjacent  dupliactes" as this statement will delete only records which are adjacent (i,e one next to another).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or else do the follwing.without using Sort:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop the table into workarea. &lt;/P&gt;&lt;P&gt;and then read each recor of the  table with key.&lt;/P&gt;&lt;P&gt;if this stament is sucees for 2 times (i.e more than 1 record)&lt;/P&gt;&lt;P&gt;get the sy-index of that record&lt;/P&gt;&lt;P&gt;and delete the same record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e&lt;/P&gt;&lt;P&gt;copy to another internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab2 [] = itab1[]&lt;/P&gt;&lt;P&gt;count type i value 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 into wa1.&lt;/P&gt;&lt;P&gt;read table itab2 into wa2 with key f1 = wa1-f1  f2 = wa1-f2  f3 = wa3-f3.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;count = count +1 .&lt;/P&gt;&lt;P&gt;if count &amp;gt;=  2        " i.e more than 1 record.&lt;/P&gt;&lt;P&gt;delete from itab2 index sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;revert back if any issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward with points if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:12:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264474#M491249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: delete records from table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264475#M491250</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;Sort itab by f1 f2 f3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete adjecent duplicates comparing all. " if only three flds are there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will delete last entry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jogdand M B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:39:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-records-from-table/m-p/2264475#M491250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:39:10Z</dc:date>
    </item>
  </channel>
</rss>

