<?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 Update statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415294#M199836</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an internal table which contains fields which are a part of a database table. i.e if database table has 10 fields, my work area has 3 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I have statement like&lt;/P&gt;&lt;P&gt; update &amp;lt;tab&amp;gt;&lt;/P&gt;&lt;P&gt;   from table &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;   set k1 = f1&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;   where k  = f.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Jun 2006 09:43:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-30T09:43:57Z</dc:date>
    <item>
      <title>Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415294#M199836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an internal table which contains fields which are a part of a database table. i.e if database table has 10 fields, my work area has 3 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I have statement like&lt;/P&gt;&lt;P&gt; update &amp;lt;tab&amp;gt;&lt;/P&gt;&lt;P&gt;   from table &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;   set k1 = f1&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;   where k  = f.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 09:43:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415294#M199836</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T09:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415295#M199837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can do that. However, if you are trying to update a master table, then you should not do that. All the standard tables should be updated only using SAP programs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;Note:  Please mark the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 09:47:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415295#M199837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T09:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415296#M199838</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;These are the only option available with update .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. UPDATE  dbtab      SET f1 ... fn. or &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;UPDATE (dbtabname) SET f1 ... fn. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. UPDATE  dbtab      FROM wa. or &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;UPDATE (dbtabname) FROM wa. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. UPDATE  dbtab      FROM TABLE itab. or &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;UPDATE (dbtabname) FROM TABLE itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. UPDATE  dbtab. or &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;UPDATE *dbtab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 09:47:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415296#M199838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T09:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415297#M199839</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;Yes you can do that, Read the Help on Update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 09:52:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415297#M199839</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T09:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415298#M199840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi madhukeshwar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I would personally prefer this kind of concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. myitab ( 3 fields )&lt;/P&gt;&lt;P&gt;   ZTAB  (internal table like ZDBTAB)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. SELECT SINGLE * &lt;/P&gt;&lt;P&gt;   FROM zdbtab&lt;/P&gt;&lt;P&gt;   into ztab&lt;/P&gt;&lt;P&gt;   where primarykey = myitab-field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   if sy-subrc = 0 .&lt;/P&gt;&lt;P&gt;    move-corresponding MYITAB to ZTAB.&lt;/P&gt;&lt;P&gt;   MODIFY ZDBTAB FROM ZTAB.&lt;/P&gt;&lt;P&gt;   endif.&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 10:13:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415298#M199840</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T10:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415299#M199841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is OK. But I think you better use 'MODIFY' command. That will be more robust in this scenario.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 10:26:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415299#M199841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T10:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415300#M199842</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;It is a Master table. We appended 4 fields. Now we need to populate those. So how can we go ahead?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 11:03:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415300#M199842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T11:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415301#M199843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. u added 4 fields to an existing table.&lt;/P&gt;&lt;P&gt;   and u want to fill them using some program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. use this kind of logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------" /&gt;&lt;P&gt;data : ztab like table of ztable.&lt;/P&gt;&lt;P&gt;select * from ztable&lt;/P&gt;&lt;P&gt;into ztab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="-----------------------" /&gt;&lt;P&gt;LOOP AT ZTAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZTAB-FIELD15 = 'AA'.&lt;/P&gt;&lt;P&gt;ZTAB-FIELD16 = 'BB'.&lt;/P&gt;&lt;P&gt;ZTAB-FIELD17 = 'CC'.&lt;/P&gt;&lt;P&gt;ZTAB-FIELD18 = 'DD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY ZTABLE FROM ZTAB.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="------------------" /&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>Fri, 30 Jun 2006 11:05:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415301#M199843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T11:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415302#M199844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;define an internal table of same structure of your Ztable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. read all the entries from your Ztable to internal table.&lt;/P&gt;&lt;P&gt;2. modify the internal table with the values for those newly created 4 fields.&lt;/P&gt;&lt;P&gt;3. modify Ztable from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab type standard table of ZTABLE WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * &lt;/P&gt;&lt;P&gt;       from ztable &lt;/P&gt;&lt;P&gt;       into table itab.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;  itab-newfield1 = &amp;lt;some value&amp;gt;&lt;/P&gt;&lt;P&gt;  itab-newfield2 = &amp;lt;some value2&amp;gt;&lt;/P&gt;&lt;P&gt;*etc...&lt;/P&gt;&lt;P&gt;  modify itab index sy-tabix.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify ztable from table itab.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0. &lt;/P&gt;&lt;P&gt;   write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; 'no of records updated' , sy-dbcnt.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endif.&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;srikanth&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;srikanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Srikanth Kidambi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 11:12:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415302#M199844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T11:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415303#M199845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I meant was standard fields should not updated directly. You can directly update the custom fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Please mark all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 11:19:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415303#M199845</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T11:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415304#M199846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats what I wanted. Is there any spcific way or as amit told we need to select every thing and put the custom field values and put everything back?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way with which just we update custom fields &lt;/P&gt;&lt;P&gt;  --without selecting every field&lt;/P&gt;&lt;P&gt;  --update at once (one DB hit) using internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 12:14:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415304#M199846</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T12:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415305#M199847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Is there any way with which just we update custom fields &lt;/P&gt;&lt;P&gt;--without selecting every field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, we can do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;update ZT001&lt;/P&gt;&lt;P&gt;set bukrs = '1000'&lt;/P&gt;&lt;P&gt;butxt  = 'My company'&lt;/P&gt;&lt;P&gt;where bukrs = '1000'&amp;lt;/b&amp;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;2. update at once (one DB hit) using internal table&lt;/P&gt;&lt;P&gt;I am not sure,&lt;/P&gt;&lt;P&gt;but we have to do record by record.&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>Fri, 30 Jun 2006 12:19:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415305#M199847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-30T12:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415306#M199848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Since this is a standard SAP table, can we update it without taking precautions (such as lock)? Is there a standard way where in we can see to it that data consistancy is not lost?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:12:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415306#M199848</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415307#M199849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If is SAP table, you should NOT update it explicitly at all. You should use the BAPI / functions to do the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which table are you updating? Did you try to see if a BAPI does the same?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:15:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415307#M199849</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415308#M199850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have added 4 zfields to the table &amp;lt;b&amp;gt;JVTBEZART&amp;lt;/b&amp;gt;. Those z fields I am updating.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:36:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415308#M199850</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415309#M199851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi madhu,&lt;/P&gt;&lt;P&gt;   sorry , because i don't understand that what do u want to do, plz tell me in detail with ur code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; thanks&lt;/P&gt;&lt;P&gt; chetan vishnoi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 12:39:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415309#M199851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T12:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415310#M199852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai Bhut&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the following Document for Update Statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variants&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. UPDATE dbtab SET s1 ... sn. &lt;/P&gt;&lt;P&gt;2. UPDATE dbtab. or &lt;/P&gt;&lt;P&gt;UPDATE *dbtab. or &lt;/P&gt;&lt;P&gt;UPDATE (dbtabname) ... . &lt;/P&gt;&lt;P&gt;3. UPDATE dbtab FROM TABLE itab. or &lt;/P&gt;&lt;P&gt;UPDATE (dbtabname) FROM TABLE itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Updates values in a database table (see Relational database ). You can specify the name of the database table either directly in the form dbtab or at runtime as contents of the field dbtabname . In both cases, the table must be known to the ABAP/4 Dictionary . If you specify the name of the database table directly, the program must also contain an appropriate TABLES statement. Normally, lines are updated only in the current client. Data can only be updated using a view if the view refers to a single table and was created in the ABAP/4 Dictionary with the maintenance status "No restriction". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE belongs to the Open SQL command set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes&lt;/P&gt;&lt;P&gt;Authorization checks are not supported by the UPDATE statement. You must include these in the program yourself. &lt;/P&gt;&lt;P&gt;Changes to lines made with the UPDATE command only become final after a database commit (see LUW ). Prior to this, any database update can be canceled by a database rollback (see Programming transactions ). &lt;/P&gt;&lt;P&gt;In the dialog system, you cannot rely on the database system locking mechanism alone to synchronize simultaneous access to the same database by several users. Therefore, it is often necessary to use the SAP locking mechanism . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 1&lt;/P&gt;&lt;P&gt;UPDATE dbtab SET s1 ... sn. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. ... WHERE condition &lt;/P&gt;&lt;P&gt;2. ... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Updates values in a database table. If there is no WHERE clause , all lines (in the current client) are updated. If a WHERE condition is specified, only those records which satisfy the condition are updated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SET clause s1 ... sn identifies the columns to be updated and assigns values to them. Three types of SET statements si are supported: &lt;/P&gt;&lt;P&gt;f = g In all selected lines, the database table column determined by f receives the values of the ABAP/4 field or literal g . &lt;/P&gt;&lt;P&gt;f = f + g In all selected lines, the contents of the ABAP/4 field or literal g is added to the value in the database table column determined by f . The NULL value remains unchanged. This statement can only be applied to a numeric field. &lt;/P&gt;&lt;P&gt;f = f - g In all selected lines, the contents of the ABAP/4 field or literal g is subtracted from the value in the database table column determined by f . The NULL value remains unchanged. This statement can only be applied to a numeric field. &lt;/P&gt;&lt;P&gt;When the command has been executed, the system field SY-DBCNT contains the number of updated lines. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The return code value is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0 At least one line was updated, &lt;/P&gt;&lt;P&gt;SY_SUBRC = 4 No line was updated because no line could be selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;With pooled and cluster tables, an UPDATE cannot change any primary key field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples&lt;/P&gt;&lt;P&gt;Update discount for all customers (in the current client) to 3 percent: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES SCUSTOM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE SCUSTOM SET DISCOUNT = '003'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;The 'colon and comma' logic in the program fragment &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE SCUSTOM SET: DISCOUNT  = '003',&lt;/P&gt;&lt;P&gt;                    TELEPHONE = '0621/444444'&lt;/P&gt;&lt;P&gt;              WHERE ID        = '00017777'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;defines record chains, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;not through a single statement which updates the discount and the telephone number of the customer with the customer number '00017777', &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but by means of two statements where the first updates the discount for all customers and the second changes the telephone number of the customer with the customer number '00017777'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1&lt;/P&gt;&lt;P&gt;... WHERE condition &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Updates only those lines which satisfy the WHERE clause condition . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;Increase the number of occupied seats on Lufthansa flight 0400 on 28.02.1995 by 3 (in the current client): &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES SFLIGHT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE SFLIGHT SET   SEATSOCC = SEATSOCC + 3&lt;/P&gt;&lt;P&gt;               WHERE CARRID   = 'LH'   AND&lt;/P&gt;&lt;P&gt;                     CONNID   = '0400' AND&lt;/P&gt;&lt;P&gt;                     FLDATE   = '19950228'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2&lt;/P&gt;&lt;P&gt;... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Switches off automatic client handling. This allows you to update across all clients when using client-specific tables. The client field is treated like a normal table field, for which you can formulate suitable conditions in the WHERE clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition must immediately follow the database table name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;Increase the number of occupied seats on Lufthansa flight 0400 on 28.02.1995 by 3 in client 2: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES SFLIGHT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE SFLIGHT CLIENT SPECIFIED&lt;/P&gt;&lt;P&gt;               SET   SEATSOCC = SEATSOCC + 3&lt;/P&gt;&lt;P&gt;               WHERE MANDT    = '002'  AND&lt;/P&gt;&lt;P&gt;               WHERE CARRID   = 'LH'   AND&lt;/P&gt;&lt;P&gt;                     CONNID   = '0400' AND&lt;/P&gt;&lt;P&gt;                     FLDATE   = '19950228'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 2&lt;/P&gt;&lt;P&gt;UPDATE dbtab. or &lt;/P&gt;&lt;P&gt;UPDATE *dbtab. or &lt;/P&gt;&lt;P&gt;UPDATE (dbtabname) ... . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. ... FROM wa &lt;/P&gt;&lt;P&gt;2. ... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;These are SAP-specific short forms which update one single line of a database table. The primary key for identifying the line to be updated and the values to be changed when specifying the database table name in the program are taken from the table work area - dbtab or *dbtab . If the database table name is determined at runtime, you need to use the addition ... FROM wa . &lt;/P&gt;&lt;P&gt;When the command has been executed, the system field SY-DBCNT contains the number of updated lines (0 or 1). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The return code value is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0 The specified line was updated, &lt;/P&gt;&lt;P&gt;SY_SUBRC = 4 No line was updated because no line with the specified primary key exists. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples&lt;/P&gt;&lt;P&gt;Update discount for the customer with the customer number '00017777' to 3 percent (in the current client): &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES SCUSTOM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SCUSTOM-ID       = '00017777'.&lt;/P&gt;&lt;P&gt;SCUSTOM-DISCOUNT = '003'.&lt;/P&gt;&lt;P&gt;UPDATE SCUSTOM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1&lt;/P&gt;&lt;P&gt;... FROM wa &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Takes the values for the line to be updated not from the table work area dbtab , but from the explicitly specified work area wa . Here, the data is taken from wa , moving from left to right according to the structure of the table work area dbtab (defined with TABLES ). Since the structure of wa is ignored, the work area wa must be at least as wide (see DATA ) as the table work area dbtab and the alignment of the work area wa must correspond to the alignment of the table work area. Otherwise, a runtime error occurs &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;Update the telephone number of the customer with the customer number '12400177' in the current client: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES SCUSTOM.&lt;/P&gt;&lt;P&gt;DATA   WA LIKE SCUSTOM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA-ID        = '12400177'.&lt;/P&gt;&lt;P&gt;WA-TELEPHONE = '06201/44889'.&lt;/P&gt;&lt;P&gt;UPDATE SCUSTOM FROM WA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;If you do not explicitly specify a work area, the values for the line to be updated are taken from the table work area dbtab , even if the statement appears in a FORM or FUNCTION where the table work area is held in a formal parameter or a local variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2&lt;/P&gt;&lt;P&gt;... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Like variant 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 3&lt;/P&gt;&lt;P&gt;UPDATE dbtab FROM TABLE itab. or &lt;/P&gt;&lt;P&gt;UPDATE (dbtabname) FROM TABLE itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect&lt;/P&gt;&lt;P&gt;Mass update of several lines in a database table. Here, the primary key for identifying the lines to be updated and the values to be changed are taken from the lines of the internal table itab . The lines of the internal table must satisfy the same conditions as the work area wa in addition 1 to variant 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system field SY-DBCNT contains the number of updated lines, i.e. the number of lines in the internal table itab which have key values corresponding to lines in the database table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The return code value is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0 All lines from itab could be used to update the database table. &lt;/P&gt;&lt;P&gt;SY_SUBRC = 4 At least one line of the internal table itab in the database table, had no line with the same primary key. The other lines of the database table were updated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note&lt;/P&gt;&lt;P&gt;If the internal table itab is empty, SY-SUBRC and SY-DBCNT are set to 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition&lt;/P&gt;&lt;P&gt;... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards&lt;/P&gt;&lt;P&gt;Sreenivasulu P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 13:34:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415310#M199852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T13:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Update statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415311#M199853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chetan,&lt;/P&gt;&lt;P&gt;I there is a SAP table &amp;lt;b&amp;gt;jvtbezart&amp;lt;/b&amp;gt;. I have appended 4 Z fields. Those Z fields I need to update in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 13:37:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-statement/m-p/1415311#M199853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T13:37:15Z</dc:date>
    </item>
  </channel>
</rss>

