Search Results get_po_number




Overview

POR_APPRV_WF_UTIL_GRP is a PL/SQL utility package owned by the APPS schema in Oracle E-Business Suite, classified in the ETRM repository as a GRP (group) type object. The package, whose header file is identified as PORWFUTS.pls (version 115.1, dated 31-MAR-2004), declares AUTHID CURRENT_USER, meaning its SQL statements execute under the privileges of the invoking user rather than the definer. Its name indicates that it supports the Purchasing Approval Workflow — specifically the notification and approval routing logic in the Oracle Purchasing module — by supplying descriptive values that must appear in approval notification messages or in workflow attribute lookups.

The package is intentionally small. Its documented purpose is to resolve a small set of context-derived identifiers from a line-level key, so that the workflow engine and its notification templates can present meaningful business references (purchase order number, sales order number, and cost center) rather than internal numeric identifiers. It is documented in ETRM 12.2.2 and is understood to behave identically in 12.1.1, since the source header predates both releases and the package has not been materially revised.

Key Procedures and Functions

  • get_po_number — Returns the purchase order number associated with a given line_location_id. It is the only function in the package keyed on PO_LINE_LOCATIONS rather than on a requisition line, reflecting the fact that the purchasing approval workflow operates at the shipment/schedule level once a requisition has been autocreated into a PO.
  • get_so_number — Returns the sales order number for a given requisition_line_id. This is the function most frequently sought by developers and support analysts; it maps a purchasing requisition line back to the originating sales order, supporting drop-ship and back-to-back order flows where a requisition is created to fulfill a sales order demand. Its return type is NUMBER.
  • get_cost_center — Returns the cost center for a given requisition_line_id, again as a VARCHAR2. The value is resolved from the accounting flexfield segments attached to the requisition distribution, allowing the approval notification to display the charge account's cost center without the workflow having to call the flexfield APIs directly.

Tables Accessed

The documented table references are consistent with the three functions. PO_HEADERS_ALL, PO_LINE_LOCATIONS_ALL and PO_RELEASES_ALL supply the PO number for get_po_number. OE_ORDER_HEADERS_ALL and OE_ORDER_LINES_ALL supply the sales order number for get_so_number, joined through the requisition line. PO_REQUISITION_HEADERS_ALL, PO_REQUISITION_LINES_ALL and PO_REQ_DISTRIBUTIONS_ALL provide the requisition context used by get_so_number and get_cost_center. PO_SYSTEM_PARAMETERS_ALL and FINANCIALS_SYSTEM_PARAMS_ALL provide operating unit and ledger-level defaults, while FND_ID_FLEX_SEGMENTS and FND_SEGMENT_ATTRIBUTE_VALUES are used to resolve the cost center segment from the accounting flexfield definition for the appropriate chart of accounts.

Usage Notes

The package is referenced by zero other packages in the ETRM repository, which confirms its role as a terminal utility rather than a shared library. It is normally invoked from the Oracle Purchasing approval workflow (POAPPRV) and from workflow notification templates or document-management hooks that need to display a PO number, sales order number, or cost center. Because the functions accept only an ID and return a scalar, they are safe to call from custom PL/SQL, from Oracle Forms personalizations, and from concurrent programs or BI Publisher data templates. Callers should supply a valid, committed line_location_id or requisition_line_id; the functions do not raise meaningful exceptions for missing data and can return NULL when the relationship has not been established.