Search Results okc_hdr




Overview

OKC_OPPORTUNITY_PVT is a private PL/SQL package body in the Oracle E-Business Suite applications schema (APPS) that belongs to the Oracle Contracts (OKC) module. Its role is to encapsulate the internal business logic required to create and seed opportunity records that are linked to contract headers. In the context of Oracle EBS 12.1.1 and 12.2.2, an "opportunity" represents a pre-sales or sales-effort record that may subsequently convert into a contract, and this package provides the programmatic foundation for establishing the opportunity header and its associated lines while enforcing validation and defaulting rules.

Because it is classified as a PVT (private) API, it is not intended for direct invocation by external or customer code; it is designed to be called by other OKC packages that expose the corresponding public interface. The package header source header comment (OKCROPPB.pls) and the debug instrumentation using okc_debug indicate that it operates under the standard OKC API framework, observing OKC_API return status conventions and OKC_CONTEXT organization context initialization.

Key Procedures and Functions

The package exposes five documented procedures or functions, each addressing a discrete step in the opportunity lifecycle:

  • CREATE_OPPORTUNITY — The primary entry point. It orchestrates opportunity creation by first validating whether creation is permissible, establishing the correct operating unit context via OKC_CONTEXT, and then delegating header construction to CREATE_OPP_HEADER. It returns a lead identifier and standard OKC message return status codes.
  • CREATE_OPP_HEADER — Responsible for inserting the opportunity header record and its related opportunity-level attributes, including win probability and expected close days. Called internally by CREATE_OPPORTUNITY.
  • CREATE_OPP_LINES — Handles creation of the opportunity line records associated with a header.
  • IS_OPP_CREATION_ALLOWED — A validation routine that determines whether the supplied context and contract permit opportunity creation, raising a halt-validation exception when the check fails.
  • GET_OPP_DEFAULTS — Retrieves defaulting values used to populate opportunity fields during creation.

Tables Accessed

The package works across both the OKC contracts schema and shared EBS reference tables. Core contract structures include OKC_K_HEADERS_B, OKC_K_LINES_B, and OKC_K_ITEMS for the header, line, and item foundations; OKC_K_PARTY_ROLES_B for party and sales-role assignment; OKC_K_REL_OBJS for relationship between objects (the g_rty_code variable references this table); OKC_RULES_B for rule definitions; OKC_STATUSES_B for status values; and OKC_SUBCLASSES_B, OKC_CONTACTS for subclass and contact information.

Supporting EBS tables include JTF_RS_SALESREPS for sales representative resolution, MTL_CATEGORIES_B and MTL_ITEM_CATEGORIES for item category assignment, JTF_OBJECT_USAGES for object usage mapping, FND_ID_FLEX_STRUCTURES for descriptive flexfield structure metadata, and PLITBLM, an internal PL/SQL index-by-table helper. These tables are accessed through APPS synonyms.

Usage Notes

Because OKC_OPPORTUNITY_PVT is a private package, it is invoked indirectly. Typical callers are other OKC packages — the metadata records one package referencing it — and the standard OKC Contracts forms and concurrent programs that create opportunities from quotes or sales leads. Under EBS 12.1.1 and 12.2.2, developers performing custom extensions should invoke the supported public OKC opportunity API rather than this private body, as private APIs carry no backward-compatibility guarantee. The AFLOG_ENABLED profile option controls debug output through okc_debug, allowing support personnel to trace execution flow during diagnosis.