Search Results check_date_range




Overview

GMD_COMMON_VAL is a shared PL/SQL validation and calculation package within the Oracle E-Business Suite Process Manufacturing (GMD) family. Its declared purpose, stated in the package header, is to provide "validation functions and procedures used by more than one part of GMD," encompassing Routings, Operations, Formulas, Quality Control, Recipes, and Laboratory modules. The package is owned by APPS and declared with AUTHID CURRENT_USER, meaning that its SQL executes under the privileges of the calling schema rather than the definer, which is consistent with standard Oracle EBS shared-library practice.

The package centralizes logic that would otherwise be duplicated across the discrete GMD modules, offering reusable date-range validation, customer and user lookups, status resolution, process-loss and quantity calculations, and charge computation for routing steps and operations. The header history indicates an original creation date of 14 November 2000, with subsequent revisions tracking bug fixes and feature extensions. A companion package, GMA_VALID_GRP, carries the code common to more than one module for items such as unit-of-measure validation, organization code validation, and type validation.

Key Procedures and Functions

The documented interface exposes eighteen procedures and functions. Validation utilities include CHECK_FROM_DATE, CHECK_DATE_RANGE, CUSTOMER_EXISTS, CHECK_USER_ID, and CHECK_FORMULA_ITEM_ACCESS, the last of which governs whether a user may access a given formula item and is the object most relevant to the user's search. Lookup helpers include GET_CUSTOMER_ID, ACTION_CODE, GET_STATUS, and UPDATE_ALLOWED. Calculation routines include CALCULATE_PROCESS_LOSS, CALCULATE_TOTAL_QTY, CALCULATE_TOTAL_PRODUCT_QTY, GET_ROUTING_SCALE_FACTOR, CALCULATE_CHARGES, and CALCULATE_STEP_CHARGES. Control-flow helpers include VERSION_CONTROL_STATE and RUN_STATUS_UPDATE.

The package defines named error-code constants for date validation, including GMD_MAX_DATE_ERR (-6), GMD_MIN_DATE_ERR (-7), GMD_TO_FROM_DATE (-8), and GMD_FROM_DATE_REQD (-35), plus FMVAL_CUSTID_ERR (-92205). A CHARGE_REC record type supports charge calculation, carrying routing step, capacity, unit of measure, charge, and default-charge flag attributes.

Tables Accessed

The package references a defined set of tables through APPS synonyms. Routing structures include FM_ROUT_HDR, FM_ROUT_DTL, and FM_ROUT_DEP. Resource master and detail data come from CR_RSRC_MST and CR_RSRC_MST_B, with CR_RSRC_DTL supplying detail records. Operations and their supporting entities are represented by GMD_OPERATIONS, GMD_OPERATION_ACTIVITIES, and GMD_OPERATION_RESOURCES. Formula and recipe context is supplied by CM_CMPT_DTL and GMD_RECIPES. Process-loss and status logic draw on GMD_PROCESS_LOSS and GMD_STATUS, while calendar and method information is sourced from CM_CLDR_DTL and CM_MTHD_MST. Collectively these references support date validation, charge computation, quantity aggregation, status resolution, and access checking.

Usage Notes

GMD_COMMON_VAL is a shared library rather than an end-user interface. It is invoked from GMD forms (Routings, Operations, Formula, Recipes, and Quality) and from concurrent programs that require consistent validation or calculation behavior. The ETRM metadata records that the package is referenced by twenty-five other packages, confirming its role as a foundational dependency across Process Manufacturing. Custom code extending or integrating with GMD should call these procedures rather than reimplementing equivalent validation, and should honor the documented error-code constants when interpreting return values. Because the package executes AUTHID CURRENT_USER, callers must have appropriate direct privileges on the referenced tables.