Search Results get_input_ratio




Overview

GMD_VALIDITY_RULES is a PL/SQL package in the Oracle EBS Process Manufacturing (OPM) application, owned by APPS and classified as an OTHER API. It encapsulates the business logic governing recipe validity rules — the records in GMD_RECIPE_VALIDITY_RULES that determine which recipe, formula, and routing combination is selected for a given organization, inventory item, and quantity range. Validity rules drive the automatic recipe selection performed during batch creation, costing, and production transactions, using attributes such as recipe use, preference, effective dates, minimum/maximum/standard quantities, and validity rule status. The package exposes both a record type (gmd_val_rules_out) that mirrors the validity rule table structure and a set of query and calculation routines used by Oracle Process Manufacturing forms, concurrent programs, and dependent packages. The header comment indicates an NPD (New Product Development) conversion that introduced organization_id and revision columns and renamed item_id to inventory_item_id and item_um to detail_uom, reflecting the 11i-to-R12 data model. Seven other packages reference this package, confirming it is a shared foundation for recipe and batch processing logic.

Key Procedures and Functions

The package documents twelve procedures and functions. Their names and roles are:

  • GET_VALIDITY_RULES — Retrieves validity rule records matching supplied selection criteria, returning data in the gmd_val_rules_out record structure.
  • GET_ALL_VALIDITY_RULES — Returns the complete set of validity rules for a given context, typically used where multiple candidate rules must be evaluated.
  • GET_OUTPUT_RATIO — Calculates the output ratio for a validity rule, expressing the relationship between the rule's output quantity and its standard or base quantity. This is the routine most often sought when scaling recipe yields.
  • GET_INGREDPROD_RATIO — Computes the ingredient-to-product ratio, used to scale ingredient quantities proportionally to batch output.
  • GET_BATCHFORMULA_RATIO — Derives the batch-to-formula ratio applied when converting a formula quantity into an actual batch quantity.
  • GET_CONTRIBUTING_QTY — Determines the contributing quantity for an ingredient or product within the validity rule's quantity range.
  • GET_INPUT_RATIO — Calculates the input ratio for a validity rule, the input-side counterpart to GET_OUTPUT_RATIO.
  • GET_VALIDITY_SCALE_FACTOR — Returns a scale factor derived from the validity rule, applied when adjusting quantities across the min/max/standard range.
  • GET_VALIDITY_OUTPUT_FACTOR — Returns the output factor used in yield and output quantity calculations.
  • GET_FORMULA_COST — Retrieves the cost associated with the formula linked to the validity rule, supporting batch costing.
  • INSERT_VAL_TEMP_TBL — Inserts validity rule data into the temporary table GMD_VAL_RULE_GTMP, supporting set-based processing in forms and concurrent programs.
  • UOM_CONVERSION_MESG — Produces the message text associated with unit-of-measure conversion failures during validity rule evaluation.

Tables Accessed

The package reads and writes the following tables through APPS synonyms:

  • GMD_RECIPE_VALIDITY_RULES — the primary source and target of validity rule data.
  • GMD_RECIPES, GMD_RECIPES_B — recipe headers supplying recipe-level attributes.
  • FM_FORM_MST, FM_FORM_MST_B, FM_MATL_DTL — formula master and material detail, used for ratio and cost calculations.
  • GMD_STATUS, GMD_STATUS_B — status codes controlling validity rule and recipe availability.
  • GMD_TECH_PARAMETERS_B — technical parameters influencing scaling and conversion.
  • GMD_VAL_RULE_GTMP — the global temporary table populated by INSERT_VAL_TEMP_TBL.
  • MTL_PARAMETERS — organization parameters providing default UOM and costing context.
  • MTL_SYSTEM_ITEMS_B, MTL_SYSTEM_ITEMS_KFV — inventory item definitions and the key flexfield view for item validation.
  • MTL_UNITS_OF_MEASURE — UOM definitions supporting conversion and ratio logic.
  • PLITBLM — a general temporary/work table used in OPM processing.

Usage Notes

GMD_VALIDITY_RULES is invoked indirectly rather than by end users. OPM recipe and batch forms (such as the Recipe Validity Rules and Batch Maintenance windows) call its routines to resolve which recipe applies to a given item, organization, and quantity range, and to compute the ratios needed to scale the selected batch. Concurrent programs that create or cost batches use the same routines, and INSERT_VAL_TEMP_TBL is used to pre-stage candidate rules for set-based evaluation in GMD_VAL_RULE_GTMP. The seven dependent packages that reference this package rely on it to keep recipe selection and quantity computation consistent across OPM modules. Custom code should call the documented routines rather than querying GMD_RECIPE_VALIDITY_RULES directly, because the ratio, scale factor, and output factor logic encodes rules that are not reproducible from the table columns alone. The package is unchanged in substance between EBS 12.1.1 and 12.2.2; the NPD conversion attributes in the record type remain the distinguishing feature of its interface.