<?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: modify database table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696199#M305409</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;use the following logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select from (dbtable)&lt;/P&gt;&lt;P&gt;          into (itab of same type as dbtable)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa_itab.&lt;/P&gt;&lt;P&gt;change the values required&lt;/P&gt;&lt;P&gt;modify itab from wa_itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify (dbtable) from table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should solve your problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Nov 2006 11:39:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-21T11:39:35Z</dc:date>
    <item>
      <title>modify database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696194#M305404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone tell me How to modify the Database table using the internal table? I have to change only one field value of a particular row and column ????? &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 have to use only Modify command &amp;#133;. I have done it with update ..it&amp;#146;s working but with modify it is changing the entire line of the database table which I m modifying .. as &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 m passing only the primary keys and the fields to be edited &amp;#133;. What should I do now ??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 11:32:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696194#M305404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T11:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: modify database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696195#M305405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nilesh,&lt;/P&gt;&lt;P&gt;Modify Command basically overwrites the value of existing fields with the new fields. Now since you are passing only the primary key &amp;amp; the fields to be edited, the statement considers all other fields as blank &amp;amp;  so the database table also gets modified.&lt;/P&gt;&lt;P&gt;If u still need to use modify statement, first select the data from the database table into the internal table. Then modify the fields in the internal table &amp;amp; then modify the database table from the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chetan.&lt;/P&gt;&lt;P&gt;PS:Reward points if this is helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 11:36:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696195#M305405</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T11:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: modify database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696196#M305406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you have to modify a few fields then..&lt;/P&gt;&lt;P&gt;1. try to look for some stadard SAP ransaction.&lt;/P&gt;&lt;P&gt;   because SAP do not recommend direct modifications&lt;/P&gt;&lt;P&gt;2. if there is no transaction or function module then read the table with primary keys it will fetch all the old values now first modify iternal table then use MODIFY table command to update database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 11:37:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696196#M305406</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T11:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: modify database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696197#M305407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Declare internal table same as ur database table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then use  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modift ztable from table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but ur modify statement will append a record if doesnt exist in database table , so safe to use UPDATE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 11:37:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696197#M305407</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T11:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: modify database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696198#M305408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nilesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First select the original data from the database table, make changes in required fields in the internal table &amp;amp; then modify.&lt;/P&gt;&lt;P&gt;When u say modify, it overwrites all the non key fields in the database table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 11:39:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696198#M305408</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T11:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: modify database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696199#M305409</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;use the following logic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select from (dbtable)&lt;/P&gt;&lt;P&gt;          into (itab of same type as dbtable)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa_itab.&lt;/P&gt;&lt;P&gt;change the values required&lt;/P&gt;&lt;P&gt;modify itab from wa_itab.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify (dbtable) from table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should solve your problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 11:39:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696199#M305409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T11:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: modify database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696200#M305410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;modify &amp;lt;database&amp;gt; from &amp;lt;internal table&amp;gt;&lt;/P&gt;&lt;P&gt;or else&lt;/P&gt;&lt;P&gt;update &amp;lt;database&amp;gt; from &amp;lt;internal table&amp;gt; where &amp;lt;condition&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 11:41:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696200#M305410</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T11:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: modify database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696201#M305411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi nilesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I have to change only one field value of a particular row and column ????? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) First SELECT the data from DBTABLE for the corresponding record in &lt;/P&gt;&lt;P&gt;   DTAB eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) then change the value of the field in that DTAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c) then using loop&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  LOOP AT DTAB.&lt;/P&gt;&lt;P&gt;  MODIFY ZTABLE FROM DTAB.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d) DTAB should have same structure as that of ZTABLE.&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 11:53:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696201#M305411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T11:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: modify database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696202#M305412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To insert lines into a database table regardless of whether there is already a line in the table with the same primary key, use the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY target lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the database table contains no line with the same primary key as the line to be inserted, MODIFY works like IINSERT - that is, the line is added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the database already contains a line with the same primary key as the line to be inserted, MODIFY works like UPDATE - that is, the line is changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot change the value of a key field. Select to internal table, update data in internal table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Regards&lt;/P&gt;&lt;P&gt;charitha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Nov 2006 12:08:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/1696202#M305412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-21T12:08:56Z</dc:date>
    </item>
  </channel>
</rss>

