Quite often while testing a WF, we come across a situation where the WF hangs at some background step but the WF log does not show any error which would help us to solve the problem. In such cases it becomes necessary to debug the background method that is used by the WF task in question.
By following one of the below mentioned options, root cause of the problem can be determined.
1. Go to transaction ST22 and check for the ABAP Dump if any for the BO method in question.
2.Set the BO method as well as the WF task as Dialog (both were originally set as background activity) for testing purpose.
Set the agent for the task as your own user ID.
Set a breakpoint in the BO method.
Trigger the WF.
Now the step at which the WF had stopped earlier will appear as a WI in your inbox.
Go to the inbox and execute the WI.
Since a breakpoint was set in the BO method, debugger will start and then we can proceed with normal debugging.
After we are done with debugging, BO method and WF task must be once again set to their original status i.e. background activities.