<?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 DELETE FROM database table takes more time... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092641#M1359006</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;The below statement takes more time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT i_final.
  DELETE FROM zcisconec WHERE werks = i_final-werks
                          AND aufnr = i_final-aufnr
                          AND vornr = i_final-vornr.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal table I_FINAL will have more than 80,000 records.&lt;/P&gt;&lt;P&gt;DB Table &lt;STRONG&gt;zcisconec&lt;/STRONG&gt; have 4 primary key fields out of 10 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below 4 fields are primary key fields &lt;/P&gt;&lt;P&gt;WERKS&lt;/P&gt;&lt;P&gt;AUFNR&lt;/P&gt;&lt;P&gt;VORNR&lt;/P&gt;&lt;P&gt;MATNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide me..How to optimize it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Viji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2009 05:46:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-15T05:46:42Z</dc:date>
    <item>
      <title>DELETE FROM database table takes more time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092641#M1359006</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;The below statement takes more time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT i_final.
  DELETE FROM zcisconec WHERE werks = i_final-werks
                          AND aufnr = i_final-aufnr
                          AND vornr = i_final-vornr.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal table I_FINAL will have more than 80,000 records.&lt;/P&gt;&lt;P&gt;DB Table &lt;STRONG&gt;zcisconec&lt;/STRONG&gt; have 4 primary key fields out of 10 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below 4 fields are primary key fields &lt;/P&gt;&lt;P&gt;WERKS&lt;/P&gt;&lt;P&gt;AUFNR&lt;/P&gt;&lt;P&gt;VORNR&lt;/P&gt;&lt;P&gt;MATNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please guide me..How to optimize it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Viji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 05:46:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092641#M1359006</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-15T05:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM database table takes more time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092642#M1359007</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;Instead of looping the internal table and deleting the Db table use the below syntax,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DELETE zcisconec from i_final.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure i_final has the same structure as that of zcisconec&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 05:57:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092642#M1359007</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-15T05:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM database table takes more time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092643#M1359008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Viji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it depends on the data you have. Is the matnr filled? Or do you want do delete every entry with a combination of werks/aufnr/vornr? Then you can first sort the table, loop and do a at new vornr. So you have to do less deletes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another possiblity, but I'm not sure if it works, is too collect the entries to delete in a special itab with fields werks/aufnr/vornr and do a delete zcisconec from table itab_special. I'm not sure if it works, because you don't have the complete key specified. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bastian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 06:00:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092643#M1359008</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-15T06:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM database table takes more time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092644#M1359009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try  sorting i_final .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort i_final by werks aufnr vornr.&lt;/P&gt;&lt;P&gt;LOOP AT i_final.&lt;/P&gt;&lt;P&gt;  DELETE FROM zcisconec WHERE werks = i_final-werks&lt;/P&gt;&lt;P&gt;                          AND aufnr = i_final-aufnr&lt;/P&gt;&lt;P&gt;                          AND vornr = i_final-vornr.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 06:02:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092644#M1359009</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-15T06:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM database table takes more time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092645#M1359010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why u  using LOOP for deletion .if u have some lines from ifnal needed to be deleted.then its better to first move those line to another internal table and then just user DELETE Itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;means. if u have table ifinal which have 80,000 records.&lt;/P&gt;&lt;P&gt;  in this table u found suppose 1000 record needed to be deleted..so u move those records to another internal table like i_Deleted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then when u required just delete complete with DELETE I_delete so its performance will be good.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 06:05:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092645#M1359010</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-15T06:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM database table takes more time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092646#M1359011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hii,&lt;/P&gt;&lt;P&gt;add some more conditions to your where clause,if possible .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 06:06:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092646#M1359011</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-15T06:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM database table takes more time...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092647#M1359012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Check this one ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;put a break point on that delete statement and add another line of code after, like .... CHECK SY-SUBRC = 0. Now got to debug and stop at the DELETE statement, check the number of records in your DB table, now hit F5 to step to the next statement, now go back to SE16 and refresh, do you see the number change? It should.........if you are selecting the data correctly, make sure that you are getting data into the IT_  table.&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;STRONG&gt;DELETE zcisconec from i_final.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CALL FUNCTION 'DB_COMMIT'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ansari.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ansari Samsudeen on Sep 15, 2009 8:14 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 06:11:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-database-table-takes-more-time/m-p/6092647#M1359012</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-15T06:11:48Z</dc:date>
    </item>
  </channel>
</rss>

