Search Results get_who




Overview

GMA_GLOBAL_GRP is a utility package body owned by APPS and classified in ETRM as a GRP (group) object. Its stated purpose, taken from the package header comments, is to contain "all Utility functions pertaining to System Module." The package consolidates low-level, frequently reused lookups that Process Manufacturing (OPM) and related EBS modules require: sequential document numbering, reason code retrieval, and standardized WHO-column auditing values. The source file is GMAGGBLB.pls, with a header revision tag of 115.2 dated 2002/11/01. A documented history entry shows an upgrade to Release 11 on 17-FEB-1999, followed by a modification on 23-JUL-2002 in which Get_Who was changed to return -1 when the user was not defined; the comment notes that SYSADMIN has a valid user_id of 0, which is why a distinct negative sentinel was chosen rather than zero. In 12.1.1 and 12.2.2 the package remains part of the APPS schema and is referenced by 27 other packages, confirming its role as a shared dependency rather than a standalone business flow.

Key Procedures and Functions

The package exposes three documented functions.

  • GET_DOC_NO — Returns the next document number for a given document type and organization code. The header comments describe it as a global function that obtains the next document number, returning the document number on success and a blank value when errors occur. It is the numbering utility used by other OPM packages that need sequential document identifiers.
  • GET_REASON_CODE — Retrieves reason code information for the system module. Consistent with the package's utility role, it centralizes reason-code access so that callers do not query the reason code table directly.
  • GET_WHO — Supplies the WHO-column audit values (the created-by / updated-by user identifier) used throughout OPM tables. As recorded in the package history, its behavior was explicitly changed so that it returns -1 if the user was not defined, because SYSADMIN legitimately has a user_id of 0 and could not otherwise be distinguished from a failed lookup. This is the function associated with the search term "get_who."

Tables Accessed

ETRM lists three tables referenced through APPS synonyms:

  • SY_DOCS_SEQ — The document sequence source. GET_DOC_NO reads the sequence definition (keyed by document type and organization code) to derive and return the next document number.
  • SY_REAS_CDS — The reason code definitions. GET_REASON_CODE draws its return values from this table.
  • FND_USER — The Oracle Applications user repository. GET_WHO uses it to resolve the current or specified user to a user_id, marking the not-found case with the -1 return value noted above.

Usage Notes

Because the package is classified as a group utility and is referenced by 27 other packages, it is normally invoked indirectly. OPM base packages and module-specific APIs call GET_DOC_NO when they must generate the next sequential document number, call GET_REASON_CODE when populating or validating reason codes, and call GET_WHO when stamping WHO columns during inserts and updates. It is not a user-facing API and has no form or concurrent program of its own; rather, it is a dependency of the code behind OPM forms, concurrent programs, and custom extensions. Custom code should call these functions instead of duplicating the sequence and WHO logic, and should account for GET_DOC_NO returning a blank value on error and GET_WHO returning -1 for an undefined user. The package is unchanged in structure between 12.1.1 and 12.2.2, and since the last documented modification dates to 2002, it should be treated as stable legacy utility code that is safe to depend on but unlikely to change.