<?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 syntax in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-syntax/m-p/2297650#M501853</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Karan Chopra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update command is used to Update a DB record ......../ records .......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u want to update records which meets certain criteria then use the following command ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;UPDATE&amp;lt;/b&amp;gt; &amp;lt;DB Table Name&amp;gt; &amp;lt;b&amp;gt;SET&amp;lt;/b&amp;gt; &amp;lt;Fieldname&amp;gt; = &amp;lt;value u want to pass&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;WHERE&amp;lt;/b&amp;gt; &amp;lt;field 1&amp;gt; &amp;lt;b&amp;gt;=&amp;lt;/b&amp;gt; &amp;lt;retrict value 1&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;AND&amp;lt;/b&amp;gt; &amp;lt;field 2&amp;gt;&amp;lt;b&amp;gt; =&amp;lt;/b&amp;gt; &amp;lt;retrict value 2&amp;gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Objects in BOLD ==&amp;gt; keywords&lt;/P&gt;&lt;P&gt;Objects in &amp;lt; .. &amp;gt; ==&amp;gt; values which u want to pass / which u use ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. DB table name -&amp;gt; Updating DB table&lt;/P&gt;&lt;P&gt;2. Fieldname       -&amp;gt; What record u want to update &lt;/P&gt;&lt;P&gt;3. value u want to pass -&amp;gt; the value u want to set/pass to &amp;lt;Fieldname&amp;gt;&lt;/P&gt;&lt;P&gt;4. field 1, field 2     ....  -&amp;gt; The fields which uniquely identify the record which u want to update &lt;/P&gt;&lt;P&gt;4. retrict value 1, retrict value 2 --&amp;gt; The values with which u retrict for the Field 1 and Field 2 resp... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps ! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Kripa Rangachari ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 May 2007 04:21:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-28T04:21:25Z</dc:date>
    <item>
      <title>update syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-syntax/m-p/2297646#M501849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;plz tell me the update command syntax for updating a table using some where condition&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 04:07:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-syntax/m-p/2297646#M501849</guid>
      <dc:creator>Karan_Chopra_</dc:creator>
      <dc:date>2007-05-28T04:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: update syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-syntax/m-p/2297647#M501850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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   = '20010228'. &lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 04:11:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-syntax/m-p/2297647#M501850</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T04:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: update syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-syntax/m-p/2297648#M501851</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;&amp;lt;b&amp;gt;UPDATE SFLIGHT SET PLANETYPE = 'A310' PRICE = PRICE - '100.00'&lt;/P&gt;&lt;P&gt;WHERE CARRID = 'LH' AND CONNID = '0402'&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Padmam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 04:13:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-syntax/m-p/2297648#M501851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T04:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: update syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-syntax/m-p/2297649#M501852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From SAP Help.. &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;1. UPDATE dbtab SET f1 ... fn. &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;&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 Databases ). 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 Dictionary. 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 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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;Authorization checks (see The SAP Authorization Concept) are not supported by the UPDATE statement. You must include these in the program yourself. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changes to lines made with the UPDATE command only become final after a database commit (see Logical Unit of Work (LUW)). Prior to this, any database update can be canceled by a database rollback (see Programming Transactions). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the dialog system, you cannot rely on the locking mechanism used by the database system (see Database Locking) to synchronize simultaneous access to the same database by several users. Therefore, it is often necessary to use SAP's locking mechanism (see SAP Locking). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot change the primary key when you UPDATE a table for which a synchronous matchcode is defined. &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 1 &lt;/P&gt;&lt;P&gt;UPDATE dbtab SET f1 ... fn. &lt;/P&gt;&lt;P&gt;&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;1. ... WHERE condition &lt;/P&gt;&lt;P&gt;2. ... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&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 WHERE condition are updated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SET clause f1 ... fn identifies the columns to be updated and assigns values to them. Three types of SET statements fi are supported: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f = g &lt;/P&gt;&lt;P&gt;In all selected lines, the database table column determined by f receives the value of g. g can be an ABAP field, a literal, or a field descriptor. In the latter case, the contents of the column to which g points are copied into the line of the table that you are updating. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f = f + g &lt;/P&gt;&lt;P&gt;In all selected lines, the contents of g are added to the value in the database table column determined by f. g can be an ABAP field, a literal, or a field descriptor. The NULL value remains unchanged. This statement can only be applied to a numeric field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f = f - g &lt;/P&gt;&lt;P&gt;In all selected lines, the content of g is subtracted from the value in the database table column determined by f. g can be an ABAP field, a literal, or a field descriptor. The NULL value remains unchanged. This statement can only be applied to a numeric field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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 is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;At least one line was updated, &lt;/P&gt;&lt;P&gt;SY-SUBRC = 4: &lt;/P&gt;&lt;P&gt;No line was updated because either no line could be selected or the change would have generated lines with primary keys that already existed. &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;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;&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 statement chains, &lt;/P&gt;&lt;P&gt;&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;&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;&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;&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;&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;The addition CLIENT SPECIFIED must immediately follow the database table name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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 UPDATE *dbtab. or &lt;/P&gt;&lt;P&gt;UPDATE (dbtabname) ... . &lt;/P&gt;&lt;P&gt;&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;1. ... FROM wa &lt;/P&gt;&lt;P&gt;2. ... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See Short forms not allowed and * work areas not allowed. &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 that 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 you specify the name of the database table directly, the program must also contain an appropriate TABLES statement. If the database table name is determined at runtime, you must use the addition FROM wa. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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 is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;The specified line was updated, &lt;/P&gt;&lt;P&gt;SY-SUBRC = 4: &lt;/P&gt;&lt;P&gt;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;&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;&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;&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;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;As with variant 1. &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 3 &lt;/P&gt;&lt;P&gt;UPDATE dbtab FROM TABLE itab. or UPDATE (dbtabname) FROM TABLE itab. &lt;/P&gt;&lt;P&gt;&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;... 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 is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;All lines from itab could be used to update the database table. &lt;/P&gt;&lt;P&gt;SY-SUBRC = 4: &lt;/P&gt;&lt;P&gt;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;&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;&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;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;As with variant 1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 04:17:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-syntax/m-p/2297649#M501852</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T04:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: update syntax</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-syntax/m-p/2297650#M501853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Karan Chopra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Update command is used to Update a DB record ......../ records .......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u want to update records which meets certain criteria then use the following command ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;UPDATE&amp;lt;/b&amp;gt; &amp;lt;DB Table Name&amp;gt; &amp;lt;b&amp;gt;SET&amp;lt;/b&amp;gt; &amp;lt;Fieldname&amp;gt; = &amp;lt;value u want to pass&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;WHERE&amp;lt;/b&amp;gt; &amp;lt;field 1&amp;gt; &amp;lt;b&amp;gt;=&amp;lt;/b&amp;gt; &amp;lt;retrict value 1&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;AND&amp;lt;/b&amp;gt; &amp;lt;field 2&amp;gt;&amp;lt;b&amp;gt; =&amp;lt;/b&amp;gt; &amp;lt;retrict value 2&amp;gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Objects in BOLD ==&amp;gt; keywords&lt;/P&gt;&lt;P&gt;Objects in &amp;lt; .. &amp;gt; ==&amp;gt; values which u want to pass / which u use ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. DB table name -&amp;gt; Updating DB table&lt;/P&gt;&lt;P&gt;2. Fieldname       -&amp;gt; What record u want to update &lt;/P&gt;&lt;P&gt;3. value u want to pass -&amp;gt; the value u want to set/pass to &amp;lt;Fieldname&amp;gt;&lt;/P&gt;&lt;P&gt;4. field 1, field 2     ....  -&amp;gt; The fields which uniquely identify the record which u want to update &lt;/P&gt;&lt;P&gt;4. retrict value 1, retrict value 2 --&amp;gt; The values with which u retrict for the Field 1 and Field 2 resp... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps ! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Kripa Rangachari ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 04:21:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-syntax/m-p/2297650#M501853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T04:21:25Z</dc:date>
    </item>
  </channel>
</rss>

