<?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: function module exception in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-exception/m-p/1628064#M280447</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in case of Exceptions in FM it will return thru SUBRC , Most of the time we will use BAPIs in case of Interfaces.&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;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Sep 2006 08:13:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-20T08:13:09Z</dc:date>
    <item>
      <title>function module exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-exception/m-p/1628063#M280446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why we are going for exception in function module,&lt;/P&gt;&lt;P&gt;are these exception get catched as in java . are&lt;/P&gt;&lt;P&gt;this exception will not stop normal processing&lt;/P&gt;&lt;P&gt;of program , in case it got triggered.how we know&lt;/P&gt;&lt;P&gt;what exception to define for a function module&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Sep 2006 08:11:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-exception/m-p/1628063#M280446</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-20T08:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: function module exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-exception/m-p/1628064#M280447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;in case of Exceptions in FM it will return thru SUBRC , Most of the time we will use BAPIs in case of Interfaces.&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;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Sep 2006 08:13:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-exception/m-p/1628064#M280447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-20T08:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: function module exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-exception/m-p/1628065#M280448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;exceptions are being returned by sy-subrc for any function module.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Sep 2006 08:13:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-exception/m-p/1628065#M280448</guid>
      <dc:creator>gopi_narendra</dc:creator>
      <dc:date>2006-09-20T08:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: function module exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-exception/m-p/1628066#M280449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Function modules are independent piece of code, which can be executed independently. we need to pass the parameters to it and get the result out of it. while processing the code, it may throw an error at several places. in case of such errors program should come to the place where function module is called. hence there is a provision of exceptions. this will not stop the program execution inside the function module. it only raise the exception.&lt;/P&gt;&lt;P&gt;in main program you can read the number of that exception and raise appropriate message for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Sep 2006 08:18:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-exception/m-p/1628066#M280449</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-20T08:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: function module exception</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-exception/m-p/1628067#M280450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exception handling is very imprtant while creating FM's.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose assume that you are calling a FM and in that function module you have written query to select some entries from the table and you are returning the table. Assume that the internal table returns NULL table. ( Bacause select query is not met).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the calling program you are using this returned table from the FM in another query in the context FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the rule the internal table should not be used in the context FOR ALL ENTRIES is the table is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this just define a exception called NO_DATA in the FM and after using the select query in the FM, check for sy-subrc value. if it is 0, then export the table else, raise exception using RAISE NO_DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now in the calling program you can decide to go further to use that retunred table ffrom the FM using the sy-subrc in the FM exceptions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is only a instance. There are amyn examples like this top explain. Yes as you said it's similar to raising to exceptions in JAVA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this is clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regs,&lt;/P&gt;&lt;P&gt;Venkat Ramanan N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Sep 2006 08:40:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-exception/m-p/1628067#M280450</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-20T08:40:05Z</dc:date>
    </item>
  </channel>
</rss>

