<?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: update db table for duplicate entries. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-db-table-for-duplicate-entries/m-p/2848646#M667401</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Any body can answer this.&lt;/P&gt;&lt;P&gt;Need help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Neetu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Oct 2007 16:46:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-04T16:46:32Z</dc:date>
    <item>
      <title>update db table for duplicate entries.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-db-table-for-duplicate-entries/m-p/2848645#M667400</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;If i want to update a ztable&lt;/P&gt;&lt;P&gt;i have 3 to 5 different ways.&lt;/P&gt;&lt;P&gt;1.   UPDATE ztab FROM workarea.&lt;/P&gt;&lt;P&gt;2.   UPDATE ztable SET field1 = wa-f1 field2  = wa-f2&lt;/P&gt;&lt;P&gt;               WHERE keyf1 = wa-kf1&lt;/P&gt;&lt;P&gt;               AND   keyf2 = wa-kf2.&lt;/P&gt;&lt;P&gt;3.  UPDATE ztable FROM TABLE itab.&lt;/P&gt;&lt;P&gt;4.  MODIFY ztable FROM TABLE itable  or from  wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if i want to update some 2 to 3 fields&lt;/P&gt;&lt;P&gt;by checking with the fields in db table with values in flat file&lt;/P&gt;&lt;P&gt;and when i check the dbtable values with flat file and i find the entries in dbtable are multiple because i am not putting all key fields in where condition&lt;/P&gt;&lt;P&gt;because i know only some of them .&lt;/P&gt;&lt;P&gt;so duplicate entries are available and i wanted to update the same values to all those duplicate records .&lt;/P&gt;&lt;P&gt;then how should i update them.&lt;/P&gt;&lt;P&gt;i don't want to use update between&lt;/P&gt;&lt;P&gt;select and end-select because the records that i am updating are many.&lt;/P&gt;&lt;P&gt;i will store records into itab and then i will compare with values i file&lt;/P&gt;&lt;P&gt;and for all records i want to update the two or three fields with the values  in flat file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 14:40:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-db-table-for-duplicate-entries/m-p/2848645#M667400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-04T14:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: update db table for duplicate entries.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-db-table-for-duplicate-entries/m-p/2848646#M667401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Any body can answer this.&lt;/P&gt;&lt;P&gt;Need help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Neetu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 16:46:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-db-table-for-duplicate-entries/m-p/2848646#M667401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-04T16:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: update db table for duplicate entries.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-db-table-for-duplicate-entries/m-p/2848647#M667402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a pseudo logic, i hope it will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get all the data from file into internal table IT_FILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at IT_FILE.&lt;/P&gt;&lt;P&gt;For each record, check if there is entry in db table to be updated. &lt;/P&gt;&lt;P&gt;Use update statement to update db table use SET clause as you need to update certain fields and provide appropriate condition in WHERE clause. As you do not have all key values, it will update all records which satisfy this WHERE condition.&lt;/P&gt;&lt;P&gt;Check for SY-SUBRC and if it is successful, commit work.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 16:53:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-db-table-for-duplicate-entries/m-p/2848647#M667402</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-04T16:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: update db table for duplicate entries.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-db-table-for-duplicate-entries/m-p/2848648#M667403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;If i do this way always it satisfies the first record of the multiple records that are satisfied when we put where condition with some of the key fields.&lt;/P&gt;&lt;P&gt;then always it might update the same record.&lt;/P&gt;&lt;P&gt;I stead i can loop through the itab having the DB table and read the file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways thanks for the help.&lt;/P&gt;&lt;P&gt;and i am waiting for the correct file, once i get it, then i will try this and update points.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Neetu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2007 17:05:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-db-table-for-duplicate-entries/m-p/2848648#M667403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-04T17:05:17Z</dc:date>
    </item>
  </channel>
</rss>

