I am having difficulty starting the purchase order approval stream by PLSQL.
The command is able to start the flow but I can not end it.
When I click on "activity history" it shows the status "awaiting concurrent program".
I'vê ramed the concurrent "Background" anyway nothing.
If I send detail to the information below
When I will look at the details appears "PDF error of the SYSTEM COULD NOT GENERATE AND / Or Communicate at Least One of the Documents to the Supplier or The Approver. Please contact the System Administrator. "
Below is the procedure I am using .... I tried to call both the Core flow "POAPPRV" as the customized company.
PROCEDURE start_approval_wf(p_document_id NUMBER /*
,p_document_type_code VARCHAR2
,p_document_subtype VARCHAR2
,p_user_id NUMBER
,p_resp_id NUMBER
,p_resp_appl_id NUMBER
,p_note VARCHAR2*/) IS
--pragma autonomous_transaction;
l_vitemkey VARCHAR2(100);
l_seq_for_item_key VARCHAR2(20);
BEGIN
fnd_client_info.set_org_context('108');
fnd_global.apps_initialize(1126, 50326, 178);
--p_user_id, p_resp_id, p_resp_appl_id);
BEGIN
SELECT to_char(po_wf_itemkey_s.NEXTVAL) INTO l_seq_for_item_key FROM sys.dual;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('ERRO select to_char(PO_WF_ITEMKEY_S.NEXTVAL) ' || SQLERRM);
END;
l_vitemkey := to_char(p_document_id) || '-' || l_seq_for_item_key;
po_reqapproval_init1.start_wf_process(itemtype => 'MQSAPO', -- POAPPRV
itemkey => l_vitemkey, -- null
workflowprocess => NULL,
actionoriginatedfrom => NULL,
documentid => p_document_id --p_document_id --v_doc_id
,
documentnumber => NULL,
preparerid => 1126, --fnd_global.employee_id,
documenttypecode => 'RELEASE' --v_header_interface.document_type_code
,
documentsubtype => 'BLANKET' --v_header_interface.document_subtype
,
submitteraction => 'APPROVE',
forwardtoid => NULL,
forwardfromid => NULL,
defaultapprovalpathid => NULL,
note => 'Teste de WF Acordo de compra. 01' ||
p_document_id,
printflag => 'N',
faxflag => 'N',
faxnumber => 'N',
emailflag => 'N',
emailaddress => NULL,
createsourcingrule => 'N',
updatesourcingrule => 'N',
releasegenmethod => NULL,
massupdatereleases => 'N',
retroactivepricechange => 'N',
orgassignchange => NULL,
communicatepricechange => 'Y');
--commit;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20000, 'ERRO AO INICIAR WF DE APROVAÇÃO: ' || SQLERRM);
END;