<?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/932144#M61093</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;Check this statement suits your requirement.In this you can update set of records in database table which matches the where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update db set field1 = value1 &lt;/P&gt;&lt;P&gt;              field2 = value2&lt;/P&gt;&lt;P&gt;where field3 = value3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you want to use internal table to modify the database the table,both the internal table and database table needs to be of same structure.For that you need to do something as ZI told you before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this answers your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jul 2005 03:55:04 GMT</pubDate>
    <dc:creator>jayanthi_jayaraman</dc:creator>
    <dc:date>2005-07-19T03:55:04Z</dc:date>
    <item>
      <title>Modify database table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/932137#M61086</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 have a database table with 10 fields,i need just 5 of these 10 fields in an internal table and do the processing based on this and later modify only these 5 fields in  the database table  based on values in internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like, modify dbtab from itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify with transporting option doesn't work for database tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any  other way to do this .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 03:03:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/932137#M61086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T03:03:32Z</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/932138#M61087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why can't you have the internal table with the 10 fields and not do any operation on those fields which you don't want. That way no value will be entered into those fields on DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 03:09:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/932138#M61087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T03:09:39Z</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/932139#M61088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;right now that's the way i have done.&lt;/P&gt;&lt;P&gt;it's for performance reasons that i'm trying for other options,becaus there's no point in selecting fields if u r not making use of it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 03:31:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/932139#M61088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T03:31:10Z</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/932140#M61089</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;You can do that by using update or modify statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : itab type standard table of db,&lt;/P&gt;&lt;P&gt;       wa type db.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from db into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;*Manipulating the fields&lt;/P&gt;&lt;P&gt;wa-field1 = wa-field1 * 2.&lt;/P&gt;&lt;P&gt;*Modifying the internal table&lt;/P&gt;&lt;P&gt;modify itab from wa index sy-tabix transporting field1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Modifying the database table from the modified internal table&lt;/P&gt;&lt;P&gt;update db from table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is useful,reward points.&lt;/P&gt;&lt;P&gt;If you need more clarifications,get back with the problem you are facing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 03:39:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/932140#M61089</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-07-19T03:39:19Z</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/932141#M61090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raghavendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even if you are not modifying the other fields, you need to select them into your internal table. Otherwise you will not be able to update the database table properly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your internal table has got only 5 fields, then you cannot uniquely identify which row of the database table corresponds to which row in the internal table (unless these 5 fields include all the primary key fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if your database table has got 10 fields of which 1 and 2 are key fields, in the worst case, you will have to select 5 + 2 = 7 fields. I suppose your internal table will have 10 fields in it as well, so as to be able to update the database table. Now, the remaining 3 fields will be empty. So when you do an &amp;lt;b&amp;gt;update&amp;lt;/b&amp;gt; or a &amp;lt;b&amp;gt;modify&amp;lt;/b&amp;gt;, the values for these three fields will be overwritten by the blank values (coming from the interal table). This may not be desirable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's one variant of the UPDATE statement which allows you to specify which fields have to be updated. but that will work only for a single record. Which means that for multiple records, you need to put that UPDATE statement in the LOOP. Which is certainly not a good idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, in your case, you need to select all the values from the database even if you do not intend to modify some of them. even if this approach requires more memory to run, it is okay. All other approaches will take up too much of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps. If you have further doubts, please get back. Otherwise please reward points and close the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 03:42:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/932141#M61090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T03:42:23Z</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/932142#M61091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jayanthi,&lt;/P&gt;&lt;P&gt;this is exactly the way i have done it right now,&lt;/P&gt;&lt;P&gt;functionality wise no problem it works fine,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem is goin to be in performance,&lt;/P&gt;&lt;P&gt;suppose i have 1 lakh records ,then selecting 5 extra fields for 1 lakh records would certainly have an effect on performance.that's the reason i'm in search of something where we can select only 5 fields from the db and later modify only those 5 fields in the db table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg to modify only one field of an internal table which has 5 fields we can do like this&lt;/P&gt;&lt;P&gt;modify itab transporting fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any way to do the same on db table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 03:45:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/932142#M61091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T03:45: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/932143#M61092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raghavendra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have observed that you have not rewarded any points to any of the questions that you have asked earlier. Please spend a few seconds re-visiting those posts of yours. Reward points as you think appropriate for the responses that you got, if they have helped you. And if your problem is solved, then please close the thread by either - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Rewarding 10 points to the answer that solved your problem&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;2. choosing the option Solved it on my own for your post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anticipating a quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika, Moderator @ SDN (ABAP Programming).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 03:53:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/932143#M61092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T03:53:05Z</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/932144#M61093</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;Check this statement suits your requirement.In this you can update set of records in database table which matches the where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update db set field1 = value1 &lt;/P&gt;&lt;P&gt;              field2 = value2&lt;/P&gt;&lt;P&gt;where field3 = value3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if you want to use internal table to modify the database the table,both the internal table and database table needs to be of same structure.For that you need to do something as ZI told you before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this answers your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 03:55:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/932144#M61093</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-07-19T03:55:04Z</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/932145#M61094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jayanthi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was just wondering what additional information your answer has got that is not already contained in mine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 04:06:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/932145#M61094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-19T04:06:32Z</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/932146#M61095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anand,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You mentioned that&lt;/P&gt;&lt;P&gt;There's one variant of the UPDATE statement which allows you to specify which fields have to be updated. but that will work only for a &amp;lt;b&amp;gt;single record&amp;lt;/b&amp;gt;. Which means that for multiple records, you need to put that UPDATE statement in the LOOP. Which is certainly not a good idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually what I meant in my reply is,&lt;/P&gt;&lt;P&gt;Update will modify set of records based on the single set of condition.&lt;/P&gt;&lt;P&gt;That is multiple records can be modified based on the single set of condition.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jul 2005 04:11:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-database-table/m-p/932146#M61095</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-07-19T04:11:48Z</dc:date>
    </item>
  </channel>
</rss>

