Symptom
- When using the Purchase Order - Advanced app to modify purchase orders, the importing parameter PURCHASEORDERITEM_DB is not populated (it should contain original values such as the amount).
- Custom logic calculates the new total amount against zero, resulting in the approval workflow restarting when the original amount exceeds the defined tolerance (for example, 100).
- The behavior does not occur when using the Manage Purchase Orders app.
- Any modification in the Purchase Order - Advanced app, including adding attachments, initiates reapproval when the original amount exceeds the tolerance.
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
- Open the Purchase Order - Advanced app and change a purchase order.
- Ensure the original amount exceeds the defined tolerance (for example, 100).
- Observe that the approval workflow is restarted even though the change does not affect approval criteria.
Cause
- The behavior is related to custom logic that controls when the approval workflow should restart.
- The custom logic relies on the importing parameter PURCHASEORDERITEM_DB, which is not populated in the Purchase Order - Advanced app, leading to an incorrect delta amount calculation against zero.
Resolution
- Review the custom logic (for example, in the PO workflow restart enhancement) to remove the dependency on PURCHASEORDERITEM_DB when it is initial in the Purchase Order - Advanced app.
- Read the required original database values using a released PO item API instead of the BAdI importing parameter PURCHASEORDERITEM_DB.
- Implement a fallback in the logic to handle initial/empty PURCHASEORDERITEM_DB and compute the amount delta using values retrieved via the released API.
- Test in both the Purchase Order - Advanced and Manage Purchase Orders apps to confirm approvals restart only when the defined tolerance is genuinely exceeded.
Note:
If users are making any changes to PO using "Create Purchase Order Advanced" App, Parameter: PURCHASEORDERITEM_DB will not be filled.
If users are making any changes to PO using "Manage Purchase Orders" App, Parameter: PURCHASEORDERITEM_DB will be filled.
Both "Create Purchase Order Advanced" & "Manage Purchase Orders" are two different applications and follow different call stack execution.
As a workaround, use whitelisted PO item API instead of using BADI parameter PURCHASEORDERITEM_DB to read DB values.
See Also
Keywords
purchase order advanced, manage purchase orders, purchaseorderitem_db, workflow restart, reapproval, custom logic, badi, po_workflow_restart, delta amount, tolerance, not populated, released api, po item api, s/4hana cloud, procurement , KBA , MM-FIO-PUR-PO-WFL-CL , Purchase Order Workflow (Public Cloud) , MM-PUR-PO-2CL , Purchase Orders (Public Cloud) , Problem
SAP Knowledge Base Article - Public