Most of ABAPers are dependant on debugger more than code editor 😀 . In the same way when I learnt workflow, I was wondering if I can debug workflow like R3 report/WDA. There are some situations while executing the workflow where we need to check container values on runtime and the data flow through the workflow.
So for all the ABAPers, refer below steps. This is the magic trick to debug workflow 😉
1. Open BOR method which you want to debug. Put below code in it. Save and generate the BOR.
This is infinite loop code. 😀
2. Trigger the workflow.
3. Go to SM50, you will observe one task is in Running state with user as WF-BATCH.
4. Select that record and click Administration from menu bar.
Go to Program and then click on Debugging, this will open new session for debugger.
5. Terminate the infinite loop by clicking to ‘Go to Statement’.
Now you can debug your workflow methods. This trick works fine in development server, but don’t forgot to comment/remove the infinite code before transport to Production 😀