‎2005 Dec 29 11:44 PM
Hello all,
I have an event defined in SWETYPV.
In that event I have a check function module.
The check function module has 5 different cases where it can raise an exception thus stopping the workflow after it from starting.
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.
When I raise the event myself through SWUE and debug the code using the same data - the code works fine without raising an exception.
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?
Or how is the best way to tell which excpetion was raised in a check function module?
Thanks.
Scott Overmeyer
‎2005 Dec 30 3:57 AM
‎2005 Dec 29 11:54 PM
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.
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.
Call function 'ZTEST'
exceptions
error1 = 1
error2 = 2
error3 = 3.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.
Regards,
Rich Heilman
‎2005 Dec 30 2:11 PM
As you can tell - this is my first time posting to this forum.
Hopefully I am doing this correctly.
My function module does have exceptions like you described.
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.
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.
It sounds like this is not an abap question but a workflow question from reading the other post.
Maybe it would be better if I posted it there.
Thanks for the help!
Scott
‎2005 Dec 30 3:57 AM