Search Results references_exist




Overview

PO_HEADERS_SV4 is a server-side PL/SQL package body owned by APPS in Oracle E-Business Suite Purchasing. It belongs to the family of PO_HEADERS_SV* packages that provide row-level validation and attribute resolution services for purchasing document headers. Unlike the PO_HEADERS_SV* packages that support the Supplier Model or the core purchasing forms block handlers, PO_HEADERS_SV4 is oriented toward document type classification, document numbering, and structural integrity checks on header and line data.

The package is classified as OTHER in the ETRM repository and is documented with eleven procedures and functions. Its principal business role is to answer classification questions about a purchasing document — whether it is a quotation, what its document type name and lookup code are, what its document number is, and whether the document has accumulated lines or is referenced elsewhere. These answers are consumed by higher-level purchasing APIs and by form logic that must branch on document category before permitting an action. The package header carries the CVS revision marker $Header: POXPOH4B.pls 120.1 2008/02/25 09:22:51 adevadul ship $, indicating a long-stable interface that has been carried forward across the 12.1.1 and 12.2.2 releases without functional rework.

Key Procedures and Functions

The documented callable units fall into three functional groups.

  • IS_QUOTATION — returns a BOOLEAN indicating whether a given header identifier corresponds to a document whose type lookup code is 'QUOTATION'. The supplied source shows it selecting type_lookup_code from PO_HEADERS_ALL and comparing against the literal, returning FALSE on any exception.
  • GET_TYPE_NAME — the unit associated with the "get_type_name" search term. It resolves and returns the descriptive type name for a purchasing document, derived from the document type definition rather than the header row itself.
  • GET_DOC_TYPE_LOOKUP_CODE (also documented as NAME) — the supplied source shows it accepting a document type code and subtype and returning the corresponding type name and document subtype through IN OUT NOCOPY parameters, selecting from PO_DOCUMENT_TYPES and blanking the outputs on NO_DATA_FOUND while logging other errors via PO_MESSAGE_S.SQL_ERROR.
  • GET_DOC_NUM and GET_VENDOR_QUOTE_NUM — retrieve the internal document number and the vendor quotation number respectively for a header.
  • CUMULATIVE_LINES_EXIST — determines whether cumulative (quantity- or amount-based) lines exist against the document.
  • REFERENCES_EXIST — determines whether the document is referenced by other purchasing entities, supporting deletion and cancellation guards.
  • IS_CONTRACT_VALID — validates that a contract document satisfies the conditions required for continued use.

Tables Accessed

The package reads through APPS synonyms rather than the underlying PO schema directly:

  • PO_HEADERS_ALL — the primary source for type_lookup_code, document number, and vendor quotation number, and the anchor for existence checks.
  • PO_DOCUMENT_TYPES_ALL and PO_DOCUMENT_TYPES — the document type definitions used to translate a type code and subtype into a display type name and lookup code. The supplied source confirms PO_DOCUMENT_TYPES as the source of type_name and document_subtype.
  • PO_HEADERS — the header view, used where display-level attributes are required.
  • PO_LINES_ALL — used by the cumulative-line and reference checks to establish whether child rows exist.

Usage Notes

PO_HEADERS_SV4 is a supporting validation package rather than a public business API, and ETRM records it as referenced by five other packages. It is typically invoked from the Purchasing forms layer, from other PO_HEADERS_SV* packages, and from concurrent programs that pre-validate documents before processing. Custom code should call these units only for read-only classification and existence checks; the documented exception handling returns benign defaults (FALSE, empty strings) in several paths, so callers that require a hard failure must test the returned values explicitly rather than relying on exceptions. Because routine GET_DOC_TYPE_LOOKUP_CODE logs through PO_MESSAGE_S before re-raising, the FND message stack should be inspected when diagnosing failures.