<?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: change documents with modify statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696909#M1451961</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE works only when a data which needs to be changed exists in a table. If you try to update a record which is non existant then sy-subrc is returned as 4. Nothing happens in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY works as a combination of UPDATE and INSERT. If a record exists then it is updated with new values but if it does not exist then a new records is created and added to the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this clarifies your doubt regarding in issue that you are facing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Mar 2010 03:55:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-04T03:55:01Z</dc:date>
    <item>
      <title>change documents with modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696907#M1451959</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;I have implemented change docs for an own application. I use the functional moduls (not only the generated one) because there is a little bit extra stuff around it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyhow I face a problem with I have not yet identified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question: can i use "modify" statement to update into a table with change document or do I need to use update and insert separatly? I use "modify" and asked myself whether this is the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just hope that someone of you has the answer out of the box so I dont have to figure that out by my own...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 23:57:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696907#M1451959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-03T23:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: change documents with modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696908#M1451960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;Hi Eddie, 
Here we go. 

The differences between UPDATE and MODIFY 
In case of UPDATE
&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;li&amp;gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;UPDATE sflight FROM TABLE sflight_tab.&lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&amp;lt;li&amp;gt;If there is no row in the database with the same content of the primary key for a row in the internal table, or if the change would lead to a double entry in a unique secondary key, the respective row is not changed and sy-subrc is set to 4.
&lt;/PRE&gt;

In case of MODIFY
&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;li&amp;gt;&lt;/CODE&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;CODE&gt;MODIFY t100 FROM TABLE message_wa.&lt;/CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&amp;lt;li&amp;gt;If there is no row in the database with the same content of the primary key for a row in the internal table, record is created and subrc is set to 0. or if the change would lead to a double entry in a unique secondary key, the respective row is changed and sy-subrc is set to 0.
&lt;/PRE&gt;

Thanks
Venkat.O&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Mar 2010 02:31:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696908#M1451960</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2010-03-04T02:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: change documents with modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696909#M1451961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE works only when a data which needs to be changed exists in a table. If you try to update a record which is non existant then sy-subrc is returned as 4. Nothing happens in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY works as a combination of UPDATE and INSERT. If a record exists then it is updated with new values but if it does not exist then a new records is created and added to the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this clarifies your doubt regarding in issue that you are facing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Mar 2010 03:55:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696909#M1451961</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-04T03:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: change documents with modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696910#M1451962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Eddie,&lt;/P&gt;&lt;P&gt;The differance between insert , update and modify is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT - Inserts a new record. INSERT expects that a record with the required key does NOT exist in the table. Therefore, if a record with the same key already exists, a runtime error occurs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE -Update an existing record. UPDATE expects that a record with required key exists in the table. If a record with the required key does not exist, it issue an error (sy-subrc is 4). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY - Acts like a combination of INSERT and UPDATE. If a record with the specified key does not exist, it adds it to the table. If a record with the specified key does exist, it modifies it. So MODIFY actually acts like "Insert or change record". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To summarize:&lt;/P&gt;&lt;P&gt;INSERT - Adds a new record to the table. If the row (key) exists, issues an error.&lt;/P&gt;&lt;P&gt;UPDATE - Updates an existing record to the table. If the row (key) does not exist, issues an error.&lt;/P&gt;&lt;P&gt;MODIFY - If the key exists, modifies the record. If the key does not exist, adds the record to the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Soundarya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Mar 2010 04:30:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696910#M1451962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-04T04:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: change documents with modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696911#M1451963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for your answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I was not so clear with what my question is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that modify acts as an insert or an update. But can I use this statement in order to create a change record?&lt;/P&gt;&lt;P&gt;I only saw examples with update and insert and the change indicator only has insert of update.&lt;/P&gt;&lt;P&gt;My application uses modify and does not work. But I have quite a bit development around the change documents&lt;/P&gt;&lt;P&gt;and just wanted to get feedback whether my modify statements are the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i think I will just write a small program and test it in a small standard environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Mar 2010 10:38:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696911#M1451963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-04T10:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: change documents with modify statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696912#M1451964</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 think this is helpful for u...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffff;"&gt;TYPES: BEGIN OF ty_str ,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r1(10) TYPE c,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r2(10) TYPE c,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END OF ty_str.&lt;BR /&gt;DATA: it_str TYPE TABLE OF ty_str,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wa_str LIKE LINE OF it_str.&lt;BR /&gt;&lt;BR /&gt;data: lv_r1 TYPE string,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_r2 TYPE string.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_r1 = 10.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_r2 = 20.&lt;BR /&gt;wa_str-r1 = lv_r1.&lt;BR /&gt;wa_str-r2 = lv_r2.&lt;BR /&gt;&lt;BR /&gt;APPEND wa_str to it_str.&lt;BR /&gt;CLEAR wa_str.&lt;BR /&gt;wa_str-r1 = '100'.&lt;BR /&gt;wa_str-r2 = '200'.&lt;BR /&gt;&lt;BR /&gt;APPEND wa_str to it_str.&lt;BR /&gt;CLEAR wa_str.&lt;BR /&gt;wa_str-r1 = '55'.&lt;BR /&gt;wa_str-r2 = '66'.&lt;BR /&gt;INSERT wa_str INTO it_str INDEX 2.&lt;BR /&gt;CLEAR wa_str.&lt;BR /&gt;wa_str-r1 = '155'.&lt;BR /&gt;wa_str-r2 = '166'.&lt;BR /&gt;APPEND wa_str to it_str.&lt;BR /&gt;CLEAR wa_str.&lt;BR /&gt;&lt;BR /&gt;DELETE it_str INDEX 4.&lt;BR /&gt;*MODIFY TABLE it_str FROM wa_str .&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOOP AT it_str INTO wa_str.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; read TABLE it_str INTO wa_str INDEX 2.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if sy-subrc = 0.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wa_str-r1 = 'roopa'.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MODIFY it_str FROM&amp;nbsp; wa_str INDEX 1 .&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endif.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENDLOOP.&lt;BR /&gt;&lt;BR /&gt;LOOP AT it_str INTO wa_str.&lt;BR /&gt;&amp;nbsp; WRITE:/ wa_str-r1, wa_str-r2.&lt;BR /&gt;ENDLOOP.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;roopa.k&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 07:18:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-documents-with-modify-statement/m-p/6696912#M1451964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-03-18T07:18:12Z</dc:date>
    </item>
  </channel>
</rss>

