<?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 Setting Sy-Subrc from Update Task in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-sy-subrc-from-update-task/m-p/10327199#M1835991</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I have a question about how to control the value of sy-subrc that is returned from a "commit work and wait" statement used to end the LUW and trigger an update function module (for synchronous update).&amp;nbsp; Here is my code for the update function module call and the commit (note: this code is contained withing a custom inbound IDOC process code) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CALL &lt;SPAN class="L0S52"&gt;FUNCTION &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'Z_UPDATE_IMS' &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;IN &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;UPDATE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TASK&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EXPORTING&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imt_ims &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;gt_ims&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;COMMIT &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;WORK &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AND &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;WAIT&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;sy&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;subrc &lt;SPAN class="L0S52"&gt;NE &lt;/SPAN&gt;&lt;SPAN class="L0S32"&gt;0&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ROLLBACK &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;WORK&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_status &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'68'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_msgv1 &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'IMS Invoice Load Failed'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;t04&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ELSE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_status &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'53'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_msgv1 &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'IMS Invoice(s) Loaded Successfully'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;t05&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Here is the relevant code from withing function "Z_UPDATE_IMS" which is set as an "Update Module - Start Immediately":&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;SPAN class="L0S52"&gt;NOT &lt;/SPAN&gt;lts_insert[] &lt;SPAN class="L0S52"&gt;IS &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INITIAL&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;TRY&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;INSERT &lt;/SPAN&gt;zims &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;lts_insert&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CATCH &lt;/SPAN&gt;cx_sy_open_sql_db&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;MESSAGE &lt;/SPAN&gt;a004&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;zar_ap&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDTRY&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;If the d/b insert statement above results in a duplicate record insert, the exception in caught and I issue an abort message (as I was trained in my ABAP certification) to cause a d/b rollback.&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;However, the code after the "commit work and wait" statement is never executed. It appears the update task and the calling program are both aborted.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;My question, in the above situation, what is needed so that the "commit work and wait" returns a non-zero sy subrc if the database insert fails in the update task. Note: the use of synchronous update is essential because I need to know the results of the d/b update in order to set the proper IDOC status.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Your advice is greatly appreciated.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;R/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Jim Moore&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 May 2014 21:24:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-05-16T21:24:28Z</dc:date>
    <item>
      <title>Setting Sy-Subrc from Update Task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-sy-subrc-from-update-task/m-p/10327199#M1835991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I have a question about how to control the value of sy-subrc that is returned from a "commit work and wait" statement used to end the LUW and trigger an update function module (for synchronous update).&amp;nbsp; Here is my code for the update function module call and the commit (note: this code is contained withing a custom inbound IDOC process code) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CALL &lt;SPAN class="L0S52"&gt;FUNCTION &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'Z_UPDATE_IMS' &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;IN &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;UPDATE &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TASK&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;EXPORTING&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imt_ims &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;gt_ims&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;COMMIT &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;WORK &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;AND &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;WAIT&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;sy&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;subrc &lt;SPAN class="L0S52"&gt;NE &lt;/SPAN&gt;&lt;SPAN class="L0S32"&gt;0&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ROLLBACK &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;WORK&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_status &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'68'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_msgv1 &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'IMS Invoice Load Failed'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;t04&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ELSE&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_status &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'53'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_msgv1 &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'IMS Invoice(s) Loaded Successfully'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;t05&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Here is the relevant code from withing function "Z_UPDATE_IMS" which is set as an "Update Module - Start Immediately":&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;SPAN class="L0S52"&gt;NOT &lt;/SPAN&gt;lts_insert[] &lt;SPAN class="L0S52"&gt;IS &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;INITIAL&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;TRY&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;INSERT &lt;/SPAN&gt;zims &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;TABLE &lt;/SPAN&gt;lts_insert&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;CATCH &lt;/SPAN&gt;cx_sy_open_sql_db&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;MESSAGE &lt;/SPAN&gt;a004&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;zar_ap&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDTRY&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;If the d/b insert statement above results in a duplicate record insert, the exception in caught and I issue an abort message (as I was trained in my ABAP certification) to cause a d/b rollback.&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;However, the code after the "commit work and wait" statement is never executed. It appears the update task and the calling program are both aborted.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;My question, in the above situation, what is needed so that the "commit work and wait" returns a non-zero sy subrc if the database insert fails in the update task. Note: the use of synchronous update is essential because I need to know the results of the d/b update in order to set the proper IDOC status.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Your advice is greatly appreciated.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;R/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;&lt;SPAN class="L0S52"&gt;&lt;SPAN class="L0S55"&gt;Jim Moore&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 21:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/setting-sy-subrc-from-update-task/m-p/10327199#M1835991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-16T21:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Sy-Subrc from Update Task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-sy-subrc-from-update-task/m-p/10327200#M1835992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When commit is executed the program enters the update mode. You can't commit or rollback in update mode, it's already done.&lt;/P&gt;&lt;P&gt;Also you're in a synchronous call inside the function, so naturally if you abort the function so does the main program aborts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having a hard time understanding your code. Why isn't just something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;CALL &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;FUNCTION &lt;/SPAN&gt;&lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;'Z_UPDATE_IMS' &lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;EXPORTING&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imt_ims &lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;= &lt;/SPAN&gt;gt_ims&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exceptions&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_rollback = 1.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;IF &lt;/SPAN&gt;sy&lt;SPAN class="L0S70" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;-&lt;/SPAN&gt;subrc &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;NE &lt;/SPAN&gt;&lt;SPAN class="L0S32" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;0&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;ROLLBACK &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;WORK&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_status &lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;'68'&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_msgv1 &lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;'IMS Invoice Load Failed'&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;(&lt;/SPAN&gt;t04&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;ELSE&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;commit work. "shouldn't be necessary...&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_status &lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;'53'&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; w_msgv1 &lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;'IMS Invoice(s) Loaded Successfully'&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;(&lt;/SPAN&gt;t05&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;ENDIF&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;and in function:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;IF &lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;NOT &lt;/SPAN&gt;lts_insert[] &lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;IS &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;INITIAL&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;TRY&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;INSERT &lt;/SPAN&gt;zims &lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;FROM &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;TABLE &lt;/SPAN&gt;lts_insert&lt;SPAN class="L0S55" style="font-weight: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;CATCH &lt;/SPAN&gt;cx_sy_open_sql_db&lt;SPAN class="L0S55" style="font-weight: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise err_rollback.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;ENDTRY&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;SPAN class="L0S52" style="font-weight: inherit; font-family: inherit;"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-family: inherit;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Edgar&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;STRONG style="font-size: 12px; color: #333333;"&gt;&lt;EM style="font-weight: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S52" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN class="L0S55" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 May 2014 00:14:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/setting-sy-subrc-from-update-task/m-p/10327200#M1835992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-17T00:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Sy-Subrc from Update Task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-sy-subrc-from-update-task/m-p/10327201#M1835993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jim&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No need to rollback after commit. When you will raise abort in FM system will perform auto roll back&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nabheet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 May 2014 06:35:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/setting-sy-subrc-from-update-task/m-p/10327201#M1835993</guid>
      <dc:creator>nabheetscn</dc:creator>
      <dc:date>2014-05-17T06:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Sy-Subrc from Update Task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-sy-subrc-from-update-task/m-p/10327202#M1835994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Edgar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the feedback.&amp;nbsp; I'm performing the d/b updates in an update function module because there are several updates that must occur in the same LUW.&amp;nbsp; I only showed one of these updates in my original post for the sake of simplicity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You said: "you're in a synchronous call inside the function, so naturally if you abort the function so does the main program aborts"...&amp;nbsp; I guess I don't see this as obvious as you. I would expect the update task to abort.&amp;nbsp; I expected this to result in a sy-subrc = 4 for the "commit work and wait" statement in the calling program per SAP help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;System fields&lt;/STRONG&gt; &lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;sy-subrc&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG&gt;Meaning&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="font-size: 10pt;"&gt;0&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="font-size: 10pt;"&gt;You have specified the &lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;AND WAIT&lt;/STRONG&gt; addition, and the updating of the update function modules was successful.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="font-size: 10pt;"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;&lt;SPAN style="font-size: 10pt;"&gt;You have specified the &lt;STRONG style="font-size: 10pt; font-family: Courier New;"&gt;AND WAIT&lt;/STRONG&gt; addition, and the updating of the update function modules was not successful.&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I re-reviewed this help documentation and noticed that it only references the "and wait" addition in the context of "Triggering an internal event for the Persistence Service of the &lt;A href="https://community.sap.com/" style="color: #505050;"&gt;Object Services&lt;/A&gt;".&amp;nbsp; I'm currently not familiar with "Persistence Services", is this a technique that may address my issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The essence of my question...&amp;nbsp; is there a way, other than issuing an abort in the update task, that I can trigger the sy-subrc = 4 in the calling program?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nabheet,&lt;/P&gt;&lt;P&gt;Yes, you are correct that the "rollback work" statement is redundant as the abort message will take care of this.&amp;nbsp; I was experimenting with other message types in my update module and forgot to remove the rollback statement when I returned the messages to type "A".&amp;nbsp; I'm pretty certain this is not causing my issue as the abort currently stops both the update task and the calling program, thus the "rollback work" statement never actually gets called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you both for the feedback,&lt;/P&gt;&lt;P&gt;R/&lt;/P&gt;&lt;P&gt;Jim Moore&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 13:16:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/setting-sy-subrc-from-update-task/m-p/10327202#M1835994</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-19T13:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Sy-Subrc from Update Task</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/setting-sy-subrc-from-update-task/m-p/10327203#M1835995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Edgar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You were correct, I didn't realize, until now, that I could do multiple on-line d/b updates within a single d/b LUW and still roll back all of them if any failures occured... as long as no implicit d/b commit occurs.&amp;nbsp; I was under the mistaken impression that I had to use an update task to bundle together multiple d/b updates. Lesson learned, update task is only need for performance reasons or when LUW must span multiple screen changes (implicit d/b commits). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2014 15:49:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/setting-sy-subrc-from-update-task/m-p/10327203#M1835995</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-19T15:49:01Z</dc:date>
    </item>
  </channel>
</rss>

