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;
295: l_cmro_count NUMBER :=0; -- fix for bug 1166647
296:
297: BEGIN
298:
299: x_return_status := FND_API.G_RET_STS_SUCCESS;
300:
301: IF EAM_PROCESS_WO_PVT.GET_DEBUG = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Within WO Check Attributes . . . '); END IF;
302:
303:
348: end if;
349: end if;
350: -- End -- fix for bug 11666479 : do not allow dept change if resources exists for CMRO workorders
351: end if;
352: x_return_status := FND_API.G_RET_STS_SUCCESS;
353:
354: exception
355: WHEN OP_DEPT_NOT_UPDATEABLE THEN
356: l_token_tbl(1).token_name := 'DEPT_NAME';
369: , x_mesg_token_tbl => l_out_mesg_token_tbl
370: );
371: l_mesg_token_tbl := l_out_mesg_token_tbl;
372:
373: x_return_status := FND_API.G_RET_STS_ERROR;
374: x_mesg_token_tbl := l_mesg_token_tbl ;
375: return;
376:
377: when others then
392: , x_mesg_token_tbl => l_out_mesg_token_tbl
393: );
394: l_mesg_token_tbl := l_out_mesg_token_tbl;
395:
396: x_return_status := FND_API.G_RET_STS_ERROR;
397: x_mesg_token_tbl := l_mesg_token_tbl ;
398: return;
399:
400: end;
416: end if;
417:
418: end if;
419:
420: x_return_status := FND_API.G_RET_STS_SUCCESS;
421:
422: exception
423: when others then
424:
433: , x_mesg_token_tbl => l_out_mesg_token_tbl
434: );
435: l_mesg_token_tbl := l_out_mesg_token_tbl;
436:
437: x_return_status := FND_API.G_RET_STS_ERROR;
438: x_mesg_token_tbl := l_mesg_token_tbl ;
439: return;
440:
441: end;
447:
448: if (p_eam_op_rec.transaction_type in (EAM_PROCESS_WO_PVT.G_OPR_CREATE, EAM_PROCESS_WO_PVT.G_OPR_UPDATE)) then
449:
450: if p_eam_op_rec.minimum_transfer_quantity < 0 then
451: raise fnd_api.g_exc_unexpected_error;
452: end if;
453:
454: end if;
455:
452: end if;
453:
454: end if;
455:
456: x_return_status := FND_API.G_RET_STS_SUCCESS;
457:
458: exception
459: when others then
460:
469: , x_mesg_token_tbl => l_out_mesg_token_tbl
470: );
471: l_mesg_token_tbl := l_out_mesg_token_tbl;
472:
473: x_return_status := FND_API.G_RET_STS_ERROR;
474: x_mesg_token_tbl := l_mesg_token_tbl ;
475: return;
476:
477: end;
490: and lookup_code = p_eam_op_rec.count_point_type;
491:
492: end if;
493:
494: x_return_status := FND_API.G_RET_STS_SUCCESS;
495:
496: exception
497: when others then
498:
507: , x_mesg_token_tbl => l_out_mesg_token_tbl
508: );
509: l_mesg_token_tbl := l_out_mesg_token_tbl;
510:
511: x_return_status := FND_API.G_RET_STS_ERROR;
512: x_mesg_token_tbl := l_mesg_token_tbl ;
513: return;
514:
515: end;
528: and lookup_code = p_eam_op_rec.backflush_flag;
529:
530: end if;
531:
532: x_return_status := FND_API.G_RET_STS_SUCCESS;
533:
534: exception
535: when others then
536:
545: , x_mesg_token_tbl => l_out_mesg_token_tbl
546: );
547: l_mesg_token_tbl := l_out_mesg_token_tbl;
548:
549: x_return_status := FND_API.G_RET_STS_ERROR;
550: x_mesg_token_tbl := l_mesg_token_tbl ;
551: return;
552:
553: end;
570: end if;
571:
572: end if;
573:
574: x_return_status := FND_API.G_RET_STS_SUCCESS;
575:
576: exception
577: when others then
578:
587: , x_mesg_token_tbl => l_out_mesg_token_tbl
588: );
589: l_mesg_token_tbl := l_out_mesg_token_tbl;
590:
591: x_return_status := FND_API.G_RET_STS_ERROR;
592: x_mesg_token_tbl := l_mesg_token_tbl ;
593: return;
594:
595: end;
601:
602: if (p_eam_op_rec.transaction_type in (EAM_PROCESS_WO_PVT.G_OPR_CREATE, EAM_PROCESS_WO_PVT.G_OPR_UPDATE)) then
603:
604: if p_eam_op_rec.start_date > p_eam_op_rec.completion_date then
605: raise fnd_api.g_exc_unexpected_error;
606: end if;
607:
608: end if;
609:
606: end if;
607:
608: end if;
609:
610: x_return_status := FND_API.G_RET_STS_SUCCESS;
611:
612: exception
613: when others then
614:
623: , x_mesg_token_tbl => l_out_mesg_token_tbl
624: );
625: l_mesg_token_tbl := l_out_mesg_token_tbl;
626:
627: x_return_status := FND_API.G_RET_STS_ERROR;
628: x_mesg_token_tbl := l_mesg_token_tbl ;
629: return;
630:
631: end;
650: and organization_id = p_eam_op_rec.organization_id
651: and operation_seq_num = p_eam_op_rec.operation_seq_num;
652:
653: if(l_count_eoct > 0) then
654: raise fnd_api.g_exc_unexpected_error;
655: end if;
656:
657: select count(*)
658: into l_count_res
661: and organization_id = p_eam_op_rec.organization_id
662: and operation_seq_num = p_eam_op_rec.operation_seq_num;
663:
664: if(l_count_res > 0) then
665: raise fnd_api.g_exc_unexpected_error;
666: end if;
667:
668: select count(*)
669: into l_count_on
673: and ( prior_operation = p_eam_op_rec.operation_seq_num
674: or next_operation = p_eam_op_rec.operation_seq_num);
675:
676: if(l_count_on > 0) then
677: raise fnd_api.g_exc_unexpected_error;
678: end if;
679:
680:
681: select count(*)
685: and organization_id = p_eam_op_rec.organization_id
686: and operation_seq_num = p_eam_op_rec.operation_seq_num;
687:
688: if(l_count_mr <> 0) then
689: raise fnd_api.g_exc_unexpected_error;
690: end if;
691:
692: end if;
693:
690: end if;
691:
692: end if;
693:
694: x_return_status := FND_API.G_RET_STS_SUCCESS;
695:
696: exception
697: when others then
698:
707: , x_mesg_token_tbl => l_out_mesg_token_tbl
708: );
709: l_mesg_token_tbl := l_out_mesg_token_tbl;
710:
711: x_return_status := FND_API.G_RET_STS_ERROR;
712: x_mesg_token_tbl := l_mesg_token_tbl ;
713: return;
714:
715: end;
731: ) ;
732: l_mesg_token_tbl := l_out_mesg_token_tbl;
733:
734: -- Return the status and message table.
735: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
736: x_mesg_token_tbl := l_mesg_token_tbl ;
737:
738:
739: END Check_Attributes;
756: l_out_Mesg_Token_Tbl EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type;
757: l_Token_Tbl EAM_ERROR_MESSAGE_PVT.Token_Tbl_Type;
758: BEGIN
759:
760: x_return_status := FND_API.G_RET_STS_SUCCESS;
761:
762: IF p_eam_op_rec.wip_entity_id IS NULL
763: THEN
764: l_token_tbl(1).token_name := 'OPERATION_SEQ_NUM';
772: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
773: );
774: l_mesg_token_tbl := l_out_mesg_token_tbl;
775:
776: x_return_status := FND_API.G_RET_STS_ERROR;
777:
778: END IF;
779:
780: IF p_eam_op_rec.operation_seq_num IS NULL
791: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
792: );
793: l_mesg_token_tbl := l_out_mesg_token_tbl;
794:
795: x_return_status := FND_API.G_RET_STS_ERROR;
796:
797: END IF;
798:
799: IF p_eam_op_rec.organization_id IS NULL
809: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
810: );
811: l_mesg_token_tbl := l_out_mesg_token_tbl;
812:
813: x_return_status := FND_API.G_RET_STS_ERROR;
814:
815: END IF;
816:
817: IF p_eam_op_rec.department_id IS NULL
827: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
828: );
829: l_mesg_token_tbl := l_out_mesg_token_tbl;
830:
831: x_return_status := FND_API.G_RET_STS_ERROR;
832:
833: END IF;
834:
835: IF p_eam_op_rec.start_date IS NULL
845: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
846: );
847: l_mesg_token_tbl := l_out_mesg_token_tbl;
848:
849: x_return_status := FND_API.G_RET_STS_ERROR;
850:
851: END IF;
852:
853: IF p_eam_op_rec.completion_date IS NULL
863: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
864: );
865: l_mesg_token_tbl := l_out_mesg_token_tbl;
866:
867: x_return_status := FND_API.G_RET_STS_ERROR;
868:
869: END IF;
870:
871: IF p_eam_op_rec.count_point_type IS NULL
881: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
882: );
883: l_mesg_token_tbl := l_out_mesg_token_tbl;
884:
885: x_return_status := FND_API.G_RET_STS_ERROR;
886:
887: END IF;
888:
889: IF p_eam_op_rec.backflush_flag IS NULL
899: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
900: );
901: l_mesg_token_tbl := l_out_mesg_token_tbl;
902:
903: x_return_status := FND_API.G_RET_STS_ERROR;
904:
905: END IF;
906:
907: IF p_eam_op_rec.minimum_transfer_quantity IS NULL
917: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
918: );
919: l_mesg_token_tbl := l_out_mesg_token_tbl;
920:
921: x_return_status := FND_API.G_RET_STS_ERROR;
922:
923: END IF;
924:
925:
932:
933: PROCEDURE Check_Operation_Netwrok_Dates
934: (
935: p_api_version IN NUMBER,
936: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
937: p_commit IN VARCHAR2 := FND_API.G_FALSE,
938: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
939:
940: p_wip_entity_id IN NUMBER,
933: PROCEDURE Check_Operation_Netwrok_Dates
934: (
935: p_api_version IN NUMBER,
936: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
937: p_commit IN VARCHAR2 := FND_API.G_FALSE,
938: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
939:
940: p_wip_entity_id IN NUMBER,
941:
934: (
935: p_api_version IN NUMBER,
936: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
937: p_commit IN VARCHAR2 := FND_API.G_FALSE,
938: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
939:
940: p_wip_entity_id IN NUMBER,
941:
942: x_return_status OUT NOCOPY VARCHAR2,
958:
959: FOR l_opeation IN l_op_network (p_wip_entity_id)
960: LOOP
961: If l_opeation.last_unit_completion_date > l_opeation.first_unit_start_date THEN
962: x_return_status := FND_API.G_RET_STS_ERROR;
963: x_pri_operation_no := l_opeation.prior_operation;
964: x_next_operation_no := l_opeation.next_operation;
965: RETURN ;
966: End if;
965: RETURN ;
966: End if;
967: END LOOP;
968:
969: x_return_status := FND_API.G_RET_STS_SUCCESS;
970:
971: EXCEPTION
972: when others then
973: x_return_status := FND_API.G_RET_STS_ERROR;
969: x_return_status := FND_API.G_RET_STS_SUCCESS;
970:
971: EXCEPTION
972: when others then
973: x_return_status := FND_API.G_RET_STS_ERROR;
974: return;
975:
976: END Check_Operation_Netwrok_Dates;
977: