Hello SAP,
We have a requirement that the workflow should only retrigger when there is an increase in the PO total net amount but if there is a decrease PO should not trigger the approval flow again.
we have written lbelow ogic in BADI : MMPUR_PO_WORKFLOW_RESTART
******************************************************************************** * PURCHASEORDER - New Purchasing Document Header * PURCHASEORDER_DB - Old Purchasing Document Header * PURCHASEORDERITEM - New Purchasing Document Items * PURCHASEORDERITEM_DB - Old Purchasing Document Items * PURCHASEORDERSCHEDLINES - New Purchasing Document Schedule Lines * PURCHASEORDERSCHEDLINES_DB - Old Purchasing Document Schedule Lines * PURCHASEORDERACCOUNTING - New Purchasing Document Account Assignment * PURCHASEORDERACCOUNTING_DB - Old Purchasing Document Account Assignment * PURCHASEORDERTEXTS - Purchasing Document Texts Changes * SSCUI_FIELDS - Manage your solutions-> Manage Conditions to * Restart PO Flex. WF * WORKFLOWRESTARTTYPE - "R" Always Restart * "N" No Restart * "C" Conditional Restart ****************************************************************************** * READ TABLE purchaseorderitem INTO DATA(ls_item) INDEX 1. "Read New PO Line item 1 READ TABLE purchaseorderitem_db INTO DATA(ls_item_db) INDEX 1. "Read old PO Line item 1 CASE workflowrestarttype. WHEN 'R'."When standard SSCUI is Always Restart. IF ls_item-netamount LT ls_item_db-netamount. workflowrestarttype = 'N'. RETURN. ELSEIF ls_item-netamount GT ls_item_db-netamount. workflowrestarttype = 'R'. RETURN. ENDIF. ENDCASE. .
But this is not working somehow. Could you please suggest where are we getting wrong.Note: we have also tried keeping C in this condition IF ls_item-netamount LT ls_item_db-netamount.