DBA Data[Home] [Help]

APPS.WIP_JSI_VALIDATOR dependencies on FND_API

Line 382: raise fnd_api.g_exc_unexpected_error;

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

Line 410: raise fnd_api.g_exc_unexpected_error;

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

Line 415: raise fnd_api.g_exc_unexpected_error;

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

Line 535: raise fnd_api.g_exc_unexpected_error;

531:
532: procedure load_type is begin
533: if(wjsi_row.load_type not in (wip_constants.create_job, wip_constants.create_sched, wip_constants.resched_job,
534: wip_constants.create_ns_job, wip_constants.create_eam_job, wip_constants.resched_eam_job)) then
535: raise fnd_api.g_exc_unexpected_error;
536: end if;
537: if((wjsi_row.load_type = wip_constants.resched_job and wdj_row.entity_type = wip_constants.eam) or
538: (wjsi_row.load_type = wip_constants.resched_eam_job and wdj_row.entity_type <> wip_constants.eam)) then
539: raise fnd_api.g_exc_unexpected_error;

Line 539: raise fnd_api.g_exc_unexpected_error;

535: raise fnd_api.g_exc_unexpected_error;
536: end if;
537: if((wjsi_row.load_type = wip_constants.resched_job and wdj_row.entity_type = wip_constants.eam) or
538: (wjsi_row.load_type = wip_constants.resched_eam_job and wdj_row.entity_type <> wip_constants.eam)) then
539: raise fnd_api.g_exc_unexpected_error;
540: end if;
541: exception
542: when others then
543: wip_jsi_utils.record_error('WIP_ML_LOAD_TYPE');

Line 570: raise fnd_api.g_exc_unexpected_error;

566: and wp.organization_id = ood.organization_id
567: and wp.organization_id = wjsi_row.organization_id;
568:
569: if(l_disable_date < sysdate) then
570: raise fnd_api.g_exc_unexpected_error;
571: end if;
572: exception
573: when others then
574: wip_jsi_utils.record_error('WIP_ML_ORGANIZATION_ID');

Line 589: raise fnd_api.g_exc_unexpected_error;

585: from wip_entities
586: where wip_entity_name = wjsi_row.job_name
587: and organization_id = wjsi_row.organization_id;
588: if(l_count > 0) then
589: raise fnd_api.g_exc_unexpected_error;
590: end if;
591: end if;
592: exception
593: when others then

Line 603: raise fnd_api.g_exc_unexpected_error;

599: begin
600: if (wjsi_row.load_type in (wip_constants.create_eam_job,
601: wip_constants.resched_eam_job) or
602: wdj_row.entity_type in (WIP_CONSTANTS.LOTBASED, WIP_CONSTANTS.EAM)) then
603: raise fnd_api.g_exc_unexpected_error;
604: end if;
605:
606: exception
607: when others then

Line 621: raise fnd_api.g_exc_unexpected_error;

617: into l_count
618: from wip_entities
619: where wip_entity_id = wjsi_row.wip_entity_id;
620: if(l_count > 0) then
621: raise fnd_api.g_exc_unexpected_error;
622: end if;
623: end if;
624: exception
625: when others then

Line 641: raise fnd_api.g_exc_unexpected_error;

637: return;
638: end if;
639:
640: if (wip_jsi_utils.validation_level <> wip_constants.inv) then
641: raise fnd_api.g_exc_unexpected_error;
642: end if ;
643:
644: l_msg := 'WIP_ML_KB_UPDATE_FAILED';
645: l_doc_header_id := wjsi_row.wip_entity_id ;

Line 651: raise fnd_api.g_exc_unexpected_error;

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

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

664: when others then
665: l_status := null ;
666: end ;
667:
668: if((l_status is null) or (l_status <> fnd_api.g_ret_sts_success)) then
669: raise fnd_api.g_exc_unexpected_error;
670: end if ;
671: exception
672: when others then

Line 669: raise fnd_api.g_exc_unexpected_error;

665: l_status := null ;
666: end ;
667:
668: if((l_status is null) or (l_status <> fnd_api.g_ret_sts_success)) then
669: raise fnd_api.g_exc_unexpected_error;
670: end if ;
671: exception
672: when others then
673: WIP_JSI_Utils.record_error(l_msg) ;

Line 707: raise fnd_api.g_exc_unexpected_error;

703: l_reservation_count NUMBER;
704: l_msg VARCHAR2(30) := 'WIP_ML_START_QUANTITY';
705: begin
706: if(wjsi_row.start_quantity < 0) then
707: raise fnd_api.g_exc_unexpected_error;
708: elsif(wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_ns_job) and
709: wjsi_row.start_quantity is null) then
710: raise fnd_api.g_exc_unexpected_error;
711: elsif(wjsi_row.load_type = wip_constants.create_job and wjsi_row.start_quantity = 0) then

Line 710: raise fnd_api.g_exc_unexpected_error;

706: if(wjsi_row.start_quantity < 0) then
707: raise fnd_api.g_exc_unexpected_error;
708: elsif(wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_ns_job) and
709: wjsi_row.start_quantity is null) then
710: raise fnd_api.g_exc_unexpected_error;
711: elsif(wjsi_row.load_type = wip_constants.create_job and wjsi_row.start_quantity = 0) then
712: raise fnd_api.g_exc_unexpected_error;
713: elsif(wjsi_row.load_type = wip_constants.resched_job) then
714: if(wjsi_row.start_quantity = 0 and wdj_row.job_type = wip_constants.standard) then

Line 712: raise fnd_api.g_exc_unexpected_error;

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

Line 715: raise fnd_api.g_exc_unexpected_error;

711: elsif(wjsi_row.load_type = wip_constants.create_job and wjsi_row.start_quantity = 0) then
712: raise fnd_api.g_exc_unexpected_error;
713: elsif(wjsi_row.load_type = wip_constants.resched_job) then
714: if(wjsi_row.start_quantity = 0 and wdj_row.job_type = wip_constants.standard) then
715: raise fnd_api.g_exc_unexpected_error;
716: elsif(wjsi_row.start_quantity < wdj_row.quantity_completed) then
717: l_msg := 'WIP_ML_RESCHEDULE_QUANTITY';
718: raise fnd_api.g_exc_unexpected_error;
719: else

Line 718: raise fnd_api.g_exc_unexpected_error;

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

Line 728: raise fnd_api.g_exc_unexpected_error;

724: and organization_id = wjsi_row.organization_id;
725: if(l_reservation_count > 0 and
726: wjsi_row.start_quantity < l_reserved_qty) then
727: l_msg := 'WIP_ML_RESCHEDULE_QUANTITY';
728: raise fnd_api.g_exc_unexpected_error;
729: end if;
730: end if;
731: end if;
732: exception

Line 742: raise fnd_api.g_exc_unexpected_error;

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

Line 749: raise fnd_api.g_exc_unexpected_error;

745: ((wjsi_row.load_type = wip_constants.create_ns_job and wjsi_row.primary_item_id is null) or
746: (wjsi_row.load_type = wip_constants.resched_job and
747: wdj_row.job_type = wip_constants.nonstandard and
748: wdj_row.primary_item_id is null))) then
749: raise fnd_api.g_exc_unexpected_error;
750: end if;
751: end if;
752: exception
753: when others then

Line 765: raise fnd_api.g_exc_unexpected_error;

761: (wjsi_row.firm_planned_flag = wip_constants.yes and
762: wdj_row.job_type = wip_constants.nonstandard and
763: wjsi_row.load_type in (wip_constants.resched_job, wip_constants.resched_eam_job)) or
764: (wjsi_row.firm_planned_flag not in (wip_constants.yes, wip_constants.no))) then
765: raise fnd_api.g_exc_unexpected_error;
766: end if;
767: exception
768: when others then
769: wip_jsi_utils.record_error('WIP_ML_FIRM_PLANNED_FLAG');

Line 777: raise fnd_api.g_exc_unexpected_error;

773: l_rep_sched_count NUMBER;
774: begin
775: if(wjsi_row.load_type = wip_constants.create_sched) then
776: if(wjsi_row.repetitive_schedule_id is null) then
777: raise fnd_api.g_exc_unexpected_error;
778: else
779: select count(*)
780: into l_rep_sched_count
781: from wip_repetitive_schedules

Line 785: raise fnd_api.g_exc_unexpected_error;

781: from wip_repetitive_schedules
782: where repetitive_schedule_id = wjsi_row.repetitive_schedule_id;
783:
784: if(l_rep_sched_count > 0) then
785: raise fnd_api.g_exc_unexpected_error;
786: end if;
787: end if;
788: end if;
789: exception

Line 810: raise fnd_api.g_exc_unexpected_error;

806: end demand_class;
807:
808: procedure line_id is begin
809: if(wjsi_row.load_type = wip_constants.create_sched and wjsi_row.line_id is null) then
810: raise fnd_api.g_exc_unexpected_error;
811: elsif(wjsi_row.line_id is not null) then
812: select 1
813: into g_dummy
814: from wip_lines_val_v

Line 848: raise fnd_api.g_exc_unexpected_error;

844: p_organization_id => wjsi_row.organization_id,
845: p_line_id => nvl(wjsi_row.line_id, wdj_row.line_id),
846: p_schedule_group_id => nvl(wjsi_row.schedule_group_id, wdj_row.schedule_group_id));
847: if(not l_retval) then
848: raise fnd_api.g_exc_unexpected_error;
849: end if;
850: end if;
851: exception
852: when others then

Line 876: raise fnd_api.g_exc_unexpected_error;

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

Line 891: raise fnd_api.g_exc_unexpected_error;

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

Line 906: raise fnd_api.g_exc_unexpected_error;

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

Line 935: raise fnd_api.g_exc_unexpected_error;

931: if ( l_qty_reserved > 0 and
932: wjsi_row.status_type in (wip_constants.cancelled,
933: wip_constants.comp_nochrg)) then
934: l_msg := 'WIP_CANT_CANCEL_SO';
935: raise fnd_api.g_exc_unexpected_error;
936: end if;
937:
938: if ( l_qty_reserved > 0 and
939: wjsi_row.status_type = wip_constants.comp_chrg) then

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

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

Line 1010: raise fnd_api.g_exc_unexpected_error;

1006: WIP_PICKING_PUB.Is_Job_Pick_Released(
1007: p_wip_entity_id => wjsi_row.wip_entity_id,
1008: p_org_id => wjsi_row.organization_id)) then
1009: l_msg := 'WIP_UNRLS_JOB/SCHED';
1010: raise fnd_api.g_exc_unexpected_error;
1011: end if;
1012: end if; -- JOB RESCHED : END
1013:
1014: exception

Line 1023: raise fnd_api.g_exc_unexpected_error;

1019:
1020: procedure processing_work_days is begin
1021: if(wjsi_row.load_type = wip_constants.create_sched and
1022: (wjsi_row.processing_work_days <= 0 or wjsi_row.processing_work_days is null)) then
1023: raise fnd_api.g_exc_unexpected_error;
1024: end if;
1025: exception
1026: when others then
1027: wip_jsi_utils.record_error('WIP_ML_PROCESSING_WORK_DAYS');

Line 1035: raise fnd_api.g_exc_unexpected_error;

1031: l_max_line_rate NUMBER;
1032: begin
1033: if(wjsi_row.load_type = wip_constants.create_sched) then
1034: if(wjsi_row.daily_production_rate <= 0 or wjsi_row.daily_production_rate is null) then
1035: raise fnd_api.g_exc_unexpected_error;
1036: end if;
1037:
1038: select daily_maximum_rate
1039: into l_max_line_rate

Line 1068: raise fnd_api.g_exc_unexpected_error;

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

Line 1074: raise fnd_api.g_exc_unexpected_error;

1070: if(primary_item_row.build_in_wip_flag <> 'Y' or
1071: primary_item_row.pick_components_flag <> 'N' or
1072: (l_see_eng_items_flag = wip_constants.no and primary_item_row.eng_item_flag = 'Y')) then
1073: l_msg := 'WIP_ML_PRIMARY_ITEM_ID';
1074: raise fnd_api.g_exc_unexpected_error;
1075: end if;
1076: if(wjsi_row.load_type = wip_constants.create_sched) then
1077: l_msg := 'WIP_ML_REPETITIVE_ITEM';
1078: select 1

Line 1120: raise fnd_api.g_exc_unexpected_error;

1116: wjsi_row.primary_item_id is not null) then
1117: l_msg := 'WIP_ML_EAM_ACTIVITY';
1118:
1119: if(primary_item_row.eam_item_type <> 2) then
1120: raise fnd_api.g_exc_unexpected_error;
1121: end if;
1122:
1123: if(wjsi_row.maintenance_object_type = 1) then
1124: if(wjsi_row.rebuild_item_id is null) then

Line 1164: raise fnd_api.g_exc_unexpected_error;

1160: end if;
1161:
1162: if(l_start_date is not null and
1163: l_start_date > nvl(wjsi_row.first_unit_start_date, wjsi_row.last_unit_completion_date)) then
1164: raise fnd_api.g_exc_unexpected_error;
1165: end if;
1166: if(l_end_date is not null and
1167: l_end_date < nvl(wjsi_row.last_unit_completion_date, wjsi_row.first_unit_start_date)) then
1168: raise fnd_api.g_exc_unexpected_error;

Line 1168: raise fnd_api.g_exc_unexpected_error;

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

Line 1186: raise fnd_api.g_exc_unexpected_error;

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

Line 1191: raise fnd_api.g_exc_unexpected_error;

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

Line 1202: raise fnd_api.g_exc_unexpected_error;

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

Line 1217: raise fnd_api.g_exc_unexpected_error;

1213: wjsi_row.routing_reference_id is not null and
1214: (routing_ref_row.build_in_wip_flag <> 'Y' or
1215: routing_ref_row.pick_components_flag <> 'N' or
1216: routing_ref_row.eng_item_flag <> 'N')) then
1217: raise fnd_api.g_exc_unexpected_error;
1218: end if;
1219: exception
1220: when others then
1221: wip_jsi_utils.record_error('WIP_ML_ROUTING_REFERENCE_ID');

Line 1265: raise fnd_api.g_exc_unexpected_error;

1261: l_rtg_item_id,
1262: wjsi_row.alternate_routing_designator);
1263: if(l_is_flow_rtg = wip_constants.yes) then
1264: l_msg := 'WIP_ERROR_CHOSEN_RTG_IS_CFM';
1265: raise fnd_api.g_exc_unexpected_error;
1266: end if;
1267: l_msg := 'WIP_ML_ALTERNATE_ROUTING';
1268: select 1
1269: into g_dummy

Line 1344: raise fnd_api.g_exc_unexpected_error;

1340: end if;
1341:
1342: if (PJM_PROJECT.val_task_idtonum(l_project_id, wjsi_row.task_id) is null)
1343: then
1344: raise fnd_api.g_exc_unexpected_error;
1345: end if;
1346:
1347: end if;
1348: exception

Line 1370: raise fnd_api.g_exc_unexpected_error;

1366: x_error_code => l_errcode
1367: );
1368:
1369: if ( l_result <> PJM_PROJECT.G_VALIDATE_SUCCESS ) then
1370: raise fnd_api.g_exc_unexpected_error;
1371: end if;
1372: end if;
1373: exception
1374: when others then

Line 1403: raise fnd_api.g_exc_unexpected_error;

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

Line 1411: raise fnd_api.g_exc_unexpected_error;

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

Line 1416: raise fnd_api.g_exc_unexpected_error;

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

Line 1422: raise fnd_api.g_exc_unexpected_error;

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

Line 1428: raise fnd_api.g_exc_unexpected_error;

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

Line 1469: raise fnd_api.g_exc_unexpected_error;

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

Line 1482: raise fnd_api.g_exc_unexpected_error;

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

Line 1496: raise fnd_api.g_exc_unexpected_error;

1492: and bor.organization_id = wri.organization_id
1493: and bor.assembly_item_id = wri.primary_item_id;
1494: if(l_rtg_count > 0) then
1495: --the line can not have a routing
1496: raise fnd_api.g_exc_unexpected_error;
1497: end if;
1498: end if;
1499:
1500: select count(*)

Line 1524: raise fnd_api.g_exc_unexpected_error;

1520: if(not (l_date_count = 2 and
1521: ((wjsi_row.first_unit_start_date is not null and wjsi_row.first_unit_completion_date is not null) or
1522: (wjsi_row.last_unit_start_date is not null and wjsi_row.last_unit_completion_date is not null)))) then
1523: if(l_rtg_count = 0 and l_line_count > 0) then
1524: raise fnd_api.g_exc_unexpected_error;
1525: end if;
1526: end if;
1527:
1528: if(l_line_count > 0 and l_rtg_count = 0) then

Line 1656: raise fnd_api.g_exc_unexpected_error;

1652: begin
1653: if(wjsi_row.load_type <> wip_constants.create_sched) then
1654: if(wjsi_row.scheduling_method not in (wip_constants.routing, wip_constants.leadtime,
1655: wip_constants.ml_manual)) then
1656: raise fnd_api.g_exc_unexpected_error;
1657: end if;
1658: if(wjsi_row.scheduling_method = wip_constants.leadtime and
1659: ((wjsi_row.load_type = wip_constants.create_ns_job and wjsi_row.routing_reference_id is null) or
1660: (wjsi_row.load_type = wip_constants.resched_job and

Line 1664: raise fnd_api.g_exc_unexpected_error;

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

Line 1668: raise fnd_api.g_exc_unexpected_error;

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

Line 1676: raise fnd_api.g_exc_unexpected_error;

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

Line 1695: raise fnd_api.g_exc_unexpected_error;

1691: begin
1692: if(wjsi_row.load_type = wip_constants.create_ns_job and
1693: wjsi_row.primary_item_id is null and
1694: wjsi_row.completion_subinventory is not null) then
1695: raise fnd_api.g_exc_unexpected_error;
1696: end if;
1697:
1698: if(wjsi_row.load_type = wip_constants.create_eam_job and
1699: wjsi_row.rebuild_item_id is not null) then

Line 1775: raise fnd_api.g_exc_unexpected_error;

1771: (wjsi_row.load_type = wip_constants.create_eam_job and wjsi_row.rebuild_item_id is not null)) and
1772: wjsi_row.completion_subinventory is null) then
1773: if(wjsi_row.completion_locator_id is not null) then
1774: l_msg := 'WIP_ML_COMPLETION_LOCATOR';
1775: raise fnd_api.g_exc_unexpected_error;
1776: else
1777: return;
1778: end if;
1779: end if;

Line 1848: raise fnd_api.g_exc_unexpected_error;

1844: 'SPECIFIC', -- validation mode
1845: 'Y', -- required?
1846: wjsi_row.project_id,
1847: wjsi_row.task_id)) then
1848: raise fnd_api.g_exc_unexpected_error;
1849: end if;
1850: end if;
1851: end if;
1852: end if;

Line 1879: raise fnd_api.g_exc_unexpected_error;

1875: p_locator_id => wjsi_row.completion_locator_id,
1876: p_locator_segments => wjsi_row.completion_locator_segments,
1877: p_success_flag => l_success);
1878: if(not l_success) then
1879: raise fnd_api.g_exc_unexpected_error;
1880: end if;
1881: end if;
1882: exception when others then
1883: wip_jsi_utils.record_error(l_msg);

Line 1891: raise fnd_api.g_exc_unexpected_error;

1887:
1888: procedure due_date is begin
1889: if(wjsi_row.load_type = wip_constants.create_eam_job) then
1890: if(wjsi_row.due_date is not null and wjsi_row.pm_schedule_id is null) then
1891: raise fnd_api.g_exc_unexpected_error;
1892: end if;
1893: elsif(wjsi_row.due_date is not null and wjsi_row.load_type = wip_constants.resched_eam_job) then
1894: if(wdj_row.status_type <> wip_constants.draft) then
1895: raise fnd_api.g_exc_unexpected_error;

Line 1895: raise fnd_api.g_exc_unexpected_error;

1891: raise fnd_api.g_exc_unexpected_error;
1892: end if;
1893: elsif(wjsi_row.due_date is not null and wjsi_row.load_type = wip_constants.resched_eam_job) then
1894: if(wdj_row.status_type <> wip_constants.draft) then
1895: raise fnd_api.g_exc_unexpected_error;
1896: end if;
1897: end if;
1898: exception
1899: when others then

Line 1907: raise fnd_api.g_exc_unexpected_error;

1903:
1904: procedure date_released is begin
1905: if(wjsi_row.date_released > sysdate and
1906: wjsi_row.status_type = wip_constants.released) then
1907: raise fnd_api.g_exc_unexpected_error;
1908: end if;
1909: exception when others then
1910: wip_jsi_utils.record_error('WIP_ML_INVALID_RELEASE_DATE');
1911: wip_jsi_utils.abort_request;

Line 1917: raise fnd_api.g_exc_unexpected_error;

1913:
1914: procedure requested_start_date is begin
1915: if(wjsi_row.load_type = wip_constants.create_eam_job) then
1916: if(wjsi_row.requested_start_date is not null and wjsi_row.pm_schedule_id is null) then
1917: raise fnd_api.g_exc_unexpected_error;
1918: end if;
1919: elsif(wjsi_row.load_type = wip_constants.resched_eam_job) then
1920: if(wjsi_row.requested_start_date is not null and wdj_row.status_type <> wip_constants.draft) then
1921: raise fnd_api.g_exc_unexpected_error;

Line 1921: raise fnd_api.g_exc_unexpected_error;

1917: raise fnd_api.g_exc_unexpected_error;
1918: end if;
1919: elsif(wjsi_row.load_type = wip_constants.resched_eam_job) then
1920: if(wjsi_row.requested_start_date is not null and wdj_row.status_type <> wip_constants.draft) then
1921: raise fnd_api.g_exc_unexpected_error;
1922: end if;
1923: end if;
1924: exception
1925: when others then

Line 1971: raise fnd_api.g_exc_unexpected_error;

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

Line 1986: raise fnd_api.g_exc_unexpected_error;

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

Line 2017: raise fnd_api.g_exc_unexpected_error;

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

Line 2029: raise fnd_api.g_exc_unexpected_error;

2025: exception
2026: when others then
2027: FND_Message.set_name('WIP', 'WIP_ML_PRIMARY_ITEM_ID') ;
2028: WIP_JSI_Utils.record_current_error ;
2029: raise fnd_api.g_exc_unexpected_error;
2030: end ;
2031: end if;
2032:
2033: -- if status is not unreleased, end_item_unit_number is ignored.

Line 2051: raise fnd_api.g_exc_unexpected_error;

2047: exception
2048: when others then
2049: FND_Message.set_name('PJM', 'UEFF-UNIT NUMBER INVALID') ;
2050: WIP_JSI_Utils.record_current_error ;
2051: raise fnd_api.g_exc_unexpected_error;
2052: end ;
2053: end if;
2054: end if ;
2055:

Line 2072: raise fnd_api.g_exc_unexpected_error;

2068: (wjsi_row.load_type = wip_constants.create_ns_job and wjsi_row.primary_item_id is not null)) then
2069: if(l_tol_value is not null and l_tol_type is not null) then
2070: if(l_tol_type not in (wip_constants.percent, wip_constants.amount)) then
2071: l_msg:= 'WIP_ML_COMP_TOLERANCE_TYPE';
2072: raise fnd_api.g_exc_unexpected_error;
2073: end if;
2074: if(l_tol_value < 0) then
2075: l_msg := 'WIP_ML_COMP_TOLERANCE_NEGATIVE';
2076: raise fnd_api.g_exc_unexpected_error;

Line 2076: raise fnd_api.g_exc_unexpected_error;

2072: raise fnd_api.g_exc_unexpected_error;
2073: end if;
2074: if(l_tol_value < 0) then
2075: l_msg := 'WIP_ML_COMP_TOLERANCE_NEGATIVE';
2076: raise fnd_api.g_exc_unexpected_error;
2077: end if;
2078: elsif(l_tol_value is not null or l_tol_type is not null) then
2079: l_msg := 'WIP_ML_COMP_TOLERANCE_NULL';--only one overcompletion column was provided
2080: raise fnd_api.g_exc_unexpected_error;

Line 2080: raise fnd_api.g_exc_unexpected_error;

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

Line 2091: raise fnd_api.g_exc_unexpected_error;

2087:
2088: procedure class_code is begin
2089: if(wjsi_row.load_type in (wip_constants.create_job, wip_constants.create_ns_job, wip_constants.create_eam_job) and
2090: wjsi_row.class_code is null) then
2091: raise fnd_api.g_exc_unexpected_error;
2092: end if;
2093: if(wjsi_row.load_type = wip_constants.create_job) then
2094: if(wjsi_row.project_id is null) then
2095: select 1

Line 2196: raise fnd_api.g_exc_unexpected_error;

2192: x_sched_dir => l_sched_dir,
2193: x_est_date => wjsi_row.first_unit_start_date);
2194: if(wjsi_row.first_unit_start_date is null) then
2195: l_msg := 'WIP_ML_EST_LEADTIME';
2196: raise fnd_api.g_exc_unexpected_error;
2197: end if;
2198: end if;
2199: else
2200: if(wjsi_row.load_type = wip_constants.create_ns_job and wjsi_row.routing_reference_id is not null) then

Line 2254: raise fnd_api.g_exc_unexpected_error;

2250: x_sched_dir => wip_constants.lucd,
2251: x_est_date => wjsi_row.first_unit_start_date);
2252: if(wjsi_row.first_unit_start_date is null) then
2253: l_msg := 'WIP_ML_EST_LEADTIME';
2254: raise fnd_api.g_exc_unexpected_error;
2255: end if;
2256: elsif(wjsi_row.last_unit_completion_date is null and
2257: wjsi_row.first_unit_start_date is not null and
2258: wjsi_row.scheduling_method = wip_constants.leadtime) then

Line 2274: raise fnd_api.g_exc_unexpected_error;

2270: x_sched_dir => wip_constants.fusd,
2271: x_est_date => wjsi_row.last_unit_completion_date);
2272: if(wjsi_row.last_unit_completion_date is null) then
2273: l_msg := 'WIP_NO_CALENDAR';
2274: raise fnd_api.g_exc_unexpected_error;
2275: end if;
2276: end if;
2277: end if;
2278: exception

Line 2355: raise fnd_api.g_exc_unexpected_error;

2351: where inventory_item_id = wjsi_row.asset_group_id
2352: and organization_id = wjsi_row.organization_id
2353: and eam_item_type = 1; -- asset group
2354: elsif(wjsi_row.rebuild_item_id is null) then
2355: raise fnd_api.g_exc_unexpected_error;
2356: end if;
2357: end if;
2358: exception
2359: when others then

Line 2374: raise fnd_api.g_exc_unexpected_error;

2370: -- Per EAM Enh. for H, this field is no longer mandatory
2371:
2372: if(wjsi_row.asset_group_id is null and
2373: wjsi_row.asset_number is not null) then
2374: raise fnd_api.g_exc_unexpected_error;
2375: end if;
2376:
2377: if(wjsi_row.asset_group_id is not null) then
2378: select 1

Line 2413: raise fnd_api.g_exc_unexpected_error;

2409: if(wjsi_row.load_type = wip_constants.create_eam_job) then
2410:
2411: if(wjsi_row.rebuild_item_id is null and
2412: wjsi_row.rebuild_serial_number is not null) then
2413: raise fnd_api.g_exc_unexpected_error;
2414: end if;
2415:
2416: if(wjsi_row.rebuild_item_id is not null) then
2417: if(wjsi_row.rebuild_serial_number is null) then

Line 2421: raise fnd_api.g_exc_unexpected_error;

2417: if(wjsi_row.rebuild_serial_number is null) then
2418: if(wjsi_row.maintenance_object_source = 1 and
2419: wjsi_row.maintenance_object_type = 1) then
2420: if(wjsi_row.status_type not in (wip_constants.draft, wip_constants.unreleased)) then
2421: raise fnd_api.g_exc_unexpected_error;
2422: end if;
2423: elsif(wjsi_row.maintenance_object_type not in (2, 3)) then
2424: raise fnd_api.g_exc_unexpected_error;
2425: end if;

Line 2424: raise fnd_api.g_exc_unexpected_error;

2420: if(wjsi_row.status_type not in (wip_constants.draft, wip_constants.unreleased)) then
2421: raise fnd_api.g_exc_unexpected_error;
2422: end if;
2423: elsif(wjsi_row.maintenance_object_type not in (2, 3)) then
2424: raise fnd_api.g_exc_unexpected_error;
2425: end if;
2426: else
2427: if(wjsi_row.maintenance_object_type = 1) then
2428: select 1

Line 2471: raise fnd_api.g_exc_unexpected_error;

2467: if(wjsi_row.load_type = wip_constants.create_eam_job) then
2468: if(wjsi_row.manual_rebuild_flag is not null and
2469: (wjsi_row.rebuild_item_id is null or
2470: wjsi_row.manual_rebuild_flag not in ('Y', 'N'))) then
2471: raise fnd_api.g_exc_unexpected_error;
2472: end if;
2473:
2474: if(wjsi_row.manual_rebuild_flag is null and
2475: wjsi_row.rebuild_item_id is not null) then

Line 2476: raise fnd_api.g_exc_unexpected_error;

2472: end if;
2473:
2474: if(wjsi_row.manual_rebuild_flag is null and
2475: wjsi_row.rebuild_item_id is not null) then
2476: raise fnd_api.g_exc_unexpected_error;
2477: end if;
2478: end if;
2479: exception
2480: when others then

Line 2499: raise fnd_api.g_exc_unexpected_error;

2495: and organization_id = wjsi_row.organization_id;
2496:
2497: if(l_disable_date is not null and
2498: l_disable_date < l_job_date) then
2499: raise fnd_api.g_exc_unexpected_error;
2500: end if;
2501: end if;
2502: exception
2503: when others then

Line 2511: raise fnd_api.g_exc_unexpected_error;

2507: procedure notification_required is begin
2508: if(wjsi_row.load_type in (wip_constants.create_eam_job, wip_constants.resched_eam_job) and
2509: wjsi_row.notification_required is not null and
2510: wjsi_row.notification_required not in ('Y', 'N')) then
2511: raise fnd_api.g_exc_unexpected_error;
2512: end if;
2513: exception
2514: when others then
2515: wip_jsi_utils.record_error('WIP_ML_EAM_NOTIF_REQ');

Line 2537: raise fnd_api.g_exc_unexpected_error;

2533: procedure tagout_required is begin
2534: if(wjsi_row.load_type in (wip_constants.create_eam_job, wip_constants.resched_eam_job) and
2535: wjsi_row.tagout_required is not null and
2536: wjsi_row.tagout_required not in ('Y', 'N')) then
2537: raise fnd_api.g_exc_unexpected_error;
2538: end if;
2539: exception
2540: when others then
2541: wip_jsi_utils.record_error('WIP_ML_EAM_TAGOUT_REQUIRED');

Line 2548: raise fnd_api.g_exc_unexpected_error;

2544: procedure plan_maintenance is begin
2545: if(wjsi_row.load_type = wip_constants.create_eam_job and
2546: wjsi_row.plan_maintenance is not null and
2547: wjsi_row.plan_maintenance not in ('Y', 'N')) then
2548: raise fnd_api.g_exc_unexpected_error;
2549: end if;
2550: exception
2551: when others then
2552: wip_jsi_utils.record_error('WIP_ML_EAM_PLAN_MAINTENANCE');

Line 2606: raise fnd_api.g_exc_unexpected_error;

2602: begin
2603: if(wjsi_row.load_type in (wip_constants.create_eam_job, wip_constants.resched_eam_job) and
2604: wjsi_row.maintenance_object_type is not null) then
2605: if(wjsi_row.rebuild_item_id is null and wjsi_row.maintenance_object_type <> 1) then
2606: raise fnd_api.g_exc_unexpected_error;
2607: elsif(wjsi_row.rebuild_item_id is not null) then
2608:
2609: select serial_number_control_code
2610: into l_serial_number_control_code

Line 2617: raise fnd_api.g_exc_unexpected_error;

2613: and inventory_item_id = wjsi_row.rebuild_item_id;
2614:
2615: if(l_serial_number_control_code in (2, 5, 6) and
2616: wjsi_row.maintenance_object_type not in (1, 3)) then
2617: raise fnd_api.g_exc_unexpected_error;
2618: elsif(l_serial_number_control_code not in (2, 5, 6) and
2619: wjsi_row.maintenance_object_type not in(2, 3)) then
2620: raise fnd_api.g_exc_unexpected_error;
2621: end if;

Line 2620: raise fnd_api.g_exc_unexpected_error;

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

Line 2635: raise fnd_api.g_exc_unexpected_error;

2631: if(wjsi_row.load_type in (wip_constants.create_eam_job, wip_constants.resched_eam_job) and
2632: wjsi_row.maintenance_object_source is not null) then
2633: if(wjsi_row.rebuild_item_id is null and
2634: wjsi_row.maintenance_object_source <> 1) then
2635: raise fnd_api.g_exc_unexpected_error;
2636: else
2637: select 1
2638: into g_dummy
2639: from mfg_lookups

Line 2674: raise fnd_api.g_exc_unexpected_error;

2670: and gen_object_id = wjsi_row.maintenance_object_id;
2671: end if;
2672: elsif(wjsi_row.maintenance_object_type = 2 and
2673: wjsi_row.maintenance_object_id <> wjsi_row.rebuild_item_id) then
2674: raise fnd_api.g_exc_unexpected_error;
2675: end if;
2676:
2677: end if;
2678:

Line 2682: raise fnd_api.g_exc_unexpected_error;

2678:
2679: if(wjsi_row.load_type = wip_constants.create_eam_job and
2680: wjsi_row.maintenance_object_id is null and
2681: wjsi_row.maintenance_object_type = 3) then
2682: raise fnd_api.g_exc_unexpected_error;
2683: end if;
2684:
2685: exception
2686: when others then

Line 2694: raise fnd_api.g_exc_unexpected_error;

2690: procedure pm_schedule_id is begin
2691: if(wjsi_row.load_type in (wip_constants.create_eam_job, wip_constants.resched_eam_job) and
2692: wjsi_row.pm_schedule_id is not null and
2693: wjsi_row.primary_item_id is null) then
2694: raise fnd_api.g_exc_unexpected_error;
2695: end if;
2696: exception
2697: when others then
2698: wip_jsi_utils.record_error('WIP_ML_EAM_PM_SCHEDULE_ID');