<?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 error catch of a function module exception in a method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-catch-of-a-function-module-exception-in-a-method/m-p/1595953#M267709</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;how do you catch the error of a function module that is called from within a method. Presently the process terminates in case of an exceptions. Sy-subrc seems also not to work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.G.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;client = sy-mandt&lt;/P&gt;&lt;P&gt;date = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;foreign_amount = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;foreign_currency = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;local_currency = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;local_amount = RESULT&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_RATE_FOUND = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OVERFLOW = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_FACTORS_FOUND = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_SPREAD_FOUND = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DERIVED_2_TIMES = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 6.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Sep 2006 06:57:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-19T06:57:12Z</dc:date>
    <item>
      <title>error catch of a function module exception in a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-catch-of-a-function-module-exception-in-a-method/m-p/1595953#M267709</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;how do you catch the error of a function module that is called from within a method. Presently the process terminates in case of an exceptions. Sy-subrc seems also not to work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.G.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;client = sy-mandt&lt;/P&gt;&lt;P&gt;date = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;foreign_amount = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;foreign_currency = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;local_currency = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;local_amount = RESULT&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_RATE_FOUND = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OVERFLOW = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_FACTORS_FOUND = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NO_SPREAD_FOUND = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DERIVED_2_TIMES = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 6.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 06:57:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-catch-of-a-function-module-exception-in-a-method/m-p/1595953#M267709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T06:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: error catch of a function module exception in a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-catch-of-a-function-module-exception-in-a-method/m-p/1595954#M267710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please uncomment the exceptions part and then check the sy-subrc .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll have to uncomment evrything from exceptions till the last .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nishant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Nishant Rustagi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 06:59:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-catch-of-a-function-module-exception-in-a-method/m-p/1595954#M267710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-19T06:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: error catch of a function module exception in a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-catch-of-a-function-module-exception-in-a-method/m-p/1595955#M267711</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;use 'EXCEPTIONS' to catch the error happens in FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uncomment all your exceptions when calling FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and you will get the exception number in sy-subrc.&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;P&gt;client = sy-mandt&lt;/P&gt;&lt;P&gt;date = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;foreign_amount = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;foreign_currency = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;local_currency = SOURCE_FIELDS-xxx&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;local_amount = RESULT&lt;/P&gt;&lt;P&gt; EXCEPTIONS&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;&lt;/P&gt;&lt;P&gt;if sy-subrc = 2.&lt;/P&gt;&lt;P&gt;message e000(su) 'overflow.&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;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Sep 2006 06:59:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-catch-of-a-function-module-exception-in-a-method/m-p/1595955#M267711</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-09-19T06:59:47Z</dc:date>
    </item>
  </channel>
</rss>

