<?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 key fields??? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578833#M1566152</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rachel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; You sholud not update the keyfields. Then it will create new record with updated keyfield. It should not be happened , so try to Insert or Modify or Delete the keyfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; So that you can get the new record with updated keyfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: renu1ece on Dec 30, 2010 6:56 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Dec 2010 05:55:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-12-30T05:55:30Z</dc:date>
    <item>
      <title>How to update key fields???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578828#M1566147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a table &lt;STRONG&gt;ztable&lt;/STRONG&gt; with fields &lt;STRONG&gt;field1,field2,field3,field4,field5,field6&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;the key fields are  field1,field2,field3,field4,field5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Records in ztable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD1 FIELD2 FIELD3 FIELD4 FIELD5 FIELD6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1         2      3      4      5      6&lt;/P&gt;&lt;P&gt;1          2      3      5      6      7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want to modify 1st row with field4 = 9.&lt;/P&gt;&lt;P&gt;and second row with field 4 = 10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Please suggest how can i update field4&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;since field 4 is a key field new line are inserted .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD1 FIELD2 FIELD3 FIELD4 FIELD5 FIELD6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1         2      3      4      5      6 ....................................old&lt;/P&gt;&lt;P&gt;1          2      3      5      6      7................................old&lt;/P&gt;&lt;P&gt;1         2      3      9      5      6..............................new&lt;/P&gt;&lt;P&gt;1          2      3      9    6      7.............................new&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone help me with a soultion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rachel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rachel@sap on Dec 30, 2010 6:10 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Dec 2010 05:08:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578828#M1566147</guid>
      <dc:creator>former_member321825</dc:creator>
      <dc:date>2010-12-30T05:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to update key fields???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578829#M1566148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the UPDATE statement to update the KEY FIELDS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;UPDATE ztable) 
    SET    field4 = 1 
    WHERE  field1 = ''
     and       field2 = ''. " Tip- in the where clause add all the key fields&lt;/CODE&gt;&lt;/PRE&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;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhukar Shetty&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Dec 2010 05:16:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578829#M1566148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-30T05:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to update key fields???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578830#M1566149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Rachel&lt;/P&gt;&lt;P&gt;first you need to select the values from z table into an internal table with similar structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then loo through internal table with index.&lt;/P&gt;&lt;P&gt;like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;data; l_index type sy-tabix.&lt;/P&gt;&lt;P&gt;l_index = sy-tabix.&lt;/P&gt;&lt;P&gt;field4 = 9.&lt;/P&gt;&lt;P&gt;modify itab from wa index l_index transporting field4.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this will modify all the values of field4 to value 4.&lt;/P&gt;&lt;P&gt;and the rows will be the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then insert the values of internal table itab to your Z table. but before that delete all the values from z table because afterall you are going to update it again from internal table.&lt;/P&gt;&lt;P&gt;or check if it is not necessary to delete the values from z table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;lalit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Dec 2010 05:25:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578830#M1566149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-30T05:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to update key fields???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578831#M1566150</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;Please loop the z table move all the key fiel values to another variable/temp structure, (give ur new value too)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at ztab&lt;/P&gt;&lt;P&gt; temtab-field1 = 1.&lt;/P&gt;&lt;P&gt;temptab-field2 = 2.&lt;/P&gt;&lt;P&gt;temptab-field3 = 3.&lt;/P&gt;&lt;P&gt;tempfab-field4 = 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  MODIFY ztab    FROM temptab&lt;/P&gt;&lt;P&gt;                   TRANSPORTING field1 field2 field3 field4                    WHERE field1 EQ temptab-field1&lt;/P&gt;&lt;P&gt;                     AND field2 EQ temptab-field2&lt;/P&gt;&lt;P&gt;                     AND field3 EQ temptab-field3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop ztab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember you have to give all the key fields in the modify statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Mullai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Dec 2010 05:37:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578831#M1566150</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-30T05:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to update key fields???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578832#M1566151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your requirement violates the basic principle of RDBMS. All the key fields(of a composite key) form a key which is used to identify a record uniquely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you modify a key field, you'll generate a new record with the modified key fields &amp;amp; not overwrite the old one!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you need to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. INSERT / MODIFY the DB table with the modified key field.&lt;/P&gt;&lt;P&gt;2. DELETE the record with the old key field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope i'm clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Dec 2010 05:41:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578832#M1566151</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-12-30T05:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to update key fields???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578833#M1566152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rachel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; You sholud not update the keyfields. Then it will create new record with updated keyfield. It should not be happened , so try to Insert or Modify or Delete the keyfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; So that you can get the new record with updated keyfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: renu1ece on Dec 30, 2010 6:56 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Dec 2010 05:55:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578833#M1566152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-30T05:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to update key fields???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578834#M1566153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       As you want to change the key fields of the ZTABLE the only way is to insert a new record(with the new key) and delete the previous one(if not required).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please go through the link below for Easy user interface(Provided you have authorisation for the same)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Link:[Easiest way to Edit table but be cautious|http://www.kowboyz.nl/blog/edit-sap-tables/]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps you,&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;Abhijit G. Borkar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Dec 2010 06:15:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578834#M1566153</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-30T06:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to update key fields???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578835#M1566154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the solution.&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;Rachel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Dec 2010 11:48:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578835#M1566154</guid>
      <dc:creator>former_member321825</dc:creator>
      <dc:date>2010-12-30T11:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to update key fields???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578836#M1566155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Rachel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you forgot something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhijit G. Borkar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Dec 2010 12:47:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578836#M1566155</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-30T12:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to update key fields???</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578837#M1566156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know I'm reviving a dead post six years later... But isn't this the right answer for the question asked...??? Please remark if possible.. Helped me in a tight spot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2016 14:28:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-key-fields/m-p/7578837#M1566156</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-10-05T14:28:49Z</dc:date>
    </item>
  </channel>
</rss>

