[Home] [Help]
404: f_demand_type number_idx_tbl;
405: d_origination_type number_idx_tbl;
406: f_origination_type number_idx_tbl;
407:
408: TYPE demand_schedule IS TABLE OF msc_st_demands.demand_schedule_name%TYPE
409: INDEX BY BINARY_INTEGER;
410: empty_demand_schedule demand_schedule;
411: d_demand_schedule demand_schedule;
412: f_demand_schedule demand_schedule;
410: empty_demand_schedule demand_schedule;
411: d_demand_schedule demand_schedule;
412: f_demand_schedule demand_schedule;
413:
414: TYPE dorder_number IS TABLE OF msc_st_demands.order_number%TYPE INDEX BY BINARY_INTEGER;
415: empty_dorder_number dorder_number ;
416: d_order_number dorder_number ;
417: f_order_number dorder_number ;
418:
415: empty_dorder_number dorder_number ;
416: d_order_number dorder_number ;
417: f_order_number dorder_number ;
418:
419: TYPE dwip_entity_name IS TABLE OF msc_st_demands.wip_entity_name%TYPE INDEX BY BINARY_INTEGER;
420: empty_dwip_entity_name dwip_entity_name ;
421: d_wip_entity_name dwip_entity_name ;
422: f_wip_entity_name dwip_entity_name ;
423:
426:
427: d_request_date date_idx_tbl;
428: f_request_date date_idx_tbl;
429:
430: TYPE forecast_designator IS TABLE OF msc_st_demands.forecast_designator%TYPE
431: INDEX BY BINARY_INTEGER;
432: f_forecast_designator forecast_designator ;
433:
434: f_sales_order_line_id number_idx_tbl;
787: * activity is Changed
788: * Sridhar 31-MAR-2003 B2882286 Ensuring the Order so that if the last batch
789: * resource requirements are written
790: * Sridhar 30-APR-2003 B2919303 Added Operation Seq Number in msc_st_supplies
791: * and in msc_st_demands table
792: * Sridhar 09-MAY-2003 B2919303 Added line_no and included in order by clause
793: * Sridhar 12-MAY-2003 B2953953 Populated BY_PRODUCT_USING_ASSY_ID with
794: * product_line which is the assembly_item_id
795: * Navin 21-APR-2003 B3577871 ST:OSFME2: collections failing in planning data pull.
2315: i := 1 ;
2316: log_message(d_organization_id.FIRST || '*' || d_index || '*' || d_organization_id.LAST );
2317: IF d_organization_id.FIRST > 0 THEN
2318: FORALL i IN d_organization_id.FIRST..d_organization_id.LAST
2319: INSERT INTO msc_st_demands (
2320: organization_id,
2321: inventory_item_id,
2322: sr_instance_id,
2323: using_assembly_item_id,
2963: * insert_demands
2964: *
2965: * DESCRIPTION
2966: * This procedure will take the parameter values and insert a row into
2967: * the table msc_st_demands
2968: * HISTORY
2969: * M Craig
2970: * 10/13/99 - Added deleted_flag in the insert statement
2971: * P Dong
3035: INTO t_order_number, t_wip_entity_name
3036: FROM dual ;
3037:
3038: statement_demands :=
3039: ' INSERT INTO msc_st_demands ( '
3040: ||' organization_id, inventory_item_id, sr_instance_id, '
3041: ||' using_assembly_item_id, using_assembly_demand_date, '
3042: ||' using_requirement_quantity, demand_type, origination_type, '
3043: ||' wip_entity_id, demand_schedule_name, order_number, '
3066: pbatchstep_no, /* B2919303 */
3067: 2 ;
3068: EXCEPTION
3069: WHEN OTHERS THEN
3070: log_message('Failure occured during the insert into msc_st_demands');
3071: log_message(sqlerrm);
3072: RAISE;
3073: END;
3074:
3433: * NAME
3434: * extract_inv_transfer_demands
3435: *
3436: * DESCRIPTION
3437: * This procedure will insert records into the table msc_st_demands
3438: * According to APS team (Sam Tupe < prganesh Shah etc.
3439: * The inventory transfer demand is similar to Internal Sales Order
3440: * demand hence should be added to each of the demand schedule
3441: * The specifics are
3467: pdoc_type := 'XFER';
3468:
3469: return_status := TRUE ;
3470:
3471: v_sql_stmt := 'INSERT into msc_st_demands ('
3472: || ' organization_id,'
3473: || ' inventory_item_id,'
3474: || ' sr_instance_id,'
3475: || ' using_assembly_item_id,'
3528: * Extract_inventory_transfer_supplies
3529: *
3530: * DESCRIPTION
3531: * This procedure will insert records into the table msc_st_supplies
3532: * and msc_st_demands for pending inventory transfers.
3533: * HISTORY
3534: * 25-Jan-2003 B1332662 Created New procedure to insert supplies
3535: * Per discussions with APS team the specifics are
3536: * Order_type = 2
3780: * This procedure is a wrapper for the preexisting sales_forecast procedure.
3781: * This version is set up with the proper parameters to be called as from the
3782: * concurrent manager. In addition, the main difference is the table into
3783: * which demands are inserted. The standard procedure inserts into
3784: * msc_st_demands.
3785: * This new procedure inserts into gmp_demands_api. The difference between
3786: * the two tables is the addition of a schedule_id column in
3787: * gmp_demands_api. Also, this version of sales_forecast begins by
3788: * truncating gmp_demands_api and leaves it populated after
3785: * This new procedure inserts into gmp_demands_api. The difference between
3786: * the two tables is the addition of a schedule_id column in
3787: * gmp_demands_api. Also, this version of sales_forecast begins by
3788: * truncating gmp_demands_api and leaves it populated after
3789: * it completes. By contrast, msc_st_demands (which is an APS staging table)
3790: * is immediately truncated after APS reads its data. This difference allows
3791: * gmp_demands_api to be a general purpose version of msc_st_demands.
3792: *
3793: * HISTORY
3787: * gmp_demands_api. Also, this version of sales_forecast begins by
3788: * truncating gmp_demands_api and leaves it populated after
3789: * it completes. By contrast, msc_st_demands (which is an APS staging table)
3790: * is immediately truncated after APS reads its data. This difference allows
3791: * gmp_demands_api to be a general purpose version of msc_st_demands.
3792: *
3793: * HISTORY
3794: * P. Dong
3795: * 09/14/01 - Created
3841: *
3842: * DESCRIPTION
3843: * This procedure will retrieve all of the sales order lines and forecast
3844: * details for their respective schedules. The forecast will be consumed
3845: * and the all of the rows will be written to msc_st_demands. Each demand
3846: * is applied to an MDS aka designator.
3847: * HISTORY
3848: * M Craig
3849: * 10/13/99 - Sridhar Added Designator Type column in the insert statement
4396: ||' :p11, :p12, :p13, '
4397: ||' :p14,:p15,:p16 ) ';
4398:
4399: l_demands_stmt :=
4400: ' INSERT INTO msc_st_demands ( '
4401: ||' organization_id, inventory_item_id, sr_instance_id, '
4402: ||' using_assembly_item_id, using_assembly_demand_date, '
4403: ||' using_requirement_quantity,demand_class,bucket_type, '
4404: ||' demand_type, origination_type, wip_entity_id, '
4676: i := 1 ;
4677: log_message(f_organization_id.FIRST || ' *forecast*' || f_organization_id.LAST );
4678: IF f_organization_id.FIRST > 0 THEN
4679: FORALL i IN f_organization_id.FIRST..f_organization_id.LAST
4680: INSERT INTO msc_st_demands (
4681: organization_id,
4682: inventory_item_id,
4683: sr_instance_id,
4684: using_assembly_item_id,
5138: * HISTORY
5139: * Created By : Rajesh Patangya
5140: * P Dong
5141: * 09/14/01 - Added api_mode to pass to insert_demands
5142: * 05/21/03 - B2971996 - Populating request_date in msc_st_demands table
5143: ************************************************************************/
5144: PROCEDURE write_this_so(pcounter IN NUMBER,
5145: sapi_mode IN BOOLEAN)
5146: AS
5185: ELSE
5186: BEGIN
5187:
5188: statement_demands :=
5189: ' INSERT INTO msc_st_demands ( '
5190: ||' organization_id, inventory_item_id, sr_instance_id, '
5191: ||' using_assembly_item_id, using_assembly_demand_date, '
5192: ||' using_requirement_quantity, demand_type, origination_type, '
5193: ||' wip_entity_id, demand_schedule_name, order_number, '
5288: END;
5289: ELSE
5290: BEGIN
5291: statement_demands :=
5292: ' INSERT INTO msc_st_demands ( '
5293: ||' organization_id, inventory_item_id, sr_instance_id, '
5294: ||' using_assembly_item_id, using_assembly_demand_date, '
5295: ||' using_requirement_quantity, demand_type, origination_type, '
5296: ||' wip_entity_id, demand_schedule_name, order_number, '