Search Results set_role




Overview

APPS.PO_GLOBAL is a PL/SQL package body in the Oracle E-Business Suite Purchasing (PO) module. Its business function is to maintain the session-level role context under which the current database session operates. Rather than deriving role membership from database privileges or responsibility assignments, PO_GLOBAL stores a simple character flag in a package global variable that identifies whether the session is acting as a Buyer, a Catalog Administrator, or a Supplier. Other Purchasing packages then read this flag to determine which validation, security, and defaulting rules should be applied to the transaction at hand.

The package is classified as OTHER in the ETRM (E-Business Suite Technical Reference Manual) metadata, indicating that it is not a public, installable API but an internal utility package intended for consumption by other Oracle Purchasing code. Its header identifies it as a no-ship (`noship`) source file, meaning it is delivered and maintained as part of the standard application code base.

Key Procedures and Functions

The documented public interface consists of two program units:

  • SET_ROLE — A procedure that sets the role of the user for the current database session. Internally it assigns the incoming role value to the package global variable g_role, making the role available to any other code executing within the same session. The role can be one of three constants defined on the package: g_role_BUYER (Buyer), g_role_CAT_ADMIN (Catalog Admin), or g_role_SUPPLIER (Supplier). The procedure has no prerequisites and does not modify database tables or acquire locks.
  • ROLE — A function that returns the role of the current session. It reads back the value previously stored by SET_ROLE, allowing callers to test the current context without keeping their own copy of the setting.

Both units follow the standard Oracle Purchasing instrumentation convention: they declare a module identifier by concatenating the package base name from PO_LOG.get_package_base with the API name, and, when debug logging is enabled (PO_LOG.d_proc), they emit entry trace messages through PO_LOG. This consistent logging pattern makes the package's activity visible in PO debug output when tracing is turned on.

Tables Accessed

The ETRM metadata records that the package references PO_HEADERS_ALL through APPS synonyms. PO_HEADERS_ALL is the core Purchasing table storing document headers for purchase orders, agreements, quotations, and related documents. In the context of PO_GLOBAL, the reference supports role-sensitive processing of purchasing documents — for example, determining which header records are visible or actionable for the currently established role. The role-setting procedures themselves perform no DML; they operate purely on the in-memory package state.

Usage Notes

PO_GLOBAL is an internal support package. It is typically invoked by other Oracle Purchasing packages rather than directly by end users. The ETRM metadata notes that it is referenced by 13 other packages, confirming its role as a shared context utility across the Purchasing module.

In practice, session entry points — such as an Oracle Forms-based Purchasing window, a concurrent program, or custom code built on the Purchasing APIs — call SET_ROLE once to establish the operating role, and downstream logic calls ROLE to branch on that value. Because the role is held in a package global, it persists for the life of the database session and is shared by all code in that session. Developers writing custom extensions for EBS 12.1.1 or 12.2.2 that mimic standard Purchasing behavior should set the role explicitly at the start of their processing to ensure consistent handling of Buyer, Catalog Admin, and Supplier scenarios.