43: , p_op_network_unexp_rec IN Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
44: , p_old_op_network_rec IN Bom_Rtg_Pub.Op_Network_Rec_Type
45: , p_old_op_network_unexp_rec
46: IN Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
47: , p_mesg_token_tbl IN Error_Handler.Mesg_Token_Tbl_Type
48: , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
49: , x_return_status IN OUT NOCOPY VARCHAR2
50: )
51: IS
44: , p_old_op_network_rec IN Bom_Rtg_Pub.Op_Network_Rec_Type
45: , p_old_op_network_unexp_rec
46: IN Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
47: , p_mesg_token_tbl IN Error_Handler.Mesg_Token_Tbl_Type
48: , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
49: , x_return_status IN OUT NOCOPY VARCHAR2
50: )
51: IS
52:
49: , x_return_status IN OUT NOCOPY VARCHAR2
50: )
51: IS
52:
53: l_mesg_token_tbl Error_Handler.Mesg_Token_Tbl_Type;
54: l_return_status VARCHAR2(1);
55: l_err_msg VARCHAR2(2000);
56: l_common_routing_sequence_id NUMBER;
57:
62: x_return_status := FND_API.G_RET_STS_SUCCESS;
63: l_mesg_token_tbl := p_mesg_token_tbl;
64:
65: IF BOM_Rtg_Globals.Get_Debug = 'Y'
66: THEN Error_Handler.Write_Debug
67: ('Within Operation Network Check Eam Rtg Network. . . ');
68: END IF;
69:
70:
88:
89: END IF;
90:
91: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN
92: Error_Handler.Write_Debug('Call eAM Rtg Network validation API. . . ');
93: END IF;
94:
95: -- Call Routing eAM API for eAM Rtg Network validation
96: Bom_Rtg_Eam_Util.Check_Eam_Rtg_Network
102: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
103:
104: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
105: THEN
106: Error_Handler.Add_Error_Token
107: ( p_message_name => NULL
108: , p_message_text => l_err_msg
109: , p_mesg_token_tbl => l_mesg_token_tbl
110: , x_mesg_token_tbl => x_mesg_token_tbl
113: END IF;
114: x_return_status := FND_API.G_RET_STS_ERROR ;
115: ELSIF l_return_status = FND_API.G_RET_STS_SUCCESS AND
116: l_err_msg IS NOT NULL THEN
117: Error_Handler.Add_Error_Token
118: (
119: p_message_name => NULL,
120: p_message_text => l_err_msg,
121: p_mesg_token_tbl => l_mesg_token_tbl,
151: , p_op_network_unexp_rec IN Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
152: , x_old_op_network_rec IN OUT NOCOPY Bom_Rtg_Pub.Op_Network_Rec_Type
153: , x_old_op_network_unexp_rec
154: IN OUT NOCOPY Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
155: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
156: , x_return_status IN OUT NOCOPY VARCHAR2
157: )
158: IS
159: l_token_tbl Error_Handler.Token_Tbl_Type;
155: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
156: , x_return_status IN OUT NOCOPY VARCHAR2
157: )
158: IS
159: l_token_tbl Error_Handler.Token_Tbl_Type;
160: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
161: l_return_status VARCHAR2(1);
162: cfm_flag NUMBER := NULL ;
163: BEGIN
156: , x_return_status IN OUT NOCOPY VARCHAR2
157: )
158: IS
159: l_token_tbl Error_Handler.Token_Tbl_Type;
160: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
161: l_return_status VARCHAR2(1);
162: cfm_flag NUMBER := NULL ;
163: BEGIN
164:
162: cfm_flag NUMBER := NULL ;
163: BEGIN
164:
165: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN
166: Error_Handler.Write_Debug('Quering Op Network . . .' ) ;
167: END IF;
168:
169: Bom_Op_Network_Util.Query_Row
170: ( p_from_op_seq_id =>
176: , x_return_status => l_return_status
177: );
178:
179: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN
180: Error_Handler.Write_Debug('Query Row Returned with : ' || l_return_status);
181: END IF;
182:
183: IF l_return_status = BOM_Rtg_Globals.G_RECORD_FOUND AND
184: p_op_network_rec.transaction_type = BOM_Rtg_Globals.G_OPR_CREATE
188: p_op_network_rec.from_op_seq_number;
189: l_token_tbl(2).token_name := 'TO_OP_SEQ_NUMBER';
190: l_token_tbl(2).token_value :=
191: p_op_network_rec.to_op_seq_number;
192: Error_Handler.Add_Error_Token
193: ( x_Mesg_token_tbl => l_Mesg_Token_Tbl
194: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
195: , p_message_name => 'BOM_OP_NWK_ALREADY_EXISTS'
196: , p_token_tbl => l_token_tbl
205: p_op_network_rec.from_op_seq_number;
206: l_token_tbl(2).token_name := 'TO_OP_SEQ_NUMBER';
207: l_token_tbl(2).token_value :=
208: p_op_network_rec.to_op_seq_number;
209: Error_Handler.Add_Error_Token
210: ( x_Mesg_token_tbl => l_Mesg_Token_Tbl
211: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
212: , p_message_name => 'BOM_OP_NWK_DOESNOT_EXISTS'
213: , p_token_tbl => l_token_tbl
220: p_op_network_rec.from_op_seq_number;
221: l_token_tbl(2).token_name := 'TO_OP_SEQ_NUMBER';
222: l_token_tbl(2).token_value :=
223: p_op_network_rec.to_op_seq_number;
224: Error_Handler.Add_Error_Token
225: ( x_Mesg_token_tbl => l_Mesg_Token_Tbl
226: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
227: , p_message_name => NULL
228: , p_message_text =>
259: **********************************************************************/
260: PROCEDURE Check_Access
261: ( p_op_network_rec IN Bom_Rtg_Pub.Op_Network_Rec_Type
262: , p_op_network_unexp_rec IN Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
263: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
264: , x_return_status IN OUT NOCOPY VARCHAR2
265: )
266: IS
267: l_Token_Tbl Error_Handler.Token_Tbl_Type;
263: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
264: , x_return_status IN OUT NOCOPY VARCHAR2
265: )
266: IS
267: l_Token_Tbl Error_Handler.Token_Tbl_Type;
268: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
269: l_return_status VARCHAR2(1);
270: l_err_text VARCHAR2(2000);
271: l_cfm_flag NUMBER ;
264: , x_return_status IN OUT NOCOPY VARCHAR2
265: )
266: IS
267: l_Token_Tbl Error_Handler.Token_Tbl_Type;
268: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
269: l_return_status VARCHAR2(1);
270: l_err_text VARCHAR2(2000);
271: l_cfm_flag NUMBER ;
272:
283:
284: l_return_status := FND_API.G_RET_STS_SUCCESS;
285:
286: IF BOM_Rtg_Globals.Get_Debug = 'Y'
287: THEN Error_Handler.Write_Debug
288: ('Within Operation Network Check Access. . . ');
289: END IF;
290:
291: -- Set Token Value
304: -- is for Lot Based routing.
305: l_cfm_flag := BOM_Rtg_Globals.Get_CFM_Rtg_Flag ;
306:
307:
308: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
309: ('Cfm Routing Flag is ' || to_char(l_cfm_flag) ||
310: '. . . Eam Item Type is ' || to_char(BOM_Rtg_Globals.Get_Eam_Item_Type) ) ;
311: END IF ;
312:
320:
321: IF l_cfm_flag = BOM_Rtg_Globals.G_FLOW_RTG
322: THEN
323:
324: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
325: ('Check flow routing network . . . ' ) ;
326: END IF ;
327:
328: -- In current release, validations for Check Access
331:
332: ELSIF l_cfm_flag = BOM_Rtg_Globals.G_LOT_RTG
333: THEN
334:
335: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
336: ('Check WSM routing network . . . ' ) ;
337: END IF ;
338: if BOM_Rtg_GLobals.Get_CFM_Rtg_Flag <> BOM_Rtg_Globals.G_Lot_Rtg then --for bug 3132411
339: FOR l_nwkop_rec IN l_nwkop_csr
343: LOOP
344: IF l_nwkop_rec.standard_operation_id IS NULL THEN
345: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
346: THEN
347: Error_Handler.Add_Error_Token
348: ( p_message_name => 'BOM_OP_NWK_STDOP_REQUIRED'
349: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
350: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
351: , p_Token_Tbl => l_Token_Tbl
358: <= TRUNC(sysdate)
359: THEN
360: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
361: THEN
362: Error_Handler.Add_Error_Token
363: ( p_message_name => 'BOM_OP_NWK_ALREADY_DISABLED'
364: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
365: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
366: , p_Token_Tbl => l_Token_Tbl
380: LOOP
381: IF l_nwkop_rec.standard_operation_id IS NULL THEN
382: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
383: THEN
384: Error_Handler.Add_Error_Token
385: ( p_message_name => 'BOM_OP_NWK_STDOP_REQUIRED'
386: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
387: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
388: , p_Token_Tbl => l_Token_Tbl
395: <= TRUNC(sysdate)
396: THEN
397: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
398: THEN
399: Error_Handler.Add_Error_Token
400: ( p_message_name => 'BOM_OP_NWK_ALREADY_DISABLED'
401: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
402: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
403: , p_Token_Tbl => l_Token_Tbl
416: ELSIF l_cfm_flag = BOM_Rtg_Globals.G_STD_RTG
417: AND BOM_Rtg_Globals.Get_Eam_Item_Type = BOM_Rtg_Globals.G_ASSET_ACTIVITY
418: THEN
419:
420: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
421: ('Check maintenance routing network . . . Eam Item Type is ' || to_char(BOM_Rtg_Globals.Get_Eam_Item_Type) ) ;
422: END IF ;
423:
424: -- Check if the from operation has been disabled
432: <= TRUNC(sysdate)
433: THEN
434: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
435: THEN
436: Error_Handler.Add_Error_Token
437: ( p_message_name => 'BOM_OP_NWK_ALREADY_DISABLED'
438: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
439: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
440: , p_Token_Tbl => l_Token_Tbl
459: <= TRUNC(sysdate)
460: THEN
461: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
462: THEN
463: Error_Handler.Add_Error_Token
464: ( p_message_name => 'BOM_OP_NWK_ALREADY_DISABLED'
465: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
466: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
467: , p_Token_Tbl => l_Token_Tbl
482: AND l_cfm_flag <> BOM_Rtg_Globals.G_LOT_RTG
483: AND BOM_Rtg_Globals.Get_Eam_Item_Type <> BOM_Rtg_Globals.G_ASSET_ACTIVITY
484: THEN
485:
486: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
487: ('Check if parenet routing is a standard routing. ' || l_return_status) ;
488: END IF ;
489: l_token_tbl.delete ;
490: l_token_tbl(1).token_name := 'ASSEMBLY_ITEM_NAME';
489: l_token_tbl.delete ;
490: l_token_tbl(1).token_name := 'ASSEMBLY_ITEM_NAME';
491: l_token_tbl(1).token_value :=
492: p_op_network_rec.assembly_item_name;
493: Error_Handler.Add_Error_Token
494: ( p_Message_Name => 'BOM_OP_NWK_RTG_INVALID'
495: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
496: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
497: , p_Token_Tbl => l_Token_Tbl
499: l_return_status := FND_API.G_RET_STS_ERROR ;
500:
501: END IF ;
502:
503: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
504: ('Check if operations for network are valid. ' || l_return_status) ;
505: END IF ;
506: -- Return Status and Message Token
507: x_return_status := l_return_status;
508: x_mesg_token_tbl := l_mesg_token_tbl;
509:
510: EXCEPTION
511: WHEN OTHERS THEN
512: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
513: ('Some unknown error in Check Access. . .' || SQLERRM );
514: END IF ;
515:
516:
516:
517: l_err_text := G_PKG_NAME || ' Validation (Check Access) '
518: || substrb(SQLERRM,1,200);
519:
520: Error_Handler.Add_Error_Token
521: ( p_message_name => NULL
522: , p_message_text => l_err_text
523: , p_mesg_token_tbl => l_mesg_token_tbl
524: , x_mesg_token_tbl => l_mesg_token_tbl
544: * Operation Network attrbiute in its entirety.
545: **********************************************************************/
546: PROCEDURE Check_Attributes
547: ( x_return_status IN OUT NOCOPY VARCHAR2
548: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
549: --, p_op_network_tbl IN Bom_Rtg_Pub.Op_Network_Tbl_Type
550: , p_op_network_Rec IN Bom_Rtg_Pub.Op_Network_Rec_Type
551: , p_op_network_unexp_rec IN Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
552: , p_old_op_network_rec IN Bom_Rtg_Pub.Op_Network_Rec_Type
553: , p_old_op_network_unexp_rec IN Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
554: )
555: IS
556: l_err_text VARCHAR2(2000) := NULL;
557: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
558: l_Token_Tbl Error_Handler.Token_Tbl_Type;
559: l_cfm_flag NUMBER := NULL ;
560:
561: BEGIN
554: )
555: IS
556: l_err_text VARCHAR2(2000) := NULL;
557: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
558: l_Token_Tbl Error_Handler.Token_Tbl_Type;
559: l_cfm_flag NUMBER := NULL ;
560:
561: BEGIN
562:
562:
563: x_return_status := FND_API.G_RET_STS_SUCCESS;
564:
565: IF BOM_Rtg_Globals.Get_Debug = 'Y'
566: THEN Error_Handler.Write_Debug
567: ('Within Operation Network Check Attributes . . . ');
568: END IF;
569:
570: -- Set Token Value
584: IF p_op_network_rec.transaction_type = BOM_Rtg_Globals.G_OPR_UPDATE
585: THEN
586:
587:
588: IF Bom_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
589: ('Operation Attr Validation: Missing Value. . . ' || x_return_status) ;
590: END IF;
591:
592: -- Connection(Transition) Type
591:
592: -- Connection(Transition) Type
593: IF p_op_network_rec.connection_type = FND_API.G_MISS_NUM
594: THEN
595: Error_Handler.Add_Error_Token
596: ( p_Message_Name => 'BOM_OP_NWK_CNTTYPE_MISSING'
597: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
598: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
599: , p_Token_Tbl => l_Token_Tbl
604:
605: -- Planning Percent
606: IF p_op_network_rec.planning_percent = FND_API.G_MISS_NUM
607: THEN
608: Error_Handler.Add_Error_Token
609: ( p_Message_Name => 'BOM_OP_NWK_PLNPCT_MISSING'
610: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
611: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
612: , p_Token_Tbl => l_Token_Tbl
622: OR ( p_op_network_rec.To_X_Coordinate <> FND_API.G_MISS_NUM
623: AND p_op_network_rec.To_X_Coordinate < 0 )
624: OR ( p_op_network_rec.To_Y_Coordinate <> FND_API.G_MISS_NUM
625: AND p_op_network_rec.To_Y_Coordinate < 0 ) THEN
626: Error_Handler.Add_Error_Token
627: ( p_message_name => 'BOM_OP_NWK_COORD_NEGATIVE'
628: , p_token_tbl => l_token_tbl
629: , p_mesg_token_tbl => l_mesg_token_tbl
630: , x_mesg_token_tbl => l_mesg_token_tbl
659: p_op_network_rec.To_X_Coordinate) OR
660: (p_op_network_tbl(I).To_Y_Coordinate <>
661: p_op_network_rec.To_Y_Coordinate))) THEN
662:
663: Error_Handler.Add_Error_Token
664: ( p_message_name => 'BOM_OP_NWK_COORD_MISMATCH'
665: , p_token_tbl => l_token_tbl
666: , p_mesg_token_tbl => l_mesg_token_tbl
667: , x_mesg_token_tbl => l_mesg_token_tbl
688: AND p_op_network_rec.connection_type is NOT NULL
689: AND p_op_network_rec.connection_type <> FND_API.G_MISS_NUM
690: AND l_cfm_flag = BOM_Rtg_Globals.G_LOT_RTG
691: THEN
692: Error_Handler.Add_Error_Token
693: ( p_message_name => 'BOM_OP_NWK_CNTYPE_INVALID'
694: , p_token_tbl => l_token_tbl
695: , p_mesg_token_tbl => l_mesg_token_tbl
696: , x_mesg_token_tbl => l_mesg_token_tbl
704: AND p_op_network_rec.connection_type <> FND_API.G_MISS_NUM
705: AND l_cfm_flag = BOM_Rtg_Globals.G_FLOW_RTG
706: THEN
707:
708: Error_Handler.Add_Error_Token
709: ( p_message_name => 'BOM_OP_NWK_CNTYPE_INVALID'
710: , p_token_tbl => l_token_tbl
711: , p_mesg_token_tbl => l_mesg_token_tbl
712: , x_mesg_token_tbl => l_mesg_token_tbl
721: AND p_op_network_rec.planning_percent IS NOT NULL
722: AND p_op_network_rec.planning_percent <> FND_API.G_MISS_NUM
723: THEN
724:
725: Error_Handler.Add_Error_Token
726: ( p_message_name => 'BOM_OP_NWK_PLNPCT_INVALID'
727: , p_token_tbl => l_token_tbl
728: , p_mesg_token_tbl => l_mesg_token_tbl
729: , x_mesg_token_tbl => l_mesg_token_tbl
734: x_Mesg_Token_Tbl := l_Mesg_Token_Tbl;
735:
736: EXCEPTION
737: WHEN OTHERS THEN
738: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
739: ('Some unknown error in Attribute Validation . . .' || SQLERRM );
740: END IF ;
741:
742:
742:
743: l_err_text := G_PKG_NAME || ' Validation (Attr. Validation) '
744: || substrb(SQLERRM,1,200);
745:
746: Error_Handler.Add_Error_Token
747: ( p_message_name => NULL
748: , p_message_text => l_err_text
749: , p_mesg_token_tbl => l_mesg_token_tbl
750: , x_mesg_token_tbl => l_mesg_token_tbl
775: ( p_op_network_rec IN Bom_Rtg_Pub.Op_Network_Rec_Type
776: , p_op_network_unexp_rec IN Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
777: , p_old_op_network_rec IN Bom_Rtg_Pub.Op_Network_Rec_Type
778: , p_old_op_network_unexp_rec IN Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
779: , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
780: , x_return_status IN OUT NOCOPY VARCHAR2
781: )
782: IS
783:
810:
811:
812: l_total_planning_pct NUMBER :=0;
813: l_planning_pct NUMBER :=0;
814: l_token_tbl Error_Handler.Token_Tbl_Type;
815: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
816: l_dummy NUMBER;
817: l_err_text VARCHAR2(2000) ;
818: l_return_status VARCHAR2(1);
811:
812: l_total_planning_pct NUMBER :=0;
813: l_planning_pct NUMBER :=0;
814: l_token_tbl Error_Handler.Token_Tbl_Type;
815: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
816: l_dummy NUMBER;
817: l_err_text VARCHAR2(2000) ;
818: l_return_status VARCHAR2(1);
819: l_err_code NUMBER;
826:
827: x_return_status := FND_API.G_RET_STS_SUCCESS;
828:
829: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN
830: Error_Handler.Write_Debug ('Within Operation Network Check Entity1 . . . ');
831: END IF;
832:
833: -- Set Token Value
834: l_token_tbl(1).token_name := 'FROM_OP_SEQ_NUMBER';
845: p_op_network_unexp_rec.new_to_op_seq_id IS NOT NULL )
846: THEN
847:
848: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN
849: Error_Handler.Write_Debug('Check op network uniqueness for UPDATE . . . ');
850: END IF;
851:
852: FOR l_uniqe_rec in check_unique_network_csr
853: ( P_From_Op_Seq_Id => NVL(p_op_network_unexp_rec.new_from_op_seq_id,
856: p_op_network_unexp_rec.to_op_seq_id)
857: )
858: LOOP
859:
860: Error_Handler.Add_Error_Token
861: ( x_Mesg_token_tbl => l_Mesg_Token_Tbl
862: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
863: , p_message_name => 'BOM_OP_NWK_ALREADY_EXISTS'
864: , p_token_tbl => l_token_tbl
875: NULL ;
876:
877:
878: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN
879: Error_Handler.Write_Debug('Call eAM Rtg Network validation API. . . ');
880: END IF;
881: /*
882: -- This validation no longer used
883: -- Call Routing eAM API for eAM Rtg Network validation
893: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
894:
895: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
896: THEN
897: Error_Handler.Add_Error_Token
898: ( p_message_name => NULL
899: , p_message_text => l_err_text
900: , p_mesg_token_tbl => l_mesg_token_tbl
901: , x_mesg_token_tbl => l_mesg_token_tbl
908: -- If operation network is for maintenance routing,
909: -- pass through followings validations.
910:
911: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN
912: Error_Handler.Write_Debug ('Pass Operation Network Check Entity1 in maintenance routings . . . ');
913: END IF;
914: */
915:
916: RAISE PASS_CHECK_ENTITY1_FOR_EAM ;
925: IF p_op_network_rec.planning_percent IS NULL
926: OR p_op_network_rec.planning_percent = FND_API.G_MISS_NUM
927: THEN
928:
929: Error_Handler.Add_Error_Token
930: ( p_message_name => 'BOM_OP_NWK_PLNPCT_REQUIRED'
931: , p_token_tbl => l_token_tbl
932: , p_mesg_token_tbl => l_mesg_token_tbl
933: , x_mesg_token_tbl => l_mesg_token_tbl
952:
953: IF p_op_network_rec.operation_type = 1
954: THEN
955:
956: Error_Handler.Add_Error_Token
957: ( p_message_name => 'BOM_OP_NWK_PMOP_NOTUNIQUE'
958: , p_token_tbl => l_token_tbl
959: , p_mesg_token_tbl => l_mesg_token_tbl
960: , x_mesg_token_tbl => l_mesg_token_tbl
963:
964: ELSIF p_op_network_rec.operation_type = 2
965: THEN
966:
967: Error_Handler.Add_Error_Token
968: ( p_message_name => 'BOM_OP_NWK_PMPRCS_NOTUNIQUE'
969: , p_token_tbl => l_token_tbl
970: , p_mesg_token_tbl => l_mesg_token_tbl
971: , x_mesg_token_tbl => l_mesg_token_tbl
973: x_return_status := FND_API.G_RET_STS_ERROR;
974: ELSIF p_op_network_rec.operation_type = 3
975: THEN
976:
977: Error_Handler.Add_Error_Token
978: ( p_message_name => 'BOM_OP_NWK_PMLO_NOTUNIQUE'
979: , p_token_tbl => l_token_tbl
980: , p_mesg_token_tbl => l_mesg_token_tbl
981: , x_mesg_token_tbl => l_mesg_token_tbl
1037: l_token_tbl.DELETE(2) ;
1038:
1039: IF p_op_network_rec.operation_type IN (1,2)
1040: THEN
1041: Error_Handler.Add_Error_Token
1042: ( p_message_name => 'BOM_OP_NWK_PRCS_PLNPCT_INVALID'
1043: , p_token_tbl => l_token_tbl
1044: , p_mesg_token_tbl => l_mesg_token_tbl
1045: , x_mesg_token_tbl => l_mesg_token_tbl
1046: );
1047: x_return_status := FND_API.G_RET_STS_ERROR;
1048: ELSIF p_op_network_rec.operation_type = 3
1049: THEN
1050: Error_Handler.Add_Error_Token
1051: ( p_message_name => 'BOM_OP_NWK_LO_PLNLPCT_INVALID'
1052: , p_token_tbl => l_token_tbl
1053: , p_mesg_token_tbl=> l_mesg_token_tbl
1054: , x_mesg_token_tbl=> l_mesg_token_tbl
1070: p_operation_seq_num => p_op_network_rec.From_Op_Seq_Number)
1071: THEN
1072: l_token_tbl(1).token_name := 'OP_SEQ_NUMBER';
1073: l_token_tbl(1).token_value := p_op_network_rec.From_Op_Seq_Number;
1074: Error_Handler.Add_Error_Token(p_message_name => 'BOM_WSM_FROM_OP_ACTIVE_JOB',
1075: p_mesg_token_tbl => l_mesg_token_tbl,
1076: p_token_tbl => l_token_tbl,
1077: x_mesg_token_tbl => l_mesg_token_tbl);
1078: x_return_status := Error_Handler.G_Status_Error;
1074: Error_Handler.Add_Error_Token(p_message_name => 'BOM_WSM_FROM_OP_ACTIVE_JOB',
1075: p_mesg_token_tbl => l_mesg_token_tbl,
1076: p_token_tbl => l_token_tbl,
1077: x_mesg_token_tbl => l_mesg_token_tbl);
1078: x_return_status := Error_Handler.G_Status_Error;
1079: END IF;
1080: --End of Delete Link OSFM Constraint
1081:
1082: x_mesg_token_tbl := l_mesg_token_tbl;
1085: WHEN PASS_CHECK_ENTITY1_FOR_EAM THEN
1086: x_mesg_token_tbl := l_mesg_token_tbl;
1087:
1088: WHEN OTHERS THEN
1089: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
1090: ('Some unknown error in Entity Validation1. . .' || SQLERRM );
1091: END IF ;
1092:
1093:
1093:
1094: l_err_text := G_PKG_NAME || ' Validation (Entity Validation1) '
1095: || substrb(SQLERRM,1,200);
1096:
1097: Error_Handler.Add_Error_Token
1098: ( p_message_name => NULL
1099: , p_message_text => l_err_text
1100: , p_mesg_token_tbl => l_mesg_token_tbl
1101: , x_mesg_token_tbl => l_mesg_token_tbl
1127: ( p_op_network_rec IN Bom_Rtg_Pub.Op_Network_Rec_Type
1128: , p_op_network_unexp_rec IN Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
1129: , p_old_op_network_rec IN Bom_Rtg_Pub.Op_Network_Rec_Type
1130: , p_old_op_network_unexp_rec IN Bom_Rtg_Pub.Op_Network_Unexposed_Rec_Type
1131: , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
1132: , x_return_status IN OUT NOCOPY VARCHAR2
1133: )
1134: IS
1135: x_status VARCHAR2(1);
1136: x_message VARCHAR2(255);
1137:
1138: l_total_planning_pct NUMBER :=0;
1139: l_err_text VARCHAR2(2000) ;
1140: l_token_tbl Error_Handler.Token_Tbl_Type;
1141: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
1142: l_dummy NUMBER;
1143:
1144: BEGIN
1137:
1138: l_total_planning_pct NUMBER :=0;
1139: l_err_text VARCHAR2(2000) ;
1140: l_token_tbl Error_Handler.Token_Tbl_Type;
1141: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
1142: l_dummy NUMBER;
1143:
1144: BEGIN
1145:
1146:
1147: x_return_status := FND_API.G_RET_STS_SUCCESS;
1148:
1149: IF BOM_Rtg_Globals.Get_Debug = 'Y'
1150: THEN Error_Handler.Write_Debug
1151: ('Within operation network entity level check2 . . . ');
1152: END IF;
1153:
1154: -- Set Token Value
1198: -- + p_op_network_rec.planning_percent ;
1199:
1200:
1201: IF BOM_Rtg_Globals.Get_Debug = 'Y'
1202: THEN Error_Handler.Write_Debug
1203: ('Check planning percentage '|| to_char(l_total_planning_pct) );
1204: END IF;
1205:
1206: IF (l_total_planning_pct > 100)
1209: l_token_tbl.DELETE(2) ;
1210:
1211: IF p_op_network_rec.operation_type IN (1,2)
1212: THEN
1213: Error_Handler.Add_Error_Token
1214: ( p_message_name => 'BOM_OP_NWK_PRCS_PLNPCT_INVALID'
1215: , p_token_tbl => l_token_tbl
1216: , p_mesg_token_tbl => l_mesg_token_tbl
1217: , x_mesg_token_tbl => l_mesg_token_tbl
1218: );
1219: x_return_status := FND_API.G_RET_STS_ERROR;
1220: ELSIF p_op_network_rec.operation_type = 3
1221: THEN
1222: Error_Handler.Add_Error_Token
1223: ( p_message_name => 'BOM_OP_NWK_LO_PLNLPCT_INVALID'
1224: , p_token_tbl => l_token_tbl
1225: , p_mesg_token_tbl=> l_mesg_token_tbl
1226: , x_mesg_token_tbl=> l_mesg_token_tbl
1254: , x_message => x_message
1255: ) ;
1256:
1257: IF BOM_Rtg_Globals.Get_Debug = 'Y'
1258: THEN Error_Handler.Write_Debug
1259: ('After calling Rtg Network Validate API. Retrun status is '|| x_status );
1260: END IF;
1261:
1262: END IF ;
1268:
1269: IF UPPER( RTRIM(x_message) ) =
1270: UPPER('A loop has been detected in this Routing Network.')
1271: THEN
1272: Error_Handler.Add_Error_Token
1273: ( p_message_name => 'BOM_OP_NWK_LOOP_EXIT'
1274: , p_token_tbl => l_token_tbl
1275: , p_mesg_token_tbl => l_mesg_token_tbl
1276: , x_mesg_token_tbl => l_mesg_token_tbl
1279: ELSIF UPPER( RTRIM(x_message) ) =
1280: UPPER('A broken link exists in this routing Network.')
1281: THEN
1282:
1283: Error_Handler.Add_Error_Token
1284: ( p_message_name => 'BOM_OP_NWK_BROEKN_LINK_EXIT'
1285: , p_token_tbl => l_token_tbl
1286: , p_mesg_token_tbl => l_mesg_token_tbl
1287: , x_mesg_token_tbl => l_mesg_token_tbl
1289:
1290: x_return_status := FND_API.G_RET_STS_ERROR;
1291: ELSE
1292:
1293: Error_Handler.Add_Error_Token
1294: ( p_message_name => 'BOM_OP_NWK_VLDN_ERROR'
1295: , p_token_tbl => l_token_tbl
1296: , p_mesg_token_tbl => l_mesg_token_tbl
1297: , x_mesg_token_tbl => l_mesg_token_tbl
1322: END IF ;
1323:
1324:
1325: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN
1326: Error_Handler.Write_Debug
1327: ('Validation for eAM Op Network is completed with status '|| x_return_status);
1328: END IF;
1329:
1330:
1334: x_mesg_token_tbl := l_mesg_token_tbl;
1335:
1336: EXCEPTION
1337: WHEN OTHERS THEN
1338: IF BOM_Rtg_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
1339: ('Some unknown error in Entity Validation2. . .' || SQLERRM );
1340: END IF ;
1341:
1342:
1342:
1343: l_err_text := G_PKG_NAME || ' Validation (Entity Validation2) '
1344: || substrb(SQLERRM,1,200);
1345:
1346: Error_Handler.Add_Error_Token
1347: ( p_message_name => NULL
1348: , p_message_text => l_err_text
1349: , p_mesg_token_tbl => l_mesg_token_tbl
1350: , x_mesg_token_tbl => l_mesg_token_tbl
1372: PROCEDURE Check_WSM_Netowrk_Attribs
1373: ( p_routing_sequence_id IN NUMBER
1374: , p_prev_start_id IN NUMBER
1375: , p_prev_end_id IN NUMBER
1376: , x_mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
1377: , x_Return_status IN OUT NOCOPY VARCHAR2
1378: )
1379: IS
1380: CURSOR cur_op_seq_num( p_routing_id NUMBER,
1385:
1386: l_routing_sequence_id NUMBER :=0;
1387: l_common_routing_sequence_id NUMBER :=0;
1388: l_cfm_routing_flag NUMBER :=0;
1389: l_mesg_token_tbl Error_Handler.Mesg_Token_Tbl_Type ;
1390: l_post_start_id NUMBER :=0;
1391: l_post_end_id NUMBER :=0;
1392: err_code NUMBER:=0;
1393: err_msg VARCHAR2(2000);
1390: l_post_start_id NUMBER :=0;
1391: l_post_end_id NUMBER :=0;
1392: err_code NUMBER:=0;
1393: err_msg VARCHAR2(2000);
1394: l_token_tbl Error_Handler.Token_Tbl_Type;
1395: x_success NUMBER:=0;
1396: BEGIN
1397: x_return_status := FND_API.G_RET_STS_SUCCESS;
1398:
1427: END IF;
1428:
1429: IF err_msg IS NOT NULL THEN
1430: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1431: Error_Handler.Add_Error_Token
1432: ( p_message_name => NULL
1433: , p_message_text => err_msg
1434: , p_mesg_token_tbl => l_mesg_token_tbl
1435: , x_mesg_token_tbl => l_mesg_token_tbl
1451: l_post_start_id) LOOP
1452: l_token_tbl(1).token_value := rec_op_seq_num.operation_seq_num;
1453: END LOOP;
1454: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1455: Error_Handler.Add_Error_Token
1456: ( p_message_name => 'WSM_START_CANNOT_BE_CHANGED'
1457: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1458: , x_Mesg_Token_Tbl => x_Mesg_Token_Tbl
1459: , p_token_tbl => l_token_tbl
1479:
1480: IF err_msg IS NOT NULL THEN
1481:
1482: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1483: Error_Handler.Add_Error_Token
1484: ( p_message_name => NULL
1485: , p_message_text => err_msg
1486: , p_mesg_token_tbl => l_mesg_token_tbl
1487: , x_mesg_token_tbl => l_mesg_token_tbl
1502: l_token_tbl(1).token_value := rec_op_seq_num.operation_seq_num;
1503: END LOOP;
1504:
1505: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1506: Error_Handler.Add_Error_Token
1507: ( p_message_name => 'WSM_END_CANNOT_BE_CHANGED'
1508: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1509: , x_Mesg_Token_Tbl => x_Mesg_Token_Tbl
1510: , p_token_tbl => l_token_tbl
1530: IF err_msg IS NOT NULL THEN
1531: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
1532: THEN
1533:
1534: Error_Handler.Add_Error_Token
1535: ( p_message_name => NULL
1536: , p_message_text => err_msg
1537: , p_mesg_token_tbl => l_mesg_token_tbl
1538: , x_mesg_token_tbl => l_mesg_token_tbl
1554:
1555: IF err_msg IS NOT NULL THEN
1556: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
1557: THEN
1558: Error_Handler.Add_Error_Token
1559: ( p_message_name => NULL
1560: , p_message_text => err_msg
1561: , p_mesg_token_tbl => l_mesg_token_tbl
1562: , x_mesg_token_tbl => l_mesg_token_tbl