Search Results chk_currency_value




Overview

APPS.OTA_TPC_BUS1 is a server-side PL/SQL package body belonging to the Oracle E-Business Suite Training Administration (OTA) module. Its internal header comment identifies the source file as ottpcrhi.pkb, version 115.5, dated 2003/06/17, indicating it is a long-standing component of the OTA schema. The package is classified as OTHER in the ETRM repository and is maintained under the APPS schema in both release 12.1.1 and 12.2.2.

The package encapsulates the business validation logic that governs training plan costs. Its core purpose is to enforce data integrity on the OTA_TRAINING_PLAN_COSTS entity by validating foreign-key references, cross-entity relationships, and value-level constraints before records are inserted or updated. In Oracle EBS architecture this places the package in the business-rules layer, sitting beneath the Table Handler and Entity Handler packages generated by the Oracle Designer toolset — which explains the naming convention (BUS1), the diagnostic calls to HR_UTILITY.SET_LOCATION and HR_API.MANDATORY_ARG_ERROR, and the use of FND_MESSAGE for user-facing error text. Together with its sibling packages it forms part of the documented API surface for training plan cost maintenance.

Key Procedures and Functions

ETRM documents seven procedures within this package body, all of which are validation routines invoked during the standard check phase of the object's processing cycle:

  • CHK_TP_MEASUREMENT_TYPE_ID — Confirms that the supplied training plan measurement type identifier exists and is valid for the given business group. The documented source shows it querying OTA_TP_MEASUREMENT_TYPES for the associated cost_level value and raising an error when no matching row is found.
  • CHK_TRAINING_PLAN_ID — Verifies that the referenced training plan is a valid, existing plan record.
  • CHK_BOOKING_ID — Validates the booking reference associated with the cost line, checking it against delegate booking data.
  • CHK_BOOKING_EVENT — Validates the relationship between a booking and its related event, ensuring the combination is consistent.
  • CHK_EVENT_ID — Confirms that the referenced training event exists and is available for use.
  • CHK_CURRENCY_VALUE — The routine most frequently sought by users. It validates the currency code and monetary value entered against a training plan cost record, confirming the currency is defined in FND_CURRENCIES and that the amount supplied is valid.
  • CHK_UNIQUE — Enforces uniqueness rules on the cost record, preventing duplicate combinations of plan, measurement type, or booking data.

Tables Accessed

The package reads and validates against the following documented tables, all accessed through APPS synonyms:

  • OTA_TRAINING_PLAN_COSTS — the primary transactional entity validated by the package.
  • OTA_TRAINING_PLANS — parent plan records referenced by plan identifier checks.
  • OTA_TP_MEASUREMENT_TYPES — source of the cost_level attribute used in measurement type validation.
  • OTA_DELEGATE_BOOKINGS — booking data supporting the booking identifier checks.
  • OTA_EVENTS — event records referenced by the booking/event and event identifier validations.
  • FND_CURRENCIES — the Oracle Application Object Library currency table used by CHK_CURRENCY_VALUE to confirm that the currency code is enabled and correctly defined.
  • PER_TIME_PERIODS — the HR time period table, used where cost validity depends on an effective date range.

Usage Notes

OTA_TPC_BUS1 is not intended for direct invocation by end users or standalone concurrent programs. It is called by the higher-level Training Administration APIs and by the generated table handler that processes inserts, updates, and deletions on training plan costs. ETRM records that the package is referenced by one other package, confirming its role as a subordinate validation dependency rather than a top-level entry point.

Typical invocation occurs when a user maintains training plan cost information through the OTA web or forms interface, or when custom PL/SQL code calls the corresponding Training Administration API to create or amend cost lines. Because the procedures raise standard HR_API mandatory-argument errors and FND_MESSAGE errors, any calling code should include exception handling that propagates or reports those messages. Developers extending training plan cost functionality should treat this package as validation-only: it performs no DML of its own and must be invoked within a transaction controlled by the caller.