Search Results get_tz_code




Overview

The APPS.GMF_LEGAL_ENTITY_TZ package body is a public PL/SQL utility within the Oracle E-Business Suite (EBS) environment, serving the Process Manufacturing (GMF) and Financials modules. Its primary business function is to resolve and manage time zone information associated with legal entities and operating units. In global deployments, accurately determining the time zone of a legal entity is critical for transactional integrity, particularly for date-stamping, period close, and cross-regional reporting. This package acts as a bridge between Oracle's Legal Entity configurator and the operational data stored in inventory and policy tables. It provides a centralized, reusable API to retrieve time zone codes and to convert timestamps between server time and local legal entity time, ensuring consistency across distributed systems. The package is classified as a standard "OTHER" API, indicating it is a supporting utility rather than a core transactional interface.

Key Procedures and Functions

The package exposes several documented functions and procedures, each designed for specific time zone resolution tasks:

  • GET_TIMEZONE_CODE: This function accepts an operating unit ID and returns the corresponding time zone code for the legal entity associated with that operating unit. If the legal entity time zone is not configured, the function returns NULL. It acts as a wrapper, delegating the core lookup to the XLE_LE_TIMEZONE_GRP.Get_Le_Tz_Code_For_Ou API.
  • GET_TZ_CODE: Similar to the above but accepts a legal entity ID directly. It identifies an inventory-enabled organization associated with the legal entity and returns the time zone code. This function includes a cursor to select an organization ID from the organization definitions, ensuring that the time zone is derived from an operational context.
  • CONVERT_SRV_TO_LE: A conversion procedure that translates a server time value to the local time of a legal entity. This is essential for presenting timestamps in the user's local context.
  • CONVERT_LE_TO_SRV_TZ: The inverse of the above, converting a legal entity local time to server time. This is used when data must be stored in a normalized server time zone.

These functions and procedures form a cohesive set for time zone handling, with the two GET functions providing lookup capabilities and the two CONVERT procedures enabling bidirectional time translation.

Tables Accessed

The package interacts with two primary tables, referenced via APPS synonyms, to fulfill its logic:

  • GL_PLCY_MST: This table is likely used to store legal entity time zone configuration or policy master data. The GET_TIMEZONE_CODE function, by delegating to XLE_LE_TIMEZONE_GRP, indirectly queries this table to retrieve the time zone code associated with a given operating unit or legal entity.
  • MTL_PARAMETERS: The GET_TZ_CODE function explicitly references MTL_PARAMETERS.organization_id and joins with ORG_ORGANIZATION_DEFINITIONS to find an inventory-enabled organization for a legal entity. This table holds organization-level parameters, and the time zone code is often stored or derived from these parameters to ensure the correct local time zone is applied based on the organization's physical location.

Usage Notes

This package is typically invoked from within Oracle EBS forms, concurrent programs, and custom PL/SQL code where time zone context is required. For example, a custom form that displays transaction dates for a specific operating unit would call GET_TIMEZONE_CODE to fetch the correct time zone and then use CONVERT_SRV_TO_LE to display the timestamp in local time. Similarly, when integrating with external systems, CONVERT_LE_TO_SRV_TZ ensures that data is stored in a consistent server time zone. The package is referenced by at least one other package, indicating its role as a shared utility. Developers should note that the functions return NULL if time zone setup is missing, so error handling for unconfigured legal entities is advisable. The package is available in both EBS 12.1.1 and 12.2.2, and its public scope allows safe invocation from any custom code.