SELECT i_po_header_id
|| '-' || TO_CHAR(PO_WF_ITEMKEY_S.NEXTVAL)
--INTO V_ITEM_KEY
FROM DUAL;
mo_global.set_policy_context('S', V_ORG_ID);
PO_REQAPPROVAL_INIT1.START_WF_PROCESS(ItemType => V_ITEM_TYPE, --'POAPPRV',
ItemKey => V_ITEM_KEY,
WorkflowProcess => 'POAPPRV_TOP',
ActionOriginatedFrom => 'PO_FORM',
DocumentID => I_HEADER_ID,
DocumentNumber => V_SEGMENT1, -- Purchase Order Number
PreparerID => V_PREPARER_ID, -- Buyer/Preparer_id
DocumentTypeCode => V_DOCUMENT_TYPE_CODE,
DocumentSubtype => V_DOCUMENT_SUBTYPE,
SubmitterAction => 'APPROVE',
forwardToID => NULL,
forwardFromID => NULL,
DefaultApprovalPathID => NULL,
Note => NULL,
PrintFlag => 'N',
FaxFlag => 'N',
FaxNumber => NULL,
EmailFlag => 'N',
EmailAddress => NULL,
CreateSourcingRule => 'N',
ReleaseGenMethod => 'N',
UpdateSourcingRule => 'N',
MassUpdateReleases => 'N',
RetroactivePriceChange => 'N',
OrgAssignChange => 'N',
CommunicatePriceChange => 'N',
p_Background_Flag => 'N', --N:標準API會COMMIT
p_Initiator => NULL,
p_xml_flag => NULL) --,
--FpdsngFlag => 'N', --12.0.6無此參數
--p_source_type_code => NULL); --12.0.6無此參數
備註: 執行API時不可開著PO, 否則雖然狀態變為IN PROCESS, 但workflow會有exception.
Ref:
Oracle ERP R12. - Approval PO By API
http://doggww.blogspot.com/2012/12/oracle-erp-r12-approval-po-by-api.html
依官方說法, 不提供此API:
Is There An API To Submit Incomplete PO's, Releases And Requisitions For Approval? (Doc ID 1326541.1)
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。