561: X_REQUEST_ID => x_request_id);
562: END LOOP;
563:
564:
565: UPDATE WIP_REQUIREMENT_OPERATIONS R
566: SET REQUIRED_QUANTITY = QUANTITY_PER_ASSEMBLY *
567: x_rate * x_rnd_days_ran,
568: LAST_UPDATE_DATE = SYSDATE,
569: LAST_UPDATED_BY = x_user_id,
775: close nxt_fstop;
776:
777: -- set the quantity issued as well as others info for the next
778: -- shedule in wip_requirement operation
779: UPDATE wip_requirement_operations new
780: SET new.quantity_issued =
781: (SELECT new.quantity_issued +
782: nvl(max(wro.quantity_issued -
783: (x_qty_completed * wro.quantity_per_assembly)), 0)
780: SET new.quantity_issued =
781: (SELECT new.quantity_issued +
782: nvl(max(wro.quantity_issued -
783: (x_qty_completed * wro.quantity_per_assembly)), 0)
784: FROM wip_requirement_operations wro
785: WHERE wro.organization_id = p_org_id
786: AND wro.wip_entity_id = x_wip_id
787: AND wro.repetitive_schedule_id = p_closed_sched_id
788: AND new.inventory_item_id = wro.inventory_item_id
805: WHERE new.organization_id = p_org_id
806: AND new.wip_entity_id = x_wip_id
807: AND new.repetitive_schedule_id = p_rollfwd_sched_id;
808:
809: -- insert into wip_requirement_operations
810:
811: INSERT INTO wip_requirement_operations
812: (inventory_item_id, organization_id,
813: wip_entity_id, operation_seq_num,
807: AND new.repetitive_schedule_id = p_rollfwd_sched_id;
808:
809: -- insert into wip_requirement_operations
810:
811: INSERT INTO wip_requirement_operations
812: (inventory_item_id, organization_id,
813: wip_entity_id, operation_seq_num,
814: repetitive_schedule_id, last_update_date,
815: last_updated_by, creation_date,
862: wro.attribute6, wro.attribute7, wro.attribute8,
863: wro.attribute9, wro.attribute10, wro.attribute11,
864: wro.attribute12, wro.attribute13, wro.attribute14,
865: wro.attribute15
866: FROM wip_requirement_operations wro,
867: wip_operations wo
868: WHERE wro.organization_id = p_org_id
869: AND wo.organization_id (+) = p_org_id
870: AND wro.wip_entity_id = x_wip_id
877: AND wro.required_quantity > decode(p_rollfwd_type,
878: WIP_CONSTANTS.ROLL_EC_IMP, -1, 0)
879: AND NOT EXISTS
880: (SELECT 'does the requirement already exist?'
881: FROM wip_requirement_operations wro1
882: WHERE wro1.inventory_item_id = wro.inventory_item_id
883: AND wro1.operation_seq_num = wro.operation_seq_num
884: AND wro1.organization_id = p_org_id
885: AND wro1.wip_entity_id = x_wip_id
884: AND wro1.organization_id = p_org_id
885: AND wro1.wip_entity_id = x_wip_id
886: AND wro1.repetitive_schedule_id = p_rollfwd_sched_id);
887:
888: -- update closed schedule in wip_requirement_operations
889:
890: UPDATE wip_requirement_operations wro
891: SET wro.quantity_issued = x_qty_completed * wro.quantity_per_assembly,
892: wro.last_update_date = SYSDATE,
886: AND wro1.repetitive_schedule_id = p_rollfwd_sched_id);
887:
888: -- update closed schedule in wip_requirement_operations
889:
890: UPDATE wip_requirement_operations wro
891: SET wro.quantity_issued = x_qty_completed * wro.quantity_per_assembly,
892: wro.last_update_date = SYSDATE,
893: wro.last_updated_by = x_user_id,
894: wro.request_id = DECODE(x_request_id, 0, wro.request_id,