Search Results recipe_hdr




Overview

GMD_RECIPE_GENERATE is an Oracle EBS Process Manufacturing (OPM) PL/SQL package owned by APPS and classified as OTHER within the ETRM 12.2.2 repository. Its principal business function is the programmatic creation and maintenance of recipes — the master manufacturing documents that bind a formula (the bill of materials equivalent) to a routing (the process instructions) for a specific production organization, version, and validity window. The package header declares AUTHID CURRENT_USER, meaning it executes with the privileges of the invoking schema and therefore relies on APPS synonyms and grants rather than definer's-rights escalation.

The header further establishes the package's operating context through global variables, including G_PKG_NAME, g_user_id and g_login_id initialized from FND_PROFILE.VALUE, together with g_recipe_id and g_orgn_code. Two strongly typed records, FLEX and RECIPE_HDR, model the descriptive flexfield segments and the recipe header attributes respectively. The RECIPE_HDR record exposes recipe identity and versioning columns alongside formula, routing, and project references, reflecting the integrated nature of recipe generation across OPM formula, routing, and project accounting data.

Key Procedures and Functions

The package exposes eight documented program units. Their names and purposes are as follows:

  • RECIPE_GENERATE — The primary entry point. It orchestrates end-to-end generation of a recipe from an existing formula and routing combination, populating header and detail structures and persisting the resulting recipe.
  • CREATE_RECIPE — Creates the recipe record itself, writing to the base and translation tables that hold recipe master data.
  • CREATE_VALIDITY_RULE_SET — Establishes a set of validity rules, grouping one or more date-effectivity rules for a recipe.
  • CREATE_VALIDITY_RULE — Defines an individual validity rule governing the effective date range during which a recipe or version is considered active.
  • CREATE_VALIDITY — Persists the validity definition associating a recipe, version, or routing with its effective period.
  • MANAGE_EXISTING_VALIDITY — Handles updates or reconciliation of validity data when a recipe is regenerated or a version is superseded.
  • CALCULATE_DATE — Performs date arithmetic used to derive effective and expiration dates required by the validity rule logic.

The procedures are interdependent: RECIPE_GENERATE invokes CREATE_RECIPE and the validity-related routines, which in turn rely on CALCULATE_DATE for date derivation. Error and status handling is supported by reads from GMD_STATUS and GMD_PARAMETERS, and the package is referenced by eight other packages, indicating that it is a foundational component in the recipe lifecycle rather than a leaf utility.

Tables Accessed

The package reads and writes a focused set of OPM and Oracle master data tables through APPS synonyms:

  • GMD_RECIPES_B and GMD_RECIPES_TL — base and translation tables storing recipe header data, including description, version, and flexfield attributes.
  • FM_FORM_MST and FM_FORM_MST_B — formula master and base tables supplying formula number and version to which the recipe is linked.
  • FM_ROUT_HDR and GMD_ROUTINGS_B — routing header and base data providing routing number and version.
  • GMD_RECIPE_VALIDITY_RULES — stores validity rule definitions generated by the validity procedures.
  • GMD_RECIPE_GENERATION — tracks generation activity, supporting audit and status reporting.
  • GMD_PARAMETERS and GMD_STATUS — parameter and status lookups governing generation behavior.
  • IC_ITEM_MST — item master validation for products and ingredients referenced by the recipe.
  • FND_USER — resolves the creating user's ID and user name for ownership and audit attributes.

Usage Notes

GMD_RECIPE_GENERATE is typically invoked from OPM recipe and formula maintenance forms, from concurrent programs that mass-generate or regenerate recipes across organizations, and from custom PL/SQL extensions. Because its header relies on FND_PROFILE.VALUE, it must be called within an initialized Oracle Applications session; direct SQL*Plus invocation requires the FND profile context to be established. Given its AUTHID CURRENT_USER declaration, the calling schema must hold the necessary object privileges. Custom code should call RECIPE_GENERATE rather than the lower-level CREATE_* routines, since the entry point sequences header creation, validity rule setup, and date calculation correctly and applies the package-global context (user, login, organization) consistently.