cancel
Showing results for 
Search instead for 
Did you mean: 

Exit_Return discrepancy

former_member182041
Active Contributor
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

keohanster
Active Contributor
0 Kudos

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

Answers (2)

Answers (2)

former_member182041
Active Contributor
0 Kudos

The variables containing error messge were not populated at times and hence exception was not thrown.

keohanster
Active Contributor
0 Kudos

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

former_member182041
Active Contributor
0 Kudos

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.

former_member182041
Active Contributor
0 Kudos

Do you have idea of Function Module BUS_CONTROL_MAIN _DI? What does this do?

Former Member
0 Kudos

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

former_member182041
Active Contributor
0 Kudos

Thank You for the reply.

I could see that the variables containing the error messages were not populated as the FM at times does not throw any error message.

Thanks.