<?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 in Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-in-function-module/m-p/3518056#M846120</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;RAISE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the exception is listed in the calling program, the system returns control to it directly. If the exception is not listed, a runtime error occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE () RAISING .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the exception is listed in the calling program, the statement has the same effect as RAISE . If it is not listed, the system sends message from message class with type , and no runtime error occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function modules differ from subroutines in that you must assume that they will be used by other programmers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer to the link below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Feb 2008 11:21:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-02-27T11:21:07Z</dc:date>
    <item>
      <title>Exception in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-in-function-module/m-p/3518055#M846119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How to use exception in Function module ?&lt;/P&gt;&lt;P&gt;How Can I use the exception  my program while calling the Function Module ?&lt;/P&gt;&lt;P&gt;Can anyone explain with example ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;NK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2008 11:16:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-in-function-module/m-p/3518055#M846119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-27T11:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: Exception in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-in-function-module/m-p/3518056#M846120</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;RAISE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the exception is listed in the calling program, the system returns control to it directly. If the exception is not listed, a runtime error occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MESSAGE () RAISING .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the exception is listed in the calling program, the statement has the same effect as RAISE . If it is not listed, the system sends message from message class with type , and no runtime error occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function modules differ from subroutines in that you must assume that they will be used by other programmers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer to the link below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sriram Ponna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2008 11:21:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-in-function-module/m-p/3518056#M846120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-27T11:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Exception in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-in-function-module/m-p/3518057#M846121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Declare your exception in the exceptions tab in FM &lt;/P&gt;&lt;P&gt;say (NOT_FOUND)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in the coding in FM .. write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RAISE NOT_FOUND. &amp;lt;-- If NOT_FOUND is the exception declared ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When U call the FM in your program ..&lt;/P&gt;&lt;P&gt;U'll get as&lt;/P&gt;&lt;P&gt;              call function '&amp;lt;function module name&amp;gt;'&lt;/P&gt;&lt;P&gt;              exporting ..&lt;/P&gt;&lt;P&gt;              importing ..&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;U can check with sy-subrc ... to know the exception&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2008 11:21:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-in-function-module/m-p/3518057#M846121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-27T11:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Exception in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/exception-in-function-module/m-p/3518058#M846122</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;if something happens in ur FM and u want it to be tracked in ur calling program, then u can use exception...............&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If u r having(say) 3 exceptions in ur FM....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in ur calling program its like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;EXCEPTIONS
  exception1 = 1
  exception2 = 2
  exception3 = 3&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then if the first exception is raised in ur FM,then &lt;STRONG&gt;sy-subrc&lt;/STRONG&gt; value ll be 1(  exception1 = 1 )....llly if the second exception is raised in ur FM,then &lt;STRONG&gt;sy-subrc&lt;/STRONG&gt; value ll be 2(  exception2 = 2 ).........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now u can use this sy-subrc values like below....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;If sy-subrc = '1'.
message 'First exception is raised' type 'I'.
else.
message '2nd or 3rd exception is raised' type 'I'.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;jose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2008 11:27:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/exception-in-function-module/m-p/3518058#M846122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-27T11:27:13Z</dc:date>
    </item>
  </channel>
</rss>

