Search Results get_working_day




Overview

The APPS.HR_WRK_SCH_PKG package is a PL/SQL API belonging to the Oracle E-Business Suite Human Resources (HR) module. It exposes functionality associated with the Absences and Availability feature set, allowing downstream products and external calling code to interrogate work schedules, availability windows, and calendar logic for a person assignment. In the Oracle EBS layered architecture, the package acts as a programmatic interface that isolates consumers from the underlying schedule and availability tables, providing a stable contract for schedule-related queries. It is classified in the ETRM repository under the API classification OTHER, indicating that it is a general-purpose server-side package rather than a purely declarative open interface or a public write API.

The package is documented in releases 12.1.1 and 12.2.2. Its header carries a version marker of 120.1.12010000.1, confirming it is a long-standing, low-revision artifact that has remained stable across the 12.x line. Ten other packages reference it, which suggests it is a dependency of higher-level absence, accrual, or scheduling logic rather than a consumer of other public APIs.

Key Procedures and Functions

The documented interface contains two public program units.

  • GET_PER_ASG_SCHEDULE — A procedure intended for invocation by downstream products that require the Absences Availability functionality. Its purpose is to retrieve availability data—working versus non-working time, schedule source, and exception handling—for a specified person assignment across a date range. It returns a schedule in an availability varray along with a schedule source indicator, a return status, and a return message for error handling.
  • GET_WORKING_DAY — A function that returns a DATE. As described in the package header, it retrieves the next or previous working day after a leave of absence. The direction is controlled by a previous/next flag that defaults to 'N'. Because it is a function, it can be embedded directly in SQL and PL/SQL expressions, making it convenient for consumers such as absence entry forms that need to default a return-to-work date.

The header documentation explicitly states that both units are provided so that downstream products may reuse the Absences Availability engine rather than re-implementing schedule logic.

Tables Accessed

The package reads from a defined set of tables through APPS synonyms. The CAC_SR_ family (CAC_SR_PUBLISH_SCHEDULES, CAC_SR_SCHDL_OBJECTS, and CAC_SR_SCHEDULES_B) supplies published schedule definitions and their associated objects, forming the calendar basis against which working days are evaluated. PER_ALL_ASSIGNMENTS_F identifies the person assignment and its effective dating context. PER_SCH_INHERIT_HIER supports schedule inheritance through the organization or assignment hierarchy, allowing a valid schedule to be resolved when one is not explicitly assigned. DUAL is used for simple expression evaluation, and PLITBLM provides the PL/SQL table and varray infrastructure used to pass schedule data back to callers. Because the package is a read-oriented availability engine, these accesses are predominantly queries rather than inserts or updates.

Usage Notes

HR_WRK_SCH_PKG is typically invoked from custom PL/SQL, Oracle Forms personalizations, or concurrent program logic that must determine whether a given day counts as a working day, or that must display availability for an assignment. The most common entry point is GET_WORKING_DAY, reflecting its simplicity and its suitability for direct use inside SQL statements. Typical scenarios include absence return-date defaulting, validation of leave requests that cross non-working periods, and integration logic in payroll or time-and-labor flows that must respect the HR schedule calendar.

Because the package is classified as OTHER rather than a fully public API, consumers should treat the documented signature as stable but avoid assuming undocumented behavior. Callers should always check the return status and message from GET_PER_ASG_SCHEDULE, and should pass valid, effective-dated assignment identifiers to ensure correct schedule resolution.