Search Results msc_calendar




Overview

MSC_CALENDAR is an Oracle EBS Advanced Supply Chain Planning (ASCP) package body owned by the APPS schema. It provides the core calendar arithmetic engine used throughout MSC (Material and Supply Chain) planning modules, translating raw calendar definitions into the work-day, offset, and interval calculations that planning engines, ATP routines, and scheduling workbenches require. Rather than storing calendar data itself, this package interrogates the ASCP calendar tables — calendars, assignments, dates, and week-start dates — and returns derived values such as the next work day, previous work day, number of working days between two dates, and date offsets respecting plant and supplier calendars. The package is classified as OTHER (not a public API), meaning it is intended for internal consumption by Oracle's own planning code and, where appropriate, by carefully written custom extensions. Its status is VALID in both 12.1.1 and 12.2.2. Because it focuses purely on calendar logic, MSC_CALENDAR is independent of order or item planning rules; it is a low-level utility layer that many higher-level MSC packages call. Documentation notes it is referenced by 29 other database objects, which underscores its role as a shared dependency within the ASCP code base.

Key Procedures and Functions

The documented package exposes 15 procedures and functions. Among those cataloged:

  • NEXT_WORK_DAY / PREV_WORK_DAY — Return the next or previous valid working day for a given calendar, respecting defined non-working periods.
  • DATE_OFFSET — Moves a date forward or backward by a specified number of working days on the applicable calendar.
  • DAYS_BETWEEN — Computes the number of working days separating two dates on a calendar.
  • SELECT_CALENDAR_DEFAULTS — Retrieves default calendar settings (such as the organization or site default) for use when an explicit calendar is not supplied.
  • PREV_DELIVERY_CALENDAR_DAY — Determines the prior delivery calendar day, typically used for supplier and receiving logic.
  • CALENDAR_NEXT_WORK_DAY / CALENDAR_DAYS_BETWEEN — Variants that operate explicitly against a named calendar code rather than relying on defaults.
  • GET_CALENDAR_CODE — Resolves the appropriate calendar code for a given context (organization, supplier, or trading partner).
  • THREE_STEP_CAL_OFFSET_DATE — Performs a multi-stage offset calculation, typically combining calendar, shift, and pattern adjustments.

Tables Accessed

MSC_CALENDAR reads (and in some cases manages) the following ASCP tables via APPS synonyms:

It also depends on MSC_ATP_PVT, MSC_SCH_WB, FND_MESSAGE, FND_PROFILE, APP_EXCEPTION, and STANDARD/DBMS_STANDARD utilities.

Usage Notes

MSC_CALENDAR is invoked primarily by other MSC packages rather than directly by end users. Planning engines, scheduling workbench logic, and ATP availability routines call it to convert requested dates into valid working days and to count available capacity days. Because it is a package body with no documented public API classification, customizations should call it sparingly and only where the standard planning flow cannot meet a requirement. The package relies on FND_PROFILE for session context (such as organization and user) and on APP_EXCEPTION/FND_MESSAGE for error reporting, so it should be executed within a properly initialized EBS session. Any direct calls should supply valid calendar codes or rely on SELECT_CALENDAR_DEFAULTS to resolve them; otherwise incorrect or null results may propagate into planning output.