46: lv_sql_stmt varchar2(9000):=NULL;
47: lv_previous_plan_start_date DATE;
48: CURSOR c1 IS
49: select plan_id, organization_id, plan_start_date
50: from msc_plans
51: where sr_instance_id = pINSTANCE_ID
52: and compile_designator = pDESIGNATOR;
53:
54: BEGIN
221: ||' CURR_RESERVATION_LEVEL , '
222: ||' CURR_HARD_PEGGING_LEVEL , '
223: ||' RESERVATION_LEVEL , '
224: ||' HARD_PEGGING_LEVEL '
225: ||' FROM MSC_PLANS '
226: ||' WHERE plan_id <> -1 '
227: ||' AND plan_id = :plan_id '
228: ||' AND sr_instance_id = :pINSTANCE_ID '
229: ||' AND organization_id = :organization_id ';
275:
276: lv_sql_stmt := 'update mrp_plans'|| v_dblink
277: ||' set (plan_start_date,plan_completion_date,data_completion_date) = '
278: ||' (select plan_start_date,plan_completion_date, data_completion_date '
279: ||' from msc_plans'
280: ||' where plan_id <> -1'
281: ||' and plan_id = :plan_id '
282: ||' AND sr_instance_id = :pINSTANCE_ID '
283: ||' AND organization_id = :organization_id) '
325: lv_planned_org number;
326: lv_plan_level number ;
327: CURSOR c1 IS
328: select organization_id ,plan_id
329: from msc_plans
330: where sr_instance_id = pINSTANCE_ID
331: and compile_designator = pDESIGNATOR;
332: CURSOR c2 (c_plan_id number) IS
333: select organization_id
475: lv_sql_stmt varchar2(9000) :=NULL;
476: lv_pplan_type number :=0;
477: CURSOR c1 IS
478: select organization_id
479: from msc_plans
480: where sr_instance_id = pINSTANCE_ID
481: and compile_designator = pDESIGNATOR;
482: CURSOR c2(c_org_id in number) is
483: SELECT PRODUCTION , ORGANIZATION_ID, DESIGNATOR_TYPE,
830: lv_organization_id NUMBER;
831: lv_user_id NUMBER;
832: CURSOR c1 IS
833: select plan_id
834: from msc_plans
835: where sr_instance_id = pINSTANCE_ID
836: and compile_designator = pDESIGNATOR;
837: CURSOR c2 (c_plan_id number) IS
838: select organization_id
937: IF pBUY_ORDERS_ONLY <> SYS_YES THEN
938:
939: lv_sql_stmt:=
940: ' BEGIN'
941: ||' MSC_A2A_XML_WF.PUSH_PLAN_OUTPUT(p_map_code => ''MSC_PLANSCHDO_OAG71_OUT'',
942: p_compile_designator => :pDESIGNATOR ,
943: p_instance_id => :pINSTANCE_ID ,
944: p_buy_items_only => :pBUY_ORDERS_ONLY );'
945: ||' END;';
963:
964: IF lv_buy_count > 0 THEN
965: lv_sql_stmt:=
966: ' BEGIN'
967: ||' MSC_A2A_XML_WF.PUSH_PLAN_OUTPUT(p_map_code => ''MSC_PLANSCHDO_OAG71_OUT'',
968: p_compile_designator => :pDESIGNATOR ,
969: p_instance_id => :pINSTANCE_ID ,
970: p_buy_items_only => :pBUY_ORDERS_ONLY );'
971: ||' END;';
2488: IF to_number(pPLAN_TYPE) = 2 THEN
2489:
2490: select organization_id
2491: into lv_organization_id
2492: from msc_plans
2493: where sr_instance_id = pINSTANCE_ID
2494: and compile_designator = pDESIGNATOR;
2495:
2496: lv_sql_stmt :=