82: , p_token_tbl => l_token_tbl
83: );
84: l_mesg_token_tbl := l_out_mesg_token_tbl;
85:
86: l_return_status := FND_API.G_RET_STS_ERROR;
87:
88: ELSIF l_return_status = EAM_PROCESS_WO_PVT.G_RECORD_NOT_FOUND AND
89: p_eam_op_rec.transaction_type IN
90: (EAM_PROCESS_WO_PVT.G_OPR_UPDATE, EAM_PROCESS_WO_PVT.G_OPR_DELETE)
100: , p_token_tbl => l_token_tbl
101: );
102: l_mesg_token_tbl := l_out_mesg_token_tbl;
103:
104: l_return_status := FND_API.G_RET_STS_ERROR;
105:
106: ELSIF l_Return_status = FND_API.G_RET_STS_UNEXP_ERROR
107: THEN
108: l_out_mesg_token_tbl := l_mesg_token_tbl;
102: l_mesg_token_tbl := l_out_mesg_token_tbl;
103:
104: l_return_status := FND_API.G_RET_STS_ERROR;
105:
106: ELSIF l_Return_status = FND_API.G_RET_STS_UNEXP_ERROR
107: THEN
108: l_out_mesg_token_tbl := l_mesg_token_tbl;
109: EAM_ERROR_MESSAGE_PVT.Add_Error_Token
110: ( x_Mesg_token_tbl => l_out_Mesg_Token_Tbl
112: , p_message_name => NULL
113: , p_message_text => 'Unexpected error while existence verification of ' || 'Operation '|| p_eam_op_rec.operation_seq_num , p_token_tbl => l_token_tbl
114: );
115: l_mesg_token_tbl := l_out_mesg_token_tbl;
116: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
117:
118: ELSE /* Assign the relevant transaction type for SYNC operations */
119: IF p_eam_op_rec.transaction_type = EAM_PROCESS_WO_PVT.G_OPR_SYNC THEN
120: IF l_return_status = EAM_PROCESS_WO_PVT.G_RECORD_FOUND THEN
122: ELSE
123: x_old_eam_op_rec.transaction_type := EAM_PROCESS_WO_PVT.G_OPR_CREATE;
124: END IF;
125: END IF;
126: l_return_status := FND_API.G_RET_STS_SUCCESS;
127:
128: END IF;
129:
130: x_return_status := l_return_status;
292: OP_DEPT_NOT_UPDATEABLE EXCEPTION;
293:
294: BEGIN
295:
296: x_return_status := FND_API.G_RET_STS_SUCCESS;
297:
298: IF EAM_PROCESS_WO_PVT.GET_DEBUG = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Within WO Check Attributes . . . '); END IF;
299:
300:
321: raise OP_DEPT_NOT_UPDATEABLE;
322: end if; --end of check for update and is_dept_updateable
323: end if; --end of check for create/update transaction
324:
325: x_return_status := FND_API.G_RET_STS_SUCCESS;
326:
327: exception
328: WHEN OP_DEPT_NOT_UPDATEABLE THEN
329: l_token_tbl(1).token_name := 'DEPT_NAME';
342: , x_mesg_token_tbl => l_out_mesg_token_tbl
343: );
344: l_mesg_token_tbl := l_out_mesg_token_tbl;
345:
346: x_return_status := FND_API.G_RET_STS_ERROR;
347: x_mesg_token_tbl := l_mesg_token_tbl ;
348: return;
349:
350: when others then
365: , x_mesg_token_tbl => l_out_mesg_token_tbl
366: );
367: l_mesg_token_tbl := l_out_mesg_token_tbl;
368:
369: x_return_status := FND_API.G_RET_STS_ERROR;
370: x_mesg_token_tbl := l_mesg_token_tbl ;
371: return;
372:
373: end;
389: end if;
390:
391: end if;
392:
393: x_return_status := FND_API.G_RET_STS_SUCCESS;
394:
395: exception
396: when others then
397:
406: , x_mesg_token_tbl => l_out_mesg_token_tbl
407: );
408: l_mesg_token_tbl := l_out_mesg_token_tbl;
409:
410: x_return_status := FND_API.G_RET_STS_ERROR;
411: x_mesg_token_tbl := l_mesg_token_tbl ;
412: return;
413:
414: end;
420:
421: if (p_eam_op_rec.transaction_type in (EAM_PROCESS_WO_PVT.G_OPR_CREATE, EAM_PROCESS_WO_PVT.G_OPR_UPDATE)) then
422:
423: if p_eam_op_rec.minimum_transfer_quantity < 0 then
424: raise fnd_api.g_exc_unexpected_error;
425: end if;
426:
427: end if;
428:
425: end if;
426:
427: end if;
428:
429: x_return_status := FND_API.G_RET_STS_SUCCESS;
430:
431: exception
432: when others then
433:
442: , x_mesg_token_tbl => l_out_mesg_token_tbl
443: );
444: l_mesg_token_tbl := l_out_mesg_token_tbl;
445:
446: x_return_status := FND_API.G_RET_STS_ERROR;
447: x_mesg_token_tbl := l_mesg_token_tbl ;
448: return;
449:
450: end;
463: and lookup_code = p_eam_op_rec.count_point_type;
464:
465: end if;
466:
467: x_return_status := FND_API.G_RET_STS_SUCCESS;
468:
469: exception
470: when others then
471:
480: , x_mesg_token_tbl => l_out_mesg_token_tbl
481: );
482: l_mesg_token_tbl := l_out_mesg_token_tbl;
483:
484: x_return_status := FND_API.G_RET_STS_ERROR;
485: x_mesg_token_tbl := l_mesg_token_tbl ;
486: return;
487:
488: end;
501: and lookup_code = p_eam_op_rec.backflush_flag;
502:
503: end if;
504:
505: x_return_status := FND_API.G_RET_STS_SUCCESS;
506:
507: exception
508: when others then
509:
518: , x_mesg_token_tbl => l_out_mesg_token_tbl
519: );
520: l_mesg_token_tbl := l_out_mesg_token_tbl;
521:
522: x_return_status := FND_API.G_RET_STS_ERROR;
523: x_mesg_token_tbl := l_mesg_token_tbl ;
524: return;
525:
526: end;
543: end if;
544:
545: end if;
546:
547: x_return_status := FND_API.G_RET_STS_SUCCESS;
548:
549: exception
550: when others then
551:
560: , x_mesg_token_tbl => l_out_mesg_token_tbl
561: );
562: l_mesg_token_tbl := l_out_mesg_token_tbl;
563:
564: x_return_status := FND_API.G_RET_STS_ERROR;
565: x_mesg_token_tbl := l_mesg_token_tbl ;
566: return;
567:
568: end;
574:
575: if (p_eam_op_rec.transaction_type in (EAM_PROCESS_WO_PVT.G_OPR_CREATE, EAM_PROCESS_WO_PVT.G_OPR_UPDATE)) then
576:
577: if p_eam_op_rec.start_date > p_eam_op_rec.completion_date then
578: raise fnd_api.g_exc_unexpected_error;
579: end if;
580:
581: end if;
582:
579: end if;
580:
581: end if;
582:
583: x_return_status := FND_API.G_RET_STS_SUCCESS;
584:
585: exception
586: when others then
587:
596: , x_mesg_token_tbl => l_out_mesg_token_tbl
597: );
598: l_mesg_token_tbl := l_out_mesg_token_tbl;
599:
600: x_return_status := FND_API.G_RET_STS_ERROR;
601: x_mesg_token_tbl := l_mesg_token_tbl ;
602: return;
603:
604: end;
623: and organization_id = p_eam_op_rec.organization_id
624: and operation_seq_num = p_eam_op_rec.operation_seq_num;
625:
626: if(l_count_eoct > 0) then
627: raise fnd_api.g_exc_unexpected_error;
628: end if;
629:
630: select count(*)
631: into l_count_res
634: and organization_id = p_eam_op_rec.organization_id
635: and operation_seq_num = p_eam_op_rec.operation_seq_num;
636:
637: if(l_count_res > 0) then
638: raise fnd_api.g_exc_unexpected_error;
639: end if;
640:
641: select count(*)
642: into l_count_on
646: and ( prior_operation = p_eam_op_rec.operation_seq_num
647: or next_operation = p_eam_op_rec.operation_seq_num);
648:
649: if(l_count_on > 0) then
650: raise fnd_api.g_exc_unexpected_error;
651: end if;
652:
653:
654: select count(*)
658: and organization_id = p_eam_op_rec.organization_id
659: and operation_seq_num = p_eam_op_rec.operation_seq_num;
660:
661: if(l_count_mr <> 0) then
662: raise fnd_api.g_exc_unexpected_error;
663: end if;
664:
665: end if;
666:
663: end if;
664:
665: end if;
666:
667: x_return_status := FND_API.G_RET_STS_SUCCESS;
668:
669: exception
670: when others then
671:
680: , x_mesg_token_tbl => l_out_mesg_token_tbl
681: );
682: l_mesg_token_tbl := l_out_mesg_token_tbl;
683:
684: x_return_status := FND_API.G_RET_STS_ERROR;
685: x_mesg_token_tbl := l_mesg_token_tbl ;
686: return;
687:
688: end;
704: ) ;
705: l_mesg_token_tbl := l_out_mesg_token_tbl;
706:
707: -- Return the status and message table.
708: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
709: x_mesg_token_tbl := l_mesg_token_tbl ;
710:
711:
712: END Check_Attributes;
729: l_out_Mesg_Token_Tbl EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type;
730: l_Token_Tbl EAM_ERROR_MESSAGE_PVT.Token_Tbl_Type;
731: BEGIN
732:
733: x_return_status := FND_API.G_RET_STS_SUCCESS;
734:
735: IF p_eam_op_rec.wip_entity_id IS NULL
736: THEN
737: l_token_tbl(1).token_name := 'OPERATION_SEQ_NUM';
745: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
746: );
747: l_mesg_token_tbl := l_out_mesg_token_tbl;
748:
749: x_return_status := FND_API.G_RET_STS_ERROR;
750:
751: END IF;
752:
753: IF p_eam_op_rec.operation_seq_num IS NULL
764: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
765: );
766: l_mesg_token_tbl := l_out_mesg_token_tbl;
767:
768: x_return_status := FND_API.G_RET_STS_ERROR;
769:
770: END IF;
771:
772: IF p_eam_op_rec.organization_id IS NULL
782: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
783: );
784: l_mesg_token_tbl := l_out_mesg_token_tbl;
785:
786: x_return_status := FND_API.G_RET_STS_ERROR;
787:
788: END IF;
789:
790: IF p_eam_op_rec.department_id IS NULL
800: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
801: );
802: l_mesg_token_tbl := l_out_mesg_token_tbl;
803:
804: x_return_status := FND_API.G_RET_STS_ERROR;
805:
806: END IF;
807:
808: IF p_eam_op_rec.start_date IS NULL
818: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
819: );
820: l_mesg_token_tbl := l_out_mesg_token_tbl;
821:
822: x_return_status := FND_API.G_RET_STS_ERROR;
823:
824: END IF;
825:
826: IF p_eam_op_rec.completion_date IS NULL
836: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
837: );
838: l_mesg_token_tbl := l_out_mesg_token_tbl;
839:
840: x_return_status := FND_API.G_RET_STS_ERROR;
841:
842: END IF;
843:
844: IF p_eam_op_rec.count_point_type IS NULL
854: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
855: );
856: l_mesg_token_tbl := l_out_mesg_token_tbl;
857:
858: x_return_status := FND_API.G_RET_STS_ERROR;
859:
860: END IF;
861:
862: IF p_eam_op_rec.backflush_flag IS NULL
872: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
873: );
874: l_mesg_token_tbl := l_out_mesg_token_tbl;
875:
876: x_return_status := FND_API.G_RET_STS_ERROR;
877:
878: END IF;
879:
880: IF p_eam_op_rec.minimum_transfer_quantity IS NULL
890: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
891: );
892: l_mesg_token_tbl := l_out_mesg_token_tbl;
893:
894: x_return_status := FND_API.G_RET_STS_ERROR;
895:
896: END IF;
897:
898:
905:
906: PROCEDURE Check_Operation_Netwrok_Dates
907: (
908: p_api_version IN NUMBER,
909: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
910: p_commit IN VARCHAR2 := FND_API.G_FALSE,
911: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
912:
913: p_wip_entity_id IN NUMBER,
906: PROCEDURE Check_Operation_Netwrok_Dates
907: (
908: p_api_version IN NUMBER,
909: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
910: p_commit IN VARCHAR2 := FND_API.G_FALSE,
911: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
912:
913: p_wip_entity_id IN NUMBER,
914:
907: (
908: p_api_version IN NUMBER,
909: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
910: p_commit IN VARCHAR2 := FND_API.G_FALSE,
911: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
912:
913: p_wip_entity_id IN NUMBER,
914:
915: x_return_status OUT NOCOPY VARCHAR2,
931:
932: FOR l_opeation IN l_op_network (p_wip_entity_id)
933: LOOP
934: If l_opeation.last_unit_completion_date > l_opeation.first_unit_start_date THEN
935: x_return_status := FND_API.G_RET_STS_ERROR;
936: x_pri_operation_no := l_opeation.prior_operation;
937: x_next_operation_no := l_opeation.next_operation;
938: RETURN ;
939: End if;
938: RETURN ;
939: End if;
940: END LOOP;
941:
942: x_return_status := FND_API.G_RET_STS_SUCCESS;
943:
944: EXCEPTION
945: when others then
946: x_return_status := FND_API.G_RET_STS_ERROR;
942: x_return_status := FND_API.G_RET_STS_SUCCESS;
943:
944: EXCEPTION
945: when others then
946: x_return_status := FND_API.G_RET_STS_ERROR;
947: return;
948:
949: END Check_Operation_Netwrok_Dates;
950: