Hey there, please don’t worry about the length of this post. The concept of Physical and Logical deletion is not that complicated and by the time you reach the end of this post, your fundamentals would definitely be clear. 🙂
I assume you all use “DELETE” button and “SHIFT+DELETE” button on your computer to delete the files you no longer need in your system.
If the file is no longer needed we delete it permanently using SHIFT+DELETE but suppose what if we want to get it back in future if we need them. In those cases, we just remove them from the source folder using DELETE button and it goes to RECYCLE BIN. If we want it back we can restore it from the RECYCLE BIN.
DELETE – Send the files to RECYCLE BIN folder of your computer. You can get it back any time you want.
SHIFT+DELETE – Permanently deletes your file. You can not get it back (unless you are a Geek who knows how to churn the system and get back deleted contents). 🙂
The Same concept applies to SAP Workflow.
Let’s see how?
In SAP workflow logical deletion is synonymous to deleting a file from your system but not permanently. Whereas physical deletion of workflow/work items is similar to deleting the file on your computer using SHIFT+DEL. The end result, you can not get it back.
Note: When I say ‘workflow’ I mean ‘workflow instance’. A step in the whole workflow – for example, a purchase approval for a tractor. A ‘work item’ is a step in that workflow instance that may appear in an SAP inbox.
Normally when a workflow gets initiated, the work items/workflow will be routed to some of the agents for approval. The work item will be present in user’s SAP inbox.
Seeing is believing. Check it for yourself!!
Work item number: 123456789 (Suppose it is a purchase order approval workflow)
When the purchase order was created, upon the workflow is routed to the proper approver based on the Z logic present or standard logic.If you click on the agent button, it will show you the workflow agents for this work item. If you check the same user’s SAP inbox using the transaction SWI5, you can find out the same work item is present in his inbox.
You can see in the below image the workflow related to PO 78945612 is present in the user “SAP YARD ” and “The Sharp Turtles” in ready state.
Now let’s understand the difference between Logical and Physical deletion of the workflow.
Logical deletion is simply another term for Cancellation – no data is lost or removed. 🙂
What happens when you logical delete any workflow?
- When we logically delete any workflow/work item, it gets removed from the user SAP inbox and get archived. Here archived had the same meaning as it goes to RECYCLE BIN folder.
- The work item will be present in the System.
- After deleting the work item logically its status will be set to CANCELLED and so are all of its incomplete child work items.
- If the work item was logically deleted then we can trace back the agent (Responsible/Possible) to whom work item belonged to and who performed the deletion and we can also retrieve the deleted work item.
Why there is need to logically delete the work items?
- There can be many reasons for it, for example when first time the purchase order workflow was routed then the data inside the PO was incorrect so the PO workflow was corrected and then workflow was restarted and a new work item got generated and it is routed to some user/approver. So, now the old work item is no longer needed but still, the old work item is present in some user SAP inbox. So, he logically deletes the old redundant work item.
- Due to some data issue, the workflow went to the error state. So, after correcting the data the workflow was restarted correctly and then the new work item is generated. In such instances as well, the user would like to logically delete the previous work item.
How to logically delete the workflow/work items?
There can be many ways to delete the workflow but here I have listed some of the commonly used ones:
- Using SWIA transaction
- Using transaction ADMC(Administrative Cancel) SAP Note 1286336 (‘New logically delete function for mass processing’) adds the function code ADMC (Administrator Cancel) to transaction SWIA.
- Technical work item details
If you want more information and step by step process on how to logically delete the workflow for all the above mention 3 steps and if you want to know whether a work item is logically deleted or not please visit my blog “The Sharp Turtles“.
How to Logically delete any workflow/Workitem in SAP?
Please find the answer here–> Sharp Turtle Link How to Logically Delete any WF.
How to find out whether a work item is logically deleted or not?
Please follow this Sharp Turtle Link to find if a Work Item was Logically Deleted.
Now you might ask, what if I want to reverse a logical deletion work item? i,e what if I want to retrieve the same work item that was deleted logically?
No. It is not possible to bring back the same work item once it is logically deleted. If you restart the workflow, a new workflow instance with the same parameters, if required will be generated.
Workitem number: 123456 after logically deletion and restarting the new work item with the same parameter will be generated but the work item number will be different for example 1248475.
Also Read: Logical Vs Physical Locks in SAP
Let me ask one question.
Why some time you permanently delete some of the files from your computer?
Your Answer: Because I no longer need it and I am confident that I will not need that file in future .
Similarly in SAP workflow if a work item is no longer needed it will be physically deleted.
What happens when you physically delete any workflow?
- When we physically delete any workflow/work item then it gets removed from the user SAP inbox and gets permanently deleted from the system.
- After deleting the work item physically its status will be set to COMPLETED and so are all of its incomplete child work items.
- We can not trace back who was the responsible person/agent for the workflow
- We will not be able to retrieve back the work item.
Why there is need to physically delete the work items?
- You no longer need the work items in future.
- Archived workflow size is getting increased day by day that is pushing pressure on your system. You need to clean your system or want to decrease the system load.
There are multiple reports by which we can do the physical deletion which include
- RSWWWIDE (deletes the work items including attachments)
- RSWWWIDE_TOPLEVEL (deletes all the dependent work items)
- RSWWHIDE (deletes the work item history)
Why should you never physically delete workflows in the production environment?
Warning Houston!! Never use PHYSICAL DELETION in Production Environment.
I have seen many times that we take some action on wrong data. Data that were not supposed to come in the picture.
At the end we all are humans and we make mistakes. Instead of writing 123456 we write 12456
So, What happens when We deleted the wrong Workflows?? We were supposed to delete the work item number 123456 but we have deleted 12456
Now there is no way to get it back 🙁
When someone is asking you to physically delete the workflow, just tell them we don’t do physical deletion in the Production Environment. We only archive work items in the Production system.
This is my first SAP article on SAPYard.com. Hope it would be useful to you. I would like to thank the SAPYard Team for giving me this opportunity. As mentioned above, I also write on my own blog space. Please do not forget to visit my blog for more interesting stuff and fun. My blog The Sharp Turtles
We put a lot of effort in conceptualizing, testing and writing each and every article. If you could pass this link to at least 5 colleagues/friends who you think would benefit from our post, it would be a great favor to our team. We want our articles to reach to as many audiences as possible so that everyone would benefit and our team would remain motivated and our work does not get lost in this huge ocean of the internet.
Please, please share our post in your professional and social media and introduce your friends/colleagues/co-workers to our blog page.
You might also like: End to End Implementation of Two Fiori Apps