Search Results g_module_current




Overview

OKS_SUBSCRIPTION_PVT is the primary private PL/SQL package body within the Oracle E-Business Suite Service (OKS) module responsible for creating, maintaining, and terminating subscription records associated with service contracts. Subscription functionality in EBS allows organizations to model recurring service offerings — such as periodic maintenance, warranty coverage extensions, or scheduled service visits — against contract lines and contract items defined in Oracle Contracts (OKC). The package operates as the internal engine behind subscription-related public APIs and user interfaces, encapsulating the business logic that generates schedules, instantiates subscription records, validates coverage patterns, and computes pricing-relevant quantities.

The package is classified as Private (PVT), meaning it is not intended for direct invocation from external applications or custom integrations. The global variable g_module_current, which the searcher referenced, is a common convention in OKS private packages used to track the currently executing module or context for error handling, debugging, and message resolution via the FND_MSG_PUB stack. Because this is a package body, many internal helpers, cursors, and table-driven lookups exist beyond the 13 documented procedures, but only the documented interfaces are considered stable.

Key Procedures and Functions

The documented interfaces cover the complete subscription lifecycle:

  • CREATE_DEFAULT_SCHEDULE — Builds a default subscription schedule from contract line and contract item data, using the coverage schedule defined on the inventory item. It is the primary entry point when a subscription has no explicit schedule template.
  • RECREATE_SCHEDULE — Regenerates schedule rows for an existing subscription, typically invoked after header or pattern changes.
  • RECREATE_INSTANCE — Rebuilds a subscription instance and its dependent elements when underlying contract data changes.
  • COPY_SUBSCRIPTION — Duplicates a subscription header and its associated patterns and elements, supporting amendments and renewals.
  • UNDO_SUBSCRIPTION — Reverses a previously created subscription, removing schedule, pattern, and element rows.
  • VALIDATE_PATTERN — Verifies that a subscription pattern is internally consistent before persistence.
  • GET_SUBS_QTY and GET_SUBSCRIPTION_QTY_OM — Return the effective subscription quantity and its unit of measure, used by pricing and billing flows.
  • STRETCH_EFFECTIVITY — Extends or shifts the effective date range of a subscription.
  • SUBS_TERMN_AMOUNT — Calculates the termination amount owed when a subscription is cancelled mid-term.
  • IS_SUBS_TANGIBLE — Determines whether a subscription represents a tangible (trackable) item, affecting inventory and fulfillment logic.
  • MAP_FREQ_UOM — Maps a subscription frequency to the corresponding UOM code used in scheduling.
  • DB_COMMIT — Performs a controlled commit, allowing callers to defer persistence until validation completes.

Tables Accessed

The package reads and writes across the contract and subscription schema. OKC_K_LINES_B and OKC_K_ITEMS supply the contract line and item context used to seed schedules. OKS_K_HEADERS_B, OKS_SUBSCR_HEADER_B, OKS_SUBSCR_PATTERNS, and OKS_SUBSCR_ELEMENTS hold the subscription header, pattern, and element rows that the package creates and updates. MTL_SYSTEM_ITEMS and MTL_SYSTEM_ITEMS_TL provide item attributes, including contract_item_type_code, coverage_schedule_id, and the commit-trackable flag that drives schedule generation. PLITBLM is the standard EBS temporary table used for batch processing of pattern/element rows.

Usage Notes

Because OKS_SUBSCRIPTION_PVT is a PVT package, it is invoked indirectly through Service Contracts forms (such as the Subscription tab on the contract workbench) and through concurrent programs that process subscription renewals and terminations. Custom code should never call this package directly; instead, use the public OKS subscription APIs that wrap these procedures. Any customization that references g_module_current or other internal globals risks breakage on patch application, since private package bodies are explicitly excluded from Oracle's backward-compatibility guarantee.