Search Results get_top_line_number
Overview
OKS_CONTRACTS_PUB is a public PL/SQL API package in the Oracle E-Business Suite Service Contracts (OKS) module. It exposes the core contract authoring operations used throughout the Service Contracts application, allowing callers to create contracts, contract headers, service lines, subscriptions, and billing schedules through a single, versioned API surface. The package header declares an API version constant (l_api_version CONSTANT NUMBER := 1.0), which identifies the interface as a versioned public API intended for external invocation rather than internal-only use.
The package body also contains helper logic that is not part of the published API list but supports its operation. These include GET_TOP_LINE_NUMBER and GET_SUB_LINE_NUMBER, which resolve line numbering for contract hierarchies, and CHECK_LINE_EFFECTIVITY, which validates a service line's start and end dates against the caller-supplied service dates. A private PARTY_ROLE_REC record type and a NUMERIC_TAB_TYP collection type are used internally to carry party-role and numeric identifier data.
Key Procedures and Functions
The documented public procedures of OKS_CONTRACTS_PUB are:
- CREATE_CONTRACT — Creates a contract, typically assembling the header and associated structure as a single logical operation.
- CREATE_CONTRACT_HEADER — Creates only the contract header record, for callers that manage the remaining structure separately.
- CREATE_SERVICE_LINE — Creates a service line on an existing contract, the primary entry point for adding covered services or entitlements.
- CREATE_BILL_SCHEDULE — Generates the billing schedule associated with a contract or line so that invoicing can proceed.
- SUSPEND_SUBSCRIPTION — Suspends an active subscription, for example when a customer requests a temporary hold on service.
- REACTIVATE_SUBSCRIPTION — Reverses a prior suspension and returns the subscription to active status.
The package header additionally declares GET_TOP_LINE_NUMBER and GET_SUB_LINE_NUMBER as functions, plus the CHECK_LINE_EFFECTIVITY procedure. The ETRM metadata lists seven documented procedures/functions in total: CREATE_CONTRACT, SUSPEND_SUBSCRIPTION, REACTIVATE_SUBSCRIPTION, CREATE_SERVICE_LINE, CREATE_CONTRACT_HEADER, and CREATE_BILL_SCHEDULE, together with the supporting effectivity check. Parameter lists are intentionally not reproduced here; callers should consult the package specification for exact signatures.
Tables Accessed
The package operates against the core Service Contracts and Trading Community tables, reached through APPS synonyms. Contract header and line data are stored in OKC_K_HEADERS_B and OKC_K_LINES_B, with the service-specific line extension in OKS_K_LINES_B and service subscription data in OKS_SUBSCR_HEADER_B. Party roles on the contract are held in OKC_K_PARTY_ROLES_B, and related-object associations in OKC_K_REL_OBJS. Line style defaults come from OKC_LINE_STYLES_B. Price attribute values used during authoring are read from OKC_PRICE_ATT_VALUES. Customer contact and relationship data are sourced from HZ_CONTACT_POINTS and HZ_RELATIONSHIPS. Counter values used in numbering are held in CSI_COUNTERS_B with the supporting CSI_COUNTER_ASSOCIATIONS and CS_CSI_COUNTER_GROUPS. DBMS_TRANSACTION and DUAL support transactional and utility operations.
Usage Notes
OKS_CONTRACTS_PUB is normally invoked from the Service Contracts forms and from concurrent programs that automate contract creation, renewal, and billing. Custom integrations should call these public procedures rather than inserting directly into the underlying OKC and OKS tables, because the APIs enforce effectivity validation, line numbering, counter allocation, and subscript