<?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: Exceptions in FM in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699482#M890820</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Declare exceptions in the exceptions tab ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say :  NO_AUTHORITY ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in the FM : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the field for authority ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if authority fails ..&lt;/P&gt;&lt;P&gt;raise the exception...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RAISE NO_AUTHORITY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Apr 2008 10:33:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-11T10:33:45Z</dc:date>
    <item>
      <title>Exceptions in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699481#M890819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in function module how to use exceptions tab, i have to do the authority check on some field by using the execeptions,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and that field i am not using any where in my function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please let me know its urgent&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&amp;amp;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chaithu.p&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Apr 11, 2008 4:57 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 10:29:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699481#M890819</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T10:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699482#M890820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Declare exceptions in the exceptions tab ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;say :  NO_AUTHORITY ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in the FM : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the field for authority ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if authority fails ..&lt;/P&gt;&lt;P&gt;raise the exception...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RAISE NO_AUTHORITY.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 10:33:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699482#M890820</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T10:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699483#M890821</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;U can Catch the Exception Value using &lt;STRONG&gt;sy-subrc&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exceptions throws value like 1,2,3 etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use sy-subrc statement to catch those values and use for authority Check&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if sy-subrc ne 0.

RAISE &amp;lt;VARIABLE&amp;gt;.

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Apr 11, 2008 4:58 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 10:33:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699483#M890821</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T10:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699484#M890822</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;Your question is not very clear.  Are you writing a function module or calling one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are calling one map each exception to a number, if the exception is raised by the function module the return code SY-SUBRC will be set to this number and you can code to handle this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are writing a function module when an error is reached issue an error message and include the RAISING option with the name of your exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 10:35:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699484#M890822</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T10:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699485#M890823</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 FM exceptions you can define your exceptions with numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when the exception araised the Sy-subrc will consist the Number that you are already defined in the Function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the following Example :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'READ_SPFLI_INTO_TABLE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;ID = CARRIER&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;ITAB = JTAB&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;NOT_FOUND = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&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;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO.&lt;/P&gt;&lt;P&gt;WHEN 2.&lt;/P&gt;&lt;P&gt;MESSAGE E702(AT).&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Apr 11, 2008 4:59 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 10:38:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699485#M890823</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T10:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Exceptions in FM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699486#M890824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the Exception tab of FM interface, define your exception "PERMISSION_FAILURE" (any name and it's short text)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say you are checking the authorization for transaction then in the source code you have to write something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL 'AUTH_CHECK_TCODE'
       ID 'TCODE' FIELD objectname.
  if sy-subrc ne 0.
     message e059 with objectname raising *permission_failure.*
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whil calling the FM from your program then it would be something like:&lt;/P&gt;&lt;P&gt;call function '                '&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;  permission_failure = 1   (It will automatically come when you call function by clicking PATTERNs button)&lt;/P&gt;&lt;P&gt;  other = 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 10:42:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exceptions-in-fm/m-p/3699486#M890824</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T10:42:15Z</dc:date>
    </item>
  </channel>
</rss>

