DBA Data[Home] [Help]

APPS.WIP_JSI_VALIDATOR dependencies on FND_API

Line 387: raise fnd_api.g_exc_unexpected_error;

383: --if serial op provided, the load type must be discrete or ns job
384: if(l_loadType not in (wip_constants.create_job,
385: wip_constants.create_ns_job,
386: wip_constants.resched_job)) then
387: raise fnd_api.g_exc_unexpected_error;
388: end if;
389:
390: --job must have an assembly, and the assembly must be serial controlled (predefined).
391: select 1

Line 415: raise fnd_api.g_exc_unexpected_error;

411: close c_ops;
412:
413: --The routing exists, but an invalid op seq was provided
414: if(l_rtgExists and not l_opFound) then
415: raise fnd_api.g_exc_unexpected_error;
416: end if;
417:
418: --If no routing exsts, the serialization op must be 1.
419: if(not l_rtgExists and l_serialOp <> 1) then

Line 420: raise fnd_api.g_exc_unexpected_error;

416: end if;
417:
418: --If no routing exsts, the serialization op must be 1.
419: if(not l_rtgExists and l_serialOp <> 1) then
420: raise fnd_api.g_exc_unexpected_error;
421: end if;
422:
423: --job must be unreleased to change the serialization op on a
424: --reschedule request. This is to guarantee no txns

Line 540: raise fnd_api.g_exc_unexpected_error;

536:
537: procedure load_type is begin
538: if(wjsi_row.load_type not in (wip_constants.create_job, wip_constants.create_sched, wip_constants.resched_job,
539: wip_constants.create_ns_job, wip_constants.create_eam_job, wip_constants.resched_eam_job)) then
540: raise fnd_api.g_exc_unexpected_error;
541: end if;
542: if((wjsi_row.load_type = wip_constants.resched_job and wdj_row.entity_type = wip_constants.eam) or
543: (wjsi_row.load_type = wip_constants.resched_eam_job and wdj_row.entity_type <> wip_constants.eam)) then
544: raise fnd_api.g_exc_unexpected_error;

Line 544: raise fnd_api.g_exc_unexpected_error;

540: raise fnd_api.g_exc_unexpected_error;
541: end if;
542: if((wjsi_row.load_type = wip_constants.resched_job and wdj_row.entity_type = wip_constants.eam) or
543: (wjsi_row.load_type = wip_constants.resched_eam_job and wdj_row.entity_type <> wip_constants.eam)) then
544: raise fnd_api.g_exc_unexpected_error;
545: end if;
546: exception
547: when others then
548: wip_jsi_utils.record_error('WIP_ML_LOAD_TYPE');

Line 575: raise fnd_api.g_exc_unexpected_error;

571: and wp.organization_id = ood.organization_id
572: and wp.organization_id = wjsi_row.organization_id;
573:
574: if(l_disable_date < sysdate) then
575: raise fnd_api.g_exc_unexpected_error;
576: end if;
577: exception
578: when others then
579: wip_jsi_utils.record_error('WIP_ML_ORGANIZATION_ID');

Line 594: raise fnd_api.g_exc_unexpected_error;

590: from wip_entities
591: where wip_entity_name = wjsi_row.job_name
592: and organization_id = wjsi_row.organization_id;
593: if(l_count > 0) then
594: raise fnd_api.g_exc_unexpected_error;
595: end if;
596: end if;
597: exception
598: when others then

Line 608: raise fnd_api.g_exc_unexpected_error;

604: begin
605: if (wjsi_row.load_type in (wip_constants.create_eam_job,
606: wip_constants.resched_eam_job) or
607: wdj_row.entity_type in (WIP_CONSTANTS.LOTBASED, WIP_CONSTANTS.EAM)) then
608: raise fnd_api.g_exc_unexpected_error;
609: end if;
610:
611: exception
612: when others then

Line 626: raise fnd_api.g_exc_unexpected_error;

622: into l_count
623: from wip_entities
624: where wip_entity_id = wjsi_row.wip_entity_id;
625: if(l_count > 0) then
626: raise fnd_api.g_exc_unexpected_error;
627: end if;
628: end if;
629: exception
630: when others then

Line 646: raise fnd_api.g_exc_unexpected_error;

642: return;
643: end if;
644:
645: if (wip_jsi_utils.validation_level <> wip_constants.inv) then
646: raise fnd_api.g_exc_unexpected_error;
647: end if ;
648:
649: l_msg := 'WIP_ML_KB_UPDATE_FAILED';
650: l_doc_header_id := wjsi_row.wip_entity_id ;

Line 656: raise fnd_api.g_exc_unexpected_error;

652: l_doc_type := INV_Kanban_PVT.G_doc_type_Discrete_Job ;
653: elsif(wjsi_row.load_type = wip_constants.create_sched) then
654: l_doc_type := INV_Kanban_PVT.G_doc_type_Rep_Schedule ;
655: else
656: raise fnd_api.g_exc_unexpected_error;
657: end if;
658:
659: -- Tell Inventory to update the kanban card's supply status.
660: -- Abort this request if unsuccessful.

Line 673: if((l_status is null) or (l_status <> fnd_api.g_ret_sts_success)) then

669: when others then
670: l_status := null ;
671: end ;
672:
673: if((l_status is null) or (l_status <> fnd_api.g_ret_sts_success)) then
674: raise fnd_api.g_exc_unexpected_error;
675: end if ;
676: exception
677: when others then

Line 674: raise fnd_api.g_exc_unexpected_error;

670: l_status := null ;
671: end ;
672:
673: if((l_status is null) or (l_status <> fnd_api.g_ret_sts_success)) then
674: raise fnd_api.g_exc_unexpected_error;
675: end if ;
676: exception
677: when others then
678: WIP_JSI_Utils.record_error(l_msg) ;

Line 712: raise fnd_api.g_exc_unexpected_error;

708: l_reservation_count NUMBER;
709: l_msg VARCHAR2(30) := 'WIP_ML_START_QUANTITY';
710: begin
711: if(wjsi_row.start_quantity < 0) then
712: raise fnd_api.g_exc_unexpected_error;
713: elsif(wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_ns_job) and
714: wjsi_row.start_quantity is null) then
715: raise fnd_api.g_exc_unexpected_error;
716: elsif(wjsi_row.load_type = wip_constants.create_job and wjsi_row.start_quantity = 0) then

Line 715: raise fnd_api.g_exc_unexpected_error;

711: if(wjsi_row.start_quantity < 0) then
712: raise fnd_api.g_exc_unexpected_error;
713: elsif(wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_ns_job) and
714: wjsi_row.start_quantity is null) then
715: raise fnd_api.g_exc_unexpected_error;
716: elsif(wjsi_row.load_type = wip_constants.create_job and wjsi_row.start_quantity = 0) then
717: raise fnd_api.g_exc_unexpected_error;
718: elsif(wjsi_row.load_type = wip_constants.resched_job) then
719: if(wjsi_row.start_quantity = 0 and wdj_row.job_type = wip_constants.standard) then

Line 717: raise fnd_api.g_exc_unexpected_error;

713: elsif(wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_ns_job) and
714: wjsi_row.start_quantity is null) then
715: raise fnd_api.g_exc_unexpected_error;
716: elsif(wjsi_row.load_type = wip_constants.create_job and wjsi_row.start_quantity = 0) then
717: raise fnd_api.g_exc_unexpected_error;
718: elsif(wjsi_row.load_type = wip_constants.resched_job) then
719: if(wjsi_row.start_quantity = 0 and wdj_row.job_type = wip_constants.standard) then
720: raise fnd_api.g_exc_unexpected_error;
721: elsif(wjsi_row.start_quantity < wdj_row.quantity_completed) then

Line 720: raise fnd_api.g_exc_unexpected_error;

716: elsif(wjsi_row.load_type = wip_constants.create_job and wjsi_row.start_quantity = 0) then
717: raise fnd_api.g_exc_unexpected_error;
718: elsif(wjsi_row.load_type = wip_constants.resched_job) then
719: if(wjsi_row.start_quantity = 0 and wdj_row.job_type = wip_constants.standard) then
720: raise fnd_api.g_exc_unexpected_error;
721: elsif(wjsi_row.start_quantity < wdj_row.quantity_completed) then
722: l_msg := 'WIP_ML_RESCHEDULE_QUANTITY';
723: raise fnd_api.g_exc_unexpected_error;
724: else

Line 723: raise fnd_api.g_exc_unexpected_error;

719: if(wjsi_row.start_quantity = 0 and wdj_row.job_type = wip_constants.standard) then
720: raise fnd_api.g_exc_unexpected_error;
721: elsif(wjsi_row.start_quantity < wdj_row.quantity_completed) then
722: l_msg := 'WIP_ML_RESCHEDULE_QUANTITY';
723: raise fnd_api.g_exc_unexpected_error;
724: else
725: select sum(primary_quantity), count(*)
726: into l_reserved_qty, l_reservation_count
727: from wip_reservations_v

Line 733: raise fnd_api.g_exc_unexpected_error;

729: and organization_id = wjsi_row.organization_id;
730: if(l_reservation_count > 0 and
731: wjsi_row.start_quantity < l_reserved_qty) then
732: l_msg := 'WIP_ML_RESCHEDULE_QUANTITY';
733: raise fnd_api.g_exc_unexpected_error;
734: end if;
735: end if;
736: end if;
737: exception

Line 747: raise fnd_api.g_exc_unexpected_error;

743: procedure net_quantity is begin
744:
745: if(wjsi_row.load_type <> wip_constants.create_sched and wjsi_row.net_quantity is not null) then
746: if(wjsi_row.net_quantity not between 0 and wjsi_row.start_quantity) then
747: raise fnd_api.g_exc_unexpected_error;
748: --can't have net qty when creating a ns job w/no item or rescheduling a ns job w/no item
749: elsif(wjsi_row.net_quantity is not null and wjsi_row.net_quantity <> 0 and
750: ((wjsi_row.load_type = wip_constants.create_ns_job and wjsi_row.primary_item_id is null) or
751: (wjsi_row.load_type = wip_constants.resched_job and

Line 754: raise fnd_api.g_exc_unexpected_error;

750: ((wjsi_row.load_type = wip_constants.create_ns_job and wjsi_row.primary_item_id is null) or
751: (wjsi_row.load_type = wip_constants.resched_job and
752: wdj_row.job_type = wip_constants.nonstandard and
753: wdj_row.primary_item_id is null))) then
754: raise fnd_api.g_exc_unexpected_error;
755: end if;
756: end if;
757: exception
758: when others then

Line 770: raise fnd_api.g_exc_unexpected_error;

766: (wjsi_row.firm_planned_flag = wip_constants.yes and
767: wdj_row.job_type = wip_constants.nonstandard and
768: wjsi_row.load_type in (wip_constants.resched_job, wip_constants.resched_eam_job)) or
769: (wjsi_row.firm_planned_flag not in (wip_constants.yes, wip_constants.no))) then
770: raise fnd_api.g_exc_unexpected_error;
771: end if;
772: exception
773: when others then
774: wip_jsi_utils.record_error('WIP_ML_FIRM_PLANNED_FLAG');

Line 782: raise fnd_api.g_exc_unexpected_error;

778: l_rep_sched_count NUMBER;
779: begin
780: if(wjsi_row.load_type = wip_constants.create_sched) then
781: if(wjsi_row.repetitive_schedule_id is null) then
782: raise fnd_api.g_exc_unexpected_error;
783: else
784: select count(*)
785: into l_rep_sched_count
786: from wip_repetitive_schedules

Line 790: raise fnd_api.g_exc_unexpected_error;

786: from wip_repetitive_schedules
787: where repetitive_schedule_id = wjsi_row.repetitive_schedule_id;
788:
789: if(l_rep_sched_count > 0) then
790: raise fnd_api.g_exc_unexpected_error;
791: end if;
792: end if;
793: end if;
794: exception

Line 815: raise fnd_api.g_exc_unexpected_error;

811: end demand_class;
812:
813: procedure line_id is begin
814: if(wjsi_row.load_type = wip_constants.create_sched and wjsi_row.line_id is null) then
815: raise fnd_api.g_exc_unexpected_error;
816: elsif(wjsi_row.line_id is not null) then
817: select 1
818: into g_dummy
819: from wip_lines_val_v

Line 853: raise fnd_api.g_exc_unexpected_error;

849: p_organization_id => wjsi_row.organization_id,
850: p_line_id => nvl(wjsi_row.line_id, wdj_row.line_id),
851: p_schedule_group_id => nvl(wjsi_row.schedule_group_id, wdj_row.schedule_group_id));
852: if(not l_retval) then
853: raise fnd_api.g_exc_unexpected_error;
854: end if;
855: end if;
856: exception
857: when others then

Line 881: raise fnd_api.g_exc_unexpected_error;

877: begin
878: --on job creation, status must be unreleased, released, on hold, or draft
879: if(wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_ns_job, wip_constants.create_eam_job) and
880: wjsi_row.status_type not in (wip_constants.unreleased, wip_constants.released, wip_constants.hold, wip_constants.draft)) then
881: raise fnd_api.g_exc_unexpected_error;
882:
883: --on reschedule, status must be unreleased, released, complete charges allowed, on hold, cancelled, or pending scheduling
884: elsif(wjsi_row.load_type in (wip_constants.resched_job, wip_constants.resched_eam_job)) then
885:

Line 896: raise fnd_api.g_exc_unexpected_error;

892: wip_constants.hold, wip_constants.cancelled, wip_constants.pend_sched) and
893: -- new comp_nochrg status is allowed in eam if old status is comp_chrg
894: (wjsi_row.status_type <> wip_constants.comp_nochrg or wdj_row.status_type <> wip_constants.comp_chrg
895: or wjsi_row.load_type <> wip_constants.resched_eam_job)) then
896: raise fnd_api.g_exc_unexpected_error;
897:
898: --additionally, you can not reschedule jobs that are in certain statuses
899: elsif(wdj_row.status_type not in (wip_constants.unreleased, wip_constants.released, wip_constants.comp_chrg,
900: wip_constants.hold, wip_constants.cancelled)) then

Line 911: raise fnd_api.g_exc_unexpected_error;

907: --these statuses ok for rescheduling eam jobs
908: return;
909: end if;
910: l_msg := 'WIP_ML_WIP_DJ_RESCHEDULE';
911: raise fnd_api.g_exc_unexpected_error;
912: end if;
913: /* Bug 2308832 - Added below if condition for sales order/PO checking */
914: IF (wjsi_row.status_type IN (WIP_CONSTANTS.CANCELLED,
915: WIP_CONSTANTS.COMP_CHRG,

Line 940: raise fnd_api.g_exc_unexpected_error;

936: if ( l_qty_reserved > 0 and
937: wjsi_row.status_type in (wip_constants.cancelled,
938: wip_constants.comp_nochrg)) then
939: l_msg := 'WIP_CANT_CANCEL_SO';
940: raise fnd_api.g_exc_unexpected_error;
941: end if;
942:
943: if ( l_qty_reserved > 0 and
944: wjsi_row.status_type = wip_constants.comp_chrg) then

Line 974: IF(l_return_status <> fnd_api. g_ret_sts_success) THEN

970: wip_osp.cancelPOReq(p_job_id => wjsi_row.wip_entity_id,
971: p_org_id => wjsi_row.organization_id,
972: x_return_status => l_return_status);
973:
974: IF(l_return_status <> fnd_api. g_ret_sts_success) THEN
975: -- If we are unable to cancel all PO/requisition associated
976: -- to this job, we will try to cancel as much as we can,
977: -- then user need to manually cancel the rest.
978: po_warning_flag := WIP_CONSTANTS.YES;

Line 1015: raise fnd_api.g_exc_unexpected_error;

1011: WIP_PICKING_PUB.Is_Job_Pick_Released(
1012: p_wip_entity_id => wjsi_row.wip_entity_id,
1013: p_org_id => wjsi_row.organization_id)) then
1014: l_msg := 'WIP_UNRLS_JOB/SCHED';
1015: raise fnd_api.g_exc_unexpected_error;
1016: end if;
1017: end if; -- JOB RESCHED : END
1018:
1019: exception

Line 1028: raise fnd_api.g_exc_unexpected_error;

1024:
1025: procedure processing_work_days is begin
1026: if(wjsi_row.load_type = wip_constants.create_sched and
1027: (wjsi_row.processing_work_days <= 0 or wjsi_row.processing_work_days is null)) then
1028: raise fnd_api.g_exc_unexpected_error;
1029: end if;
1030: exception
1031: when others then
1032: wip_jsi_utils.record_error('WIP_ML_PROCESSING_WORK_DAYS');

Line 1040: raise fnd_api.g_exc_unexpected_error;

1036: l_max_line_rate NUMBER;
1037: begin
1038: if(wjsi_row.load_type = wip_constants.create_sched) then
1039: if(wjsi_row.daily_production_rate <= 0 or wjsi_row.daily_production_rate is null) then
1040: raise fnd_api.g_exc_unexpected_error;
1041: end if;
1042:
1043: select daily_maximum_rate
1044: into l_max_line_rate

Line 1073: raise fnd_api.g_exc_unexpected_error;

1069: if(wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_sched,
1070: wip_constants.create_ns_job)) then
1071: if(wjsi_row.primary_item_id is null and wjsi_row.load_type <> wip_constants.create_ns_job) then
1072: l_msg := 'WIP_ML_PRIMARY_ITEM_ID';
1073: raise fnd_api.g_exc_unexpected_error;
1074: elsif(wjsi_row.primary_item_id is not null) then
1075: if(primary_item_row.build_in_wip_flag <> 'Y' or
1076: primary_item_row.pick_components_flag <> 'N' or
1077: (l_see_eng_items_flag = wip_constants.no and primary_item_row.eng_item_flag = 'Y')) then

Line 1079: raise fnd_api.g_exc_unexpected_error;

1075: if(primary_item_row.build_in_wip_flag <> 'Y' or
1076: primary_item_row.pick_components_flag <> 'N' or
1077: (l_see_eng_items_flag = wip_constants.no and primary_item_row.eng_item_flag = 'Y')) then
1078: l_msg := 'WIP_ML_PRIMARY_ITEM_ID';
1079: raise fnd_api.g_exc_unexpected_error;
1080: end if;
1081: if(wjsi_row.load_type = wip_constants.create_sched) then
1082: l_msg := 'WIP_ML_REPETITIVE_ITEM';
1083: select 1

Line 1125: raise fnd_api.g_exc_unexpected_error;

1121: wjsi_row.primary_item_id is not null) then
1122: l_msg := 'WIP_ML_EAM_ACTIVITY';
1123:
1124: if(primary_item_row.eam_item_type <> 2) then
1125: raise fnd_api.g_exc_unexpected_error;
1126: end if;
1127:
1128: if(wjsi_row.maintenance_object_type = 1) then
1129: if(wjsi_row.rebuild_item_id is null) then

Line 1169: raise fnd_api.g_exc_unexpected_error;

1165: end if;
1166:
1167: if(l_start_date is not null and
1168: l_start_date > nvl(wjsi_row.first_unit_start_date, wjsi_row.last_unit_completion_date)) then
1169: raise fnd_api.g_exc_unexpected_error;
1170: end if;
1171: if(l_end_date is not null and
1172: l_end_date < nvl(wjsi_row.last_unit_completion_date, wjsi_row.first_unit_start_date)) then
1173: raise fnd_api.g_exc_unexpected_error;

Line 1173: raise fnd_api.g_exc_unexpected_error;

1169: raise fnd_api.g_exc_unexpected_error;
1170: end if;
1171: if(l_end_date is not null and
1172: l_end_date < nvl(wjsi_row.last_unit_completion_date, wjsi_row.first_unit_start_date)) then
1173: raise fnd_api.g_exc_unexpected_error;
1174: end if;
1175:
1176: end if;
1177: exception

Line 1191: raise fnd_api.g_exc_unexpected_error;

1187: if(wjsi_row.wip_supply_type not in (wip_constants.push, wip_constants.assy_pull, wip_constants.op_pull,
1188: wip_constants.bulk, wip_constants.vendor, wip_constants.phantom,
1189: wip_constants.based_on_bom)) then
1190: --not a valid supply type
1191: raise fnd_api.g_exc_unexpected_error;
1192: elsif(wjsi_row.load_type = wip_constants.create_ns_job and
1193: wjsi_row.primary_item_id is null and
1194: wjsi_row.wip_supply_type in (wip_constants.assy_pull, wip_constants.op_pull)) then
1195: --can't have pull components for ns job w/no assy

Line 1196: raise fnd_api.g_exc_unexpected_error;

1192: elsif(wjsi_row.load_type = wip_constants.create_ns_job and
1193: wjsi_row.primary_item_id is null and
1194: wjsi_row.wip_supply_type in (wip_constants.assy_pull, wip_constants.op_pull)) then
1195: --can't have pull components for ns job w/no assy
1196: raise fnd_api.g_exc_unexpected_error;
1197: elsif(wjsi_row.wip_supply_type = wip_constants.op_pull) then
1198: select count(*)
1199: into l_routing_count
1200: from bom_operational_routings

Line 1207: raise fnd_api.g_exc_unexpected_error;

1203: and nvl(alternate_routing_designator, '@@@') = nvl(wjsi_row.alternate_routing_designator, '@@@')
1204: and nvl(cfm_routing_flag, 2) = 2; --ignore flow routings
1205: if(l_routing_count = 0) then
1206: --can't have op pulls if no routing exists!
1207: raise fnd_api.g_exc_unexpected_error;
1208: end if;
1209: end if;
1210: end if;
1211: exception

Line 1222: raise fnd_api.g_exc_unexpected_error;

1218: wjsi_row.routing_reference_id is not null and
1219: (routing_ref_row.build_in_wip_flag <> 'Y' or
1220: routing_ref_row.pick_components_flag <> 'N' or
1221: routing_ref_row.eng_item_flag <> 'N')) then
1222: raise fnd_api.g_exc_unexpected_error;
1223: end if;
1224: exception
1225: when others then
1226: wip_jsi_utils.record_error('WIP_ML_ROUTING_REFERENCE_ID');

Line 1270: raise fnd_api.g_exc_unexpected_error;

1266: l_rtg_item_id,
1267: wjsi_row.alternate_routing_designator);
1268: if(l_is_flow_rtg = wip_constants.yes) then
1269: l_msg := 'WIP_ERROR_CHOSEN_RTG_IS_CFM';
1270: raise fnd_api.g_exc_unexpected_error;
1271: end if;
1272: l_msg := 'WIP_ML_ALTERNATE_ROUTING';
1273: select 1
1274: into g_dummy

Line 1349: raise fnd_api.g_exc_unexpected_error;

1345: end if;
1346:
1347: if (PJM_PROJECT.val_task_idtonum(l_project_id, wjsi_row.task_id) is null)
1348: then
1349: raise fnd_api.g_exc_unexpected_error;
1350: end if;
1351:
1352: end if;
1353: exception

Line 1375: raise fnd_api.g_exc_unexpected_error;

1371: x_error_code => l_errcode
1372: );
1373:
1374: if ( l_result <> PJM_PROJECT.G_VALIDATE_SUCCESS ) then
1375: raise fnd_api.g_exc_unexpected_error;
1376: end if;
1377: end if;
1378: exception
1379: when others then

Line 1408: raise fnd_api.g_exc_unexpected_error;

1404: if(wjsi_row.load_type = wip_constants.create_ns_job and
1405: wjsi_row.routing_reference_id is null and
1406: l_date_count <> 2) then
1407: --must provide both dates when creating a ns job
1408: raise fnd_api.g_exc_unexpected_error;
1409: end if;
1410:
1411: if(wjsi_row.load_type = wip_constants.resched_job and
1412: wdj_row.job_type = wip_constants.nonstandard and

Line 1416: raise fnd_api.g_exc_unexpected_error;

1412: wdj_row.job_type = wip_constants.nonstandard and
1413: wdj_row.routing_reference_id is null and
1414: (l_date_count = 1)) then
1415: --when rescheduling a ns job and providing one date, it must have a routing
1416: raise fnd_api.g_exc_unexpected_error;
1417: end if;
1418: if(wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_ns_job, wip_constants.create_eam_job) and
1419: l_date_count = 0) then
1420: --all job creations must have at least one date

Line 1421: raise fnd_api.g_exc_unexpected_error;

1417: end if;
1418: if(wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_ns_job, wip_constants.create_eam_job) and
1419: l_date_count = 0) then
1420: --all job creations must have at least one date
1421: raise fnd_api.g_exc_unexpected_error;
1422: end if;
1423: if(wjsi_row.load_type = wip_constants.resched_job and
1424: l_date_count = 0 and
1425: wjsi_row.start_quantity is not null) then

Line 1427: raise fnd_api.g_exc_unexpected_error;

1423: if(wjsi_row.load_type = wip_constants.resched_job and
1424: l_date_count = 0 and
1425: wjsi_row.start_quantity is not null) then
1426: --when changing the quantity, you must also provide a date
1427: raise fnd_api.g_exc_unexpected_error;
1428: end if;
1429: if(wjsi_row.load_type in (wip_constants.resched_job, wip_constants.resched_eam_job) and
1430: (wjsi_row.allow_explosion = 'N' or wjsi_row.allow_explosion = 'n') and
1431: (l_date_count not in (0,2))) then

Line 1433: raise fnd_api.g_exc_unexpected_error;

1429: if(wjsi_row.load_type in (wip_constants.resched_job, wip_constants.resched_eam_job) and
1430: (wjsi_row.allow_explosion = 'N' or wjsi_row.allow_explosion = 'n') and
1431: (l_date_count not in (0,2))) then
1432: --if not exploding, then the user must provide both dates or none at all
1433: raise fnd_api.g_exc_unexpected_error;
1434: end if;
1435: if(wjsi_row.first_unit_start_date is not null) then
1436: select 1
1437: into g_dummy

Line 1474: raise fnd_api.g_exc_unexpected_error;

1470:
1471: if(wjsi_row.load_type = wip_constants.create_sched) then
1472: if(l_date_count = 0) then
1473: --must provide at least one date for rep sched
1474: raise fnd_api.g_exc_unexpected_error;
1475: end if;
1476:
1477: if(l_date_count <> 1) then
1478: --if you do not enter exactly one date then...

Line 1487: raise fnd_api.g_exc_unexpected_error;

1483: and line_id = wjsi_row.line_id
1484: and line_schedule_type = 1; --fixed
1485: if(l_line_count > 0) then
1486: --the line can not have a fixed lead time
1487: raise fnd_api.g_exc_unexpected_error;
1488: end if;
1489: select count(*)
1490: into l_rtg_count
1491: from bom_operational_routings bor, wip_repetitive_items wri

Line 1501: raise fnd_api.g_exc_unexpected_error;

1497: and bor.organization_id = wri.organization_id
1498: and bor.assembly_item_id = wri.primary_item_id;
1499: if(l_rtg_count > 0) then
1500: --the line can not have a routing
1501: raise fnd_api.g_exc_unexpected_error;
1502: end if;
1503: end if;
1504:
1505: select count(*)

Line 1529: raise fnd_api.g_exc_unexpected_error;

1525: if(not (l_date_count = 2 and
1526: ((wjsi_row.first_unit_start_date is not null and wjsi_row.first_unit_completion_date is not null) or
1527: (wjsi_row.last_unit_start_date is not null and wjsi_row.last_unit_completion_date is not null)))) then
1528: if(l_rtg_count = 0 and l_line_count > 0) then
1529: raise fnd_api.g_exc_unexpected_error;
1530: end if;
1531: end if;
1532:
1533: if(l_line_count > 0 and l_rtg_count = 0) then

Line 1661: raise fnd_api.g_exc_unexpected_error;

1657: begin
1658: if(wjsi_row.load_type <> wip_constants.create_sched) then
1659: if(wjsi_row.scheduling_method not in (wip_constants.routing, wip_constants.leadtime,
1660: wip_constants.ml_manual)) then
1661: raise fnd_api.g_exc_unexpected_error;
1662: end if;
1663: if(wjsi_row.scheduling_method = wip_constants.leadtime and
1664: ((wjsi_row.load_type = wip_constants.create_ns_job and wjsi_row.routing_reference_id is null) or
1665: (wjsi_row.load_type = wip_constants.resched_job and

Line 1669: raise fnd_api.g_exc_unexpected_error;

1665: (wjsi_row.load_type = wip_constants.resched_job and
1666: wdj_row.job_type = wip_constants.nonstandard and
1667: wdj_row.routing_reference_id is null))) then
1668: --can not do lead time for ns jobs that have no routing reference
1669: raise fnd_api.g_exc_unexpected_error;
1670: elsif(wjsi_row.scheduling_method = wip_constants.ml_manual) then
1671: if((wjsi_row.first_unit_start_date is null or wjsi_row.last_unit_completion_date is null) or
1672: wjsi_row.first_unit_start_date > wjsi_row.last_unit_completion_date) then
1673: raise fnd_api.g_exc_unexpected_error;

Line 1673: raise fnd_api.g_exc_unexpected_error;

1669: raise fnd_api.g_exc_unexpected_error;
1670: elsif(wjsi_row.scheduling_method = wip_constants.ml_manual) then
1671: if((wjsi_row.first_unit_start_date is null or wjsi_row.last_unit_completion_date is null) or
1672: wjsi_row.first_unit_start_date > wjsi_row.last_unit_completion_date) then
1673: raise fnd_api.g_exc_unexpected_error;
1674: end if;
1675: else --routing
1676: if(wjsi_row.allow_explosion in ('n','N') and
1677: wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_eam_job) and

Line 1681: raise fnd_api.g_exc_unexpected_error;

1677: wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_eam_job) and
1678: (wjsi_row.first_unit_start_date is null or wjsi_row.last_unit_completion_date is null)) then
1679: --if not exploding, the user must provide both dates.
1680: l_msg_code := 'WIP_ML_SCHEDULING_METHOD2';
1681: raise fnd_api.g_exc_unexpected_error;
1682: end if;
1683: end if;
1684: end if;
1685: exception

Line 1700: raise fnd_api.g_exc_unexpected_error;

1696: begin
1697: if(wjsi_row.load_type = wip_constants.create_ns_job and
1698: wjsi_row.primary_item_id is null and
1699: wjsi_row.completion_subinventory is not null) then
1700: raise fnd_api.g_exc_unexpected_error;
1701: end if;
1702:
1703: if(wjsi_row.load_type = wip_constants.create_eam_job and
1704: wjsi_row.rebuild_item_id is not null) then

Line 1780: raise fnd_api.g_exc_unexpected_error;

1776: (wjsi_row.load_type = wip_constants.create_eam_job and wjsi_row.rebuild_item_id is not null)) and
1777: wjsi_row.completion_subinventory is null) then
1778: if(wjsi_row.completion_locator_id is not null) then
1779: l_msg := 'WIP_ML_COMPLETION_LOCATOR';
1780: raise fnd_api.g_exc_unexpected_error;
1781: else
1782: return;
1783: end if;
1784: end if;

Line 1853: raise fnd_api.g_exc_unexpected_error;

1849: 'SPECIFIC', -- validation mode
1850: 'Y', -- required?
1851: wjsi_row.project_id,
1852: wjsi_row.task_id)) then
1853: raise fnd_api.g_exc_unexpected_error;
1854: end if;
1855: end if;
1856: end if;
1857: end if;

Line 1884: raise fnd_api.g_exc_unexpected_error;

1880: p_locator_id => wjsi_row.completion_locator_id,
1881: p_locator_segments => wjsi_row.completion_locator_segments,
1882: p_success_flag => l_success);
1883: if(not l_success) then
1884: raise fnd_api.g_exc_unexpected_error;
1885: end if;
1886: end if;
1887: exception when others then
1888: wip_jsi_utils.record_error(l_msg);

Line 1896: raise fnd_api.g_exc_unexpected_error;

1892:
1893: procedure due_date is begin
1894: if(wjsi_row.load_type = wip_constants.create_eam_job) then
1895: if(wjsi_row.due_date is not null and wjsi_row.pm_schedule_id is null) then
1896: raise fnd_api.g_exc_unexpected_error;
1897: end if;
1898: elsif(wjsi_row.due_date is not null and wjsi_row.load_type = wip_constants.resched_eam_job) then
1899: if(wdj_row.status_type <> wip_constants.draft) then
1900: raise fnd_api.g_exc_unexpected_error;

Line 1900: raise fnd_api.g_exc_unexpected_error;

1896: raise fnd_api.g_exc_unexpected_error;
1897: end if;
1898: elsif(wjsi_row.due_date is not null and wjsi_row.load_type = wip_constants.resched_eam_job) then
1899: if(wdj_row.status_type <> wip_constants.draft) then
1900: raise fnd_api.g_exc_unexpected_error;
1901: end if;
1902: end if;
1903: exception
1904: when others then

Line 1912: raise fnd_api.g_exc_unexpected_error;

1908:
1909: procedure date_released is begin
1910: if(wjsi_row.date_released > sysdate and
1911: wjsi_row.status_type = wip_constants.released) then
1912: raise fnd_api.g_exc_unexpected_error;
1913: end if;
1914: exception when others then
1915: wip_jsi_utils.record_error('WIP_ML_INVALID_RELEASE_DATE');
1916: wip_jsi_utils.abort_request;

Line 1922: raise fnd_api.g_exc_unexpected_error;

1918:
1919: procedure requested_start_date is begin
1920: if(wjsi_row.load_type = wip_constants.create_eam_job) then
1921: if(wjsi_row.requested_start_date is not null and wjsi_row.pm_schedule_id is null) then
1922: raise fnd_api.g_exc_unexpected_error;
1923: end if;
1924: elsif(wjsi_row.load_type = wip_constants.resched_eam_job) then
1925: if(wjsi_row.requested_start_date is not null and wdj_row.status_type <> wip_constants.draft) then
1926: raise fnd_api.g_exc_unexpected_error;

Line 1926: raise fnd_api.g_exc_unexpected_error;

1922: raise fnd_api.g_exc_unexpected_error;
1923: end if;
1924: elsif(wjsi_row.load_type = wip_constants.resched_eam_job) then
1925: if(wjsi_row.requested_start_date is not null and wdj_row.status_type <> wip_constants.draft) then
1926: raise fnd_api.g_exc_unexpected_error;
1927: end if;
1928: end if;
1929: exception
1930: when others then

Line 1976: raise fnd_api.g_exc_unexpected_error;

1972: -- You cannot create a repetitive schedule for a unit effective assembly.
1973: if(wjsi_row.load_type = wip_constants.create_sched and
1974: is_unit_effective_item) then
1975: wip_jsi_utils.record_error('WIP_ML_NO_UNIT_EFF_SCHED');
1976: raise fnd_api.g_exc_unexpected_error;
1977: end if;
1978:
1979: -- If this is a discrete job load...
1980: if (wjsi_row.load_type in (WIP_CONSTANTS.CREATE_JOB, WIP_CONSTANTS.CREATE_NS_JOB))

Line 1991: raise fnd_api.g_exc_unexpected_error;

1987: -- Unit number is required for unit effective assemblies.
1988: if(is_unit_effective_item and wjsi_row.end_item_unit_number is null) then
1989: fnd_message.set_name('PJM', 'UEFF-UNIT NUMBER REQUIRED');
1990: wip_jsi_utils.record_current_error;
1991: raise fnd_api.g_exc_unexpected_error;
1992: end if;
1993: end if;
1994:
1995: --if request is for reschedule, keep as is for all cases except when job_status is unreleased

Line 2022: raise fnd_api.g_exc_unexpected_error;

2018: exception
2019: when others then
2020: FND_Message.set_name('PJM', 'UEFF-UNIT NUMBER INVALID') ;
2021: WIP_JSI_Utils.record_current_error ;
2022: raise fnd_api.g_exc_unexpected_error;
2023: end ;
2024: else
2025: begin
2026: -- bug#2719927, bom revision code/reexplosion is based on bom_reference_id

Line 2034: raise fnd_api.g_exc_unexpected_error;

2030: exception
2031: when others then
2032: FND_Message.set_name('WIP', 'WIP_ML_PRIMARY_ITEM_ID') ;
2033: WIP_JSI_Utils.record_current_error ;
2034: raise fnd_api.g_exc_unexpected_error;
2035: end ;
2036: end if;
2037:
2038: -- if status is not unreleased, end_item_unit_number is ignored.

Line 2056: raise fnd_api.g_exc_unexpected_error;

2052: exception
2053: when others then
2054: FND_Message.set_name('PJM', 'UEFF-UNIT NUMBER INVALID') ;
2055: WIP_JSI_Utils.record_current_error ;
2056: raise fnd_api.g_exc_unexpected_error;
2057: end ;
2058: end if;
2059: end if ;
2060:

Line 2077: raise fnd_api.g_exc_unexpected_error;

2073: (wjsi_row.load_type = wip_constants.create_ns_job and wjsi_row.primary_item_id is not null)) then
2074: if(l_tol_value is not null and l_tol_type is not null) then
2075: if(l_tol_type not in (wip_constants.percent, wip_constants.amount)) then
2076: l_msg:= 'WIP_ML_COMP_TOLERANCE_TYPE';
2077: raise fnd_api.g_exc_unexpected_error;
2078: end if;
2079: if(l_tol_value < 0) then
2080: l_msg := 'WIP_ML_COMP_TOLERANCE_NEGATIVE';
2081: raise fnd_api.g_exc_unexpected_error;

Line 2081: raise fnd_api.g_exc_unexpected_error;

2077: raise fnd_api.g_exc_unexpected_error;
2078: end if;
2079: if(l_tol_value < 0) then
2080: l_msg := 'WIP_ML_COMP_TOLERANCE_NEGATIVE';
2081: raise fnd_api.g_exc_unexpected_error;
2082: end if;
2083: elsif(l_tol_value is not null or l_tol_type is not null) then
2084: l_msg := 'WIP_ML_COMP_TOLERANCE_NULL';--only one overcompletion column was provided
2085: raise fnd_api.g_exc_unexpected_error;

Line 2085: raise fnd_api.g_exc_unexpected_error;

2081: raise fnd_api.g_exc_unexpected_error;
2082: end if;
2083: elsif(l_tol_value is not null or l_tol_type is not null) then
2084: l_msg := 'WIP_ML_COMP_TOLERANCE_NULL';--only one overcompletion column was provided
2085: raise fnd_api.g_exc_unexpected_error;
2086: end if;
2087: end if;
2088: exception
2089: when others then

Line 2096: raise fnd_api.g_exc_unexpected_error;

2092:
2093: procedure class_code is begin
2094: if(wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_ns_job, wip_constants.create_eam_job) and
2095: wjsi_row.class_code is null) then
2096: raise fnd_api.g_exc_unexpected_error;
2097: end if;
2098: if(wjsi_row.load_type = wip_constants.create_job) then
2099: if(wjsi_row.project_id is null) then
2100: select 1

Line 2201: raise fnd_api.g_exc_unexpected_error;

2197: x_sched_dir => l_sched_dir,
2198: x_est_date => wjsi_row.first_unit_start_date);
2199: if(wjsi_row.first_unit_start_date is null) then
2200: l_msg := 'WIP_ML_EST_LEADTIME';
2201: raise fnd_api.g_exc_unexpected_error;
2202: end if;
2203: end if;
2204: else
2205: if(wjsi_row.load_type = wip_constants.create_ns_job and wjsi_row.routing_reference_id is not null) then

Line 2259: raise fnd_api.g_exc_unexpected_error;

2255: x_sched_dir => wip_constants.lucd,
2256: x_est_date => wjsi_row.first_unit_start_date);
2257: if(wjsi_row.first_unit_start_date is null) then
2258: l_msg := 'WIP_ML_EST_LEADTIME';
2259: raise fnd_api.g_exc_unexpected_error;
2260: end if;
2261: elsif(wjsi_row.last_unit_completion_date is null and
2262: wjsi_row.first_unit_start_date is not null and
2263: wjsi_row.scheduling_method = wip_constants.leadtime) then

Line 2279: raise fnd_api.g_exc_unexpected_error;

2275: x_sched_dir => wip_constants.fusd,
2276: x_est_date => wjsi_row.last_unit_completion_date);
2277: if(wjsi_row.last_unit_completion_date is null) then
2278: l_msg := 'WIP_NO_CALENDAR';
2279: raise fnd_api.g_exc_unexpected_error;
2280: end if;
2281: end if;
2282: end if;
2283: exception

Line 2360: raise fnd_api.g_exc_unexpected_error;

2356: where inventory_item_id = wjsi_row.asset_group_id
2357: and organization_id = wjsi_row.organization_id
2358: and eam_item_type = 1; -- asset group
2359: elsif(wjsi_row.rebuild_item_id is null) then
2360: raise fnd_api.g_exc_unexpected_error;
2361: end if;
2362: end if;
2363: exception
2364: when others then

Line 2379: raise fnd_api.g_exc_unexpected_error;

2375: -- Per EAM Enh. for H, this field is no longer mandatory
2376:
2377: if(wjsi_row.asset_group_id is null and
2378: wjsi_row.asset_number is not null) then
2379: raise fnd_api.g_exc_unexpected_error;
2380: end if;
2381:
2382: if(wjsi_row.asset_group_id is not null) then
2383: select 1

Line 2418: raise fnd_api.g_exc_unexpected_error;

2414: if(wjsi_row.load_type = wip_constants.create_eam_job) then
2415:
2416: if(wjsi_row.rebuild_item_id is null and
2417: wjsi_row.rebuild_serial_number is not null) then
2418: raise fnd_api.g_exc_unexpected_error;
2419: end if;
2420:
2421: if(wjsi_row.rebuild_item_id is not null) then
2422: if(wjsi_row.rebuild_serial_number is null) then

Line 2426: raise fnd_api.g_exc_unexpected_error;

2422: if(wjsi_row.rebuild_serial_number is null) then
2423: if(wjsi_row.maintenance_object_source = 1 and
2424: wjsi_row.maintenance_object_type = 1) then
2425: if(wjsi_row.status_type not in (wip_constants.draft, wip_constants.unreleased)) then
2426: raise fnd_api.g_exc_unexpected_error;
2427: end if;
2428: elsif(wjsi_row.maintenance_object_type not in (2, 3)) then
2429: raise fnd_api.g_exc_unexpected_error;
2430: end if;

Line 2429: raise fnd_api.g_exc_unexpected_error;

2425: if(wjsi_row.status_type not in (wip_constants.draft, wip_constants.unreleased)) then
2426: raise fnd_api.g_exc_unexpected_error;
2427: end if;
2428: elsif(wjsi_row.maintenance_object_type not in (2, 3)) then
2429: raise fnd_api.g_exc_unexpected_error;
2430: end if;
2431: else
2432: if(wjsi_row.maintenance_object_type = 1) then
2433: select 1

Line 2476: raise fnd_api.g_exc_unexpected_error;

2472: if(wjsi_row.load_type = wip_constants.create_eam_job) then
2473: if(wjsi_row.manual_rebuild_flag is not null and
2474: (wjsi_row.rebuild_item_id is null or
2475: wjsi_row.manual_rebuild_flag not in ('Y', 'N'))) then
2476: raise fnd_api.g_exc_unexpected_error;
2477: end if;
2478:
2479: if(wjsi_row.manual_rebuild_flag is null and
2480: wjsi_row.rebuild_item_id is not null) then

Line 2481: raise fnd_api.g_exc_unexpected_error;

2477: end if;
2478:
2479: if(wjsi_row.manual_rebuild_flag is null and
2480: wjsi_row.rebuild_item_id is not null) then
2481: raise fnd_api.g_exc_unexpected_error;
2482: end if;
2483: end if;
2484: exception
2485: when others then

Line 2504: raise fnd_api.g_exc_unexpected_error;

2500: and organization_id = wjsi_row.organization_id;
2501:
2502: if(l_disable_date is not null and
2503: l_disable_date < l_job_date) then
2504: raise fnd_api.g_exc_unexpected_error;
2505: end if;
2506: end if;
2507: exception
2508: when others then

Line 2516: raise fnd_api.g_exc_unexpected_error;

2512: procedure notification_required is begin
2513: if(wjsi_row.load_type in (wip_constants.create_eam_job, wip_constants.resched_eam_job) and
2514: wjsi_row.notification_required is not null and
2515: wjsi_row.notification_required not in ('Y', 'N')) then
2516: raise fnd_api.g_exc_unexpected_error;
2517: end if;
2518: exception
2519: when others then
2520: wip_jsi_utils.record_error('WIP_ML_EAM_NOTIF_REQ');

Line 2542: raise fnd_api.g_exc_unexpected_error;

2538: procedure tagout_required is begin
2539: if(wjsi_row.load_type in (wip_constants.create_eam_job, wip_constants.resched_eam_job) and
2540: wjsi_row.tagout_required is not null and
2541: wjsi_row.tagout_required not in ('Y', 'N')) then
2542: raise fnd_api.g_exc_unexpected_error;
2543: end if;
2544: exception
2545: when others then
2546: wip_jsi_utils.record_error('WIP_ML_EAM_TAGOUT_REQUIRED');

Line 2553: raise fnd_api.g_exc_unexpected_error;

2549: procedure plan_maintenance is begin
2550: if(wjsi_row.load_type = wip_constants.create_eam_job and
2551: wjsi_row.plan_maintenance is not null and
2552: wjsi_row.plan_maintenance not in ('Y', 'N')) then
2553: raise fnd_api.g_exc_unexpected_error;
2554: end if;
2555: exception
2556: when others then
2557: wip_jsi_utils.record_error('WIP_ML_EAM_PLAN_MAINTENANCE');

Line 2611: raise fnd_api.g_exc_unexpected_error;

2607: begin
2608: if(wjsi_row.load_type in (wip_constants.create_eam_job, wip_constants.resched_eam_job) and
2609: wjsi_row.maintenance_object_type is not null) then
2610: if(wjsi_row.rebuild_item_id is null and wjsi_row.maintenance_object_type <> 1) then
2611: raise fnd_api.g_exc_unexpected_error;
2612: elsif(wjsi_row.rebuild_item_id is not null) then
2613:
2614: select serial_number_control_code
2615: into l_serial_number_control_code

Line 2622: raise fnd_api.g_exc_unexpected_error;

2618: and inventory_item_id = wjsi_row.rebuild_item_id;
2619:
2620: if(l_serial_number_control_code in (2, 5, 6) and
2621: wjsi_row.maintenance_object_type not in (1, 3)) then
2622: raise fnd_api.g_exc_unexpected_error;
2623: elsif(l_serial_number_control_code not in (2, 5, 6) and
2624: wjsi_row.maintenance_object_type not in(2, 3)) then
2625: raise fnd_api.g_exc_unexpected_error;
2626: end if;

Line 2625: raise fnd_api.g_exc_unexpected_error;

2621: wjsi_row.maintenance_object_type not in (1, 3)) then
2622: raise fnd_api.g_exc_unexpected_error;
2623: elsif(l_serial_number_control_code not in (2, 5, 6) and
2624: wjsi_row.maintenance_object_type not in(2, 3)) then
2625: raise fnd_api.g_exc_unexpected_error;
2626: end if;
2627:
2628: end if;
2629: end if;

Line 2640: raise fnd_api.g_exc_unexpected_error;

2636: if(wjsi_row.load_type in (wip_constants.create_eam_job, wip_constants.resched_eam_job) and
2637: wjsi_row.maintenance_object_source is not null) then
2638: if(wjsi_row.rebuild_item_id is null and
2639: wjsi_row.maintenance_object_source <> 1) then
2640: raise fnd_api.g_exc_unexpected_error;
2641: else
2642: select 1
2643: into g_dummy
2644: from mfg_lookups

Line 2679: raise fnd_api.g_exc_unexpected_error;

2675: and gen_object_id = wjsi_row.maintenance_object_id;
2676: end if;
2677: elsif(wjsi_row.maintenance_object_type = 2 and
2678: wjsi_row.maintenance_object_id <> wjsi_row.rebuild_item_id) then
2679: raise fnd_api.g_exc_unexpected_error;
2680: end if;
2681:
2682: end if;
2683:

Line 2687: raise fnd_api.g_exc_unexpected_error;

2683:
2684: if(wjsi_row.load_type = wip_constants.create_eam_job and
2685: wjsi_row.maintenance_object_id is null and
2686: wjsi_row.maintenance_object_type = 3) then
2687: raise fnd_api.g_exc_unexpected_error;
2688: end if;
2689:
2690: exception
2691: when others then

Line 2699: raise fnd_api.g_exc_unexpected_error;

2695: procedure pm_schedule_id is begin
2696: if(wjsi_row.load_type in (wip_constants.create_eam_job, wip_constants.resched_eam_job) and
2697: wjsi_row.pm_schedule_id is not null and
2698: wjsi_row.primary_item_id is null) then
2699: raise fnd_api.g_exc_unexpected_error;
2700: end if;
2701: exception
2702: when others then
2703: wip_jsi_utils.record_error('WIP_ML_EAM_PM_SCHEDULE_ID');