Search Results error_status




Overview

GMF_GLCOMMON_DB is a server-side PL/SQL package owned by APPS in the Oracle E-Business Suite. It provides shared currency conversion and exchange-rate retrieval utilities for the Process Manufacturing (GMF) applications. Its principal role is to resolve the correct General Ledger exchange rate between two currencies for a given rate date and rate type, returning both the rate value and a multiplier/divisor indicator that the calling program uses to apply the conversion correctly. The package is classified as OTHER in the ETRM repository, indicating it is not a public business API but an internal utility package consumed by other GMF and SLA-related code.

The documented source header (gmfglcob.pls 115.1) confirms the package was introduced to centralize rate lookup logic, particularly the "closest rate" search behavior. When no rate exists for the exact rate date, the package rolls backward through history up to a maximum number of days, mirroring the GL:MAX_ROLL_DAYS profile-based behavior used by General Ledger currency conversion.

Key Procedures and Functions

  • GET_CLOSEST_RATE — The core public function. It accepts a from-currency, a to-currency, an exchange rate date, and a rate type, then returns the applicable rate along with an output multiplier/divisor sign and an IN OUT NOCOPY error_status flag. It validates that no mandatory parameter is null (setting error_status to 100 and returning -1 in that case), short-circuits identical currency pairs by returning 1, and obtains currency attributes via GET_INFO before resolving the rate.
  • PROC_GET_CLOSEST_RATE — The procedural wrapper for the rate lookup, allowing callers that do not need a return value to invoke the same logic and receive results through OUT parameters, including error_status.
  • GET_INFO — Retrieves currency-level information for a given currency code and rate date, returning the derived rate, the multiplier/divisor amount (mau), and the currency's rate type classification. GET_CLOSEST_RATE invokes GET_INFO first and immediately returns -1 when error_status is set to 100.
  • IS_FIXED_RATE — A boolean-style function that reports whether a given currency or rate definition is fixed, used to determine whether rate lookup should proceed or be bypassed.
  • PROC_IS_FIXED_RATE — The procedural variant of the same check, returning its outcome through an OUT parameter.

Tables Accessed

  • GL_CURR_MST — The GL currency master. It is queried to identify currencies with a derive type of 1 (euro-derived currencies) and delete_mark of 0, and to obtain the currency attributes consumed by GET_INFO. This drives the euro triangulation and rate-type logic.
  • GL_XCHG_RTE — The GL daily exchange rates table. It supplies the conversion rate for the requested currency pair, rate type, and rate date, and is the source for the backward-rolling "closest rate" search up to the maximum roll days.

No other packages are documented as referencing GMF_GLCOMMON_DB, indicating it sits near the leaf of the dependency chain and is called directly rather than through intermediate APIs.

Usage Notes

Because the ETRM classification is OTHER and no dependent packages are recorded, GMF_GLCOMMON_DB is normally invoked from within other GMF and subledger PL/SQL units, concurrent programs, and custom extensions that must convert amounts using GL rates rather than reimplementing the lookup. When a caller searches on "error_status," the relevant contract is that error_status is an IN OUT NOCOPY parameter initialized to 0 at entry; a value of 100 signals a null or unresolvable input, in which case the function returns -1. Callers should test error_status after every invocation and treat the returned rate as valid only when error_status remains 0. Identical from- and to-currency codes return a rate of 1 with the multiplier/divisor sign left untouched. The backward-rolling search means results can be returned for a rate date slightly earlier than requested; callers requiring an exact-date rate must compare the resolved date themselves. The package is not intended for direct end-user execution.