Search Results get_hours




Overview

The APPS.HXC_TIMECARD_HOURS_PKG package is a PL/SQL utility package within the Oracle E-Business Suite Time and Labor (HXC) module. It provides centralized functions for retrieving aggregated hour values from timecard data, serving as a computational layer that other Time and Labor components, forms, and custom extensions can call to obtain summed hours without re-implementing aggregation logic. The package accomplishes this by exposing overloaded functions that accept either a specific timecard identifier or a date range combined with a resource identifier.

The package is declared with AUTHID CURRENT_USER, meaning its SQL statements execute under the privileges of the invoking session rather than the package owner. In an EBS context this is significant because the APPS schema owns the object, yet execution context is governed by the calling user. The header comment ($Header: hxchours.pkh 115.4 2002/06/10) indicates substantial stability, with the interface largely unchanged since the early 11i era and carried forward into 12.1.1 and 12.2.2.

Key Procedures and Functions

The package exposes four documented functions across two logical names. Note that identical names are overloaded with different signatures, which allows callers to select the aggregation approach that matches the data they hold.

  • GET_HOURS (timecard variant) — Accepts a timecard ID, a timecard object version number, and an hours lookup type, returning the sum of hours of the specified lookup type for that timecard. This is the primary access path for form-driven or row-level display of hours by category.
  • GET_HOURS (date-range variant) — Accepts a period start time, period stop time, resource ID, and hours lookup type, returning the summed hours for that resource across the period.
  • GET_TOTAL_HOURS (timecard variant) — Accepts a timecard ID and its object version number, returning the aggregate of all hour types for the timecard rather than a single lookup type.
  • GET_TOTAL_HOURS (date-range variant) — Accepts a period start time, period stop time, and resource ID, with a mode parameter defaulting to 'DAYS_INCLUSIVE', returning total hours across the period for the resource.

All four entry points are functions returning NUMBER, making them directly usable in SQL SELECT lists as well as PL/SQL expressions.

Tables Accessed

The package reads from the core Time and Labor building-block and attribute model, accessed through APPS synonyms:

Usage Notes

Because the package is documented as an "OTHER" classification API and is referenced by zero other packages, it is best understood as a leaf-level helper rather than a shared framework API. Typical invocation occurs from Time and Labor self-service or administrative forms, from custom PL/SQL that needs a consistent total rather than a locally written SQL query, or from reporting code. When calling the date-range variants, ensure the resource ID corresponds to the desired person or resource and that the period boundaries align with the expected calendar. The DUE default of 'DAYS_INCLUSIVE' for GET_TOTAL_HOURS governs how boundary days in the period are counted, so callers should verify behavior when partial-day boundaries are involved. There is no validation to prevent passing mismatched timecard ID and object version number; callers must supply the correct OVN to avoid stale results.