Tuesday, 6 September 2016

Resolving Stuck IN PROCESS of Purchase Order and Purchase Order Requisition

First the WF_ITEM_KEY, WF_ITEM_TYPE  of the IN PROCESS status PO need to be identified. Following sql statement can be used to get the details based on the PO No (segment1) and ORG_ID;
SELECT         wf_item_key, wf_item_type, authorization_status,
org_id, last_update_date, segment1 po_no
FROM             po_headers_all
WHERE          authorization_status = ‘IN PROCESS’
AND                org_id = 337
AND                segment1 in (‘po_no’,’po_no2′)
ORDER BY    last_update_date desc

.
Similarly  WF_ITEM_KEY, WF_ITEM_TYPE  of the IN PROCESS status PO REQ can be  identified. Using the following sql statement for the PO REQ No (segment1) and ORG_ID;
–To select all the inProcess for PO REQ
SELECT         wf_item_type , wf_item_key, authorization_status,
org_id , last_update_date, segment1 poreq_no
FROM             po_requisition_headers_all
WHERE         authorization_status = ‘IN PROCESS’
AND               org_id = 247
AND               segment1 in (‘po_req_no’,’po_req_no2′)
ORDER BY   last_update_date DESC

.
After getting the WF_ITEM_KEY and WF_ITEM_TYPE , you need to run the following process in the APPS SESSION LOGIN to remove stuck in process status;
For PO
begin
—  wf_engine.startprocess( ‘WF_ITEM_TYPE’ , ‘WF_ITEM_KEY’ );
wf_engine.startprocess( ‘POAPPRV’  ,  ‘123001-244471’ );
end;

For PO REQ
begin
—  wf_engine.startprocess( ‘WF_ITEM_TYPE’ , ‘WF_ITEM_KEY’ );
wf_engine.startprocess(‘REQAPPRV’  ,  ‘123001-244471’ );
end;