Search Results copy_templates




Overview

The APPS.OKL_COPY_TEMPLATE_PUB package body is part of the Oracle Lease and Finance Management (OKL) module within Oracle E-Business Suite, classified under the ETRM (E-Business Suite Technical Reference Manual) as a PUBLIC API package. Its principal business function is to support the duplication of lease templates — referred to internally as "AES" (Agreement/Asset structures) templates — from a source template to a target template. This capability allows implementers and business users to replicate a fully configured lease or financing template, including its associated structure and clauses, rather than recreating it manually.

The _PUB suffix indicates that this is the public-facing wrapper API, intended for external callers, while the actual processing logic resides in the corresponding private package, OKL_COPY_TEMPLATE_PVT. The package follows Oracle's standard PL/SQL API architecture, including a versioning parameter, the FND_MSG_PUB message stack, and standardized return/status conventions.

Key Procedures and Functions

  • COPY_TEMPLATES — The sole documented procedure in the package. It copies lease/financing template definitions from one template identifier (p_aes_id_from) to another (p_aes_id_to). The procedure accepts the standard API parameters (API version, initialization of the message list, and output parameters for status, message count, and message data) along with the source and target template IDs. Internally, it establishes a savepoint, delegates execution to OKL_COPY_TEMPLATE_PVT.COPY_TEMPLATES, and maps the private package's return status to the standard FND_API exceptions (G_EXC_ERROR and G_EXC_UNEXPECTED_ERROR).

Tables Accessed

The documented ETRM metadata does not list explicit base tables referenced through APPS synonyms for this package. Operational logic is delegated to the private package OKL_COPY_TEMPLATE_PVT, which performs the actual insert and select operations against the OKL template-related entities (such as the AES template definition tables and their associated component and clause lines). The public wrapper itself does not directly manipulate business tables; it manages the transactional boundary (savepoint and rollback) and message handling. The FND_MSG_PUB package is used to count and retrieve messages from the message stack.

Usage Notes

This API is typically invoked when a business requirement exists to clone an existing lease or financing template so that a new template can be derived from a proven configuration. Callers may include custom PL/SQL routines, Oracle Workflow processes, or form-level logic that needs to automate template replication.

Callers should observe the following conventions:

  • The API version parameter (p_api_version) must be compatible with the internal l_api_version of 1.0.
  • Callers should pass FND_API.G_TRUE for p_init_msg_list to ensure a clean message stack.
  • A SAVEPOINT named COPY_TEMPLATES is established internally; on error, the transaction is rolled back to this savepoint, so partial template copies are not committed.
  • The x_return_status output must be checked against FND_API.G_RET_STS_SUCCESS, G_RET_STS_ERROR, and G_RET_STS_UNEXP_ERROR; on failure, the caller should invoke FND_MSG_PUB.Count_and_get or Get to retrieve diagnostic messages.
  • No other packages reference this package according to the documented metadata, indicating it is intended as a leaf-level public API consumed by external or custom code.