Search Results get_correction_quantity




Overview

RCV_QUANTITIES_S is a Receiving (RCV) package body in the Oracle E-Business Suite APPS schema that centralizes the computation of available, tolerable, pending, and primary-quantity values during receiving and delivery transactions. In the Oracle EBS 12.1.1 and 12.2.2 releases, receiving forms, correction workflows, and the receiving transaction processor all require a consistent, source-aware answer to the question: how much of a given document line remains available to receive, correct, or deliver? Rather than duplicating that logic in every caller, RCV_QUANTITIES_S encapsulates it.

The package is classified in ETRM as OTHER and is not an externally published open interface; it is an internal utility package invoked by other receiving components. It is referenced by 23 other packages, confirming its role as a shared quantity-resolution service rather than an end-user-facing API. The body also declares a private debug flag, g_asn_debug, initialized from the profile option RCV_DEBUG_MODE, which enables diagnostic tracing during quantity calculation.

Key Procedures and Functions

ETRM documents 11 procedures and functions, of which four are publicly identified by name:

  • GET_AVAILABLE_QUANTITY — the primary entry point. Given a source document identifier and receipt source code, it returns the quantity still available to act upon, together with associated tolerable quantity, unit of measure, and secondary quantity values. It dispatches to source-specific private helpers based on the receipt source code.
  • GET_PRIMARY_QTY_UOM — returns the primary unit of measure applicable to the quantity being evaluated, so callers can present and validate quantities in the correct UOM.
  • GET_PENDING_QTY — returns quantity that is in a pending state, i.e., committed to a document or transaction but not yet fully processed or delivered.
  • NAME — enumerated in the ETRM inventory of package members.

The package body also declares forward definitions for a family of private helper procedures that feed GET_AVAILABLE_QUANTITY, each keyed to a distinct receiving source: get_receive_quantity (by parent ID and source code), get_po_quantity (by line location ID), get_rma_quantity (by order line ID), get_shipment_quantity (by shipment line ID), get_transaction_quantity (by transaction ID), get_correction_quantity (by correction type, parent transaction type, source code, parent ID, and grandparent ID), and get_deliver_quantity (by transaction ID). Because these are forward declarations, the exact public surface remains the four documented members above; the helpers are internal and should not be invoked directly.

Tables Accessed

The package reads and writes a broad set of Receiving, Purchasing, Order Management, Shipping, and Inventory tables through APPS synonyms. Purchasing-side data comes from PO_LINES, PO_LINES_ALL, PO_LINE_LOCATIONS, PO_LINE_LOCATIONS_ALL, and PO_DISTRIBUTIONS_ALL, which define ordered, received, and distributed quantities. Receiving data comes from RCV_SHIPMENT_LINES, RCV_TRANSACTIONS, RCV_TRANSACTIONS_INTERFACE, RCV_SUPPLY, and MTL_SUPPLY, which describe shipment lines, transaction history, interface staging, and supply records. Return material authorization quantities derive from OE_ORDER_LINES_ALL. Delivery information comes from WSH_DELIVERY_DETAILS, and item/UOM context from MTL_SYSTEM_ITEMS_B, MTL_SYSTEM_ITEMS_KFV, and MTL_UNITS_OF_MEASURE. These tables are consulted to derive current availability and pending amounts relative to the document under evaluation.

Usage Notes

RCV_QUANTITIES_S is normally invoked indirectly. The Receiving form (RCV Transactions), receiving correction forms, and the receiving transaction processor call it to default and validate quantities on shipment and transaction lines, and to determine how much may still be corrected or delivered. Order Management and Shipping components call it during RMA and delivery processing. Custom extensions and concurrent programs that must replicate receiving quantity logic should call the documented public procedures (GET_AVAILABLE_QUANTITY, GET_PRIMARY_QTY_UOM, GET_PENDING_QTY) rather than reimplementing the source-specific rules, because the package encapsulates the nuances of each receipt source code. The opm_status search term relates to process manufacturing status checks that may influence availability in OPM-enabled environments; the package operates alongside OPM receiving logic but its documented scope remains the discrete receiving quantity calculation described above.