<?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: Abap performance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595862#M267682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can just use the modify statement and no need to write any commit after that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify ZTABLE from table ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**&lt;STRONG&gt;make sure the internal table ITAB is of type ZTABLE&lt;/STRONG&gt;**&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;b&amp;gt;PLEASE CLOSE ALL THE PREVIOUS THREADS IF PROBLEM SOLVED&amp;lt;/b&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Gopi Narendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Oct 2006 00:40:12 GMT</pubDate>
    <dc:creator>gopi_narendra</dc:creator>
    <dc:date>2006-10-02T00:40:12Z</dc:date>
    <item>
      <title>Abap performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595861#M267681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI ALl ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In My program , i got one internal table (itab) and one &lt;/P&gt;&lt;P&gt;customized database table say DB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I fill itab and then deletes the existing records in table DB and now i have to fill DB with records in table &lt;/P&gt;&lt;P&gt;itab . &lt;/P&gt;&lt;P&gt;I have two optins :&lt;/P&gt;&lt;P&gt;LOOP AT ITAB. modify db from itab . Endloop .&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;MODIFY DB FROM TABLE ITAB .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which one is better(performace wise) and should i write commit work after&lt;/P&gt;&lt;P&gt;these statements .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2006 00:31:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595861#M267681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-02T00:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Abap performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595862#M267682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can just use the modify statement and no need to write any commit after that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify ZTABLE from table ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**&lt;STRONG&gt;make sure the internal table ITAB is of type ZTABLE&lt;/STRONG&gt;**&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;b&amp;gt;PLEASE CLOSE ALL THE PREVIOUS THREADS IF PROBLEM SOLVED&amp;lt;/b&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Gopi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Gopi Narendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2006 00:40:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595862#M267682</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2006-10-02T00:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Abap performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595863#M267683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe the 2nd option (from table) is better and that no commit is required. An implicit commit will occur when your program ends..... of course if you have a complex program you may need to put one in but for normal purposes it's not needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your table is small or medium the performance benefits may be small so if you wanted to, say, catch errors and show them on a report for update failures then the first option would be ok.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2006 01:01:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595863#M267683</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-10-02T01:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Abap performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595864#M267684</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;The second option is better performance wise. No need to write COMMIT WORK .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2006 01:22:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595864#M267684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-02T01:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Abap performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595865#M267685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go for,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY DB FROM TABLE ITAB .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because, if the internal table entries are not in DB then the DB will be inserted with those table entries, Otherwise, the record will be modified against internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Performance is also good because, you are accessing the DB at once and not in loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regs,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Venkat Ramanan Natarajan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2006 08:36:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595865#M267685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-02T08:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Abap performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595866#M267686</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;Most of the performance issues are related to database. It should be an inherent practice to reduce the access to database as far as possible and use it in the most optimal manner.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Just as in select statements, database updates also affect the performance. When records are to be inserted in database table do it in once. Populate the internal table completely, with which the records are to be inserted. Then update the table from the internal table instead of updating it for each record within the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Do not use

	Loop at i_mara.
		---------------
		---------------
		mara = i_mara.
Modify mara.
	Endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avoid accessing database multiple times even for updating the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As is seen the table mara is modified for each record. The performance can be considerably improved if the internal table is populated and then the table is updated once for all the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead use the statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at i_mara.
--------------
---------------	
Modify i_mara.
Endloop.

Modify mara from table i_mara.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As is seen the table mara is modified for once in the end. The performance is considerably improved and the database access is reduced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sailaja.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2006 08:49:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595866#M267686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-02T08:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Abap performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595867#M267687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;1) modify db from table itab will be better for &lt;/P&gt;&lt;P&gt;   performance wise because database will be accessed &lt;/P&gt;&lt;P&gt;   once per all table entries where as in &lt;/P&gt;&lt;P&gt; 2)&lt;/P&gt;&lt;P&gt;   loop at itab.&lt;/P&gt;&lt;P&gt;      endloop.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;database is hit for each record and it may take&lt;/P&gt;&lt;P&gt; time because of network activity .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use option 1 and use commit work after modify statement&lt;/P&gt;&lt;P&gt;so the changes are  reflected in database&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;amole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Oct 2006 10:11:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595867#M267687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-02T10:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Abap performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595868#M267688</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; modify db from table itab will be better for &lt;/P&gt;&lt;P&gt;performance wise because database will be accessed &lt;/P&gt;&lt;P&gt;once per all table entries where as in &lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;database is hit for each record and it makes performance poor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use &amp;lt;b&amp;gt;modify db from table&amp;lt;/b&amp;gt; ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;need not use commit work...also no prob if u use commit work/&lt;/P&gt;&lt;P&gt;if u use commit work..the modification is reflected immediately in the table..as the execution is passed through the commit statement.&lt;/P&gt;&lt;P&gt;if u dont use ...then it reflected to table only at the end of execution of program,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ajith&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Oct 2006 08:40:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595868#M267688</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-04T08:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Abap performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595869#M267689</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;dont write the select or othere data base queries inside the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it will affect the performace badly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so use MODIFY DB FROM TABLE ITAB .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;anver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls mark all hlpful anwers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Oct 2006 08:40:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-performance/m-p/1595869#M267689</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-10-04T08:40:43Z</dc:date>
    </item>
  </channel>
</rss>

