Search Results okc_terms_copy_grp




Overview

The APPS.OKC_TERMS_COPY_GRP package body is a group (GRP-classified) PL/SQL API within the Oracle E-Business Suite Contracts (OKC) module, which forms part of the ETRM (Enterprise Contracts) application stack. Its principal business function is to manage the copying and transition of contract terms, term templates, and associated documents between source and target entities. The package encapsulates the logic required to duplicate document content, preserve or reset article versions, and handle amendments and archived documents without exposing the underlying individual APIs to the caller.

The package declares standard Oracle EBS API conventions as global constants, including G_FND_APP, G_APP_NAME, G_FALSE, G_TRUE, G_RET_STS_SUCCESS, G_RET_STS_ERROR, and G_RET_STS_UNEXP_ERROR, confirming it follows the FND_API error-handling and return-status model. A package-level record G_TEMPLATE_MISS_REC of type OKC_TERMS_TEMPLATES_PVT.template_rec_type is used to carry template data during copy operations. The header revision notes reflect maintenance through release 12.x.

Key Procedures and Functions

The package exposes seven documented procedures and functions:

  • COPY_DOC — The primary routine for copying a document's terms. As indicated by the embedded comments, it supports a p_keep_version flag that should be set to 'Y' during document transition and 'N' during a document copy where the target document is expected to retain the same article version as the source. A p_copy_for_amendment flag is passed as 'Y' when creating an amendment.
  • COPY_TERMS_TEMPLATE — Copies a terms template, likely from a source template definition into a target context using the package-level template record.
  • COPY_TERMS — Copies the terms and article content associated with a source entity to a destination.
  • CREATE_TEMPLATE_REVISION — Creates a new revision of an existing terms template.
  • COPY_ARCHIVED_DOC — Copies a document that has been archived, preserving archived content semantics.
  • COPY_RESPONSE_DOC — Copies a response document, supporting the response/negotiation flow of contracts.
  • PROCESS_MOD_TERMS — Processes modified terms, applying term-level changes as part of a copy or amendment flow.

Tables Accessed

The package interacts with the following tables via APPS synonyms:

  • OKC_BUS_DOC_TYPES_B — The business document types base table, used to validate and resolve document type context during copy operations.
  • OKC_TEMPLATE_USAGES — Records which template usages apply, guiding template copy and revision behavior.
  • OKC_TERMS_TEMPLATES_ALL — The master terms template table, read to source template definitions and written when creating revisions.
  • DUAL — Used for single-row PL/SQL evaluations and constant resolution.

Usage Notes

OKC_TERMS_COPY_GRP is a grouping API intended to be invoked rather than called standalone at the table level. It is referenced by 19 other packages, indicating it serves as a shared service for document and template copy scenarios across the Contracts module. Typical invocation occurs from contract authoring and amendment forms, and potentially from concurrent programs or custom code performing bulk document duplication. Because it follows the FND_API return-status convention, callers should inspect the returned status and message tokens (ERROR_MESSAGE, ERROR_CODE) and handle the G_UNABLE_TO_RESERVE_REC condition. Customizations should call the documented procedures rather than replicating their logic, and should respect the p_keep_version and p_copy_for_amendment semantics described in the package header.