Case 1: An employee applies for an emergency leave, and the manager does not able to complete the work item due to certain error in the approval step. The manager asks HR administrator to update the leave data directly and as such the whole workflow instance is NOT required anymore.
How do we complete or (logically) delete the workflow instance?
Case 2: An employee claims his expense, and the first approver can not approve it because the work item is not created at his workplace. How do we resume the workflow processing so that the subsequent step, the 2nd approval step in this case, can be performed?
How do we resume workflow processing?
Case 3: SAP server is down when purchasing manager approve the purchase request. However after the server is up and running again, purchase order is not created. The workflow log shows the approval work item is actually executed and completed, but it does not proceed to the next step.
How do we resume workflow processing after system down?
Workflow administrative tools
There are several administrative tools or transactions which SAP has provided for administrator to resume or complete workflow processing, after error or system crash. I personally prefer to use these following 3 transaction codes:
1. SWI1 – Work Item Selection Report,
2. SWPR – Workflow Restart after Error, and
3. SWPC – Workflow Restart after System Crash
SWI1 – Work Item Selection Report
This report provides very useful information (including workflow log), which can help administrator as well as developer to identify the root cause of the issue. Interestingly, with proper administration authorization, we can use this report to do certain manipulation on the workflow instance and its corresponding work items.
Run report SWI1 (populate workflow instance or work item ID into field ‘Identification’ if possible) to locate your error workflow instance. Once you get the report, you can proceed as following to get into ‘Display work item’ screen:
1. Click on ‘Spectacle’ button
2. Go to menu Goto -> Technical Work Item Display, and
3. Go to menu Edit -> Change
There are 10 functionalities available to manipulate workflow instance and work item. Some functionalities are more relevant for work item than for workflow instance level.
1. Change Container
You will be able to see all your workflow container elements over here and you can add, change or even delete the values from these elements. For example if the agent value is NOT populated properly from the rule, we can add this value into the element manually.
2. Lock for Execution
If you lock the workflow instance for execution, then your workflow instance and the related work items are locked and can not be executed by any agent. You will get a warning message and a checked mark appears on your screen with description ‘Work item locked against execut.’.
3. Replace Manually
You use this function if the work item is reserved by some one (as such it is not visible from other agents’ workplace) and you want it to become visible again in all agents’ workplace. So, for the workflow instance, this functionality may not be that relevant.
4. Change Work Item Text
It basically gives you the chance to change your workflow instance or work item description. A pop up screen will come out, which allow you to change the description.
5. Change Work Item Language
This functionality gives you the chance to change your workflow instance or work item language. Just like ‘Change Work Item Text’, a pop will come out, which allow you to change the language.
6. Change Priority
You can use this functionality to change the priority of the work item. The agent will get the immediate pop up if you change it from ‘medium’ to ‘express’ for example.
7. Logically Delete
This is the functionality to (logically) delete the workflow instance and its related work items. They are only ‘LOGICALLY deleted’ from the system, which means that the workflow log, workflow instance and work items records are still stored in the workflow tables.
8. Complete Manually
Using this functionality, the workflow instance and its related work item status will be set to ‘Completed’. A pop up screen will come out, confirming your decision. Afterward another pop up with warning message will come out. Please be noted that the task on which the work item is based is not executed, and if necessary you will have to do manual update using SAP transaction.
9. Set Enqueue Lock
You can lock the workflow instance or work item so that other user can not process it at the time you process it. However, unlike lock for execution, this lock is SAP logical lock which can be deleted from SM12. Don’t forget to unlock it afterwards by clicking on button ‘Undo Enqueue Lock’.
10. Change Deadline
Using this functionality, you can overwrite or set a new deadline monitoring deadline like Latest Start (Deadline Start), Latest End (Deadline End) and Requested End (Planned Start) of a work item.
There are 4 more additional functionalities available for manipulating work item, those are:
This functionality allows you to forward the work item from the current agent to another agent. You can still use this functionality, even if the work item currently is created without agent.
12. Execute Agent
This functionality allows you to execute the agent determination rule again. One typical example would be in the case where the work item is created without agent and the rule has been rectified, and you run this functionality to re-assign the work item to the proper agent.
13. Start Execution & 14. Execute
This functionality allows you to execute the work item just like any normal agent executes the work item from the workplace.
If the work item you manipulate is not the last step of the work flow instance, and you need to resume the workflow processing to the subsequent step, then you need to restart the workflow using following transactions.
SWPR – Workflow Restart after Error
Use this tool to restart any workflow instance after error. This tool can be used in this 2 situations, those are:
1. After you have changed the container value manually using the SWI1 functionalities above, so that you can resumethe workflow processing without waiting for the developer to finish rectifying the error, or
2. After the developer finish rectifying the error, and re-transport it to the production.
SWPC – Workflow Restart after System Crash
Use this tool to restart any workflow instance that is hanging after server down or system crash. You can recognize this ‘hanging’ workflow instance by comparing the last work item status with the workflow instance status in table SWWWIHEAD. If the workflow status is still ‘STARTED’ where as the last work item status is ‘COMPLETED’ for more than several hours, most probably the workflow is hanging.