Search Results get_contributing_qty




Overview

GMD_FETCH_VALIDITY_RULES is a PL/SQL package body owned by APPS in the Oracle E-Business Suite Process Manufacturing (OPM) schema. Its central business function is to retrieve the recipe validity rules that govern which formulas and recipes may be used for a given combination of item, organization, recipe use, and quantity. Valid recipes in Process Manufacturing are those whose validity rule ranges (quantity, dates, and contextual qualifiers) are satisfied at the time a batch or production transaction is created. The package encapsulates that determination so that calling forms, APIs, and concurrent programs obtain a consistent, rules-based answer rather than re-implementing the logic.

The package is an "OTHER" classified API as recorded in ETRM 12.2.2 metadata, meaning it is not a formally published public API in the FND_API sense, but is nevertheless referenced by other packages and callable from custom code. The header comment references source file GMDPVRFB.pls version 120.3 (2006/11/21), indicating this is a long-standing component carried forward into both 12.1.1 and 12.2.2.

Key Procedures and Functions

The documented package exposes seven procedures and functions. The primary entry point is GET_VALIDITY_RULES, which accepts a recipe, item, organization, product quantity, UOM, recipe use, total input, and total output, and returns a table of valid recipes (recipe_validity_tbl) together with the standard FND_API return status, message count, message data, and return code. The remaining routines are supporting computations used by the validity evaluation:

  • GET_OUTPUT_RATIO — derives the ratio of output quantity relative to the recipe or formula basis, used when matching validity ranges against yielded quantity.
  • GET_INGREDPROD_RATIO — computes the ratio between ingredient quantity and produced (product) quantity, supporting scaling decisions during validity evaluation.
  • GET_BATCHFORMULA_RATIO — calculates the batch-to-formula scaling ratio that reconciles the requested batch size with the formula's defined quantity.
  • GET_CONTRIBUTING_QTY — determines the contributing quantity of a component within the recipe, used to evaluate quantity-based validity thresholds.
  • GET_INPUT_RATIO — returns the input-to-basis ratio applied in quantity range checks.
  • UOM_CONVERSION_MESG — provides UOM conversion handling and messaging, ensuring quantity comparisons occur in compatible units.

Collectively these routines implement the arithmetic needed so that validity rules expressed in fixed units can be tested against the caller's requested quantities.

Tables Accessed

The package reads from a defined set of OPM and inventory tables via APPS synonyms:

  • GMD_RECIPE_VALIDITY_RULES — the core table storing validity rule definitions (quantity ranges, dates, and associated recipe references) that the package retrieves and returns.
  • FM_FORM_MST — the formula header, providing formula quantity and UOM that anchor scaling.
  • FM_MATL_DTL — formula material detail lines, supplying ingredient and product quantities used in contribution and ratio calculations.
  • MTL_SYSTEM_ITEMS / MTL_SYSTEM_ITEMS_KFV — item master data, including item-level UOM and descriptive attributes used in conversion and validation.
  • MTL_UNITS_OF_MEASURE — UOM definitions that support conversion between the recipe UOM and the requested quantity UOM.

These tables are read-only inputs to the calculation; the package does not create or update production data.

Usage Notes

Typical invocation occurs when a user selects a recipe for a batch in OPM production forms, or when a batch or formula is validated programmatically. The package can be called directly from custom PL/SQL because GET_VALIDITY_RULES follows the FND_API parameter convention (p_api_version, p_init_msg_list, x_return_status, x_msg_count, x_msg_data), accepting a version of 1.0 and returning the validity table as an OUT NOCOPY collection. Because it is classified as OTHER rather than PUBLIC, no compatibility guarantee is implied in 12.1.1 or 12.2.2; developers extending batch validation should isolate calls to this package so that internal signature changes in a later patch do not propagate through custom code. One other package in the ETRM metadata already references it, confirming it is reused as a shared utility rather than being invoked only from a single form.