Search Results primary_key_id1




Overview

OKC_HZ_MERGE_PUB is a public PL/SQL package body in the Oracle E-Business Suite Applications (APPS) schema that manages the merge of customers and parties across the Oracle EBS data model. Its central business purpose is to resolve duplicate trading partners by consolidating related records — accounts, sites, site uses, and the contract structures that reference them — into a single surviving entity. The package is identified in its header comments as API OKC_HZ_MERGE_PUB, of type Public, with the stated purpose "Manage customer and party merges." It was originally created in December 2000 and subsequently modified to accommodate evolving merge rules, including the 11.5.10 rule migration changes for Oracle Knowledge/Service (OKS), site use merge handling for Oracle Knowledge/Engineering (OKE), and auditing through the HZ_CUSTOMER_MERGE_LOG table.

The package is tightly coupled to Oracle's Trading Community Architecture (TCA) and to the Oracle Contracts (OKC) schema. Its header documents a specific set of merging rules that govern when an account merge is permissible. Merges are permitted for accounts, sites, and site uses when the duplicate (source) party is not referenced in a contract. Account merges within the same party are processed, and site merges within the same account are processed. Critically, later revisions relaxed an earlier restriction: merges are now possible even when the source party is referenced in a contract, reflecting the modified logic described in the package comments.

Key Procedures and Functions

The ETRM metadata documents a single public procedure within this package:

  • MERGE_ACCOUNT — The public entry point for processing account-level merges. Based on the documented modification history, this procedure drives the consolidation of account records and their dependent sites and site uses, and it performs the auditing insert into the customer merge log. The procedure also incorporates the OKS 11.5.10 rule migration logic and the OKE site use merge logic applied to the contract party role tables.

Although only MERGE_ACCOUNT is listed in the extracted metadata, the modification history and NOTES section reference internal procedures named PARTY_MERGE, ACCOUNT_MERGE, and ACCOUNT_SITE_MERGE. PARTY_MERGE is noted as having been modified to insert into OKC_K_VERS_NUMBERS_H, and additional logic was added to handle site use merges for OKE across the OKC_K_PARTY_ROLES tables. These procedures represent the internal processing layers that MERGE_ACCOUNT ultimately coordinates.

Tables Accessed

The package references a broad set of tables, reflecting the breadth of the merge operation:

Usage Notes

OKC_HZ_MERGE_PUB is a public API intended to be invoked by Oracle EBS processing that requires customer or party consolidation within the contracts context. The ETRM metadata indicates the package is referenced by zero other packages, meaning it is not consumed internally by dependent PL/SQL units and is instead called from external entry points. In practice, such an API is typically invoked from the Oracle Trading Community customer merge concurrent program (such as the Customer Merge process that drives RA_CUSTOMER_MERGES), from contract-related forms, or from custom extensions that need to reconcile contract party references when TCA records are merged. The package relies on the FND_PROFILE value 'AFLOG_ENABLED' for debug logging, and its auditing behavior writes to HZ_CUSTOMER_MERGE_LOG. When implementing custom merge logic, callers should respect the documented merging rules — particularly that account merges within the same party and site merges within the same account are supported — and should account for the OKS and OKE migration-related behavior introduced in later patches. Because the API directly manipulates contract and TCA tables, it should be invoked only within a controlled merge operation to preserve data integrity across the contracts and receivables schemas.