Search Results okl_copy_template_pvt




Overview

OKL_COPY_TEMPLATE_PVT is a private PL/SQL package within the Oracle E-Business Suite Lease Management (Oracle Lease and Finance Management, module OKL) schema. It is declared with AUTHID CURRENT_USER, meaning it executes with the privileges of the invoking user rather than the package owner, and it is classified as a private (PVT) API — reserved for internal use by other ETRM components rather than exposed to external integrators or end-user customization.

The package's business purpose is to duplicate lease and finance template definitions from one source to another. Templates in Oracle Lease Management define reusable contract structures, clause sets, line configurations, and associated attributes that drive lease origination. When an organization needs to replicate a proven template configuration — for example, to create a variant for a new product line, to seed a new operating unit, or to clone a master template before modification — the copy logic in this package performs the structural duplication of both the template header and its associated lines. The package header carries the RCS revision identifier $Header: OKLRTLCS.pls 115.1 2002/02/06, indicating it originates from the Oracle Lease Management release template copy source file and has been part of the product since the early 11i-era codebase and carried forward into 12.1.1 and 12.2.2.

Key Procedures and Functions

The package exposes a single documented procedure:

  • COPY_TEMPLATES — The core public entry point that performs the template duplication operation. It accepts the standard concurrent/API parameter set: an API version indicator (p_api_version), a message list initialization flag (p_init_msg_list), and the standard output trio for error handling (x_return_status, x_msg_count, x_msg_data). Its key business parameters are p_aes_id_from and p_aes_id_to, which identify the source and target template (attribute/entity set) identifiers respectively. The procedure copies the template definition associated with the "from" identifier into the "to" identifier, returning status via the standard OKL API return status convention.

The package additionally declares subtype aliases (avlv_rec_type, avlv_tbl_type, atlv_rec_type, atlv_tbl_type) that resolve to the corresponding types declared in OKL_TMPT_SET_PUB, indicating that this private package shares record and table structures with the public template set API. It also references standard OKL error-message constants (G_REQUIRED_VALUE, G_INVALID_VALUE, G_COL_NAME_TOKEN) from OKL_API for consistent validation messaging.

Tables Accessed

The documented tables referenced through APPS synonyms are:

  • OKL_AE_TEMPLATES — The template header table holding the template master record. COPY_TEMPLATES reads the source template row and inserts the corresponding row for the target identifier.
  • OKL_AE_TMPT_LNES — The template lines table holding the individual line/attribute records belonging to a template header. The procedure duplicates the complete set of lines from the source template so the copied template is structurally complete.
  • PLITBLM — A standard Oracle-supplied table used for message/error token storage and processing, consistent with the OKL API error-handling framework.

Usage Notes

As a _PVT package, OKL_COPY_TEMPLATE_PVT is not intended for direct invocation by external custom code. It is referenced by exactly one other package in the ETRM schema, which acts as the internal caller that drives template copying on behalf of higher-level business flows. Typical invocation paths include Lease Management setup forms or concurrent processes where a user requests that an existing template be duplicated; the calling layer resolves the source and target identifiers and delegates the actual duplication to COPY_TEMPLATES. Because it uses AUTHID CURRENT_USER and relies on APPS synonyms for its table access, callers must run with the appropriate OKL grants. Customizations should prefer the public template APIs (OKL_TMPT_SET_PUB) and treat this package as an internal implementation detail subject to change between patch levels.