Search Results approve_and_forward_doc




Overview

APPS.PO_REQAPPROVAL_ACTION is the PL/SQL package that implements the server-side approval workflow logic for Oracle Purchasing requisitions and purchase orders in Oracle E-Business Suite 12.1.1 and 12.2.2. It functions as the action library behind the Purchasing Document Approval (POAPPRV) workflow item type, providing the procedure calls that Oracle Workflow executes at each node of the approval process. The package governs state validation, document completeness verification, approval, rejection, forwarding, reservation of funds, and authority checking for documents routed through the approval hierarchy.

The package is declared with AUTHID CURRENT_USER, meaning it executes with the privileges of the invoker, consistent with standard APPS schema coding conventions. It was originally created in 1997 and carries a header version from the 11i era, but remains the runtime engine for approval actions in both Release 12.1.1 and 12.2.2. Its procedures are invoked directly by Workflow function activities, each receiving the standard parameter set (itemtype, itemkey, actid, funcmode) and returning a Resultout value that Workflow interprets as Activity Performed or a comparable status. This result-driven contract makes the package the authoritative point at which a document's eligibility to move to the next approval stage is determined.

The user search "down project manager send approval to sbu" reflects a common approval routing scenario: a Project Manager submits a requisition that must be escalated to a Strategic Business Unit reviewer. That routing is driven by the approval hierarchy and Workflow definitions, while the actual state transitions and validations at each step are performed by the procedures within PO_REQAPPROVAL_ACTION.

Key Procedures and Functions

The package exposes thirteen documented procedures. The principal ones include:

  • STATE_CHECK_APPROVE — Determines whether the current state of the document is compatible with the approve action. Returns a result indicating whether the action may proceed.
  • STATE_CHECK_REJECT — Determines whether the document's current state is compatible with the reject action.
  • DOC_COMPLETE_CHECK — Validates that the document is complete, verifying that quantities match and that at least one line and one distribution exist before approval is permitted.
  • APPROVE_DOC — Performs the approval of the document, recording the approval and advancing its workflow state.
  • APPROVE_AND_FORWARD_DOC — Approves the document and forwards it to the next approver in a single action.
  • FORWARD_DOC_INPROCESS — Forwards a document that is currently in process.
  • FORWARD_DOC_PREAPPROVED — Forwards a document that has already received pre-approval.
  • REJECT_DOC — Rejects the document and returns it to the appropriate prior state.
  • VERIFY_AUTHORITY — Confirms that the acting user possesses the authority required to perform the requested approval action.
  • OPEN_DOC_STATE — Establishes or opens the document state used by the approval process.
  • RESERVE_DOC — Reserves the document for approval processing.
  • RESERVE_DOC_OVERRIDE — Reserves the document while overriding normal reservation constraints.
  • INSERTHISTFOROWNERAPPROVE — Inserts approval history for an owner-level approval action.

Two global variables, doc_mgr_err_num and sysadmin_err_msg, support error capture and system administrator messaging during execution.

Tables Accessed

The package references several tables through APPS synonyms. PO_HEADERS and PO_HEADERS_ALL store the document header data whose state and completeness are validated. PO_ACTION_HISTORY records the audit trail of approval and rejection actions. PO_DOCUMENT_TYPES and PO_DOCUMENT_TYPES_ALL supply document type definitions used during validation. PO_DRAFTS holds draft documents relevant to online approval. PO_ONLINE_REPORT_TEXT stores reporting text associated with the approval display. FND_USER provides approver identity information used by VERIFY_AUTHORITY. WF_ITEMS links the workflow item to its document. DUAL and PLITBLM support utility operations and PL/SQL table handling.

Usage Notes

PO_REQAPPROVAL_ACTION is invoked primarily by Oracle Workflow during execution of the POAPPRV item type, where each procedure is registered as a function activity. It is not a user-facing API and should not be called directly from forms. Customizations that alter approval routing, such as escalating a Project Manager's requisition to an SBU reviewer, are normally implemented through workflow definition and approval hierarchy configuration rather than by modifying this package. Direct modification is unsupported and may be overwritten by patching. The package is referenced by four other packages, confirming its role as a shared approval utility within the Purchasing module.