<?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: How to update database table with key field? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134074#M1189992</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;If you want to update only key fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you use modify statement wht all the fields you want  to update&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify db from wa_area index sy-tabix transporting key fileds1 field2 field3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Jan 2009 07:17:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-23T07:17:41Z</dc:date>
    <item>
      <title>How to update database table with key field?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134073#M1189991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a database table with following fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MATNR   - Key&lt;/P&gt;&lt;P&gt;SSOUR  -  Key&lt;/P&gt;&lt;P&gt;KUNNR   - Key&lt;/P&gt;&lt;P&gt;MENG1  &lt;/P&gt;&lt;P&gt;MENG2&lt;/P&gt;&lt;P&gt;MENG3&lt;/P&gt;&lt;P&gt;And this table contains records like...&lt;/P&gt;&lt;P&gt;MSD50001     R      1000001     5.30    2.30    5.25&lt;/P&gt;&lt;P&gt;MSD50002     R      1000002     5.30    2.30    5.25&lt;/P&gt;&lt;P&gt;MSD50003     R      1000003     5.30    2.30    5.25&lt;/P&gt;&lt;P&gt;MSD50005     R      1000004     5.30    2.30    5.25&lt;/P&gt;&lt;P&gt;MSD50004     R      1000005     5.30    2.30    5.25&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an internal table with same fields of above database table.&lt;/P&gt;&lt;P&gt;MSD50001     A      1000001     5.30    2.30    5.25&lt;/P&gt;&lt;P&gt;MSD50002     A      1000002     5.30    2.30    5.25&lt;/P&gt;&lt;P&gt;MSD50003     A      1000003     5.30    2.30    5.25&lt;/P&gt;&lt;P&gt;MSD50005     A      1000004     5.30    2.30    5.25&lt;/P&gt;&lt;P&gt;MSD50004     A      1000005     5.30    2.30    5.25&lt;/P&gt;&lt;P&gt;MSD50006     A      1000006     5.30    2.30    5.25&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to update the DB table with following internal table records.&lt;/P&gt;&lt;P&gt;If internal table records = db table records are same then Update....else insert from internal table to db table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But here, SSOUR is key field so i am not able to use &lt;/P&gt;&lt;P&gt;MODIFY dbtab from itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It results me , entries in internal table are inserted into db table.&lt;/P&gt;&lt;P&gt;So i have double records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any statement which updates the key field? and if no fields in db table then insert it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;RH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2009 07:10:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134073#M1189991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-23T07:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to update database table with key field?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134074#M1189992</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;If you want to update only key fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you use modify statement wht all the fields you want  to update&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify db from wa_area index sy-tabix transporting key fileds1 field2 field3.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2009 07:17:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134074#M1189992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-23T07:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to update database table with key field?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134075#M1189993</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;u cannot update akey field.u can update only non key fields by using key field as a selection criteria.For example if u go to sm30 if u enter any table for inserting values, the key field will always be greyed out it is not succumbed to chnges.but u can insert value into ,if ur inserting and in the insert staemnet if  u have key field which is already present in the table it will return sy-subrc = 4 otherwise it will insert the record and return 0.&lt;/P&gt;&lt;P&gt;eg for update :&lt;/P&gt;&lt;P&gt;UPDATE zdm_wtyprof  SET upload_status = 'S'&lt;/P&gt;&lt;P&gt;                         WHERE spart = wa_upd-spart.&lt;/P&gt;&lt;P&gt;                          &lt;/P&gt;&lt;P&gt;here spart is the key field and it will update the status field in the table as S.&lt;/P&gt;&lt;P&gt;if updated succesfully it will return 0.&lt;/P&gt;&lt;P&gt;SIMILARLY U CAN USE select.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2009 07:19:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134075#M1189993</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-23T07:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to update database table with key field?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134076#M1189994</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 not change the Primary key values. If the table is custom, then delete the current record and re insert the same using MODIFY/INSERT/UPDATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2009 07:22:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134076#M1189994</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-23T07:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to update database table with key field?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134077#M1189995</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;U can't update the key field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can do onething for ur requirement,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Delete entries in Database table where combination of MATNR and KUNNR and then u insert the new combination of MATNR SSOUR KUNNR.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Jan 2009 07:24:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134077#M1189995</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-23T07:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to update database table with key field?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134078#M1189996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Mar 2009 12:01:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-database-table-with-key-field/m-p/5134078#M1189996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-25T12:01:22Z</dc:date>
    </item>
  </channel>
</rss>

