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.
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.
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.
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!!