83: , p_token_tbl => l_token_tbl
84: );
85: l_mesg_token_tbl := l_out_mesg_token_tbl;
86:
87: l_return_status := FND_API.G_RET_STS_ERROR;
88:
89: ELSIF l_return_status = EAM_PROCESS_WO_PVT.G_RECORD_NOT_FOUND AND
90: p_eam_direct_items_rec.transaction_type IN
91: (EAM_PROCESS_WO_PVT.G_OPR_UPDATE, EAM_PROCESS_WO_PVT.G_OPR_DELETE)
101: , p_token_tbl => l_token_tbl
102: );
103: l_mesg_token_tbl := l_out_mesg_token_tbl;
104:
105: l_return_status := FND_API.G_RET_STS_ERROR;
106:
107: ELSIF l_Return_status = FND_API.G_RET_STS_UNEXP_ERROR
108: THEN
109: l_out_mesg_token_tbl := l_mesg_token_tbl;
103: l_mesg_token_tbl := l_out_mesg_token_tbl;
104:
105: l_return_status := FND_API.G_RET_STS_ERROR;
106:
107: ELSIF l_Return_status = FND_API.G_RET_STS_UNEXP_ERROR
108: THEN
109: l_out_mesg_token_tbl := l_mesg_token_tbl;
110: EAM_ERROR_MESSAGE_PVT.Add_Error_Token
111: ( x_Mesg_token_tbl => l_out_Mesg_Token_Tbl
113: , p_message_name => NULL
114: , p_message_text => 'Unexpected error while existence verification of ' || 'Direct Item '|| p_eam_direct_items_rec.direct_item_sequence_id , p_token_tbl => l_token_tbl
115: );
116: l_mesg_token_tbl := l_out_mesg_token_tbl;
117: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
118:
119: ELSE /* Assign the relevant transaction type for SYNC operations */
120: IF p_eam_direct_items_rec.transaction_type = EAM_PROCESS_WO_PVT.G_OPR_SYNC THEN
121: IF l_return_status = EAM_PROCESS_WO_PVT.G_RECORD_FOUND THEN
123: ELSE
124: x_old_eam_direct_items_rec.transaction_type := EAM_PROCESS_WO_PVT.G_OPR_CREATE;
125: END IF;
126: END IF;
127: l_return_status := FND_API.G_RET_STS_SUCCESS;
128:
129: END IF;
130:
131: x_return_status := l_return_status;
159: l_ordered_quantity NUMBER;
160:
161: BEGIN
162:
163: x_return_status := FND_API.G_RET_STS_SUCCESS;
164:
165: IF EAM_PROCESS_WO_PVT.GET_DEBUG = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Within Direct Item Check Attributes . . . '); END IF;
166:
167:
175: if (p_eam_direct_items_rec.operation_seq_num = 1 and
176: p_eam_direct_items_rec.department_id is not null) OR
177: (p_eam_direct_items_rec.operation_seq_num <> 1 and
178: p_eam_direct_items_rec.department_id is null) then
179: raise fnd_api.g_exc_error;
180: end if;
181:
182: if p_eam_direct_items_rec.operation_seq_num <> 1 then
183:
196: end if;
197:
198: end if;
199:
200: x_return_status := FND_API.G_RET_STS_SUCCESS;
201:
202: exception
203: when others then
204:
213: , x_mesg_token_tbl => l_out_mesg_token_tbl
214: );
215: l_mesg_token_tbl := l_out_mesg_token_tbl;
216:
217: x_return_status := FND_API.G_RET_STS_ERROR;
218: x_mesg_token_tbl := l_mesg_token_tbl ;
219: return;
220:
221: end;
354: end if;
355:
356: end if;
357:
358: x_return_status := FND_API.G_RET_STS_SUCCESS;
359:
360: exception
361: when others then
362:
371: , x_mesg_token_tbl => l_out_mesg_token_tbl
372: );
373: l_mesg_token_tbl := l_out_mesg_token_tbl;
374:
375: x_return_status := FND_API.G_RET_STS_ERROR;
376: x_mesg_token_tbl := l_mesg_token_tbl ;
377: return;
378:
379: end;
399:
400:
401: end if;
402:
403: x_return_status := FND_API.G_RET_STS_SUCCESS;
404:
405: exception
406: when others then
407:
416: , x_mesg_token_tbl => l_out_mesg_token_tbl
417: );
418: l_mesg_token_tbl := l_out_mesg_token_tbl;
419:
420: x_return_status := FND_API.G_RET_STS_ERROR;
421: x_mesg_token_tbl := l_mesg_token_tbl ;
422: return;
423:
424: end;
430:
431: if (p_eam_direct_items_rec.transaction_type in (EAM_PROCESS_WO_PVT.G_OPR_CREATE, EAM_PROCESS_WO_PVT.G_OPR_UPDATE)) then
432:
433: if p_eam_direct_items_rec.quantity_per_assembly < 0 then
434: raise fnd_api.g_exc_unexpected_error;
435: end if;
436:
437: end if;
438:
435: end if;
436:
437: end if;
438:
439: x_return_status := FND_API.G_RET_STS_SUCCESS;
440:
441: exception
442: when others then
443:
452: , x_mesg_token_tbl => l_out_mesg_token_tbl
453: );
454: l_mesg_token_tbl := l_out_mesg_token_tbl;
455:
456: x_return_status := FND_API.G_RET_STS_ERROR;
457: x_mesg_token_tbl := l_mesg_token_tbl ;
458: return;
459:
460: end;
470:
471: if(p_eam_direct_items_rec.wip_supply_type is not null and p_eam_direct_items_rec.wip_supply_type not in (wip_constants.push, wip_constants.bulk, wip_constants.based_on_bom)) then
472: --not a valid supply type
473:
474: raise fnd_api.g_exc_unexpected_error;
475:
476: end if;
477:
478: end if;
476: end if;
477:
478: end if;
479:
480: x_return_status := FND_API.G_RET_STS_SUCCESS;
481:
482: exception
483: when others then
484:
493: , x_mesg_token_tbl => l_out_mesg_token_tbl
494: );
495: l_mesg_token_tbl := l_out_mesg_token_tbl;
496:
497: x_return_status := FND_API.G_RET_STS_ERROR;
498: x_mesg_token_tbl := l_mesg_token_tbl ;
499: return;
500:
501: end;
508:
509: if (p_eam_direct_items_rec.transaction_type in (EAM_PROCESS_WO_PVT.G_OPR_CREATE, EAM_PROCESS_WO_PVT.G_OPR_UPDATE)) then
510:
511: if p_eam_direct_items_rec.mrp_net_flag not in (wip_constants.yes, wip_constants.no) then
512: raise fnd_api.g_exc_unexpected_error;
513: end if;
514:
515: end if;
516:
513: end if;
514:
515: end if;
516:
517: x_return_status := FND_API.G_RET_STS_SUCCESS;
518:
519: exception
520: when others then
521:
530: , x_mesg_token_tbl => l_out_mesg_token_tbl
531: );
532: l_mesg_token_tbl := l_out_mesg_token_tbl;
533:
534: x_return_status := FND_API.G_RET_STS_ERROR;
535: x_mesg_token_tbl := l_mesg_token_tbl ;
536: return;
537:
538: end;
558: and operation_seq_num = p_eam_direct_items_rec.operation_seq_num
559: and direct_item_sequence_id = p_eam_direct_items_rec.direct_item_sequence_id;
560:
561: if(l_count_mmtt > 0) then
562: raise fnd_api.g_exc_unexpected_error;
563: end if;
564:
565: select count(*)
566: into l_count_mmt
570: and operation_seq_num = p_eam_direct_items_rec.operation_seq_num
571: and direct_item_sequence_id = p_eam_direct_items_rec.direct_item_sequence_id;
572:
573: if(l_count_mmt > 0) then
574: raise fnd_api.g_exc_unexpected_error;
575: end if;
576:
577: select quantity_issued
578: into l_issued_qty
582: and operation_seq_num = p_eam_direct_items_rec.operation_seq_num
583: and direct_item_sequence_id = p_eam_direct_items_rec.direct_item_sequence_id;
584:
585: if(l_issued_qty <> 0) then
586: raise fnd_api.g_exc_unexpected_error;
587: end if;
588:
589: end if;
590:
587: end if;
588:
589: end if;
590:
591: x_return_status := FND_API.G_RET_STS_SUCCESS;
592:
593: exception
594: when others then
595:
604: , x_mesg_token_tbl => l_out_mesg_token_tbl
605: );
606: l_mesg_token_tbl := l_out_mesg_token_tbl;
607:
608: x_return_status := FND_API.G_RET_STS_ERROR;
609: x_mesg_token_tbl := l_mesg_token_tbl ;
610: return;
611:
612: end;
617: IF EAM_PROCESS_WO_PVT.GET_DEBUG = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Validating required_quantity . . . '); END IF;
618:
619: begin
620: if p_eam_direct_items_rec.required_quantity < p_eam_direct_items_rec.quantity_issued then
621: raise fnd_api.g_exc_unexpected_error;
622: end if;
623:
624: x_return_status := FND_API.G_RET_STS_SUCCESS;
625:
620: if p_eam_direct_items_rec.required_quantity < p_eam_direct_items_rec.quantity_issued then
621: raise fnd_api.g_exc_unexpected_error;
622: end if;
623:
624: x_return_status := FND_API.G_RET_STS_SUCCESS;
625:
626: exception
627: when others then
628:
634: , x_mesg_token_tbl => l_out_mesg_token_tbl
635: );
636: l_mesg_token_tbl := l_out_mesg_token_tbl;
637:
638: x_return_status := FND_API.G_RET_STS_ERROR;
639: x_mesg_token_tbl := l_mesg_token_tbl ;
640: return;
641:
642: end;
662: ) ;
663: l_mesg_token_tbl := l_out_mesg_token_tbl;
664:
665: -- Return the status and message table.
666: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
667: x_mesg_token_tbl := l_mesg_token_tbl ;
668:
669:
670: END Check_Attributes;
687: l_out_Mesg_Token_Tbl EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type;
688: l_Token_Tbl EAM_ERROR_MESSAGE_PVT.Token_Tbl_Type;
689: BEGIN
690:
691: x_return_status := FND_API.G_RET_STS_SUCCESS;
692:
693:
694:
695: IF p_eam_direct_items_rec.wip_entity_id IS NULL
705: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
706: );
707: l_mesg_token_tbl := l_out_mesg_token_tbl;
708:
709: x_return_status := FND_API.G_RET_STS_ERROR;
710:
711: END IF;
712:
713:
724: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
725: );
726: l_mesg_token_tbl := l_out_mesg_token_tbl;
727:
728: x_return_status := FND_API.G_RET_STS_ERROR;
729:
730: END IF;
731:
732:
743: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
744: );
745: l_mesg_token_tbl := l_out_mesg_token_tbl;
746:
747: x_return_status := FND_API.G_RET_STS_ERROR;
748:
749: END IF;
750:
751:
762: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
763: );
764: l_mesg_token_tbl := l_out_mesg_token_tbl;
765:
766: x_return_status := FND_API.G_RET_STS_ERROR;
767:
768: END IF;
769:
770: IF p_eam_direct_items_rec.description IS NULL
780: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
781: );
782: l_mesg_token_tbl := l_out_mesg_token_tbl;
783:
784: x_return_status := FND_API.G_RET_STS_ERROR;
785:
786: END IF;
787:
788:
799: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
800: );
801: l_mesg_token_tbl := l_out_mesg_token_tbl;
802:
803: x_return_status := FND_API.G_RET_STS_ERROR;
804:
805: END IF;
806:
807:
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:
837: , x_Mesg_Token_Tbl => l_out_Mesg_Token_Tbl
838: );
839: l_mesg_token_tbl := l_out_mesg_token_tbl;
840:
841: x_return_status := FND_API.G_RET_STS_ERROR;
842:
843: END IF;
844:
845: