<?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: Raising Exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545888#M579125</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sample code to display whether year is a leap year or not....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS:&lt;/P&gt;&lt;P&gt;  P_YEAR TYPE I.                       " year&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  W_RESULT TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ZFUNC'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    YEAR            = P_YEAR&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    RESULT          = W_RESULT&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    NEGATIVE_NUMBER = 1&lt;/P&gt;&lt;P&gt;    OTHERS          = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  WRITE ' error '(001).&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;IF W_RESULT EQ 0.&lt;/P&gt;&lt;P&gt;  WRITE: ' leap year'(002).&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  WRITE: ' Not a leap year'(003).&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;&lt;/P&gt;&lt;P&gt;Here while you are developing a Function Module, in the exceptions tab, remember to display the exception numbers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jul 2007 11:31:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-23T11:31:33Z</dc:date>
    <item>
      <title>Raising Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545884#M579121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am raising exception in Function Module but catch in my Report. So can any body tell me how to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Help will be rewarded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 11:22:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545884#M579121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T11:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Raising Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545885#M579122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;When you call the FM use the addition &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXCEPTIONS after the IMPORTING parameters and then assing a number to that exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If an exception is raised then the number you assigned will be stored in SY-SUBRC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'CATS_UPDATE_DATA_FROM_OFFLINE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      profile          = im_profile&lt;/P&gt;&lt;P&gt;      pernr            = im_pernr&lt;/P&gt;&lt;P&gt;      language         = language&lt;/P&gt;&lt;P&gt;      text_format      = im_text_format&lt;/P&gt;&lt;P&gt;      catsrecords      = im_catsrecords&lt;/P&gt;&lt;P&gt;      longtexts        = im_longtexts&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      processedrecords = ex_processedrecords&lt;/P&gt;&lt;P&gt;      messages         = ex_messages&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      no_enqueue_pernr = 1&lt;/P&gt;&lt;P&gt;      OTHERS           = 2.&lt;/P&gt;&lt;P&gt;check sy-subrc here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using a class based exception then call the FM in a TRY CATCH ENDTRY block.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRY.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL FM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CATCH &amp;lt;exception_name&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 11:25:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545885#M579122</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2007-07-23T11:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Raising Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545886#M579123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Every exception will be assigned a number starting from 1 in the order they have been defined in the Function Module. After you call the function module, if an exception has been raised the number of the same will be assigned to sy-subrc. You can use this to handle exceptions. If no exception has been raised, then the value of sy-subrc will be 0 after the function module has been called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please mark points if the solution was useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 11:26:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545886#M579123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T11:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Raising Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545887#M579124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;catch it with SY-SUBRC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 11:31:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545887#M579124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T11:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Raising Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545888#M579125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sample code to display whether year is a leap year or not....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS:&lt;/P&gt;&lt;P&gt;  P_YEAR TYPE I.                       " year&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  W_RESULT TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ZFUNC'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    YEAR            = P_YEAR&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    RESULT          = W_RESULT&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    NEGATIVE_NUMBER = 1&lt;/P&gt;&lt;P&gt;    OTHERS          = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  WRITE ' error '(001).&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;IF W_RESULT EQ 0.&lt;/P&gt;&lt;P&gt;  WRITE: ' leap year'(002).&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  WRITE: ' Not a leap year'(003).&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;&lt;/P&gt;&lt;P&gt;Here while you are developing a Function Module, in the exceptions tab, remember to display the exception numbers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 11:31:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545888#M579125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T11:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: Raising Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545889#M579126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my Function Module under Exception i defined Exception &amp;lt;b&amp;gt;E01&amp;lt;/b&amp;gt; and raise exception when there is no row found using SY-SUBRC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in my report i want to show error text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'Z_FM_TEST1'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    MAT_TYPE       = MAT_TYPE&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    TAB_MARA       = MARATABLE&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   E01            = 1&lt;/P&gt;&lt;P&gt;   OTHERS         = 2&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 1.&lt;/P&gt;&lt;P&gt;  MESSAGE e0001(E01).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;How to do it&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jul 2007 12:50:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545889#M579126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-23T12:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Raising Exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545890#M579127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Short Text with message will not be displayed.&lt;/P&gt;&lt;P&gt;you can add your text with message only statically.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 08:57:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raising-exception/m-p/2545890#M579127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T08:57:02Z</dc:date>
    </item>
  </channel>
</rss>

