<?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 raise exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-exception/m-p/2190428#M466930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;1) when control come to RAISE NOT_FOUND where NOT_FOUND in the exceptions tab in function module, what does the system do? show short text in exceptions tab as message? what does the RAISE keyword do here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION-POOL CSTR. &lt;/P&gt;&lt;P&gt;FUNCTION STRING_SPLIT. &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;  IF STRING NA DELIMITER. &lt;/P&gt;&lt;P&gt;    RAISE NOT_FOUND. &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;ENDFUNCTION. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) in the caller program, if assign 7 to NOT_FOUND under exception, which means sy-subrc = 7, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROGRAM EXAMPLE. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'STRING_SPLIT' &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ... &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     EXCEPTIONS &lt;/P&gt;&lt;P&gt;          NOT_FOUND = 7. &lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 7. &lt;/P&gt;&lt;P&gt;  WRITE / 'There is a problem.'. &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Apr 2007 06:41:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-27T06:41:30Z</dc:date>
    <item>
      <title>raise exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-exception/m-p/2190428#M466930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;1) when control come to RAISE NOT_FOUND where NOT_FOUND in the exceptions tab in function module, what does the system do? show short text in exceptions tab as message? what does the RAISE keyword do here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FUNCTION-POOL CSTR. &lt;/P&gt;&lt;P&gt;FUNCTION STRING_SPLIT. &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;  IF STRING NA DELIMITER. &lt;/P&gt;&lt;P&gt;    RAISE NOT_FOUND. &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;ENDFUNCTION. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) in the caller program, if assign 7 to NOT_FOUND under exception, which means sy-subrc = 7, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROGRAM EXAMPLE. &lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;CALL FUNCTION 'STRING_SPLIT' &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ... &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;     EXCEPTIONS &lt;/P&gt;&lt;P&gt;          NOT_FOUND = 7. &lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 7. &lt;/P&gt;&lt;P&gt;  WRITE / 'There is a problem.'. &lt;/P&gt;&lt;P&gt;ELSE. &lt;/P&gt;&lt;P&gt;  ... &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 06:41:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raise-exception/m-p/2190428#M466930</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T06:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: raise exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-exception/m-p/2190429#M466931</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;  chk out the &amp;lt;b&amp;gt;Exceptions&amp;lt;/b&amp;gt; tab in the function module , To the Left of &amp;lt;b&amp;gt;source Code&amp;lt;/b&amp;gt; tab,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What ever you write there for that Exception , it will display that error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 06:43:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raise-exception/m-p/2190429#M466931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T06:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: raise exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-exception/m-p/2190430#M466932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep, you're right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the function module, after a RAISE-EXCEPTION the function will be left with SY-SUBRC = 7 (in your case). This sy-subrc can be used by the calling program.&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;Hans&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward all helpful answers !!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 06:43:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raise-exception/m-p/2190430#M466932</guid>
      <dc:creator>h_senden2</dc:creator>
      <dc:date>2007-04-27T06:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: raise exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-exception/m-p/2190431#M466933</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;1. In the FM, when its RAISE NOT_FOUND...NOT_FOUND would be assinged some number say 7. So the program which has called this FM, will receive a sy-subrc as 7 when the exception NOT_FOUND is raised.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Yes you are correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 06:43:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raise-exception/m-p/2190431#M466933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T06:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: raise exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/raise-exception/m-p/2190432#M466934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;not_found is ur user defined exception inorder to trigger that exception u user the raise key word in func module..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when a no is assigned to it  we can call it by that no and specify the message u need to print..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ur code works&lt;/P&gt;&lt;P&gt;regards..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2007 06:49:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/raise-exception/m-p/2190432#M466934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-27T06:49:00Z</dc:date>
    </item>
  </channel>
</rss>

