Skip to Content

Handling Workflow Exceptions

What is the best way to handle exceptions in workflow?

Suppose a workflow step calls a method in a business object which in turn calls a function. Now an exception is raised in the function, the workflow just sits at that step with an "In Process" status. I would like the workflow to get an error status so that it can be restarted.

How can this be achieved? Thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 29, 2008 at 06:06 AM

    hi,

    This Blog contains the procedure to deal with Exceptions.

    Defining Exceptions in a method and handling the same in Workflow

    Hope this will help.

    Regards

    Sumit Agarwal

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 29, 2008 at 07:59 AM

    First thing is, is the exception raised in the FM also handled by the FM? So is it an exception of the FM? If so you can handle it in your method also and raise an exception for your method.

    Regards,

    Martin

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 02, 2008 at 03:19 PM

    Thanks everyone for your input. The resolution was as follows

    http://help.sap.com/saphelp_nw2004s/helpdata/en/1a/6b023c3f6aaf08e10000000a11402f/content.htm

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 29, 2008 at 05:06 AM

    Hi AB,

    are you sure that the WF's that end up in "InProcess" status are those WF's in error ?

    If yes, then you could collect all such statuses thru SWWWIHEAD and make them in "Error" state.

    After that use FM SWW_*_ERROR_RESTART for all those workitem in Error state.

    Else need to identify all WF's in "InProcess" change it to "Error" as above and run SWPR.

    Shall wait for some good answers too.

    Hope it helps.

    Aditya

    Edited by: Aditya Varrier on Aug 29, 2008 10:37 AM

    Add comment
    10|10000 characters needed characters exceeded