<?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 function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949627#M1335930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;You can use CASE sy-subrc statement ...&lt;/P&gt;&lt;P&gt;when 1.&lt;/P&gt;&lt;P&gt;do this ..&lt;/P&gt;&lt;P&gt;when 2 &lt;/P&gt;&lt;P&gt;when 0 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check any standard FM  and see how error is handled in them &lt;/P&gt;&lt;P&gt;Also wht is the DUMP message &lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jul 2009 07:17:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-13T07:17:58Z</dc:date>
    <item>
      <title>exception handling in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949621#M1335924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when we write the function module in the report program like "CONVERT_TO_LOCAL_CURRENCY"  if anything goes wrong in this FM the program goes to dump. So how to handling this exceptions. &lt;/P&gt;&lt;P&gt;if sy-subrc ne 0 then i need to continue with the next statement.  will i need to use continue statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please expllain with some example&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:09:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949621#M1335924</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T07:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: exception handling in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949622#M1335925</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;after the function modue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERT_TO_LOCAL_CURRENCY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if sy-subrc ne 0.

******write your logic to handle.
else.
******write your logic what it should do if successful.

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whether sy-subrc is 0 or not, if you want to continue with the next statement,then do as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERT_TO_LOCAL_CURRENCY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if sy-subrc ne 0.
"no need to code anything
endif.
***you can have your next statements here and there is no need to use continue statement
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Sajid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: shaik sajid on Jul 13, 2009 9:12 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:11:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949622#M1335925</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T07:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: exception handling in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949623#M1335926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
* CLIENT = SY-MANDT
date = itab-date_of_export
foreign_amount = dl_kwert
foreign_currency = itab-waers
local_currency = c_usd
IMPORTING
local_amount = itab-value_of_goods
EXCEPTIONS  " un-comment these sections
no_rate_found = 1
overflow = 2
no_factors_found = 3
no_spread_found = 4
derived_2_times = 5
OTHERS = 6.
IF sy-subrc NE 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO  " this is display the system message automatically when ever exp are hit
 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:15:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949623#M1335926</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-07-13T07:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: exception handling in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949624#M1335927</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;Go in debugging mode and when you reach the FM press F6, after then you will get a value for &lt;STRONG&gt;sy-subrc&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say if it is 2, the code like:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'.

IF sy-subrc NE 0 AND sy-subrc NE 2.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSEIF sy-subrc = 2.
  "no code
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tarun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:16:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949624#M1335927</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-07-13T07:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: exception handling in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949625#M1335928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;You can use CASE sy-subrc statement ...&lt;/P&gt;&lt;P&gt;Check any standard FM  and see how error is handled in them &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:16:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949625#M1335928</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T07:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: exception handling in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949626#M1335929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The program will dump only if something incorrect is passed to the parameters of the FM.&lt;/P&gt;&lt;P&gt;In that case there is no way to avoid the dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to handle the exceptions then handle them as they are coded when you call the FM via PATTERN in your editor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:17:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949626#M1335929</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T07:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: exception handling in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949627#M1335930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;You can use CASE sy-subrc statement ...&lt;/P&gt;&lt;P&gt;when 1.&lt;/P&gt;&lt;P&gt;do this ..&lt;/P&gt;&lt;P&gt;when 2 &lt;/P&gt;&lt;P&gt;when 0 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check any standard FM  and see how error is handled in them &lt;/P&gt;&lt;P&gt;Also wht is the DUMP message &lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:17:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949627#M1335930</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T07:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: exception handling in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949628#M1335931</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 very simple, there are two ways to do say.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. As this is std FM so when use call this FM there is some code under EXCEPTION just uncomment those code .....your problem will automatically will be solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.If you want to add your own functionality then simply use te case or if-else to check the value of sy-subrc.&lt;/P&gt;&lt;P&gt;As stated by you  just write &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if sy-subrc ne 0

your code..
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pooja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:21:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949628#M1335931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T07:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: exception handling in function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949629#M1335932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CLIENT = SY-MANDT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;date = itab-date_of_export&lt;/P&gt;&lt;P&gt;foreign_amount = dl_kwert&lt;/P&gt;&lt;P&gt;foreign_currency = itab-waers&lt;/P&gt;&lt;P&gt;local_currency = c_usd&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;local_amount = itab-value_of_goods&lt;/P&gt;&lt;P&gt;EXCEPTIONS  " un-comment these sections&lt;/P&gt;&lt;P&gt;no_rate_found = 1&lt;/P&gt;&lt;P&gt;overflow = 2&lt;/P&gt;&lt;P&gt;no_factors_found = 3&lt;/P&gt;&lt;P&gt;no_spread_found = 4&lt;/P&gt;&lt;P&gt;derived_2_times = 5&lt;/P&gt;&lt;P&gt;OTHERS = 6.&lt;/P&gt;&lt;P&gt;IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO  " this is display the system message automatically when ever exp are hit&lt;/P&gt;&lt;P&gt; WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here you can use the  case statement like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case sy-subrc.&lt;/P&gt;&lt;P&gt;  when 1.&lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;write your code what you want to do if no rate found&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  when 2.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;what do you want to do in case of overflow.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;*similarly handle all the cases of exceptons &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;&lt;/P&gt;&lt;P&gt;hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;geeta gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 07:36:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-handling-in-function-module/m-p/5949629#M1335932</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T07:36:25Z</dc:date>
    </item>
  </channel>
</rss>

