Search Results create_opp_header




Overview

OKC_OPPORTUNITY_PUB is the public API package within the Oracle Contracts (OKC) application module responsible for programmatically creating and managing sales opportunities linked to contracts and leads. In Oracle EBS 12.1.1 and 12.2.2, this package exposes a stable, documented interface that allows callers — including Oracle Sales, Oracle Quoting, and custom extensions — to generate opportunity header and line records without directly manipulating the underlying OKC base tables.

The package is classified as a PUB (public) API, signifying that its signatures are supported for external invocation and are intended to remain backward-compatible across patch upgrades. Because it is owned by APPS, the package inherits the standard EBS schema and privilege model. Internally it depends on the OKC_API utility package for shared constants such as G_APP_NAME, G_FALSE, and the standardized return-status values (for example, OKC_API.G_RET_STS_SUCCESS), and it raises the global exception G_EXCEPTION_HALT_VALIDATION when validation must be discontinued, consistent with the error-handling conventions used throughout the OKC API family.

Key Procedures and Functions

The documented interface comprises nine procedures and functions. The five principal entry points most relevant to opportunity creation are described below.

  • CREATE_OPPORTUNITY — The primary creation routine, offered in overloaded forms. It creates an opportunity for a given contract, accepting a win probability and an expected close horizon (in days) and returning the generated lead identifier. Overloads differ in whether they surface a lead ID as an OUT parameter and whether they follow the standard API message-list conventions (p_init_msg_list, x_msg_data, x_msg_count, x_return_status). The default API version is 1.0 and the default commit flag is OKC_API.G_FALSE, so the caller retains control of transaction boundaries.
  • CREATE_OPP_HEADER — Creates only the opportunity header record, taking the contract context, win probability, and expected close days, and returning the associated lead identifier. This procedure is the recommended entry point when a caller needs header-only creation — for example, when the physical header must exist before dependent line-level data is assembled. The search term "create_opp_header" corresponds to this procedure; note the documented name is CREATE_OPP_HEADER (and, in the earliest header comment, CREATE_OPP_HEADER is shown alongside CREATE_OPPORTUNITY), so callers should reference the correct spelling.
  • CREATE_OPP_LINES — Populates the opportunity line detail associated with an existing opportunity header, supporting multi-line opportunity structures.
  • IS_OPP_CREATION_ALLOWED — A validation function that determines whether opportunity creation is permitted for the supplied context, allowing callers to pre-check before invoking the creation routines and thereby avoid raising errors mid-process.
  • GET_OPP_DEFAULTS — A retrieval function that returns default values governing opportunity creation, enabling callers to initialize a new opportunity consistently with system configuration.

Tables Accessed

The ETRM extract for this package does not enumerate the underlying base tables directly; access is mediated through APPS synonyms as is standard in the OKC schema. Based on the package's function, the routines operate against the OKC opportunity tables — the opportunity header entity and its associated lines — together with the contract and lead structures required to associate an opportunity with a source contract and a generated lead. INSERT and UPDATE activity occurs on the opportunity entities, while validation and defaults routines perform SELECT operations. Callers should not assume that commits are issued internally; with the default G_FALSE commit flag, transactional control rests with the calling application.

Usage Notes

OKC_OPPORTUNITY_PUB is typically invoked from Oracle Forms in the Contracts and Sales application flows, from concurrent programs that bulk-generate opportunities, and from custom PL/SQL extensions integrated with Oracle Sales or Quoting. One documented package references it, indicating it participates in a broader dependency chain within the OKC API layer. Best practice for callers is to invoke IS_OPP_CREATION_ALLOWED before creation, use GET_OPP_DEFAULTS to seed attribute values, call CREATE_OPP_HEADER or CREATE_OPPORTUNITY to establish the header, then call CREATE_OPP_LINES for detail rows, committing explicitly at the calling layer. Because the package is a PUB API, signature changes are governed by Oracle's compatibility policy; nevertheless, custom code should rely only on the documented overloads and treat the internal global variables and exception names as implementation detail.