Search Results get_nearest_workdaytime
Overview
APPS.GMP_CALENDAR_API is the public PL/SQL interface for querying the Oracle Process Manufacturing (OPM) shop calendar. Its header identifies it as the interface used by OPM Process Execution to fetch calendar data, and its stated purpose is to supply calendar-related information such as whether a given day is a work day and to return contiguous working periods. The package is registered in ETRM with an API classification of public scope, product GMP, and an active lifecycle, and it exposes internal constants for the API version (m_api_version) and package name (m_pkg_name) used for standard API versioning conventions. Its declaration section also defines several PL/SQL collection and record types, including contiguous period records, date records carrying a work-day flag, work-day records, and shop-day detail records capturing shift number, shift start, and shift duration. These types shape the output of the functions described below and reflect the package's role as a read-oriented calendar service for manufacturing scheduling logic. Versioning metadata in the header (120.1.12010000.1, dated 2008) indicates the package has been stable across the 12.1.1 and 12.2.2 releases.
Key Procedures and Functions
The ETRM metadata documents nine procedures and functions in this package. The following are the primary calendar query routines:
- IS_WORKING_DAY — Takes a calendar code and a date and reports whether the supplied date is a working day. This is the function referenced in the source excerpt and is the direct target of the "get_work_days" search.
- IS_WORKING_DAYTIME — Extends the work-day determination to a date and time of day, allowing callers to test a specific point in time against the calendar rather than a whole day.
- GET_WORK_DAYS — Returns the set of work days for a calendar, typically over a caller-supplied date range. This function is the canonical API for scenarios where a search asks for work days in bulk rather than one date at a time.
- GET_CONTIGUOUS_PERIODS — Returns contiguous working periods as records containing start date, duration, and end date, enabling scheduling logic to work with uninterrupted production windows.
- GET_ALL_DATES — Returns dates together with a work-day indicator, providing a combined view of working and non-working dates.
- GET_WORKDAY_DETAILS — Returns shift-level detail for a working day, consistent with the shopday_dtl_rec structure (shift number, start, duration).
- GET_NEAREST_WORKDAYTIME — Locates the nearest working day and time relative to a given input, useful for rolling a requested date forward or backward to a valid production time.
- RETRIEVE_CALENDAR_DETAIL — Retrieves detail rows for a calendar, likely populating the GMP_CALENDAR_DETAIL_GTMP global temporary table for downstream processing.
- LOG_MESSAGE — An internal utility for writing diagnostic or error messages, supporting the standard return-status convention described in the header comments.
Tables Accessed
The package reads and writes through APPS synonyms. BOM_CALENDARS holds the calendar definition itself and is the base source for validating calendar codes. BOM_SHIFT_DATES stores shift-date assignments and supports work-day and date-range queries. BOM_SHIFT_TIMES stores shift timing information and underpins the time-of-day and work-day-detail functions. GMP_CALENDAR_DETAIL_GTMP is a global temporary table used to stage calendar detail results, consistent with RETRIEVE_CALENDAR_DETAIL. DUAL is used for scalar evaluations, and PLITBLM is the standard PL/SQL table-to-index-by-table helper used when passing or converting collections.
Usage Notes
GMP_CALENDAR_API is invoked by OPM Process Execution and is referenced by seven other packages, making it a shared dependency for manufacturing scheduling and shop-floor logic. Typical call patterns involve custom PL/SQL, OPM process execution routines, and concurrent or batch programs that need work-day, contiguous-period, or shift-level calendar information before scheduling production. The API follows the standard EBS interface conventions visible in the header: an API version parameter, an initialize-message-list flag, and an x_return_status output using 'S' for success, 'E' for error, and 'U' for unexpected error. Callers should therefore check return status and the message list rather than assuming success. Because the package is public and active, it is a supported integration point; however, custom code should treat the documented functions as the contract and avoid reliance on internal implementation details or the global temporary table's contents beyond documented use. For the "get_work_days" use case, GET_WORK_DAYS is the appropriate entry point, with IS_WORKING_DAY serving single-date validation.
-
PACKAGE: APPS.GMP_CALENDAR_API
12.1.1
-
PACKAGE: APPS.GMP_CALENDAR_API
12.2.2
-
PACKAGE BODY: APPS.GMP_CALENDAR_API
12.1.1
-
PACKAGE BODY: APPS.GMP_CALENDAR_API
12.2.2
-
APPS.GMP_CALENDAR_API dependencies on GMP_CALENDAR_API
12.1.1
-
APPS.GMP_CALENDAR_API dependencies on GMP_CALENDAR_API
12.2.2
-
APPS.GMP_CALENDAR_API dependencies on FND_API
12.2.2
-
APPS.GMP_CALENDAR_API dependencies on FND_FILE
12.2.2
-
APPS.GMP_CALENDAR_API dependencies on FND_FILE
12.1.1
-
APPS.GMP_CALENDAR_API dependencies on FND_API
12.1.1
-
APPS.GMP_CALENDAR_API dependencies on FND_MESSAGE
12.1.1
-
APPS.GMP_CALENDAR_API dependencies on FND_MESSAGE
12.2.2
-
APPS.GMP_CALENDAR_API dependencies on FND_MSG_PUB
12.1.1
-
APPS.GMP_CALENDAR_API dependencies on FND_MSG_PUB
12.2.2