Remove data inconsistency in Release status caused while Purchase Order / Purchase Requisition workflow approval
This blog is about the data inconsistencies observed with workflow approval process, where the root cause for the erroneous data cannot be determined as the issue occurs randomly or is non-reproducible.
Two most common scenarios are listed below:
- Purchase order (PO)/ purchase requisition (PR) is released already but the workflow work item is in the status ‘in process’ and still appears in the SBWP/ My inbox app of the approver.
- Workflow shows in the status ‘completed’ still the PO/ PR is in the status ‘in release’ instead of ‘release completed’.
How to rectify this?
Scenario 1: The requirement here is to get rid of the unnecessary work item still present in the inbox of approver. This can be done in any of the multiple following ways:
Fetch the work item id (WI_ID) of the workflow from SBWP or the table: SWW_WI2OBJ by entering the PO/PR number in the field INSTID.
- Using SWIA:
- Fetch the work item of the released PO. You can go to SBWP and take it from there
- or alternatively you may fetch it from the table sww_wi2obj : field WI_ID by putting the PO number in the field INSTID.
- Go to SWIA and enter the work item fetched from above in the field identification and execute.
- Select the line and press ‘complete manually’ as highlighted below:
- The work item status will now show as completed and the entry from SBWP/My inbox will be removed.
- Using SWWL: Enter the work item id in the field ID of the tcode SWWL and execute.This will delete the work item physically and it will get removed from the inbox.
- Using FM SAP_WAPI_WORKITEM_COMPLETE: Enter the work item id in the field WORKITEM_ID and execute. It will complete the work item id specified and it will not appear in the inbox anymore.
Scenario 2: Here the workflow is complete, but the PO/PR is still in ‘in release’ status, there is no error in the workflow log so tcodes like SWPR/SWPC would not work. In such cases, the document needs to be manually corrected at database level.
- For Purchase Order: Go to table EKKO and update the field PROCSTAT from ’03’ to ‘05’, field FRGRL from ‘X’ to blank and field FRGZU from blank to ‘X’.
- For Purchase Requisition: Go to table EBAN and update the field BANPR from ’03’ to ‘05’, field FRGRL from ‘X’ to blank and field FRGZU from blank to ‘X’.
By performing these steps there will be no inconsistent data with respect to the purchasing document approval process, and subsequent processes and follow on documents can be created without any issue.For example, if you have a purchase order and the next document you would like to create would be its corresponding Goods Receipt(GR) then it would get created successfully.