1. Run the following query for the involved requisition. Substitute the requisition number and organization id when prompted:
select requisition_header_id
select requisition_header_id
from po_requisition_headers_all
where segment1 = '&REQ_NUMBER'
and org_id = &ORG_ID;
2. Substitute the requisition_header_id returned by script 1 when prompted in script 2 below:select item_type, Item_key
from wf_items
where item_key like '&REQ_HDR_ID'||'%'
and item_type='CREATEPO'
and root_activity = 'OVERALL_AUTOCREATE_PROCESS';
3. Then substitute the requisition_header_id returned by script 1 when prompted in script 2 below:
select item_type, Item_key, root_activity
from wf_items
where parent_item_key like '&REQ_HDR_ID'||'%'
and item_type='CREATEPO'
and root_activity in ('REQ_LINE_PROCESSING', 'CREATE_AND_APPROVE_DOC');
Use following procedure to abort process
BEGIN
WF_ENGINE.AbortProcess(l_item_type, l_item_key, NULL, l_result);
bms_output.put_line(' Successfully aborted workflow'); dbms_output.put_line(' ----------------------------------------------------'); EXCEPTION WHEN OTHERS THEN dbms_output.put_line(' Exception occured while Aborting workflow for item_type: '||l_item_type|| ' item_key: '||l_item_key); dbms_output.put_line(' Error message : '||SQLERRM); dbms_output.put_line(' ----------------------------------------------------'); END;
bms_output.put_line(' Successfully aborted workflow'); dbms_output.put_line(' ----------------------------------------------------'); EXCEPTION WHEN OTHERS THEN dbms_output.put_line(' Exception occured while Aborting workflow for item_type: '||l_item_type|| ' item_key: '||l_item_key); dbms_output.put_line(' Error message : '||SQLERRM); dbms_output.put_line(' ----------------------------------------------------'); END;
No comments:
Post a Comment