Search Results select_calendar_defaults
Overview
The APPS.MRP_CALENDAR package is a foundational Oracle EBS utility that encapsulates workday arithmetic for the manufacturing and planning modules. Its central business purpose is to translate an organization's Oracle Bills of Material calendar definition — including workday patterns, week start dates, period start dates, and exception dates — into reliable date calculations used by MRP, MPS, and related planning engines. Rather than forcing each calling program to re-derive which days are working days, the package provides a single, consistent API that resolves working-day logic against the organization's assigned calendar.
Consistent date handling is critical in planning because lead times, scheduling offsets, and planning horizons are expressed in working days. The package is declared AUTHID CURRENT_USER and is owned by APPS. It is referenced by 31 other packages, which underscores its role as shared infrastructure rather than a standalone feature. Any defect or change in its behavior propagates across scheduling, capacity, and planning functionality throughout the application.
Key Procedures and Functions
The package exposes five documented program units:
- NEXT_WORK_DAY — Returns the next valid working date after a supplied date, evaluated for a specific organization and calendar bucket. It is used to advance a schedule forward past non-working days.
- PREV_WORK_DAY — Returns the previous valid working date before a supplied date, again scoped by organization and bucket. It supports backward scheduling and lead-time calculations.
- DATE_OFFSET — Returns a date shifted by a given number of working days from a starting date, honoring the organization's calendar. This is the core primitive for lead-time and offset arithmetic.
- DAYS_BETWEEN — Returns the number of working days between two dates for the specified organization and bucket. It is commonly used to compute durations, elapsed lead times, and planning spans.
- SELECT_CALENDAR_DEFAULTS — Populates the default calendar code and exception set identifier for a given organization through OUT parameters. This is the routine invoked when a caller needs to discover which calendar and exception set the organization is configured to use.
All date routines share a common signature pattern accepting an organization identifier, a calendar bucket, and one or more dates. Callers therefore need only know the organization and bucket to obtain consistent working-day results.
Tables Accessed
The package reads its calendar definitions from four documented tables, accessed through APPS synonyms:
- BOM_CALENDAR_DATES — Supplies the working and non-working date definitions, including exception dates, for a calendar.
- BOM_CAL_WEEK_START_DATES — Provides week start dates used to resolve weekly working patterns.
- BOM_PERIOD_START_DATES — Provides period start dates used for period-based calendar logic.
- MTL_PARAMETERS — The organization parameters table, read to determine the default calendar and exception set assigned to the organization, particularly by
SELECT_CALENDAR_DEFAULTS.
Together these tables allow the package to resolve both the organization's assigned calendar and the day-level detail required for accurate workday calculations.
Usage Notes
MRP_CALENDAR is not typically invoked directly by end users. It is called programmatically by the planning applications — including MRP, MPS, and capacity planning processes — and by other PL/SQL packages; the documented metadata indicates it is referenced by 31 packages. The SELECT_CALENDAR_DEFAULTS routine is the entry point used when a caller must first discover the organization's calendar code and exception set before performing date arithmetic, after which the caller invokes NEXT_WORK_DAY, PREV_WORK_DAY, DATE_OFFSET, or DAYS_BETWEEN as required. Custom code extending planning functionality should call these routines rather than querying the BOM calendar tables directly, to preserve consistency with standard scheduling behavior. Because the functions rely on committed calendar setup, implementations should ensure calendar and organization parameter configurations are complete before use.
-
PACKAGE: APPS.MRP_CALENDAR
12.1.1
-
PACKAGE: APPS.MRP_CALENDAR
12.2.2
-
APPS.MRP_CALENDAR SQL Statements
12.2.2
-
APPS.MRP_CALENDAR SQL Statements
12.1.1
-
PACKAGE: APPS.MSC_CALENDAR
12.2.2
-
PACKAGE: APPS.MSC_CALENDAR
12.1.1
-
APPS.MSC_CALENDAR SQL Statements
12.2.2
-
APPS.MSC_CALENDAR SQL Statements
12.1.1
-
APPS.MRP_MRPRPROP_XMLP_PKG SQL Statements
12.2.2
-
APPS.MRP_MRPRPROP_XMLP_PKG SQL Statements
12.1.1
-
PACKAGE BODY: APPS.MRP_CALENDAR
12.2.2
-
PACKAGE BODY: APPS.MRP_CALENDAR
12.1.1
-
PACKAGE: APPS.MRP_MRPRPROP_XMLP_PKG
12.2.2
-
PACKAGE: APPS.MRP_MRPRPROP_XMLP_PKG
12.1.1
-
PACKAGE BODY: APPS.MRP_MRPRPROP_XMLP_PKG
12.1.1
-
PACKAGE BODY: APPS.MRP_MRPRPROP_XMLP_PKG
12.2.2
-
APPS.MRP_MRPRPROP_XMLP_PKG dependencies on MRP_CALENDAR
12.1.1
-
APPS.MRP_MRPRPROP_XMLP_PKG dependencies on MRP_CALENDAR
12.2.2
-
PACKAGE BODY: APPS.MSC_CALENDAR
12.1.1
-
PACKAGE BODY: APPS.MSC_CALENDAR
12.2.2
-
APPS.MRP_CALENDAR dependencies on APP_EXCEPTION
12.1.1
-
APPS.MRP_CALENDAR dependencies on APP_EXCEPTION
12.2.2
-
APPS.MRP_CALENDAR dependencies on FND_MESSAGE
12.1.1
-
APPS.MRP_CALENDAR dependencies on FND_MESSAGE
12.2.2
-
APPS.MSC_CALENDAR dependencies on APP_EXCEPTION
12.1.1
-
APPS.MSC_CALENDAR dependencies on APP_EXCEPTION
12.2.2
-
APPS.MSC_CALENDAR dependencies on FND_MESSAGE
12.1.1
-
APPS.MSC_CALENDAR dependencies on FND_MESSAGE
12.2.2
-
APPS.MRP_CALENDAR dependencies on MRP_CALENDAR
12.2.2
-
APPS.MRP_CALENDAR dependencies on MRP_CALENDAR
12.1.1