Search Results g_get_func_curr




Overview

JAI_PLSQL_CACHE_PKG is an Oracle E-Business Suite package body owned by APPS and classified as an OTHER API within the ETRM repository. Its purpose is to provide a session-level, in-memory PL/SQL cache of inventory organization attributes that are required repeatedly by tax, legal entity, and accounting determination logic. Rather than re-querying base tables for every organization encountered during a processing run, callers read from an associative array keyed by organization identifier.

The cached record type, FUNC_CURR_DETAILS, carries the ledger identifier, functional currency code, chart of accounts identifier, organization code, legal entity, organization name, minimum accounting unit, and numeric precision for a given inventory organization. These attributes represent the functional currency and accounting context that downstream Oracle EBS tax and intercompany routines must resolve per organization. Related products in the region (notably the JAI India localization modules) reference this package heavily; the ETRM metadata records that thirty-nine other packages depend on it, which confirms its role as a shared low-level utility rather than an application-facing API.

Key Procedures and Functions

  • READ_CACHE — A function that accepts an organization identifier and returns the cached FUNC_CURR_DETAILS record. It performs an existence check against the package global associative array (G_GET_FUNC_CURR) and copies the stored field values into a local record for return. If the organization is not present in the cache, an empty record is returned. The function includes a WHEN OTHERS handler that writes a diagnostic message to the concurrent program log via FND_FILE.PUT_LINE.
  • WRITE_CACHE — A procedure that accepts an organization identifier and a FUNC_CURR_DETAILS record, and stores the individual field values into the package-level associative array under that organization key. This is the counterpart to READ_CACHE and is what populates the cache in the first place.
  • READ_FROM_DB — The population routine that derives the functional currency and accounting attributes for an organization directly from the database. It is the fallback path used when a cache miss occurs, and its results are subsequently persisted through WRITE_CACHE.
  • RETURN_SOB_CURR — A helper that resolves and returns the set of books (ledger) currency context for the organization, supporting the currency determination performed by READ_FROM_DB.

Tables Accessed

  • MTL_PARAMETERS — The inventory organization definition table, used to resolve the organization code and related inventory organization attributes for the supplied organization identifier.
  • HR_ALL_ORGANIZATION_UNITS — The organization master, used to obtain the organization name and validate the organization identifier passed to READ_CACHE and WRITE_CACHE.
  • HR_ORGANIZATION_INFORMATION — The descriptive flexfield-style organization information store, used to retrieve the legal entity and minimum accounting unit attributes associated with the organization.
  • GL_LEDGERS — Provides the ledger identifier and chart of accounts identifier for the organization's accounting context.
  • FND_CURRENCIES — Supplies currency attributes, including precision, for the functional currency code returned by RETURN_SOB_CURR.
  • PLITBLM — The PL/SQL integer table type used for bulk operations during the database read path.

Usage Notes

The package is invoked programmatically from other PL/SQL packages rather than from a form or a standalone concurrent program. The typical pattern is that a caller first attempts READ_CACHE for an organization; on a cache miss it invokes READ_FROM_DB to resolve the attributes from the base tables and then calls WRITE_CACHE to retain the result. Because the cache is held in a package global, its contents persist only for the duration of the database session and are not shared across concurrent requests.

The user search term "get_inv_org" reflects this usage: consumers of the package are seeking the inventory organization context — organization code, organization name, legal entity, ledger, and functional currency — for a given organization identifier. Callers should treat a READ_CACHE result with a null ledger identifier as an unpopulated cache entry and follow with the database read path. Because the cache is session-scoped and populated lazily, no explicit initialization call is required, but long-running sessions that span changes to organization or ledger setup may hold stale values. Diagnostic output from READ_CACHE is written to the concurrent request log, so failures during cache reads should be reviewed there.