<?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 write  MODIFY to update data into the data base table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226301#M478524</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;check out sample coding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;tabname&amp;gt; FROM &amp;lt;workarea&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;tabname&amp;gt; FROM table &amp;lt;internal table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Navneeth.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Apr 2007 09:53:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-23T09:53:17Z</dc:date>
    <item>
      <title>how to write  MODIFY to update data into the data base table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226296#M478519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;plz send me code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 09:48:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226296#M478519</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T09:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to write  MODIFY to update data into the data base table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226297#M478520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Changing a database table &lt;/P&gt;&lt;P&gt;- MODIFY  dbtab      FROM wa. &lt;/P&gt;&lt;P&gt;- MODIFY (dbtabname) FROM wa. &lt;/P&gt;&lt;P&gt;- MODIFY  dbtab      FROM TABLE itab. &lt;/P&gt;&lt;P&gt;- MODIFY (dbtabname) FROM TABLE itab. &lt;/P&gt;&lt;P&gt;- MODIFY  dbtab. &lt;/P&gt;&lt;P&gt;- MODIFY *dbtab. &lt;/P&gt;&lt;P&gt;- MODIFY  dbtab VERSION vers. &lt;/P&gt;&lt;P&gt;- MODIFY *dbtab VERSION vers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing an internal table &lt;/P&gt;&lt;P&gt;- MODIFY itab [FROM wa] [INDEX idx] [ASSIGNING &amp;lt;fs&amp;gt;|REFERENCE INTO dref] [TRANSPORTING f1 ... fn]. &lt;/P&gt;&lt;P&gt;- MODIFY TABLE itab [FROM wa] [ASSIGNING &amp;lt;fs&amp;gt;|REFERENCE INTO dref] [TRANSPORTING f1 ... fn]. &lt;/P&gt;&lt;P&gt;- MODIFY itab [FROM wa] TRANSPORTING f1 ... fn WHERE cond. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing a list line &lt;/P&gt;&lt;P&gt;- MODIFY LINE n. &lt;/P&gt;&lt;P&gt;- MODIFY LINE n OF CURRENT PAGE. &lt;/P&gt;&lt;P&gt;- MODIFY LINE n OF PAGE m. &lt;/P&gt;&lt;P&gt;- MODIFY CURRENT LINE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Changing the properties of a screen field &lt;/P&gt;&lt;P&gt;- MODIFY SCREEN.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 09:50:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226297#M478520</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T09:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to write  MODIFY to update data into the data base table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226298#M478521</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;Inserting or Changing Lines &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To insert lines into a database table regardless of whether there is already a line in the table with the same primary key, use the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;target&amp;gt; &amp;lt;lines&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the database table contains no line with the same primary key as the line to be inserted, MODIFY works like INSERT, that is, the line is added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the database already contains a line with the same primary key as the line to be inserted, MODIFY works like UPDATE, that is, the line is changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For performance reasons, you should use MODIFY only if you cannot distinguish between these two options in your ABAP program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add or change one or more lines &amp;lt;lines&amp;gt; in a database table &amp;lt;target&amp;gt;. You can only insert or change lines in an ABAP Dictionary view if it only contains fields from one table, and its maintenance status is defined as Read and change. You may specify the database table &amp;lt;target&amp;gt; either statically or dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifying a Database Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To specify the database table statically, enter the following for &amp;lt;target&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;dbtab&amp;gt; [CLIENT SPECIFIED] &amp;lt;lines&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &amp;lt;dbtab&amp;gt; is the name of a database table defined in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To specify the database table dynamically, enter the following for &amp;lt;target&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY (&amp;lt;name&amp;gt;) [CLIENT SPECIFIED] &amp;lt;lines&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where the field &amp;lt;name&amp;gt; contains the name of a database table defined in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the CLIENT SPECIFIED addition to disable automatic client handling. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserting or Changing Single Lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To insert or change a single line in a database table, use the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;target&amp;gt; FROM &amp;lt;wa&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The contents of the work area &amp;lt;wa&amp;gt; are written to the database table &amp;lt;dbtab&amp;gt;. The work area &amp;lt;wa&amp;gt; must be a data object with at least the same length and alignment as the line structure of the database table. The data is placed in the database table according to the line structure of the table, and regardless of the structure of the work area. It is a good idea to define the work area with reference to the structure of the database table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the database table does not already contain a line with the same primary key as specified in the work area, a new line is inserted. If the database table does already contain a line with the same primary key as specified in the work area, the existing line is overwritten. SY-SUBRC is always set to 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A shortened form of the above statement is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;dbtab&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, the contents of the table work area &amp;lt;dbtab&amp;gt; are inserted into the database table with the same name. You must declare this table work area using the TABLES statement. In this case, it is not possible to specify the name of the database table dynamically. Table work areas with the same name as the database table (necessary before Release 4.0) should no longer be used for the sake of clarity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserting or Changing Several Lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To insert or change several lines in a database table, use the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;target&amp;gt; FROM TABLE &amp;lt;itab&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those lines of the internal table &amp;lt;itab&amp;gt; for which there is not already a line in the database table with the same primary key are inserted into the table. Those lines of the internal table &amp;lt;itab&amp;gt; for which there is already a line in the database table with the same primary key overwrite the existing line in the database table. The same rules apply to the line type of &amp;lt;itab&amp;gt; as to the work area &amp;lt;wa&amp;gt; described above. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC is always set to 0. SY-DBCNT is set to the number of lines in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Rk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 09:51:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226298#M478521</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T09:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to write  MODIFY to update data into the data base table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226299#M478522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;   By writing the MODIFY command in the ABAP Editor and press F1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get the complete help on that key word including with syntaxes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sreeram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 09:52:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226299#M478522</guid>
      <dc:creator>sreeramkumar_madisetty</dc:creator>
      <dc:date>2007-04-23T09:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to write  MODIFY to update data into the data base table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226300#M478523</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;*Modify from internal table&lt;/P&gt;&lt;P&gt;Modify mara from table it_mara. "should be of same structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Modify from work area&lt;/P&gt;&lt;P&gt;Modify mara from wa_mara. "should be of same structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;nazeer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 09:52:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226300#M478523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T09:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to write  MODIFY to update data into the data base table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226301#M478524</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;check out sample coding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;tabname&amp;gt; FROM &amp;lt;workarea&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;tabname&amp;gt; FROM table &amp;lt;internal table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Navneeth.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 09:53:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226301#M478524</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T09:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to write  MODIFY to update data into the data base table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226302#M478525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;   modify wil insert the value if its not in DB otherwise it will update the fields which is mentioned in it....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab like mara occurs 0 with header line.&lt;/P&gt;&lt;P&gt;        itab-matnr = 10.&lt;/P&gt;&lt;P&gt;        itab-ernam = 'john'.&lt;/P&gt;&lt;P&gt;         ..........................&lt;/P&gt;&lt;P&gt;    modify mara from itab. *itab is an internal table&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data   wa type mara.&lt;/P&gt;&lt;P&gt;         wa-matnr = 10.&lt;/P&gt;&lt;P&gt;         wa-ernam = 'john'.&lt;/P&gt;&lt;P&gt;         ..........................&lt;/P&gt;&lt;P&gt;   modify mara using wa  *where wa is external work area&lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if this helps u&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        ravi r&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 09:53:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226302#M478525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T09:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to write  MODIFY to update data into the data base table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226303#M478526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi nagalakshmi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;P&gt;Creating Data Objects Dynamically &lt;/P&gt;&lt;P&gt;All of the data objects that you define in the declaration part of a program using statements such as DATA are created statically, and already exist when you start the program. To create a data object dynamically during a program, you need a data reference variable and the following statement: &lt;/P&gt;&lt;P&gt;CREATE DATA &amp;lt;dref&amp;gt; TYPE &amp;lt;type&amp;gt;|LIKE &amp;lt;obj&amp;gt;.&lt;/P&gt;&lt;P&gt;This statement creates a data object in the internal session of the current ABAP program. After the statement, the data reference in the data reference variable &amp;lt;dref&amp;gt; points to the object. The data object that you create does not have its own name. You can only address it using a data reference variable. To access the contents of the data object, you must dereference the data reference. &lt;/P&gt;&lt;P&gt;You must specify the data type of the object using the TYPE or LIKE addition. In the TYPE addition, you can specify the data type dynamically as the contents of a field (this is not possible with other uses of TYPE). &lt;/P&gt;&lt;P&gt;CREATE DATA &amp;lt;dref&amp;gt; TYPE (&amp;lt;name&amp;gt;).&lt;/P&gt;&lt;P&gt;Here, &amp;lt;name&amp;gt; is the name of a field that contains the name of the required data type. &lt;/P&gt;&lt;P&gt;1. IF you want to change the values without modify:&lt;/P&gt;&lt;P&gt;First take that row into other work area change whatever values you want to change in work area by using "MOVE" statement ,delete previous row from internal table and by using "INSERT" statement insert the workarea row into that internal table..&lt;/P&gt;&lt;P&gt;Don't forget to reward if useful... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;P.Naganjana Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 09:54:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226303#M478526</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T09:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to write  MODIFY to update data into the data base table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226304#M478527</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;  Here you will get all syntaxes as per your requirement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserting or Changing Lines &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To insert lines into a database table regardless of whether there is already a line in the table with the same primary key, use the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;target&amp;gt; &amp;lt;lines&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the database table contains no line with the same primary key as the line to be inserted, MODIFY works like INSERT, that is, the line is added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the database already contains a line with the same primary key as the line to be inserted, MODIFY works like UPDATE, that is, the line is changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For performance reasons, you should use MODIFY only if you cannot distinguish between these two options in your ABAP program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can add or change one or more lines &amp;lt;lines&amp;gt; in a database table &amp;lt;target&amp;gt;. You can only insert or change lines in an ABAP Dictionary view if it only contains fields from one table, and its maintenance status is defined as Read and change. You may specify the database table &amp;lt;target&amp;gt; either statically or dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifying a Database Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To specify the database table statically, enter the following for &amp;lt;target&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;dbtab&amp;gt; [CLIENT SPECIFIED] &amp;lt;lines&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where &amp;lt;dbtab&amp;gt; is the name of a database table defined in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To specify the database table dynamically, enter the following for &amp;lt;target&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY (&amp;lt;name&amp;gt;) [CLIENT SPECIFIED] &amp;lt;lines&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where the field &amp;lt;name&amp;gt; contains the name of a database table defined in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the CLIENT SPECIFIED addition to disable automatic client handling. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserting or Changing Single Lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To insert or change a single line in a database table, use the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;target&amp;gt; FROM &amp;lt;wa&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The contents of the work area &amp;lt;wa&amp;gt; are written to the database table &amp;lt;dbtab&amp;gt;. The work area &amp;lt;wa&amp;gt; must be a data object with at least the same length and alignment as the line structure of the database table. The data is placed in the database table according to the line structure of the table, and regardless of the structure of the work area. It is a good idea to define the work area with reference to the structure of the database table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the database table does not already contain a line with the same primary key as specified in the work area, a new line is inserted. If the database table does already contain a line with the same primary key as specified in the work area, the existing line is overwritten. SY-SUBRC is always set to 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A shortened form of the above statement is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;dbtab&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, the contents of the table work area &amp;lt;dbtab&amp;gt; are inserted into the database table with the same name. You must declare this table work area using the TABLES statement. In this case, it is not possible to specify the name of the database table dynamically. Table work areas with the same name as the database table (necessary before Release 4.0) should no longer be used for the sake of clarity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserting or Changing Several Lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To insert or change several lines in a database table, use the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;target&amp;gt; FROM TABLE &amp;lt;itab&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those lines of the internal table &amp;lt;itab&amp;gt; for which there is not already a line in the database table with the same primary key are inserted into the table. Those lines of the internal table &amp;lt;itab&amp;gt; for which there is already a line in the database table with the same primary key overwrite the existing line in the database table. The same rules apply to the line type of &amp;lt;itab&amp;gt; as to the work area &amp;lt;wa&amp;gt; described above. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC is always set to 0. SY-DBCNT is set to the number of lines in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to reward if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 09:54:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226304#M478527</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T09:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to write  MODIFY to update data into the data base table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226305#M478528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nagalakshmi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To insert lines into a database table regardless of whether there is already a line in the table with the same primary key, use the following: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;target&amp;gt; &amp;lt;lines&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the database table contains no line with the same primary key as the line to be inserted, MODIFY works like INSERT, that is, the line is added.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the database already contains a line with the same primary key as the line to be inserted, MODIFY works like UPDATE, that is, the line is changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For performance reasons, you should use MODIFY only if you cannot distinguish between these two options in your ABAP program.&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;The Open SQL statement for changing data in a database table is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE &amp;lt;target&amp;gt; &amp;lt;lines&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It allows you to change one or more lines in the database table &amp;lt;target&amp;gt;. You can only change lines in an ABAP Dictionary view if it only contains fields from one table, and its maintenance status is defined as Read and change. You may specify the database table &amp;lt;target&amp;gt; either statically or dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Brief,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE is only for database tables updation.&lt;/P&gt;&lt;P&gt;But MODIFY can be used to Modify Database tables, Internal Tables, Output Lists, and also for changing screen attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this resolves your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward all the helpful answers.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2007 09:56:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-write-modify-to-update-data-into-the-data-base-table/m-p/2226305#M478528</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-23T09:56:31Z</dc:date>
    </item>
  </channel>
</rss>

