Search Results get_primary_site_use_id




Overview

OE_HEADER_UTIL is a utility package in the Oracle Order Management module of Oracle E-Business Suite, owned by the APPS schema and classified as a UTIL API. It encapsulates the server-side logic required to create, query, update, lock, and cancel sales order headers within the OE_ORDER_HEADERS_ALL entity. The package defines an extensive set of global constants (G_ACCOUNTING_RULE through G_GL and beyond) that map attribute, descriptive flexfield, and column names to positional indexes. These constants allow generic routines such as COMPLETE_RECORD, UPDATE_ROW, and APPLY_ATTRIBUTE_CHANGES to operate against order header records without hard-coding attribute names. In release 12.1.1 and 12.2.2, the package is central to header maintenance performed by Order Management forms, the Order Import concurrent program, and downstream integrations. The user search term "get_primary_site_use_id" reflects a common requirement when resolving a customer's primary ship-to or bill-to site-use identifier prior to populating header columns such as SHIP_TO_SITE_USE_ID or INVOICE_TO_SITE_USE_ID; this site-use resolution is performed against the HZ customer model rather than against OE tables directly.

Key Procedures and Functions

The package exposes thirty-one documented procedures and functions. The record-mapping group (G_MISS_OE_AK_HEADER_REC, API_REC_TO_ROWTYPE_REC, ROWTYPE_REC_TO_API_REC) translates between the OE_AK_HEADER_REC API record structure and the OE_ORDER_HEADERS_ALL%ROWTYPE representation. The record-maintenance group (CLEAR_DEPENDENT_ATTR, APPLY_ATTRIBUTE_CHANGES, COMPLETE_RECORD, CONVERT_MISS_TO_NULL) prepares a header record for DML by clearing attributes made obsolete by other changes, applying attribute changes, filling in defaults, and converting the G_MISS sentinel to NULL. The persistence group (INSERT_ROW, UPDATE_ROW, DELETE_ROW) performs the actual header table operations, while QUERY_ROW, QUERY_CARD_DETAILS, and LOCK_ROW support retrieval and pessimistic locking. CANCEL_HEADER_CHARGES handles header-level charge cancellation. The retrieval group (GET_VALUES, GET_IDS, GET_ORD_SEQ_TYPE, GET_MTL_SALES_ORDER_ID, GET_ORDER_INFO, GET_HEADER_ID) supplies order identifiers, sequence types, sales order IDs, and header attributes used by callers and by other Order Management utilities.

Tables Accessed

The package reads and writes OE_ORDER_HEADERS and OE_ORDER_HEADERS_ALL, the base order header tables, and maintains audit history in OE_ORDER_HEADER_HISTORY. OE_ORDER_LINES and OE_ORDER_LINES_ALL are referenced for line-level context, and OE_PAYMENTS for payment information associated with the order. Customer and site data are resolved through the HZ synonyms: HZ_CUST_ACCOUNTS, HZ_CUST_ACCT_SITES, HZ_CUST_SITE_USES_ALL, HZ_LOCATIONS, HZ_PARTIES, and HZ_PARTY_SITES. This HZ access is where primary site-use identifiers are determined. Attachment-related logic uses OE_ATTACHMENT_RULES and OE_ATTACHMENT_RULE_ELEMENTS, and FND_LANGUAGES supports language-dependent retrieval.

Usage Notes

OE_HEADER_UTIL is invoked by the Order Management order entry forms, the Order Import concurrent program, and a large number of dependent packages (the metadata records 75 referencing packages). The package is declared AUTHID CURRENT_USER, so it executes with the privileges of the calling schema; custom code should therefore be granted the underlying object privileges or invoked through an APPS-owned wrapper. Because the procedures manipulate header records using positional constants, callers should initialize the API record via the G_MISS_OE_AK_HEADER_REC function and pass it through COMPLETE_RECORD before calling INSERT_ROW or UPDATE_ROW. Customizations that need to resolve a primary site-use identifier should query HZ_CUST_SITE_USES_ALL for the primary flag rather than attempting to derive it from OE header columns.