Search Results new_date




Overview

The APPS.WIP_CALENDAR package body provides the calendar arithmetic engine used by Oracle Work in Process (WIP) and related manufacturing modules to translate a manufacturing lead time, expressed in working days, into an actual schedule date. It resolves that calculation against the shop floor calendar defined for a given organization, honoring the organization's calendar code and exception set so that non-working days, holidays, and shutdowns are correctly skipped. In Oracle EBS 12.1.1 and 12.2.2, this package is a foundational utility: any date that must be pushed forward or pulled backward by a number of working days—estimated lead times, scheduling direction, projected completion—flows through the logic here.

The package body is classified in the ETRM metadata as OTHER, indicating it is an internal implementation package rather than a published public API. Its header signature (wipltesb.pls, version 115.13) reflects a long-lived component that has been patched repeatedly, most notably for exception-set handling and sequence-number edge cases.

Key Procedures and Functions

ESTIMATE_LEADTIME is the single documented procedure. Its purpose is to compute an estimated date by applying a lead time to a reference schedule date, working forward or backward through the organization calendar. It accepts inputs describing the organization, fixed and variable lead components, quantity, processing days, entity type, and up to four reference dates (first/last unit start and completion dates), together with a scheduling direction flag, and returns the estimated date through an OUT parameter. Internally it declares a new_date working variable—the term surfaced in the user's search—alongside a lead-time value and recalculated quantity and processing-day variables. Two explicit cursors, cursor_forward and cursor_backward, perform the actual calendar lookups by joining BOM_CALENDAR_DATES twice (for the anchor date's sequence number and the target date) to MTL_PARAMETERS. A third cursor, cursor_working_day, was added to detect whether the scheduled completion date falls on a working or non-working day.

Tables Accessed

  • BOM_CALENDAR_DATES — the core calendar table. The package reads it via two aliases in each cursor to obtain the sequence number of the anchor date and the calendar date corresponding to an offset sequence number. It also exposes SEQ_NUM, PRIOR_SEQ_NUM, and NEXT_SEQ_NUM, which are used to step across contiguous working days.
  • MTL_PARAMETERS — supplies, for the given organization, the CALENDAR_CODE and CALENDAR_EXCEPTION_SET_ID that qualify the BOM_CALENDAR_DATES rows. This ensures the correct organization-specific calendar and exception set are applied.

Usage Notes

WIP_CALENDAR is not invoked directly by end users. It is called programmatically from WIP scheduling and job/repetitive workbench logic, and the ETRM metadata records that it is referenced by five other packages. Typical callers include WIP job creation, lead-time estimation, and scheduling routines that need a calendar-aware completion or release date. The procedure is callable from concurrent programs, PL/SQL-based forms, and custom extensions that already have the organization context and calendar setup in place.

Because the procedure uses the ORG_ID to derive the calendar from MTL_PARAMETERS, callers must supply a valid organization that is associated with an enabled BOM calendar and exception set; otherwise the forward and backward cursors return no rows. The presence of an OUT NOCOPY date parameter means callers must declare a host variable to receive the estimated date. Historical bug fixes embedded in the body—notably the working-day cursor and the FLOOR/CEIL adjustments to sequence offsets—indicate sensitivity to non-working completion dates and to boundary conditions at calendar exception sets, so custom code should treat this package as the authoritative implementation rather than replicating its arithmetic.