Search Results validate_doc_no




Overview

GMA_VALID_GRP is a system-wide validation package owned by the APPS schema in Oracle EBS Release 12.1.1 and 12.2.2, classified as a GRP (group) API within the ETRM (E-Business Suite Technical Reference Manual). Its stated purpose, per the package header, is to consolidate "system-wide validation functions and procedures" used across the GMA (Process Manufacturing) modules. Rather than duplicating elementary edit checks in every form, report, or interface, GMA development centralized routine validations—unit of measure codes, reason codes, organization codes, company codes, document numbers, and type lookups—into a single reusable package. The package was originally created 01-OCT-1998 and upgraded to Release 11 in February 1999; a 28-OCT-1999 patch (Bug 1042739) added an extra parameter (p_orgn_code) to Validate_Doc_No so that document-number validation could be constrained to a specific organization. The package declares AUTHID CURRENT_USER, meaning its SQL executes with the privileges of the calling user rather than the definer. It is referenced by seven other packages, confirming its role as a foundational validation utility in the Process Manufacturing data model.

Key Procedures and Functions

The ETRM metadata documents eight program units, all but one implemented as boolean-returning functions:

  • NumRangeCheck — Evaluates a numeric value against a caller-supplied minimum and maximum, returning TRUE when the value falls within the range. It provides a generic bounds-checking primitive for numeric entry validation.
  • Validate_um — Confirms that a unit-of-measure code exists in the UOM master. Used wherever a UOM must be validated before being stored on a transaction or item.
  • Validate_reason_code — Verifies that a supplied reason code is a valid entry in the reason-code master, supporting transaction and adjustment reason validation.
  • Validate_orgn_code — Checks that an organization code exists in the organization master.
  • Validate_co_code — Validates a company code against the organization/company master.
  • Validate_orgn_for_company — Performs a cross-entity validation confirming that a given organization belongs to the specified company, enforcing referential consistency between the two.
  • Validate_doc_no — Validates a document number for a given document type, with an organization-code qualifier added by Bug 1042739. This is the function most commonly associated with the search term "validate_doc_no" and is central to document-sequence integrity.
  • Validate_type — Provides a generic type-lookup validation, allowing callers to confirm that a supplied type value is legitimate for its context.

Tables Accessed

The package reads from four tables accessed through APPS synonyms:

  • SY_DOCS_SEQ — The document sequence definition table, consulted by Validate_doc_no to confirm that the document type/document number combination (and, since the 1999 patch, the organization) is valid.
  • SY_ORGN_MST — The organization master, used by Validate_orgn_code, Validate_co_code, Validate_orgn_for_company, and the organization-qualified variant of Validate_doc_no.
  • SY_REAS_CDS — The reason-code master, queried by Validate_reason_code.
  • SY_UOMS_MST — The unit-of-measure master, queried by Validate_um.

These SY-prefixed tables form the common Process Manufacturing reference-data layer, which explains the package's broad reuse across seven dependent packages.

Usage Notes

GMA_VALID_GRP is a server-side utility invoked programmatically rather than through a dedicated concurrent program or form. Typical call sites include:

  • Form-level validation — When-Validate-Item and related triggers in GMA and OPM forms call functions such as Validate_um, Validate_reason_code, and Validate_orgn_code to reject invalid entries before commit.
  • PL/SQL APIs and interfaces — The seven packages that reference GMA_VALID_GRP delegate their parameter screening to it, ensuring consistent validation behavior across batch interfaces and public APIs.
  • Custom extensions — Developers writing custom validation logic should prefer these functions over bespoke SELECT statements to preserve Release 12.1.1/12.2.2 behavior and multi-org semantics, particularly for document-number checks where the organization qualifier matters.

Because functions return BOOLEAN, callers must handle the TRUE/FALSE result within PL/SQL; they cannot be invoked directly from SQL or used as a SQL expression. The AUTHID CURRENT_USER declaration means all callers require appropriate SELECT privileges on the underlying SY tables, a consideration when troubleshooting validation failures.