Search Results hr_loc_work_schedule




Overview

The APPS.HR_LOC_WORK_SCHEDULE package body is a server-side PL/SQL utility used by Oracle E-Business Suite applications, particularly within the Human Resources (HR) and Oracle Time and Labor (OTL) family of products. Its principal business function is to derive the effective working duration associated with an assignment over a specified date and time range, by evaluating the assignment's work schedule and availability bands. In practice, it answers the common business question: "how many hours (or days) is a given assignment scheduled to work between two points in time, and does that window include a particular event?"

The package maintains only a handful of global variables and is deliberately lightweight. The header comment ($Header: hrlocwks.pkb 120.0.12000000.2 ...$) indicates a long-lived 12.1.x code line, and the object remains present and callable under 12.2.2 under the APPS schema with the ETRM classification OTHER. It is an internal helper rather than a formal public API, and is referenced by fourteen other packages, confirming its role as a shared scheduling-duration engine within the HR/OTL stack.

Key Procedures and Functions

  • CALC_SCH_BASED_DUR — The central function of the package, and the object most commonly sought by developers searching for calc_sch_based_dur. It calculates the scheduled duration between a caller-supplied start date/time and end date/time for a given assignment. The p_days_or_hours argument controls whether the returned duration is expressed in days or hours; p_include_event determines whether a designated event (such as an absence or attendance event) is included in the calculation. The function returns a numeric status indicator and passes the computed duration back to the caller through an IN OUT NOCOPY parameter. Internally it iterates over the assignment's availability schedule (a cac_avlblty_time_varray collection) and day-start/day-end time bands to accumulate the scheduled time. A private exception, e_bad_time_format, is raised when the supplied time strings are malformed.
  • GOOD_TIME_FORMAT — A validation helper that checks whether a character parameter represents a valid five-character time literal in HH:MI form. It verifies that the hour portion falls between '00' and '23', the minutes between '00' and '59', and that the separator character in position three is a colon. It returns FALSE for null input, malformed strings, or any unexpected error, and TRUE otherwise. It is used as a guard before duration arithmetic is attempted.

Tables Accessed

The package is largely computational and references only two database objects through APPS synonyms. DUAL is used for single-row SQL evaluations, such as canonicalizing and formatting time values. PLITBLM (the PL/SQL implementation tables / index-by table management objects) supports the collection-based handling of the availability schedule varray used during duration accumulation. The actual work-schedule and availability data is passed in or resolved through the assignment context and the internal varray rather than being read directly from the HR schedule tables within this package body.

Usage Notes

HR_LOC_WORK_SCHEDULE is not intended for direct end-user invocation. It is typically called from other PL/SQL packages and from forms or concurrent programs that need to compute scheduled working time for an assignment. The fourteen dependent packages indicate that scheduling, time entry, and labor-cost calculations across HR and OTL rely on CALC_SCH_BASED_DUR to establish the expected duration for a period. Custom code invoking the function must supply well-formed HH:MI time strings; otherwise the internal format check will fail, so callers should validate input or handle the returned status and error message accordingly. Because parameters are passed via IN OUT NOCOPY, the duration value is returned efficiently without copy overhead.