Search Results create_lot




Overview

GMI_LOTS_WRP is a wrapper package in the Oracle Process Manufacturing (OPM) module of Oracle E-Business Suite. Its stated purpose, drawn directly from the package header comments, is to "define the wrapper function to call the Lot Create API." In the OPM data model, a lot represents a specific quantity of a product or material that is tracked through inventory, quality, and production activities. The Lot Create API is the underlying programmatic interface that inserts and validates new lot records, and GMI_LOTS_WRP exists to expose that interface in a controlled, file-driven fashion.

Rather than requiring a developer to invoke the core lot creation logic directly with in-memory parameters, this wrapper accepts a directory path plus input and output file names, reads lot definitions from a delimited flat file, and returns status information through a result file. This design makes the package particularly convenient for bulk lot load activities, data conversion projects, and interfaces where legacy lot masters must be brought into OPM.

Key Procedures and Functions

  • Create_Lot — The central routine of the package. It is documented in two forms: a procedure and a function that returns a VARCHAR2 status value. Both accept a directory, an input file, an output file, and an optional delimiter defaulting to a comma. The procedure form drives the file-based lot creation, while the function form returns an outcome indicator to the caller.
  • Get_Field — A parsing helper that extracts a numbered field from a delimited input line. It supports the file-driven processing model by allowing Create_Lot to read positional or delimited attributes (such as lot number, item, and organization) from each record.
  • Get_Substring — A complementary string utility that returns a substring, used for trimming or normalizing values parsed from the input file before they are passed to the lot creation logic.

The package is declared with AUTHID CURRENT_USER, meaning it executes with the privileges of the invoking schema rather than the defining schema.

Tables Accessed

The documented table references are IC_LOTS_CPG, IC_LOTS_MST, and UTL_FILE. IC_LOTS_MST is the OPM lot master table, which holds the definitive lot records; this is the principal destination of the create operation. IC_LOTS_CPG is a child or related lot table, typically storing additional lot-level classification or quality data that is populated alongside the master record. UTL_FILE is the Oracle-supplied file I/O package rather than a business table; it is used to read the input file and write the output/result file specified in the Create_Lot parameters. All three are accessed through APPS synonyms.

Usage Notes

GMI_LOTS_WRP is typically invoked from concurrent programs, SQL*Plus or shell-driven conversion scripts, or custom PL/SQL that needs to load lots in bulk. The caller must supply a valid server directory object path (or an accessible UTL_FILE directory) along with the input and output file names, and must ensure the delimiter argument matches the input file format. The package is intended as an interface layer and is not referenced by other documented packages, so its use is generally limited to custom integrations and one-time data loads rather than standard application flows.