<?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: Modify Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934412#M1151014</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: inserted type i,
        modified type i.

loop at itab.
   insert itab into table itab.
   if sy-subrc = 0 .
     add 1 to inserted
  else.
    modify table from itab.
    if sy-subrc = 0.
      add 1 to modified.
    endif.
   endif.
endloop.

write: 'Inserted', inserted,
       / 'Modified', modified.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Dec 2008 11:07:53 GMT</pubDate>
    <dc:creator>MarcinPciak</dc:creator>
    <dc:date>2008-12-17T11:07:53Z</dc:date>
    <item>
      <title>Modify Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934409#M1151011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have to save 4 records in a table. When I use the command MODIFY &lt;A href="https://community.sap.com/TABLE"&gt;&lt;/A&gt; FROM TABLE &lt;A href="INTERNAL TABLE"&gt;&lt;/A&gt; is only saving 2 records. What is the problem that may be occurring?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank´&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2008 10:57:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934409#M1151011</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-17T10:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934410#M1151012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe the other two are already existing in the table with the same keyfield values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2008 11:00:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934410#M1151012</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-17T11:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934411#M1151013</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 the key combination of the records, if the key combination is different then only it inserts else modifies the records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shiva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2008 11:03:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934411#M1151013</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-17T11:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934412#M1151014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: inserted type i,
        modified type i.

loop at itab.
   insert itab into table itab.
   if sy-subrc = 0 .
     add 1 to inserted
  else.
    modify table from itab.
    if sy-subrc = 0.
      add 1 to modified.
    endif.
   endif.
endloop.

write: 'Inserted', inserted,
       / 'Modified', modified.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2008 11:07:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934412#M1151014</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2008-12-17T11:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934413#M1151015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the help of everyone, could solve the problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank´&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2008 11:10:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934413#M1151015</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-17T11:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934414#M1151016</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;this is due to double entry of data based on key combination&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY&lt;/P&gt;&lt;P&gt;a line is searched for in the database table that has the same content in the primary key as the corresponding beginning part of the work area. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If such a line is not found, a new line is inserted according to the same rules as for the &lt;STRONG&gt;INSERT&lt;/STRONG&gt; statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If such a line is found, this line is overwritten according to the same rules as for the &lt;STRONG&gt;UPDATE&lt;/STRONG&gt; statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the change would lead to a double entry in a unique secondary index, then it is not executed &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2008 11:19:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934414#M1151016</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-17T11:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Modify Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934415#M1151017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friend,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      The Modify statement checks the key fields first,  if the key fields are same them it will modify the same record without inserting the new record.  Therefore check with the key fields and see that it already exist,  If this is the case then it will not insert the new record instead modify the same record as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   If the key fields have some different values then it will append the new record in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Hope the answer of your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Md Ziauddin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2008 18:19:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modify-table/m-p/4934415#M1151017</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-31T18:19:51Z</dc:date>
    </item>
  </channel>
</rss>

