<?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 message from FM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581878#M590421</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first of all put a break point  and check whether the raise statement is executing or not ? if it is executing then sy-subrc must be 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the message write &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 1.&lt;/P&gt;&lt;P&gt;message '&amp;lt;same text as in the exception&amp;gt;' type 'E'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can go through the message class also(se91).&lt;/P&gt;&lt;P&gt;if sy-subrc = 1.&lt;/P&gt;&lt;P&gt;message e001(zspd).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;just dbl click on the zspd and give the text(message text) there and save it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2007 03:56:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-24T03:56:55Z</dc:date>
    <item>
      <title>Exception message from FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581873#M590416</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;In my Function Module under Exception i defined Exception E01 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;How to do it&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>Tue, 24 Jul 2007 03:15:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581873#M590416</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T03:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Exception message from FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581874#M590417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Sachin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Inside the FM try coding in this way ..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if sy-subrc &amp;lt;&amp;gt; 0.
  raise E01.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 03:22:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581874#M590417</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T03:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Exception message from FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581875#M590418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am not enough sure what you want but you can try like this in fm source code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from mara into corresponding fields of table tab_mara where mtart = mat_type.&lt;/P&gt;&lt;P&gt;if tab_mara[] is initial.&lt;/P&gt;&lt;P&gt;raise e01.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 03:23:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581875#M590418</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T03:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: Exception message from FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581876#M590419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santosh,&lt;/P&gt;&lt;P&gt;I did it in this way only. but i am not been able to catch that exception in my REPORT where i am calling that FM. &lt;/P&gt;&lt;P&gt;I also catched that exception and &amp;lt;b&amp;gt;print that Error text&amp;lt;/b&amp;gt; that i gave in Exception short text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible?&lt;/P&gt;&lt;P&gt;and if so, please 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;Sachin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 03:38:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581876#M590419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T03:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Exception message from FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581877#M590420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ya you can do that ... immediately after calling the FM ...do this way&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;   &amp;lt;b&amp;gt;MESSAGE e001 with 'E01 Exception raised'.&amp;lt;/b&amp;gt; " 001 has to be 3 character length&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 03:42:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581877#M590420</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T03:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Exception message from FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581878#M590421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first of all put a break point  and check whether the raise statement is executing or not ? if it is executing then sy-subrc must be 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the message write &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-subrc = 1.&lt;/P&gt;&lt;P&gt;message '&amp;lt;same text as in the exception&amp;gt;' type 'E'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can go through the message class also(se91).&lt;/P&gt;&lt;P&gt;if sy-subrc = 1.&lt;/P&gt;&lt;P&gt;message e001(zspd).&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;just dbl click on the zspd and give the text(message text) there and save it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 03:56:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581878#M590421</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T03:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Exception message from FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581879#M590422</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;     define an exception and short text to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then after the select query fire the exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the sample code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function z73390_fdivide.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     REFERENCE(NUMBER1) TYPE  I DEFAULT 0&lt;/P&gt;&lt;P&gt;*"     REFERENCE(NUMBER2) TYPE  I DEFAULT 0&lt;/P&gt;&lt;P&gt;*"  EXPORTING&lt;/P&gt;&lt;P&gt;*"     REFERENCE(ANS) TYPE  P&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      ZERODIVIDEERROR&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;  if number2 eq 0.&lt;/P&gt;&lt;P&gt;    message e000(zgem) with 'Divide by Zero' raising zerodivideerror.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  ans = number1 / number2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Niyaz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endfunction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 04:02:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581879#M590422</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T04:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Exception message from FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581880#M590423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sachin&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if sy-subrc = 1.
message e001 (message class) raising &amp;lt;EXCEPTION NAME&amp;gt;.
endif
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;ravish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz reward if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2007 04:46:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-message-from-fm/m-p/2581880#M590423</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-24T04:46:43Z</dc:date>
    </item>
  </channel>
</rss>

