[Home] [Help]
509: +--------------*/
510:
511: var_user_id := fnd_profile.value('USER_ID');
512: /*-----------------------------------------------+
513: | Insert subinventories into msc_sub_inventories |
514: | that are defined after options are defined |
515: +-----------------------------------------------*/
516: BEGIN
517:
514: | that are defined after options are defined |
515: +-----------------------------------------------*/
516: BEGIN
517:
518: INSERT INTO MSC_SUB_INVENTORIES
519: (SUB_INVENTORY_CODE,
520: ORGANIZATION_ID,
521: SR_INSTANCE_ID,
522: PLAN_ID,
535: -1,
536: SYSDATE,
537: 1,
538: msi.netting_type
539: FROM msc_sub_inventories msi,
540: msc_plan_organizations mpo
541: WHERE NOT EXISTS
542: (SELECT NULL
543: FROM MSC_SUB_INVENTORIES SUB
539: FROM msc_sub_inventories msi,
540: msc_plan_organizations mpo
541: WHERE NOT EXISTS
542: (SELECT NULL
543: FROM MSC_SUB_INVENTORIES SUB
544: WHERE SUB.ORGANIZATION_ID = mpo.organization_id
545: AND sub.sr_instance_id = mpo.sr_instance_id
546: AND SUB.plan_id = mpo.plan_id
547: AND SUB.sub_inventory_code = msi.sub_inventory_code)
555: -- of sub inventories in original plan as well.
556: -- --------------------------------------------
557: --if v_plan_id <> arg_plan_id THEN
558: if v_plan_id <> v_new_plan_id THEN
559: INSERT INTO MSC_SUB_INVENTORIES
560: (SUB_INVENTORY_CODE,
561: ORGANIZATION_ID,
562: SR_INSTANCE_ID,
563: PLAN_ID,
577: -1,
578: SYSDATE,
579: 1,
580: msi.netting_type
581: FROM msc_sub_inventories msi,
582: msc_plan_organizations mpo
583: WHERE NOT EXISTS
584: (SELECT NULL
585: FROM msc_sub_inventories sub
581: FROM msc_sub_inventories msi,
582: msc_plan_organizations mpo
583: WHERE NOT EXISTS
584: (SELECT NULL
585: FROM msc_sub_inventories sub
586: WHERE sub.organization_id = mpo.organization_id
587: AND sub.sr_instance_id = mpo.sr_instance_id
588: AND sub.plan_id = mpo.plan_id
589: AND sub.sub_inventory_code = msi.sub_inventory_code)
1472: program_id = v_temp_plan_name_cur.program_id,
1473: program_update_date = v_temp_plan_name_cur.program_update_date
1474: Where plan_id = p_temp_plan_id;
1475:
1476: Update MSC_SUB_INVENTORIES
1477: set last_updated_by = v_temp_plan_name_cur.last_updated_by,
1478: last_update_date = v_temp_plan_name_cur.last_update_date,
1479: last_update_login = v_temp_plan_name_cur.last_update_login,
1480: request_id = v_temp_plan_name_cur.request_id,
1701: end if;
1702: End if; -- End Vrec_C1.request_id check
1703:
1704: /*-----------------------------------------------+
1705: | Insert subinventories into msc_sub_inventories |
1706: | that are defined after options are defined |
1707: +-----------------------------------------------*/
1708: if (arg_launch_scheduler <> DS_OLS_ONLY) then
1709: BEGIN
1706: | that are defined after options are defined |
1707: +-----------------------------------------------*/
1708: if (arg_launch_scheduler <> DS_OLS_ONLY) then
1709: BEGIN
1710: INSERT INTO MSC_SUB_INVENTORIES
1711: ( SUB_INVENTORY_CODE
1712: , ORGANIZATION_ID
1713: , SR_INSTANCE_ID
1714: , PLAN_ID
1729: , -1
1730: , SYSDATE
1731: , 1
1732: , msi.netting_type
1733: FROM msc_sub_inventories msi
1734: , msc_plan_organizations mpo
1735: WHERE NOT EXISTS (SELECT NULL
1736: FROM MSC_SUB_INVENTORIES SUB
1737: WHERE SUB.ORGANIZATION_ID = mpo.organization_id
1732: , msi.netting_type
1733: FROM msc_sub_inventories msi
1734: , msc_plan_organizations mpo
1735: WHERE NOT EXISTS (SELECT NULL
1736: FROM MSC_SUB_INVENTORIES SUB
1737: WHERE SUB.ORGANIZATION_ID = mpo.organization_id
1738: AND sub.sr_instance_id = mpo.sr_instance_id
1739: AND SUB.plan_id = mpo.plan_id
1740: AND SUB.sub_inventory_code = msi.sub_inventory_code)