<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370684#M525219</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can also check this example &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE TABLE &amp;lt;itab&amp;gt; FROM &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;DELETE TABLE &amp;lt;itab&amp;gt; WITH TABLE KEY &amp;lt;k1&amp;gt; = &amp;lt;f1&amp;gt; ... &amp;lt;kn&amp;gt; = &amp;lt;fn&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first case, &amp;lt;wa&amp;gt; must be a work area compatible with the line type of &amp;lt;itab&amp;gt;. The values&lt;/P&gt;&lt;P&gt;of the key fields are taken from the corresponding components of the work area.&lt;/P&gt;&lt;P&gt;In the second case, you have to supply the values of each key field explicitly. If you do not know&lt;/P&gt;&lt;P&gt;the name of one of the key fields until runtime, you can specify it as the content of a field &amp;lt;ni&amp;gt;&lt;/P&gt;&lt;P&gt;using the form (&amp;lt;ni&amp;gt;) = &amp;lt;fi&amp;gt;. If the data types of &amp;lt;fi&amp;gt; are not compatible with the key fields, the&lt;/P&gt;&lt;P&gt;system converts them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 17 Jun 2007 03:39:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-17T03:39:48Z</dc:date>
    <item>
      <title>delete</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370682#M525217</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;1) point a) just a single statement can do the delete in a single process as compared to point b) and c) where they need to do looping, right? so with a WHERE condition it can delete in a single process, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) point b) and c) any difference? the TABLE is meant for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a)&lt;/P&gt;&lt;P&gt;delete lt_mseg1 where dmbtr = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b)&lt;/P&gt;&lt;P&gt;loop at lt_mseg1 into lw_mseg1.&lt;/P&gt;&lt;P&gt;if lw_mseg1-dmbtr = 0.&lt;/P&gt;&lt;P&gt;delete TABLE lt_mseg1 from lw_mseg1. &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;c)&lt;/P&gt;&lt;P&gt;loop at lt_mseg1 into lw_mseg1.&lt;/P&gt;&lt;P&gt;if lw_mseg1-dmbtr = 0.&lt;/P&gt;&lt;P&gt;delete lt_mseg1 from lw_mseg1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jun 2007 02:10:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370682#M525217</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-17T02:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: delete</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370683#M525218</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;point 1. yes a &amp;amp; ( b and c ) are same. approach a is better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;point 2. yes there is a difference in b &amp;amp; c.&lt;/P&gt;&lt;P&gt; you use table when the loop of the table and the deleted table are different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. - loop at itab1 into wa_itab1.&lt;/P&gt;&lt;P&gt;          if wa_itab2-dmbtr = wa_itab1-dmbtr&lt;/P&gt;&lt;P&gt;           delete table itab2 from wa_itab2.&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;        here you are deleting table itab2 entries w.r.t entries in table itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it is clear.&lt;/P&gt;&lt;P&gt;however in your case, you can or cannot use TABLE. both are ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jun 2007 03:33:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370683#M525218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-17T03:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: delete</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370684#M525219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can also check this example &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE TABLE &amp;lt;itab&amp;gt; FROM &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;DELETE TABLE &amp;lt;itab&amp;gt; WITH TABLE KEY &amp;lt;k1&amp;gt; = &amp;lt;f1&amp;gt; ... &amp;lt;kn&amp;gt; = &amp;lt;fn&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first case, &amp;lt;wa&amp;gt; must be a work area compatible with the line type of &amp;lt;itab&amp;gt;. The values&lt;/P&gt;&lt;P&gt;of the key fields are taken from the corresponding components of the work area.&lt;/P&gt;&lt;P&gt;In the second case, you have to supply the values of each key field explicitly. If you do not know&lt;/P&gt;&lt;P&gt;the name of one of the key fields until runtime, you can specify it as the content of a field &amp;lt;ni&amp;gt;&lt;/P&gt;&lt;P&gt;using the form (&amp;lt;ni&amp;gt;) = &amp;lt;fi&amp;gt;. If the data types of &amp;lt;fi&amp;gt; are not compatible with the key fields, the&lt;/P&gt;&lt;P&gt;system converts them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jun 2007 03:39:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370684#M525219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-17T03:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: delete</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370685#M525220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;points awarded.&lt;/P&gt;&lt;P&gt;but can explain a bit on point 2? i need to loop itab2 also, right? why there are 2 internal table? in what situation have 2 internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1 into wa_itab1.&lt;/P&gt;&lt;P&gt;if wa_itab2-dmbtr = wa_itab1-dmbtr&lt;/P&gt;&lt;P&gt;delete table itab2 from wa_itab2.&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;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jun 2007 03:39:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370685#M525220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-17T03:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: delete</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370686#M525221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;This example is to demostrate the usage of TABLE in the delete statement.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;in your case you dont need to use two internal tables.&lt;/P&gt;&lt;P&gt;But had there been two internal tables and there would have been a necessity to delete 2nd internal table entries while you are in a loop of first internal table, then you should have used TABLE in the delete statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jun 2007 03:45:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370686#M525221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-17T03:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: delete</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370687#M525222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;thanks alot of your explanation.&lt;/P&gt;&lt;P&gt;can i conclude that the word TABLE whether use for delete or other function that operating on internal table means there are more than 1 internal table, right?&lt;/P&gt;&lt;P&gt;i always do not understand why some statement with table whereas some without table. &lt;/P&gt;&lt;P&gt;if what i said above is right then i am clear with your help.&lt;/P&gt;&lt;P&gt;will award you again of your reply.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jun 2007 03:54:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370687#M525222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-17T03:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: delete</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370688#M525223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes your conclusion is right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although this is only one use of table statement.&lt;/P&gt;&lt;P&gt;You can also use table when you have the to delete entries from the internal table based on the the TABLE keys.&lt;/P&gt;&lt;P&gt;Also the use of TABLE statement also related to the performance of the statement. Depending on the type of internal table the runtime of the statement will vary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system searches for the relevant lines as follows:&lt;/P&gt;&lt;P&gt;  Standard tables&lt;/P&gt;&lt;P&gt;Linear search, where the runtime is in linear relation to the number of table entries.&lt;/P&gt;&lt;P&gt;   Sorted tables&lt;/P&gt;&lt;P&gt;Binary search, where the runtime is in logarithmic relation to the number of table entries.&lt;/P&gt;&lt;P&gt;  Hashed tables&lt;/P&gt;&lt;P&gt;The entry is found using the hash algorithm of the internal table. The runtime is&lt;/P&gt;&lt;P&gt;independent of the number of table entries.&lt;/P&gt;&lt;P&gt;If the system finds a line, it deletes it from the table and sets SY-SUBRC to zero. Otherwise, SYSUBRC&lt;/P&gt;&lt;P&gt;is set to 4. If the table has a non-unique key and the system finds duplicate entries, it&lt;/P&gt;&lt;P&gt;deletes the first entry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jun 2007 04:08:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370688#M525223</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-17T04:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: delete</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370689#M525224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;plz refer to this link to find more details about it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 17 Jun 2007 04:09:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete/m-p/2370689#M525224</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-17T04:09:32Z</dc:date>
    </item>
  </channel>
</rss>

