Search Results do_restock




Overview

APPS.INV_MINMAX_PVT is a private (PVT) PL/SQL package that implements the core business logic for Oracle Inventory's Min-Max replenishment planning engine in Oracle E-Business Suite 12.1.1 and 12.2.2. The package drives the Min-Max Planning and Replenishment process, evaluating on-hand quantities, demand, supply, and item attributes across organizations, subinventories, and locators to determine which items require replenishment and what quantities must be ordered.

As the name suggests, the package is classified as private, meaning its procedures and functions are not intended as a public integration API. It is invoked by concurrent programs and replenishment forms within the Inventory module, and it centralizes the logic that previously resided in report scripts. The header comments reference a series of patchset and bug fix enhancements, including Replenishment Consolidation and Min-Max Lead Time enhancements (Patchset I), the optional parameters p_cust_site_id, p_vmi_enabled, and p_gen_report, and Bug 6807835, which added the p_osfm_batch_id parameter for process manufacturing integration.

Key Procedures and Functions

  • RUN_MIN_MAX_PLAN — The primary entry point. It executes the Min-Max planning run using the supplied item, category, and organization selection criteria, along with numerous control flags covering restocking, non-net quantities, purchase orders, move orders, WIP, internal requisitions, reservations, approvals, buyers, customers, cutoffs, calendars, and exception sets. It returns status and message outputs and populates the results used by the planning report.
  • GET_ONHAND_QTY — Returns the on-hand quantity for a given item, organization, subinventory, and system date, with a flag indicating whether non-net quantities are included. Added under Bug 2677358.
  • DO_RESTOCK — Performs the restocking calculation that determines replenishment quantity for an item when inventory falls below its minimum level.
  • GET_SHIPPED_QTY — Retrieves the quantity already shipped for an item, used in netting supply against demand during the planning computation.
  • GET_STAGED_QTY — Returns the quantity staged in a staging area for the item, contributing to the nettable supply position.
  • GET_PICK_RELEASED_QTY — Returns the quantity on pick-released material, allowing the engine to account for inventory already committed against demand.
  • GET_ITEM_UOM_CODE — Returns the unit of measure code associated with an item, used when expressing replenishment quantities in the correct UOM.

Tables Accessed

The package operates against a broad set of Inventory and Manufacturing tables through APPS synonyms. Item and category master data come from MTL_CATEGORIES and MTL_CATEGORIES_KFV. Supply and demand balancing relies on MTL_DEMAND, MTL_MATERIAL_TRANSACTIONS, MTL_MATERIAL_TRANSACTIONS_TEMP, and MRP_ATP_SCHEDULE_TEMP_S. Location and stocking detail are drawn from MTL_ITEM_LOCATIONS, MTL_ITEM_REVISIONS, and MTL_LOT_NUMBERS. Manufacturing and process data are read from BOM_OPERATIONAL_ROUTINGS, GME_BATCH_HEADER, and GME_MATERIAL_DETAILS. Calendar-driven lead time calculations use BOM_CALENDAR_DATES, and user context comes from FND_USER. Results are written to the temporary planning table INV_MIN_MAX_TEMP.

Usage Notes

INV_MINMAX_PVT is normally invoked indirectly. In the standard EBS flows it is called by the Min-Max Planning concurrent program and by replenishment-related forms within Oracle Inventory, which pass the selection parameters defined in the run_min_max_plan signature. It is referenced by one other package, indicating that other Inventory components depend on its computations. Because it is a PVT package, custom code should not call it directly without accepting the risk of signature changes across patches; developers seeking the "max " UDA or similar item attribute information should expect this package to surface such attributes only indirectly through the planning results it generates and writes to INV_MIN_MAX_TEMP, rather than as a standalone public API.