<?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: diff between update and modify stmt in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206999#M472270</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;      Update you can change database primary key value which is not&lt;/P&gt;&lt;P&gt;      possible with modify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     modify updates database when record exist else inserts new record&lt;/P&gt;&lt;P&gt;     and also used in internal table operations.&lt;/P&gt;&lt;P&gt;     update modified database table only when entry exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     while using update clause use where condition else it updates all records &lt;/P&gt;&lt;P&gt;     of table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amole&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;Amole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Apr 2007 12:07:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-27T12:07:44Z</dc:date>
    <item>
      <title>diff between update and modify stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206994#M472265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt; what is the difference between update and modify stmt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 11:48:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206994#M472265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T11:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: diff between update and modify stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206995#M472266</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;Update stmt will update the database only when there is similar record...&lt;/P&gt;&lt;P&gt;it will fail when there no record to change..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify will change the already existing record as update when it already exists but also will add the record if it were not present &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 11:54:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206995#M472266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T11:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: diff between update and modify stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206996#M472267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;refer this thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3314311"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 11:55:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206996#M472267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T11:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: diff between update and modify stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206997#M472268</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;update : it shud hv an entry in db table to update.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify: its not req for the db table/ internal table to have an  entry. if the entry matching the condition doesnt exist. it will insert a new record.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;u can chk this thread too:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/profile?userid=3609550" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/profile?userid=3609550&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if helpful&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, 27 Apr 2007 11:55:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206997#M472268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T11:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: diff between update and modify stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206998#M472269</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 statement works as INSERT statement as well as UPDATE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE: update if the record already exists.&lt;/P&gt;&lt;P&gt;MODIFY: if the record exists modify works like UPDATE. else it Inserts the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 11:56:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206998#M472269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T11:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: diff between update and modify stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206999#M472270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;      Update you can change database primary key value which is not&lt;/P&gt;&lt;P&gt;      possible with modify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     modify updates database when record exist else inserts new record&lt;/P&gt;&lt;P&gt;     and also used in internal table operations.&lt;/P&gt;&lt;P&gt;     update modified database table only when entry exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     while using update clause use where condition else it updates all records &lt;/P&gt;&lt;P&gt;     of table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amole&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;Amole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 12:07:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2206999#M472270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T12:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: diff between update and modify stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2207000#M472271</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;In ABAP language, Update statement means you are going to update a record that is already existing in the database table. For MODIFY statement, it is not necessary that a record must exist in the database table. Even if it is not existing then the statement will insert that record into the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;sksingh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 19:49:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2207000#M472271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T19:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: diff between update and modify stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2207001#M472272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jyothsna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go through  this info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Creating Data Objects Dynamically &lt;/P&gt;&lt;P&gt;&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;&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;&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;&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;&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;&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. IF you want to change the values without modify:&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;Update you can change database primary key value which is not&lt;/P&gt;&lt;P&gt;possible with modify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify updates database when record exist else inserts new record&lt;/P&gt;&lt;P&gt;and also used in internal table operations.&lt;/P&gt;&lt;P&gt;update modified database table only when entry exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while using update clause use where condition else it updates all records &lt;/P&gt;&lt;P&gt;of table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't forget to reward if useful...&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, 30 Apr 2007 09:38:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2207001#M472272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-30T09:38:21Z</dc:date>
    </item>
    <item>
      <title>Re: diff between update and modify stmt</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2207002#M472273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jyothsna&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Inserting or Changing Lines &amp;lt;/b&amp;gt;&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;&amp;lt;b&amp;gt;Specifying a Database Table&amp;lt;/b&amp;gt;&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;&amp;lt;b&amp;gt;Inserting or Changing Single Lines&amp;lt;/b&amp;gt;&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;&amp;lt;b&amp;gt;Inserting or Changing Several Lines&amp;lt;/b&amp;gt;&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;Regards Rk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2007 09:43:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/diff-between-update-and-modify-stmt/m-p/2207002#M472273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-30T09:43:01Z</dc:date>
    </item>
  </channel>
</rss>

