12: -- save owning organization's functional currency
13: begin
14: select o.currency_code
15: into l_owning_currency_code
16: from msc_trading_partners o, msc_plans p
17: where o.sr_instance_id=p.sr_instance_id
18: and o.sr_tp_id=p.organization_id
19: and o.partner_type=3
20: and p.plan_id=p_plan_id;
352: msc_demands md,
353: msc_demands md2,
354: msc_full_pegging mfp,
355: msc_system_items msi,
356: msc_trading_partners mtp
357: where mp.plan_id = p_plan_id
358: and mp.plan_type <> 6
359: and mp.plan_id = med.plan_id
360: and msi.inventory_item_id(+) = med.inventory_item_id
559: where mp.plan_id = med.plan_id
560: and mp.plan_type = 6
561: and mp.plan_id = p_plan_id) t,
562: msc_system_items msi,
563: msc_trading_partners mtp
564: where msi.plan_id(+) = t.plan_id
565: and msi.inventory_item_id(+) = t.inventory_item_id
566: and msi.organization_id(+) = t.owning_org_id
567: and msi.sr_instance_id(+) = t.owning_inst_id