Search Results check_part_available
Overview
APPS.CSP_VALIDATE_PUB is a public PL/SQL package within the Oracle E-Business Suite Spares Management (CSP) module. Its documented purpose is to expose public procedures and functions used by CSP for validating item availability and deriving on-hand and available quantity information at various inventory levels. The package source header (cspgtvps.pls, version 120.2) traces back to 1999, reflecting a long-standing component of the field service and spares replenishment functionality.
The package is classified as PUB within the ETRM repository, indicating that its procedures and functions are intended to be called from external code rather than being private implementation helpers. It is referenced by four other packages, confirming its role as a shared utility layer for quantity validation logic across the CSP schema. The keyword "get_onhand_qty" that led to this object corresponds directly to one of its documented functions.
Key Procedures and Functions
The package exposes six documented procedures and functions, of which four distinct names are identified in the ETRM metadata excerpt:
- GET_ONHAND_QTY — A function that returns the total on-hand quantity for an item. This is the object surface corresponding to the user's search term.
- GET_AVAILABLE_QTY — A function returning available quantity, typically derived in Spares Management as unreserved quantity (total on-hand minus reserved).
- GET_AVAIL_QTY — An overloaded function that resolves available quantity of an item at organization, subinventory, or locator level. Documentation notes it handles revision as well as the standard organization/subinventory/locator hierarchy.
- CHECK_PART_AVAILABLE — A procedure that validates whether a specified part is available given item, organization, subinventory, locator, revision, serial number, and lot number context, returning an available quantity along with standard API return status, message count, and message data outputs.
The package also declares package-level globals g_qoh and g_atr, used to cache on-hand and available-to-reserve values across calls within a session.
Tables Accessed
Through APPS synonyms, the package reads the following documented tables:
- MTL_SYSTEM_ITEMS and MTL_SYSTEM_ITEMS_KFV — item definition and key flexfield view, used to resolve item attributes and identifiers during validation.
- MTL_PARAMETERS — organization-level inventory parameters that govern negative availability and reservation behavior.
- MTL_RESERVATIONS — reservation records used to compute reserved quantity, which is subtracted from total on-hand to derive available quantity.
- MTL_SERIAL_NUMBERS — serial number data supporting validation when a serial-controlled part is specified.
Usage Notes
CSP_VALIDATE_PUB is typically invoked from CSP forms, concurrent programs, and custom extensions that need to confirm part availability before committing spares to a work order or service request. Because the functions are public and referenced by four other packages, they are commonly called programmatically rather than declaratively. The CHECK_PART_AVAILABLE procedure adheres to the standard EBS API contract with API version, IN parameters, and OUT NOCOPY parameters for available quantity, return status, message count, and message data. Consumers should supply a valid API version number and interpret X_RETURN_STATUS per EBS convention (success, expected error, or unexpected error). The availability functions are intended for Spares Management semantics, where available quantity equals unreserved quantity; callers requiring reservation-aware or revision-specific results should select the appropriate overload and supply organization, subinventory, locator, and item identifiers accordingly.