Search Results collect_flowsched_demand




Overview

WPS_SUPPLY_DEMAND is an Oracle Applications (APPS) PL/SQL package that belongs to the supply chain planning infrastructure of Oracle E-Business Suite, historically associated with the WPS (Supply Chain Planning) product family. Its principal business function is the collection, storage, and retrieval of supply and demand information used by planning engines, such as those that support material requirements planning (MRP) and available-to-promise (ATP) calculations. The package defines a canonical record structure, Supply_Demand_Record_Type, that standardizes how a supply or demand row is represented, capturing reservation type, supply/demand source type, transaction source type, source identifier, supply/demand type, quantity, date, inventory item, and organization. A companion collection type, Supply_Demand_Tbl_Type, is indexed by BINARY_INTEGER, while Number_Tbl_Type provides parallel indexed tables of numeric values. A package-level global, g_supply_demand_table, holds the working set of supply/demand rows for the session.

Key Procedures and Functions

The documented API surface includes nineteen procedures and functions. The central entry point is Collect_Supply_Demand_Info, which is overloaded: a function form returns a numeric status, while a procedure form accepts a group identifier, system sequence number, MRP status, and organization identifier, and returns the populated supply/demand table along with standard ERRBUF and RETCODE out parameters. Get_Supply_Demand_Info is likewise overloaded: one form returns the entire global supply/demand table, and another fetches a bounded index range while returning parallel numeric tables for each record attribute. Clear_Supply_Demand_Info resets the in-memory collection.

The remaining procedures decompose collection by category. Collect_Supply_Info and Collect_Demand_Info gather the aggregate supply and demand streams. Collect_Onhand_Supply, Collect_User_Supply, Collect_MTL_Supply, Collect_DiscreteJob_Supply, Collect_WIPNegReq_Supply, Collect_RepSched_Supply, and Collect_FlowSched_Supply populate supply from on-hand inventory, user-defined supply, material transactions, discrete jobs, negative WIP requirements, repetitive schedules, and flow schedules respectively. On the demand side, Collect_DiscreteJob_Demand, Collect_RepSched_Demand, Collect_User_Demand, Collect_FlowSched_Demand, and Collect_SalesOrder_Demand gather component, user, flow schedule, and sales order demand. This modular design allows the planning engine to assemble a complete supply/demand picture from multiple source systems.

Tables Accessed

The package references a defined set of tables through APPS synonyms. Planning and item master data are drawn from MTL_SYSTEM_ITEMS, MTL_PARAMETERS, and MTL_ATP_RULES. Supply sourcing relies on MTL_SUPPLY, MTL_ONHAND-related interfaces, MTL_MATERIAL_TRANSACTIONS_TEMP, and MTL_SECONDARY_INVENTORIES. Demand sourcing uses MTL_DEMAND, MTL_DEMAND_INTERFACE, and MTL_USER_DEMAND, with MTL_USER_SUPPLY for user supply. Manufacturing sources include WIP_DISCRETE_JOBS and WIP_FLOW_SCHEDULES. Sales order demand is derived from OE_ORDER_LINES. Bill of material explosion and calendar logic use BOM_EXPLOSIONS and BOM_CALENDAR_DATES. These tables supply the raw records that the collection procedures normalize into the Supply_Demand_Record_Type structure.

Usage Notes

WPS_SUPPLY_DEMAND is invoked by planning and ATP programs rather than by end-user forms directly. Because it is classified under OTHER and is not referenced by any other documented packages, it is typically called from concurrent programs, planning engine batches, or custom PL/SQL that requires a consolidated supply/demand snapshot. Callers should invoke Clear_Supply_Demand_Info before a fresh collection, pass a valid organization identifier and group context to the collection routines, and inspect RETCODE and ERRBUF for errors. The overloaded Get_Supply_Demand_Info supports both bulk retrieval and paged retrieval, which is useful for large planning sets.