<?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: Error handling in Update function modules in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-update-function-modules/m-p/8317498#M1637002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;function ztest1.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(EMPNO) TYPE  P0001-PERNR
*"  EXCEPTIONS
*"      NO_DATA
*"----------------------------------------------------------------------
  tables : pa0001.
  select single * from pa0001 where pernr = empno.
  if sy-subrc = 4.
    raise no_data.
  endif.


endfunction.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Exceptions in FM:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NO_DATA    No data for selection&lt;/P&gt;&lt;P&gt;Calling this FM in report&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PARAMETERS : pernr TYPE p0001-pernr.
CALL FUNCTION 'ZTEST1'
  EXPORTING
    EMPNO         = pernr
 EXCEPTIONS
   NO_DATA       = 1
   OTHERS        = 2
          .
IF SY-SUBRC &amp;lt;&amp;gt; 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Nov 2011 12:05:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-11-30T12:05:01Z</dc:date>
    <item>
      <title>Error handling in Update function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-update-function-modules/m-p/8317497#M1637001</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;Can any one please let me know how to handle errors in the update function modules.I have searched in SDN but unable to find suitable answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting an SAP Mail saying that update did not happen. I want to display error messages in the output list. I used the RAISE statement but the exception handling is not happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 10:57:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-update-function-modules/m-p/8317497#M1637001</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-30T10:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling in Update function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-update-function-modules/m-p/8317498#M1637002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;function ztest1.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(EMPNO) TYPE  P0001-PERNR
*"  EXCEPTIONS
*"      NO_DATA
*"----------------------------------------------------------------------
  tables : pa0001.
  select single * from pa0001 where pernr = empno.
  if sy-subrc = 4.
    raise no_data.
  endif.


endfunction.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Exceptions in FM:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NO_DATA    No data for selection&lt;/P&gt;&lt;P&gt;Calling this FM in report&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PARAMETERS : pernr TYPE p0001-pernr.
CALL FUNCTION 'ZTEST1'
  EXPORTING
    EMPNO         = pernr
 EXCEPTIONS
   NO_DATA       = 1
   OTHERS        = 2
          .
IF SY-SUBRC &amp;lt;&amp;gt; 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 12:05:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-update-function-modules/m-p/8317498#M1637002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-30T12:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling in Update function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-update-function-modules/m-p/8317499#M1637003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shaik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the coding,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly note the below points&lt;/P&gt;&lt;P&gt;1) I am using a update function&lt;/P&gt;&lt;P&gt;2) I already used a Raise statment&lt;/P&gt;&lt;P&gt;3) I am having error in a SAP mail,which is not sufficient&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to capture the errors like in normal function and display in a report output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regrads&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 12:27:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-update-function-modules/m-p/8317499#M1637003</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-30T12:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling in Update function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-update-function-modules/m-p/8317500#M1637004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, this is normal behavior when an exception is raised in an update module, see ABAP keyword documentation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;CALL FUNCTION - IN UPDATE TASK&lt;/P&gt;&lt;P&gt;Notes&lt;/P&gt;&lt;P&gt;- If during the update an error occurs, the update work process executes a database rollback ... and informs the user whose program has created the log record by SAPMail. After removing the error cause, the returned log records can be updated again.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to handle the exception in the calling program, perform a general function call (without using update task). Like this you can handle the exception and display errors in the output list of the calling program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 13:27:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-update-function-modules/m-p/8317500#M1637004</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-30T13:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error handling in Update function modules</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-update-function-modules/m-p/8317501#M1637005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, this type of error cannot be handled in the calling routine. They occur after the update has been passed to V1 or V2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to use SM13 or SM14 to examine the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 14:30:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-handling-in-update-function-modules/m-p/8317501#M1637005</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-30T14:30:02Z</dc:date>
    </item>
  </channel>
</rss>

