<?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 update the database table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639179#M607483</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;  i need to do  direct update to the database table and the table has apprx 60,000 records . i am getting all records from database table to internal table and has to chnage the one of the field value and pass it to the database table .  So  i am looping  the internal table and what is the best approach to update the database table is it to  use UPDATE Pa0001 SET KOSTL = it_0001-KOSTL from table it_0001  each time in the loop to update each record  and commit work which hits database for each record or use the statement UPDATE  pa0001 from table it_0001 and if count = 1000 then  COMMIT work in this way it will hit the database for every 1000 records . Appreciate your suggestions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Latha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Aug 2007 17:14:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-01T17:14:12Z</dc:date>
    <item>
      <title>update the database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639179#M607483</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;  i need to do  direct update to the database table and the table has apprx 60,000 records . i am getting all records from database table to internal table and has to chnage the one of the field value and pass it to the database table .  So  i am looping  the internal table and what is the best approach to update the database table is it to  use UPDATE Pa0001 SET KOSTL = it_0001-KOSTL from table it_0001  each time in the loop to update each record  and commit work which hits database for each record or use the statement UPDATE  pa0001 from table it_0001 and if count = 1000 then  COMMIT work in this way it will hit the database for every 1000 records . Appreciate your suggestions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Latha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 17:14:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639179#M607483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T17:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: update the database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639180#M607484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not suggested to do a direct database update.  I would suggest you find another way to achieve your end result.  Maybe using a standard funcition module or API.&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>Wed, 01 Aug 2007 17:15:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639180#M607484</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-08-01T17:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: update the database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639181#M607485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rich for quick response . Our team lead has accepted to do the direct table update as we are doing it one time and if we use other approach the changed by date field is changed and we dont want that to happen as it effects some of our interfaces so we are proceeding with direct table update . Please suggest which  UPDATE method is appropriate .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Latha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 17:19:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639181#M607485</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T17:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: update the database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639182#M607486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no reason why you can't do it all at one time using the MODIFY statement.    I have never used the UPDATE statement, I have only used the MODIFY statement.&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;PRE&gt;&lt;CODE&gt;MODIFY pa0001 from table it_pa0001.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&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>Wed, 01 Aug 2007 17:22:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639182#M607486</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2007-08-01T17:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: update the database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639183#M607487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;see this code &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;*-- Here only two hits to the database.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt; tables : ztable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : itab like standard table of ztable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from ztable into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;delete ztable from itab.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;do the changes to itab field.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;insert into ztable from table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 17:30:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639183#M607487</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T17:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: update the database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639184#M607488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE PA0000 FROM TABLE T_PA0000.&lt;/P&gt;&lt;P&gt;I tried it and it worked..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward for useful answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pradeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 17:39:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639184#M607488</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T17:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: update the database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639185#M607489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My Code to update PA0006 is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA:  t_pa0006 TYPE STANDARD TABLE OF pa0006 INITIAL SIZE 0,
       wa_pa0006 LIKE LINE OF t_pa0006,
       w_lin TYPE i.

FIELD-SYMBOLS:  &amp;lt;fs_pa0006&amp;gt; LIKE LINE OF t_pa0006.

SELECT * FROM pa0006 INTO TABLE t_pa0006 WHERE uname = 'PKHAROR'.

LOOP AT t_pa0006 ASSIGNING &amp;lt;fs_pa0006&amp;gt;.

  &amp;lt;fs_pa0006&amp;gt;-stras = 'My Street'.

ENDLOOP.

DESCRIBE TABLE t_pa0006 LINES w_lin.

UPDATE pa0006 FROM TABLE t_pa0006.
IF sy-subrc EQ 0.
  COMMIT WORK.
  WRITE:/ w_lin, ' Records have been updated..'.
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points for useful answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pradeep&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pradeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 18:00:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-the-database-table/m-p/2639185#M607489</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T18:00:40Z</dc:date>
    </item>
  </channel>
</rss>

