<?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: Exception handling in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling/m-p/2297208#M501706</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;You have to check for each subrc value and raise the exception the accordingly..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the exception is not getting carried over to the calling function..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For others I believe you don't have to do anything..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also if you put where used list of the exit function module...The exceptions are not handled...Meaning the exceptions are given..But after the FM call they are checking for the values in the importing parameter PROCESSING_PROTOCOL...Not checking for sy-subrc value..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 May 2007 15:49:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-18T15:49:04Z</dc:date>
    <item>
      <title>Exception handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling/m-p/2297207#M501705</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;in a classical userexit we have just one include to put in the coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to call a newly-created function function in this include. The function is a copy of the customer-function where the include is located in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we achieve that exceptions raised are passed to the calling function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
function exit_saplv55k_004 .
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"       EXPORTING
*"             VALUE(PROCESSING_PROTOCOL) TYPE  DELIF_T_PROTT
*"       TABLES
*"              IDOC_DATA STRUCTURE  EDIDD
*"       CHANGING
*"             VALUE(IDOC_CONTROL) LIKE  EDIDC STRUCTURE  EDIDC
*"       EXCEPTIONS
*"              IDOC_ERROR
*"              DO_NOT_PROCESS_IDOC
*"----------------------------------------------------------------------


include zxtrku12 .


endfunction.
--
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Include.: ZXTRKU12                                                  *
call function 'Z_EXIT_SAPLV55K_004'
  importing
    processing_protocol = processing_protocol
  tables
    idoc_data           = idoc_data
  changing
    idoc_control        = idoc_control
  exceptions
    idoc_error          = 1
    do_not_process_idoc = 2
    others              = 3.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are the exceptions passed to the calling function? How to achieve this, how to raise OTHERS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIA,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 15:19:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling/m-p/2297207#M501705</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-05-18T15:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Exception handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling/m-p/2297208#M501706</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;You have to check for each subrc value and raise the exception the accordingly..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the exception is not getting carried over to the calling function..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For others I believe you don't have to do anything..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also if you put where used list of the exit function module...The exceptions are not handled...Meaning the exceptions are given..But after the FM call they are checking for the values in the importing parameter PROCESSING_PROTOCOL...Not checking for sy-subrc value..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 15:49:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling/m-p/2297208#M501706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T15:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Exception handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling/m-p/2297209#M501707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to check sy-subrc ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function module returns sy-subrc ,based on ur exception ,it will return sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;idoc_error          = 1&lt;/P&gt;&lt;P&gt;    do_not_process_idoc = 2&lt;/P&gt;&lt;P&gt;    others              = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here idoc_error ,this means sy-subrc eq 1&lt;/P&gt;&lt;P&gt;        do_not_process_idoc  is sy-subrc eq 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So use your validation within ur include program like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case sy-subrc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when '1'.&lt;/P&gt;&lt;P&gt;message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when '2'.&lt;/P&gt;&lt;P&gt;message &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when others.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward Points if it is helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 15:51:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling/m-p/2297209#M501707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T15:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exception handling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling/m-p/2297210#M501708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;... turned to classes and class-based exceptions. Issue disappeared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jul 2008 10:55:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling/m-p/2297210#M501708</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2008-07-24T10:55:26Z</dc:date>
    </item>
  </channel>
</rss>

