<?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: Check function module called with an event in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-function-module-called-with-an-event/m-p/1135588#M112973</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As you can tell - this is my first time posting to this forum. &lt;/P&gt;&lt;P&gt;Hopefully I am doing this correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My function module does have exceptions like you described.&lt;/P&gt;&lt;P&gt;However, when an event is raised - and I have the event logs turned on - the only thing I get in the event log is the message 'Check FM ends with exception'.  It does not tell me what sy-subrc is.  &lt;/P&gt;&lt;P&gt;When I raise the event by hand and debug it - I don't get any exception.  Something is happening when it is raised in the normal course of business - and I'm not sure how to capture sy-subrc in the event log so I can tell which exception occured.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds like this is not an abap question but a workflow question from reading the other post.&lt;/P&gt;&lt;P&gt;Maybe it would be better if I posted it there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Dec 2005 14:11:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-12-30T14:11:27Z</dc:date>
    <item>
      <title>Check function module called with an event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-function-module-called-with-an-event/m-p/1135585#M112970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an event defined in SWETYPV.&lt;/P&gt;&lt;P&gt;In that event I have a check function module.&lt;/P&gt;&lt;P&gt;The check function module has 5 different cases where it can raise an exception thus stopping the workflow after it from starting.&lt;/P&gt;&lt;P&gt;I have cases where an exception was raised during the course of normal production work, causing the workflow after it to not start, but I cannot tell which exception was raised.&lt;/P&gt;&lt;P&gt;When I raise the event myself through SWUE and debug the code using the same data - the code works fine without raising an exception.&lt;/P&gt;&lt;P&gt;Is there a way in the function module to return which exception was raised and placed in the event log so that I can tell which part of code is failing?&lt;/P&gt;&lt;P&gt;Or how is the best way to tell which excpetion was raised in a check function module?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott Overmeyer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2005 23:44:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-function-module-called-with-an-event/m-p/1135585#M112970</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-29T23:44:54Z</dc:date>
    </item>
    <item>
      <title>Re: Check function module called with an event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-function-module-called-with-an-event/m-p/1135586#M112971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Usually when you define exceptions in your function modules, you handle this exceptions by the calling program.  for example.  If you have 3 exceptions in your function module, when you call the function module, you assign a value to the exception, which when the exception is raised, the function module ends and SY-SUBRC is set to the value that you have assign to the exception.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets say you have the following function, you are calling it this way, notice that there are 3 exceptions for this function module.  Let's say that ERROR2 was raised in the function module.  Now SY-SUBRC is set to 2.  Now you know which exception was raised and you can handle it accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Call function 'ZTEST'
    exceptions
        error1 = 1
        error2 = 2
        error3 = 3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Welcome to SDN.  Please make sure to award points for helpful answers and mark you post as solved when your question has been anwsered completely.  thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2005 23:54:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-function-module-called-with-an-event/m-p/1135586#M112971</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-12-29T23:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Check function module called with an event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-function-module-called-with-an-event/m-p/1135587#M112972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See some standard check function module and check how the exceptions are raised or captured.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have a better chance of getting quick answers from the &lt;A class="jive_macro jive_macro_community" href="https://community.sap.com/" __jive_macro_name="community" modifiedtitle="true" __default_attr="2218"&gt;&lt;/A&gt; where the workflow questions are discussed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2005 03:57:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-function-module-called-with-an-event/m-p/1135587#M112972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-30T03:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Check function module called with an event</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/check-function-module-called-with-an-event/m-p/1135588#M112973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As you can tell - this is my first time posting to this forum. &lt;/P&gt;&lt;P&gt;Hopefully I am doing this correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My function module does have exceptions like you described.&lt;/P&gt;&lt;P&gt;However, when an event is raised - and I have the event logs turned on - the only thing I get in the event log is the message 'Check FM ends with exception'.  It does not tell me what sy-subrc is.  &lt;/P&gt;&lt;P&gt;When I raise the event by hand and debug it - I don't get any exception.  Something is happening when it is raised in the normal course of business - and I'm not sure how to capture sy-subrc in the event log so I can tell which exception occured.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds like this is not an abap question but a workflow question from reading the other post.&lt;/P&gt;&lt;P&gt;Maybe it would be better if I posted it there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2005 14:11:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/check-function-module-called-with-an-event/m-p/1135588#M112973</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-30T14:11:27Z</dc:date>
    </item>
  </channel>
</rss>

