on 06-15-2010 5:36 AM
Hi experts,
I am trying to define the exception whose message can be defined at run time as
EXCEPTION: 9001 of type Application with message contents & & & &
and using it in the method as : exit_return 9001 l_msg1 l_msg2 l_msg3 l_msg4.
l_msg1 l_msg2 l_msg3 l_msg4 gets filled with error messages after calling a Function module when sy-subrc is not 0.
Although its throwing the error at method level , it does not throw the error at task level i.e after executing the workflow.
Hi Singhkumud,
You don't need to define one method exception per FM exception, but you do need to be sure you are raising the method exception regardless of the results of the FM - it sounds like you are doing this correctly since the method does raise the exception.
So I would check the task that references the method and the outcomes defined in the workflow template.
It's standard functionality to be able to throw a workflow into 'application error' status - so that someone can correct the issue, perhaps. Please have another look at the workflow template where this task is used.
Regards,
Sue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The variables containing error messge were not populated at times and hence exception was not thrown.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Singhkumud,
This is very odd, since you have defined the method exception as 'Application Error' and it looks as though you have also defined the exception and exit_return correctly.
If you defined the exceptions from the method as 'outcomes' from the task, then you would have branches in the workflow definition for each outcome - which could be the issue. Is that the case here?
Regards,
Sue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Susan,
Thanks for the reply.
My requirement is:
From the method of BOR object I want to throw an exception which can be seen from the task when the task fails[errored workflow].
The exception cannot be predefined as it depends on the error from a function module called before throwing the exception.
I have defined an exception 9001 of type application and its contents as & & & &
Then I am collecting the error in variables l_msg1 l_msg2 l_msg3 l_msg4
Then throwing the exception as exit_retun 9001 l_msg1 l_msg2 l_msg3 l_msg4
But when the workflow errors out at this task then the contents of message is blank.
Why don't you set a break-point and see if these variables actually contain the returned values?
Also, if you run the method in test mode in transaction SWO1 you should see the message with the variables populated after the exception is thrown. If this is working, then we need to look into the workflow itself.
Regards,
Abdullah Azzouni
Edited by: Abdullah Azzouni on Jun 17, 2010 3:23 PM
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.