Sie sind auf Seite 1von 4

-- Script to update demand Class in collected MPS update msc_supplies set demand_class = '&demand_class' where plan_id = -1 and order_type

= 5 and schedule_designator_id = &mps_id; -- Script to update demand Class in collected PO update msc_supplies set demand_class = '&demand_class' where plan_id = -1 and order_type = 1 --&supply_type_id and order_number = '&PO Number'

-- Script to update demand Class in collected ON HAND update msc_supplies set demand_class = '&demand_class' where plan_id = -1 and order_type = 18 and subinventory_code = '&subinventory' -- Update Demand Class for Collected Supplies update msc.msc_supplies a set demand_class = (select demand_class from msc.msc_supplies where plan_id = -1 and sr_instance_id = a.sr_instance_id and disposition_id = a.disposition_id and order_type = a.order_type and operation_seq_num = a.operation_seq_num) where a.plan_id = &plan_id; ;'****************************************************************************** *****'; -- Update Demand Class for Dependent Demand update msc.msc_demands md set demand_class = (select emd.demand_class from msc.msc_full_pegging peg, msc.msc_full_pegging epeg, msc.msc_demands emd where peg.end_pegging_id = epeg.pegging_id and peg.PLAN_ID = epeg.plan_id and peg.SR_INSTANCE_ID = epeg.sr_instance_id and emd.sr_instance_id = epeg.sr_instance_id and emd.plan_id = epeg.plan_id and emd.demand_id = epeg.demand_id and md.sr_instance_id = peg.sr_instance_id and md.plan_id = peg.plan_id and md.demand_id = peg.demand_id and rownum = 1) where plan_id = &plan_id and origination_type = 1 and demand_class is null;

;'****************************************************************************** *****'; -- Update Demand Class for Planned Orders Created by ASCP Plan update msc.msc_supplies ms set demand_class = (select emd.demand_class from msc.msc_full_pegging peg, msc.msc_full_pegging epeg, msc.msc_demands emd where peg.end_pegging_id = epeg.pegging_id and peg.PLAN_ID = epeg.plan_id and peg.SR_INSTANCE_ID = epeg.sr_instance_id and emd.sr_instance_id = epeg.sr_instance_id and emd.plan_id = epeg.plan_id and emd.demand_id = epeg.demand_id and ms.sr_instance_id = peg.sr_instance_id and ms.plan_id = peg.plan_id and ms.transaction_id = peg.demand_id and rownum = 1) where plan_id = &plan_id and order_type = 5 and demand_class is null; Scenario 1.1: Planned Orders Which record to update:

select * from msc_supplies where order_type = 5 and schedule_designator_id is null Where to get demand class from: msc_demands.demand_class linking through MSC_full_pegging table

Scenario 1.2 : Planned Orders Demand select * from msc_demands where origination_type = 1

Where to get demand class from:

msc_demands.demand_class linking through MSC_full_pegging table

Scenario 2: select * from msc_supplies where schedule_designator_id is not null and order_type <> 5 Get the demand class from msc_schedule_designators

Scenario 3: select * from msc_supplies where demand_class is null -- after all the above updates update msc.msc_supplies a set demand_class = (select demand_class from msc.msc_supplies where plan_id = -1 and sr_instance_id = a.sr_instance_id and disposition_id = a.disposition_id and order_type = a.order_type and operation_seq_num = a.operation_seq_num) where a.plan_id = &plan_id;

ASCP Post Plan Processing Hook Post Plan processing hook - MSC_MBP_CUSTOM.Custom_Post_Processing Dummy package contained in files $MSC_TOP/patch/115/sql MSCMBPCS.pls package MSCMBPCB.pls package body Called by: C code in: MSC - mscnew.o / MSO - msocnew.o

mrlncp_call_custom_postproc Reference ID 976328.1 a. The procedure MSC_MBP_CUSTOM.Custom_Post_Processing will be called by t he C Program Run ASCP Plan b. Data in MSC Tables will be retained in the plan plan run Collections (-1) after the

Das könnte Ihnen auch gefallen