Search Results set_ou_context




Overview

The APPS.INV_THIRD_PARTY_STOCK_UTIL package body (source file INVUTPSB.pls, version 120.4, last modified 20-Feb-2008) is a utility package belonging to the Oracle Inventory module, classified in ETRM as a UTIL object. Its declared purpose is to provide "Consignment Utilities" supporting Oracle's third-party and consignment inventory functionality, where goods held at a vendor or customer location remain the property of another party until consumption. The package centralises a small set of lookup routines that resolve organisational context and item/vendor master attributes required by consignment stock processing. It is owned by APPS and is referenced by two other packages, indicating that it acts as a shared helper layer rather than a standalone business API.

Key Procedures and Functions

The package exposes six documented procedures and functions. The original source header lists the same six names, with Get_Primary_UOM appearing explicitly in the procedure list, which is directly relevant to the searched term get_primary_uom.

  • SET_OU_CONTEXT — Establishes the operating unit (OU) context for the session, ensuring subsequent queries are scoped to the correct business entity. The package maintains an internal context table (g_context_tbl) of org_id/resp_id pairs for this purpose.
  • GET_ORG_ID — Returns the operating unit associated with inventory organisation derived from a vendor site identifier. The documented source shows it selecting NVL(org_id,-99) from PO_VENDOR_SITES_ALL using the vendor_site_id.
  • GET_PRIMARY_UOM — Resolves the primary unit of measure for an item, allowing callers to obtain the base UOM without directly querying item master tables. This supports quantity conversion and validation during consignment stock transactions.
  • GET_UOM_CODE — Retrieves the UOM code associated with a unit of measure, complementing GET_PRIMARY_UOM for conversion logic.
  • GET_LOCATION — Returns location information used to identify where third-party stock is held.
  • GET_VENDOR_INFO — Retrieves vendor details required for consignment and third-party processing.

Tables Accessed

ETRM documents four base tables referenced through APPS synonyms:

  • HR_ALL_ORGANIZATION_UNITS — Supplies organisation/operating unit definitions used by SET_OU_CONTEXT and organisation resolution.
  • MTL_SYSTEM_ITEMS — The item master, read to obtain item attributes including the primary unit of measure for GET_PRIMARY_UOM.
  • MTL_UNITS_OF_MEASURE — Provides UOM definitions backing GET_PRIMARY_UOM and GET_UOM_CODE.
  • DBMS_APPLICATION_INFO — A supplied PL/SQL package (not a table) used to set module/action context for session tracing and diagnostics.

The source additionally references PO_VENDOR_SITES_ALL within GET_ORG_ID.

Usage Notes

Because it is classified as a utility package, INV_THIRD_PARTY_STOCK_UTIL is not intended for direct end-user invocation. It is typically called from other PL/SQL packages (two documented referrers), from consignment-related forms, or from custom code that needs to resolve OU context, vendor site organisation, or item primary UOM before processing third-party stock. The global g_user_id and g_pgm_appl_id are initialised from FND_PROFILE at package instantiation. Callers should invoke SET_OU_CONTEXT before dependent lookups to guarantee correct multi-org scoping under EBS 12.1.1 and 12.2.2.