Search Results calculate_linecap
Overview
MRP_LINE_SCHEDULE_ALGORITHM is an internal Oracle Applications package that implements the production line scheduling engine used by Oracle Master Scheduling/MRP and Oracle Work in Process. Its role is to take unfirm and firm demand — sales orders, planned orders, and purchase order demand — and translate it into timed, capacity-feasible flow schedules, repetitive schedules, and discrete jobs on a production line. The package embodies the line scheduling algorithm that determines how demand is sequenced, leveled, rounded, and placed against the line calendar, honoring build sequence rules, order modifier restrictions, and capacity constraints for each date.
The package is declared AUTHID CURRENT_USER, so it executes with the privileges of the calling schema. The header shown above was last modified in 2003 (MRPLSCHS.pls 115.48), and the same body is shipped in both 12.1.1 and 12.2.2, meaning its behavior is consistent across those releases and it is not one of the objects materially reworked by the Online Patching or multi-org changes introduced in 12.2.2.
The package defines several PL/SQL collection types — CapTabTyp, TimeTabTyp, BuildSeqTabTyp, OrderModTabTyp — that hold net capacity by date, the latest schedule completion time within a day, the highest build sequence per schedule group, and per-item order modifier minimums and maximums. These reflect the in-memory working structures of the scheduling algorithm.
Key Procedures and Functions
Nineteen documented procedures and functions make up the package's public surface:
- CREATE_CURSOR — builds the dynamic query or cursor needed to fetch the demand and scheduling rows the algorithm will process. This is the entry point that users typically search for when investigating how the package gathers its data.
- CALCULATE_LINECAP — derives the available line capacity for each date from the calendar.
- ORDER_SCHEDULING_RULE — applies the scheduling rule configured for the line or item.
- CALCULATE_ORDER_QUANTITIES — determines the quantity to schedule for each order.
- CALCULATE_BUILD_SEQUENCES — assigns build sequences within schedule groups.
- TIME_EXISTING_FS — establishes the times already consumed by existing flow schedules.
- CREATE_PO_FS — creates flow schedules for planned/purchase order demand.
- ROUNDING_PROCESS — applies rounding rules to scheduled quantities.
- SCHEDULE_ORDERS — top-level routine that drives scheduling of a set of orders.
- CALCULATE_PRODUCTION_PLAN — computes the production plan quantities.
- SCHEDULE_ORDERS_LEVEL — performs level-loaded scheduling.
- UPDATE_BUILDSEQ — persists updated build sequences.
- SCHEDULE_MIX_MODEL and MIX_MODEL — apply mixed-model scheduling logic.
- SCHEDULE — the master scheduling driver.
- CALCULATE_DEMAND and CALCULATE_DEMAND_MIX — derive demand quantities to satisfy.
- CALCULATE_BEGIN_TIME and CALCULATE_COMPLETION_TIME — compute the start and end times for each scheduled order.
Tables Accessed
The package reads and writes through APPS synonyms. Principal transactional and setup tables include:
- WIP_FLOW_SCHEDULES, WIP_REPETITIVE_SCHEDULES, WIP_DISCRETE_JOBS, WIP_LINES, and WIP_ENTITIES_S — the scheduling targets and line definitions.
- BOM_CALENDAR_DATES and BOM_RESOURCE_FLEX_FENCES — calendar and flex-fence data used for capacity and start/completion time calculations.
- MRP_SCHEDULING_RULES and MRP_FORM_QUERY / MRP_FORM_QUERY_S — scheduling rule configuration and the form query used to drive the scheduling UI.
- MTL_SYSTEM_ITEMS and MTL_PARAMETERS — item attributes and organization parameters such as rounding and sequence settings.
- DBMS_SQL, DUAL, and PLITBLM — dynamic SQL support and internal PL/SQL table management.
Usage Notes
MRP_LINE_SCHEDULE_ALGORITHM is not an end-user API; it is invoked indirectly. It is called from the scheduling forms in Oracle Master Scheduling/MRP and from concurrent programs that perform line scheduling and flow schedule generation. It is referenced by six other packages, confirming it functions as a shared engine consumed by higher-level scheduling and planning logic. Custom code should avoid calling it directly, since its interface is internal and unversioned; any integration should go through a supported API or concurrent program instead. When debugging scheduling behavior, DBMS_OUTPUT and a call to CREATE_CURSOR can be used in a development instance to inspect the demand set being scheduled.