<?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 catch error after INSERT command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868469#M1788511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Nov 2013 02:58:39 GMT</pubDate>
    <dc:creator>arivazhagan_sivasamy</dc:creator>
    <dc:date>2013-11-11T02:58:39Z</dc:date>
    <item>
      <title>how to catch error after INSERT command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868467#M1788509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using INSERT command to insert record into&lt;/P&gt;&lt;P&gt;Database table lfa1 as per below code. I want to capture&lt;/P&gt;&lt;P&gt;Exact error ( like duplicate record) why insert lfa1 command is unsuccessful. Please advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at I_lfa1 into wa_lfa1.&lt;/P&gt;&lt;P&gt;INSERT LFA1 from wa_lfa1.&lt;/P&gt;&lt;P&gt;If sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;Capture error why insertion not success.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Pabi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 00:28:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868467#M1788509</guid>
      <dc:creator>former_member190312</dc:creator>
      <dc:date>2013-11-11T00:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to catch error after INSERT command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868468#M1788510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pabitra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's all on the online help &amp;lt;F1&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN class="qtext"&gt;sy-subrc&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN class="bold"&gt;Meaning&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;When a work area was declared in &lt;SPAN class="qtext"&gt;source&lt;/SPAN&gt;, the specified row was changed. In the declaration of an internal table in &lt;SPAN class="qtext"&gt;source&lt;/SPAN&gt;, all declared rows were inserted, or the internal table is empty.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;When a &lt;A _jive_internal="true" class="grey" href="https://answers.sap.com/thread/sapevent:ABENLOB_HANDLE_STRUCTURE_GLOSRY" title="Glossary Entry"&gt;LOB handle structure&lt;/A&gt; was specified with a component for &lt;A _jive_internal="true" class="grey" href="https://answers.sap.com/thread/sapevent:ABENWRITER_STREAM_GLOSRY" title="Glossary Entry"&gt;writer streams&lt;/A&gt;, the non-LOB handle components were not yet written to the database, but instead are passed when the stream is clased, at the latest. Whether this situation occurs or not depends on the database. Refer to &lt;A _jive_internal="true" class="blue" href="https://answers.sap.com/thread/sapevent:ABENINSERT_UPDATE_MODIFY_LOB"&gt;LOB handles&lt;/A&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;When a work area was specified in &lt;SPAN class="qtext"&gt;source&lt;/SPAN&gt;, the declared row was not inserted, or, when an internal table was specified in &lt;SPAN class="qtext"&gt;source&lt;/SPAN&gt;, not all declared rows were inserted, since a row in the database table has the same &lt;A _jive_internal="true" class="grey" href="https://answers.sap.com/thread/sapevent:ABENPRIMARY_KEY_GLOSRY" title="Glossary Entry"&gt;primary key&lt;/A&gt; or a unique &lt;A _jive_internal="true" class="grey" href="https://answers.sap.com/thread/sapevent:ABENSECONDARY_INDEX_GLOSRY" title="Glossary Entry"&gt;secondary index&lt;/A&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Custodio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 02:43:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868468#M1788510</guid>
      <dc:creator>custodio_deoliveira</dc:creator>
      <dc:date>2013-11-11T02:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to catch error after INSERT command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868469#M1788511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 02:58:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868469#M1788511</guid>
      <dc:creator>arivazhagan_sivasamy</dc:creator>
      <dc:date>2013-11-11T02:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to catch error after INSERT command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868470#M1788512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 03:45:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868470#M1788512</guid>
      <dc:creator>former_member209120</dc:creator>
      <dc:date>2013-11-11T03:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to catch error after INSERT command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868471#M1788513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pabitra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at I_lfa1 into wa_lfa1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select single * from lfa1 into (another workarea) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where field = wa_lfa1-field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if sy-subrc is not initial.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INSERT LFA1 from wa_lfa1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if sy-subrc is initial.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; commit work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rollback work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endif.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else.&lt;/P&gt;&lt;P&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Take the value in any other workarea that this is duplicate record or record already exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endif.&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Vivek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 05:19:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868471#M1788513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-11-11T05:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to catch error after INSERT command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868472#M1788514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 05:32:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868472#M1788514</guid>
      <dc:creator>former_member192023</dc:creator>
      <dc:date>2013-11-11T05:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to catch error after INSERT command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868473#M1788515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check sy-subrc value if '0' means record inserted else error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Nov 2013 10:43:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-catch-error-after-insert-command/m-p/9868473#M1788515</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-11-11T10:43:42Z</dc:date>
    </item>
  </channel>
</rss>

