Search Results set_firstscan




Overview

INV_LOT_API_PUB is the public PL/SQL API for Oracle Inventory lot number processing in Oracle E-Business Suite 12.1.1 and 12.2.2. It centralizes the business logic required to create, validate, and maintain lot master records in MTL_LOT_NUMBERS, together with associated child lot definitions, lot attribute values, and lot unit-of-measure conversions. The package is classified as a PUB (public) API in the ETRM registry and is owned by APPS, meaning it is intended for supported invocation by Oracle forms, concurrent programs, and customer extensions rather than internal-only use.

A significant portion of the package body addresses Warehouse Management System (WMS) lot attributes. The package defines the WMS_NAMED_ATTRIBUTES record type, which carries descriptive lot data such as grade_code, origination_date, date_code, retest_date, maturity_date, item_size, color, volume, place_of_origin, best_by_date, dimensions, recycled_content, territory_code, and supplier_lot_number. A global table variable, g_lot_attributes_tbl, holds the selected attribute metadata during a session. The package determines whether WMS is installed at runtime and stores the result in G_WMS_INSTALLED, allowing attribute validation and population logic to be conditionally applied. Return status constants (g_ret_sts_success, g_ret_sts_error, g_ret_sts_unexp_error) and standard missing-value constants (g_miss_num, g_miss_char, g_miss_date) provide a consistent API contract across procedures.

Key Procedures and Functions

The documented interface exposes procedures and functions grouped by function. Lot creation is handled by CREATE_INV_LOT, INSERTLOT, and INSERTTRXLOT, with AUTO_GEN_LOT supporting automatic lot number generation. Validation routines include VALIDATE_UNIQUE_LOT, VALIDATE_LOT_ATTR_INFO, VALIDATE_LOT_ATTR_IN_PARAM, VALIDATE_CHILD_LOT, VALIDATE_LOT_INDIVISIBLE, VALIDATE_QUANTITIES, CHECK_LOT_INDIVISIBILITY, and VALIDATE_LOT_ATTR_IN_PARAM, which collectively enforce uniqueness, attribute completeness, indivisibility rules, and transaction quantity constraints. UPDATE_INV_LOT and UPDATE_INV_LOT variants manage changes to existing lot records.

Child lot handling is provided through INS_MTL_CHILD_LOT_NUM and UPD_MTL_CHILD_LOT_NUM. Unit-of-measure conversion logic is exposed by LOT_UOM_CONV_ORGTXF and CREATE_LOT_UOM_CONV_ORGTXF. WMS-specific behavior is delivered through WMS_LOT_ATTR_VALIDATE and SET_WMS_INSTALLED_FLAG. Two administrative routines, POPULATEATTRIBUTESCOLUMN and SET_FIRSTSCAN, manage package state. SET_FIRSTSCAN corresponds directly to the searched term "set_firstscan": it accepts a BOOLEAN argument (p_firstscan) and controls the g_firstscan package-global flag, which is initialized to TRUE. This flag is used to gate first-scan initialization behavior so that setup work is performed once per session. No parameter lists beyond those documented are asserted here.

Tables Accessed

The package reads and writes MTL_LOT_NUMBERS, the primary lot master table storing lot numbers, expiry dates, and lot attributes. MTL_CHILD_LOT_NUMBERS supports parent-child lot relationships, while MTL_LOT_UOM_CLASS_CONVERSIONS holds lot-specific UOM conversions. Transaction context is drawn from MTL_MATERIAL_TRANSACTIONS and the temporary tables MTL_MATERIAL_TRANSACTIONS_TEMP and MTL_TRANSACTION_LOTS_TEMP. Item and organization context comes from MTL_SYSTEM_ITEMS, MTL_SYSTEM_ITEMS_B, MTL_SYSTEM_ITEMS_KFV, and MTL_PARAMETERS. FND_USER and FND_DUAL support auditing and PL/SQL execution patterns. Sequences MTL_CONVERSION_ID_S, MTL_GEN_OBJECT_ID_S, and MTL_LOT_NUMERIC_SUFFIX_S supply surrogate keys and generated suffixes.

Usage Notes

INV_LOT_API_PUB is invoked from Inventory lot entry forms, receiving and shipping transaction flows, and concurrent programs that perform bulk lot creation or conversion. The ETRM registry records that the package is referenced by twenty-seven other packages, confirming its role as a shared dependency within the Inventory and WMS code base. Custom code should call the public procedures rather than write directly to MTL_LOT_NUMBERS, so that attribute validation and WMS conditional logic are preserved. Because g_firstscan and g_lot_attributes_tbl are global, callers within a session should invoke SET_FIRSTSCAN and POPULATEATTRIBUTESCOLUMN as required by the calling context. Debug tracing is controlled by the INV_DEBUG_TRACE profile, which is loaded into g_debug at package initialization.