How to Debug any Work Item in SAP Workflow?

Share on Facebook12Share on LinkedIn17Tweet about this on TwitterShare on Google+2
Please Share!!

Finding why the particular work item routed to agent ‘X’ and not to agent ‘Y’ is one of the most common issues which you come across when you are working on SAP Workflow.

Confused?

Let me show you what we are trying to tell.

Suppose one buyer has created a Purchase order 123456789. Workflow related to PO  123456789 is triggered for approval or rejection and routed to some agents/approvers based upon some custom business code logic or some standard logic.

Let’s see how the workflow is triggered for this Purchase Order and whom it is routed to.

  • Go to transaction ME23N. Provide the Purchase order number. Go to Workflow overview.

  • Now click on the workflow Log button. It will take you to the workflow log page where you can find all the details related to the work item/workflow.

  • Once you click on the log button, it will route you to the workflow log page where you can see all the technical details of the workitem and if  you click on the Agent information button, it will show who currently is the agent of this work item/workflow i.e. in whose inbox this particular work item is present.

Also ReadDifference between Logical and Physical Deletion of Work Items in SAP Workflow

Now the real question which comes to our mind is why this work item is routed to those agents? And how to find that out?

To figure out this mystery, we need to debug the work item if the agent determination is done via some workflow rule.

How to debug the Workflow Work Item?

  • Click on the “List with technical details” button

  • Once you click technical settings button it will show all the technical  details related to this work item at the bottom of the system.

  • Now as you can see the workitem  “987456321” is coming under the task “TSXXXX”. Click on the task and it will route you to the Task id. Go to the “Default rules” tab. Under the rule, a rule number “1478529” is set. So friends, this is the rule that is responsible for fetching the agents/approvers.

 

  • Click on the rule number and it will open the workflow rule “1478529“. The Rule is linked to a standard function module “ME_REL_GET_RESPONSIBLE“. This standard function module is responsible for fetching the agents. Based on the business requirements this standard function module result can be modify/enhanced via custom and user exists.

 

  • Now to find out the standard or custom logic behind this function module “ME_REL_GET_RESPONSIBLE“, double click on the function module and put a external breakpoints in the program.

Note : Always use the External breakpoints to debug the Agent Determination Rule.      

                  

  • Come back to the agent determination Rule and click the Simulation button. It will open the Simulation for Rule Resolution screen. Provide the details using F4 and execute it. For our example, we have provided the Purchase order number and Release code.

  • Once you execute the simulation, the debugger would kick in. Now debug the function module to find out the logic to determine the agents/approvers for the PO Workflow.
  • For our case, a customer exit is called to determine the agents.                                                                                     

  • If you press F8 or if you come out of the debugger, the simulation will show you the agents list.                                                                              

Hope you now know how to debug the Agent Determination Work Item in SAP Workflow. 🙂

Do you want to learn more about SAP Work Flow?

Please visit The Sharp Turtle Blog for detailed SAP Workflow articles.

So…What Do You Think?

Now we want to hear from you.

Do you think, there is a better way to debug the SAP Workflow Work Item?

Whether you feel there is or not, in either case, please leave a quick comment below.

Please Subscribe, Like & Share!!

Share on Facebook12Share on LinkedIn17Tweet about this on TwitterShare on Google+2
Please Share!!

About the Author

Abhishek Walter
Abhishek Walter
Abhishek Walter is the founder of The Sharp Turtles, an Education blog and Educational YouTube channel that provides free of cost Cryptography and SAP technical lessons. He is also the SAP Technical consultant currently working in Cognizant Technologies Pvt Ltd. He has expertise in the areas of SAP ABAP, forms, Workflow, and Webdynpro ABAP. That’s not giving you a lot of details, is it? so read more here. Contact Details: Abhishek Walter Email: abhishek.walter@yahoo.in Find more about him on LinkedIn.

Be the first to comment on "How to Debug any Work Item in SAP Workflow?"

Please help us improve. Please Shout Often & Loud!!