Search Results get_max_dist_line_num




Overview

APPS.AP_INVOICES_UTILITY_PKG is a Payables utility package in Oracle E-Business Suite that centralizes reusable lookup, validation, and derived-value logic for invoices. Rather than embedding repetitive SQL against the invoice, distribution, hold, and prepayment tables inside individual forms, concurrent programs, and APIs, the E-Business Suite codebase exposes this logic through a single package of scalar functions and validation procedures. The package header carries the revision marker $Header: apinvuts.pls 120.17.12010000.2 2008/11/11, placing its principal evolution in the 12.1.x code line, and the object remains catalogued under the APPS schema in both 12.1.1 and 12.2.2. Its functions are oriented toward presentation and decision support: returning descriptive attributes (PO, release, receipt, prepayment references), monetary aggregates (distribution totals, withheld and prepaid amounts), status determinations (posting, approval, encumbrance), and hold indicators. The package is classified as OTHER in the ETRM registry and is referenced by 45 other packages, underscoring its role as shared infrastructure within the Payables and related modules.

Key Procedures and Functions

The documented interface divides into validation procedures, reference/derivation functions, and status functions.

Tables Accessed

The package reads and, for validation purposes, may query the principal Payables invoice tables through APPS synonyms. Header-level logic draws on AP_INVOICES_ALL and its interface counterpart AP_INVOICES_INTERFACE. Line and distribution logic uses AP_INVOICE_LINES_ALL, AP_INVOICE_LINES, AP_INVOICE_DISTRIBUTIONS_ALL, AP_INVOICE_DISTRIBUTIONS, and AP_INVOICE_LINES_INTERFACE. Hold-related functions query AP_HOLDS and AP_HOLDS_ALL. Prepayment and payment references rely on AP_CHECKS. Purchasing-reference and history functions use AP_HISTORY_INVOICES_ALL and AP_EXPENSE_REPORT_HEADERS, with AP_APINV_APPROVERS supporting approval-related logic.

Usage Notes

AP_INVOICES_UTILITY_PKG is typically invoked from Oracle Forms (notably the Invoice Workbench), concurrent programs, and custom PL/SQL extensions to obtain derived invoice attributes without duplicating business logic. Because the functions are read-oriented, they are safe to call in validation, defaulting, and display contexts. Custom code should always call the packaged functions rather than reimplementing queries, since internal SQL is owned and patched by Oracle. Note that GET_HOLDS_COUNT and GET_SCHED_HOLDS_COUNT serve distinct purposes — invoice-level versus schedule-level holds — and both should be considered when summarizing hold exposure. As with all objects in APPS, execute privileges and any dependency on specific form or view state should be considered before reuse in extensions.