76: g_Assy_Assembly_Type NUMBER; --4161794
77:
78: g_rev_component_rec Bom_bo_Pub.Rev_Component_Rec_Type;
79: g_Rev_Comp_Unexp_Rec Bom_Bo_Pub.Rev_Comp_Unexposed_Rec_Type;
80: g_Token_Tbl Error_Handler.Token_Tbl_Type;
81:
82: FUNCTION Item_Revision_Exists (p_item_id IN NUMBER,
83: p_org_id IN NUMBER,
84: p_eff_dt IN DATE)
90: WHERE INVENTORY_ITEM_ID = p_item_id
91: AND ORGANIZATION_ID = p_org_id
92: AND MIR.EFFECTIVITY_DATE <= p_eff_dt;
93: BEGIN
94: Error_Handler.Write_Debug('In Item Check Revisio' );
95: Error_Handler.Write_Debug('Item id '||to_char(p_item_id));
96: Error_Handler.Write_Debug('Org id '||to_char(p_org_id));
97: Error_Handler.Write_Debug('Eff Dt '||to_char(p_eff_dt));
98: FOR r1 IN c1
91: AND ORGANIZATION_ID = p_org_id
92: AND MIR.EFFECTIVITY_DATE <= p_eff_dt;
93: BEGIN
94: Error_Handler.Write_Debug('In Item Check Revisio' );
95: Error_Handler.Write_Debug('Item id '||to_char(p_item_id));
96: Error_Handler.Write_Debug('Org id '||to_char(p_org_id));
97: Error_Handler.Write_Debug('Eff Dt '||to_char(p_eff_dt));
98: FOR r1 IN c1
99: LOOP
92: AND MIR.EFFECTIVITY_DATE <= p_eff_dt;
93: BEGIN
94: Error_Handler.Write_Debug('In Item Check Revisio' );
95: Error_Handler.Write_Debug('Item id '||to_char(p_item_id));
96: Error_Handler.Write_Debug('Org id '||to_char(p_org_id));
97: Error_Handler.Write_Debug('Eff Dt '||to_char(p_eff_dt));
98: FOR r1 IN c1
99: LOOP
100: Error_Handler.Write_Debug('In loop');
93: BEGIN
94: Error_Handler.Write_Debug('In Item Check Revisio' );
95: Error_Handler.Write_Debug('Item id '||to_char(p_item_id));
96: Error_Handler.Write_Debug('Org id '||to_char(p_org_id));
97: Error_Handler.Write_Debug('Eff Dt '||to_char(p_eff_dt));
98: FOR r1 IN c1
99: LOOP
100: Error_Handler.Write_Debug('In loop');
101: Return TRUE;
96: Error_Handler.Write_Debug('Org id '||to_char(p_org_id));
97: Error_Handler.Write_Debug('Eff Dt '||to_char(p_eff_dt));
98: FOR r1 IN c1
99: LOOP
100: Error_Handler.Write_Debug('In loop');
101: Return TRUE;
102: END LOOP;
103: Error_Handler.Write_Debug('Returning False' );
104: Return FALSE;
99: LOOP
100: Error_Handler.Write_Debug('In loop');
101: Return TRUE;
102: END LOOP;
103: Error_Handler.Write_Debug('Returning False' );
104: Return FALSE;
105: END;
106:
107:
110: * Parameters IN : p_parent_item_id parent item id
111: * p_child_item_id child item id
112: * p_organization_id org id.
113: * p_init_msg_list Default value is TRUE.By default
114: * the error handler is initialized.If the caller does not
115: * want the error handler to get initialized, the caller
116: * has to pass FALSE.
117: * Parameters OUT: x_return_status is FND_API.G_RET_STS_SUCCESS or
118: * FND_API.G_RET_STS_ERROR
111: * p_child_item_id child item id
112: * p_organization_id org id.
113: * p_init_msg_list Default value is TRUE.By default
114: * the error handler is initialized.If the caller does not
115: * want the error handler to get initialized, the caller
116: * has to pass FALSE.
117: * Parameters OUT: x_return_status is FND_API.G_RET_STS_SUCCESS or
118: * FND_API.G_RET_STS_ERROR
119: * x_error_message The error message passed to the
141: l_child_item_type MTL_SYSTEM_ITEMS.ITEM_TYPE%TYPE;
142: l_parent_item_type_name FND_LOOKUP_VALUES_VL.MEANING%TYPE;
143: l_child_item_type_name FND_LOOKUP_VALUES_VL.MEANING%TYPE;
144: l_return_status VARCHAR2(1);
145: l_mesg_token_tbl Error_Handler.Mesg_Token_Tbl_Type;
146: l_token_tbl Error_Handler.Token_Tbl_Type;
147: l_message_list Error_Handler.Error_Tbl_Type;
148: l_parent_name VARCHAR2(700);
149: l_child_name VARCHAR2(700);
142: l_parent_item_type_name FND_LOOKUP_VALUES_VL.MEANING%TYPE;
143: l_child_item_type_name FND_LOOKUP_VALUES_VL.MEANING%TYPE;
144: l_return_status VARCHAR2(1);
145: l_mesg_token_tbl Error_Handler.Mesg_Token_Tbl_Type;
146: l_token_tbl Error_Handler.Token_Tbl_Type;
147: l_message_list Error_Handler.Error_Tbl_Type;
148: l_parent_name VARCHAR2(700);
149: l_child_name VARCHAR2(700);
150:
143: l_child_item_type_name FND_LOOKUP_VALUES_VL.MEANING%TYPE;
144: l_return_status VARCHAR2(1);
145: l_mesg_token_tbl Error_Handler.Mesg_Token_Tbl_Type;
146: l_token_tbl Error_Handler.Token_Tbl_Type;
147: l_message_list Error_Handler.Error_Tbl_Type;
148: l_parent_name VARCHAR2(700);
149: l_child_name VARCHAR2(700);
150:
151: BEGIN
155: -- Init Message List parameter
156: --
157: IF p_init_msg_list
158: THEN
159: Error_Handler.Initialize;
160: END IF;
161:
162:
163: x_return_status := FND_API.G_RET_STS_SUCCESS;
234: l_token_tbl(3).token_value := l_child_name;
235: l_token_tbl(4).token_name := 'CHILD_ITEM_TYPE';
236: l_token_tbl(4).token_value := l_child_item_type_name;
237:
238: Error_Handler.Add_Error_Token
239: ( p_Message_Name => 'BOM_COMP_ASSOC_DENIED'
240: , p_Mesg_Token_Tbl => l_mesg_token_tbl
241: , x_Mesg_Token_Tbl => l_mesg_token_tbl
242: , p_Token_Tbl => l_token_tbl
241: , x_Mesg_Token_Tbl => l_mesg_token_tbl
242: , p_Token_Tbl => l_token_tbl
243: );
244:
245: Error_Handler.Translate_And_Insert_Messages
246: ( p_mesg_token_tbl => l_mesg_token_tbl
247: , p_application_id => 'BOM'
248: );
249:
246: ( p_mesg_token_tbl => l_mesg_token_tbl
247: , p_application_id => 'BOM'
248: );
249:
250: Error_Handler.Get_Message_List( x_message_list => l_message_list);
251: x_error_message := l_message_list(1).Message_Text;
252: x_return_status := FND_API.G_RET_STS_ERROR;
253: -- dbms_output.put_line('RETURN STATUS WITH EXCEPTION '||l_return_status);
254: -- dbms_output.put_line('RETURN STATUS '||x_return_status);
254: -- dbms_output.put_line('RETURN STATUS '||x_return_status);
255: -- dbms_output.put_line('RETURN MESSAGE '||x_error_message);
256: IF p_init_msg_list
257: THEN
258: Error_Handler.Write_To_DebugFile;
259: Error_Handler.Close_Debug_Session;
260: END IF;
261: END IF;
262: END;
255: -- dbms_output.put_line('RETURN MESSAGE '||x_error_message);
256: IF p_init_msg_list
257: THEN
258: Error_Handler.Write_To_DebugFile;
259: Error_Handler.Close_Debug_Session;
260: END IF;
261: END IF;
262: END;
263: ELSE
293: * also perform any required cross entity validations
294: *******************************************************************/
295: PROCEDURE Check_Entity
296: ( x_return_status IN OUT NOCOPY VARCHAR2
297: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
298: , p_bom_component_rec IN Bom_Bo_Pub.Bom_Comps_Rec_Type
299: , p_bom_Comp_Unexp_Rec IN Bom_Bo_Pub.Bom_Comps_Unexposed_Rec_Type
300: , p_old_bom_Component_Rec IN Bom_Bo_Pub.Bom_Comps_Rec_Type
301: , p_old_bom_Comp_Unexp_Rec IN Bom_Bo_Pub.Bom_Comps_Unexposed_Rec_Type
350: * cross entity validations will be performed.
351: ********************************************************************/
352: PROCEDURE Check_Attributes
353: ( x_return_status IN OUT NOCOPY VARCHAR2
354: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
355: , p_bom_component_rec IN Bom_Bo_Pub.Bom_Comps_Rec_Type
356: , p_bom_Comp_Unexp_Rec IN Bom_Bo_Pub.Bom_Comps_Unexposed_Rec_Type
357: )
358: IS
378: END Check_Attributes;
379:
380: PROCEDURE Check_Entity_Delete
381: ( x_return_status IN OUT NOCOPY VARCHAR2
382: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
383: , p_bom_component_rec IN Bom_Bo_Pub.Bom_Comps_Rec_Type
384: , p_bom_Comp_Unexp_Rec IN Bom_Bo_Pub.Bom_Comps_Unexposed_Rec_Type
385: )
386: IS
390:
391:
392: PROCEDURE Check_Required
393: ( x_return_status IN OUT NOCOPY VARCHAR2
394: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
395: , p_bom_component_rec IN Bom_Bo_Pub.Bom_Comps_Rec_Type
396: )
397: IS
398: l_rev_component_rec Bom_Bo_Pub.Rev_Component_Rec_Type;
416: ( p_bom_component_rec IN Bom_Bo_Pub.Bom_Comps_Rec_Type
417: , p_bom_comp_unexp_rec IN Bom_Bo_Pub.Bom_Comps_Unexposed_Rec_Type
418: , x_old_bom_component_rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Comps_Rec_Type
419: , x_old_bom_comp_unexp_rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Comps_Unexposed_Rec_Type
420: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
421: , x_return_status IN OUT NOCOPY VARCHAR2
422: )
423: IS
424: l_rev_component_rec Bom_Bo_Pub.Rev_Component_Rec_Type;
458:
459: PROCEDURE Check_ComponentCount
460: ( p_bom_component_rec IN Bom_Bo_Pub.Bom_Comps_Rec_Type
461: , p_bom_comp_unexp_rec IN Bom_Bo_Pub.Bom_Comps_Unexposed_Rec_Type
462: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
463: , x_Return_Status IN OUT NOCOPY VARCHAR2
464: )
465: IS
466:
464: )
465: IS
466:
467: l_total NUMBER := 0;
468: l_mesg_token_tbl Error_Handler.Mesg_Token_Tbl_type;
469:
470: BEGIN
471:
472: x_return_status := FND_API.G_RET_STS_SUCCESS;
481: IF l_total > BOM_GLOBALS.G_COMPS_LIMIT THEN
482: g_token_tbl(1).token_name := 'ASSEMBLY_ITEM_NAME';
483: g_token_tbl(1).token_value :=
484: p_bom_component_rec.assembly_item_name;
485: Error_Handler.Add_Error_Token
486: ( p_message_name => 'BOM_COMP_COUNT_EXCEEDS_LIMIT'
487: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
488: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
489: , p_Token_Tbl => g_Token_Tbl
498:
499: PROCEDURE Check_Lineage
500: ( p_bom_component_rec IN Bom_Bo_Pub.Bom_Comps_Rec_Type
501: , p_bom_comp_unexp_rec IN Bom_Bo_Pub.Bom_Comps_Unexposed_Rec_Type
502: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
503: , x_Return_Status IN OUT NOCOPY VARCHAR2
504: )
505: IS
506: BEGIN
521: PROCEDURE Check_Access
522: ( p_organization_id IN NUMBER
523: , p_component_item_id IN NUMBER
524: , p_component_name IN VARCHAR2
525: , p_Mesg_Token_Tbl IN Error_Handler.Mesg_Token_Tbl_Type :=
526: Error_Handler.G_MISS_MESG_TOKEN_TBL
527: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
528: , x_Return_Status IN OUT NOCOPY VARCHAR2
529: )
522: ( p_organization_id IN NUMBER
523: , p_component_item_id IN NUMBER
524: , p_component_name IN VARCHAR2
525: , p_Mesg_Token_Tbl IN Error_Handler.Mesg_Token_Tbl_Type :=
526: Error_Handler.G_MISS_MESG_TOKEN_TBL
527: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
528: , x_Return_Status IN OUT NOCOPY VARCHAR2
529: )
530: IS
523: , p_component_item_id IN NUMBER
524: , p_component_name IN VARCHAR2
525: , p_Mesg_Token_Tbl IN Error_Handler.Mesg_Token_Tbl_Type :=
526: Error_Handler.G_MISS_MESG_TOKEN_TBL
527: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
528: , x_Return_Status IN OUT NOCOPY VARCHAR2
529: )
530: IS
531: l_bom_comp_item_type NUMBER;
530: IS
531: l_bom_comp_item_type NUMBER;
532: l_OPM_org VARCHAR2(1);
533: l_return_status VARCHAR2(1):=FND_API.G_RET_STS_SUCCESS;
534: l_mesg_token_tbl Error_Handler.Mesg_Token_Tbl_type;
535: l_token_tbl Error_Handler.Token_Tbl_Type;
536: BEGIN
537: /*************************************************************
538: --
531: l_bom_comp_item_type NUMBER;
532: l_OPM_org VARCHAR2(1);
533: l_return_status VARCHAR2(1):=FND_API.G_RET_STS_SUCCESS;
534: l_mesg_token_tbl Error_Handler.Mesg_Token_Tbl_type;
535: l_token_tbl Error_Handler.Token_Tbl_Type;
536: BEGIN
537: /*************************************************************
538: --
539: -- Check if the user has access to the revised component's
554: /* Validations for OPM Convergence Project
555: Model/Option class items are not allowed in OPM organizations*/
556:
557: IF (l_OPM_org='Y' and l_bom_comp_item_type in ( Bom_Globals.G_MODEL, Bom_Globals.G_OPTION_CLASS))THEN
558: Error_Handler.Add_Error_Token
559: ( p_Message_name => 'BOM_OPM_ORG_MODEL_OC'
560: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
561: , x_mesg_token_tbl => l_mesg_token_tbl
562: );
588: THEN
589: l_Token_Tbl(2).Token_Value := 'BOM_STANDARD';
590: END IF;
591:
592: Error_Handler.Add_Error_Token
593: ( p_Message_Name => 'BOM_BOM_COMP_ACCESS_DENIED'
594: , p_Mesg_Token_Tbl => l_mesg_token_tbl
595: , x_Mesg_Token_Tbl => l_mesg_token_tbl
596: , p_Token_Tbl => l_token_tbl
623: * filled in, then the record would get an error.
624: ********************************************************************/
625: PROCEDURE Check_Required
626: ( x_return_status IN OUT NOCOPY VARCHAR2
627: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
628: , p_rev_component_rec IN Bom_Bo_Pub.Rev_Component_Rec_Type
629: )
630: IS
631: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
627: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
628: , p_rev_component_rec IN Bom_Bo_Pub.Rev_Component_Rec_Type
629: )
630: IS
631: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
632: BEGIN
633: x_return_status := FND_API.G_RET_STS_SUCCESS;
634:
635: g_token_tbl(1).token_name := 'REVISED_COMPONENT_NAME';
640: p_rev_component_rec.acd_type = FND_API.G_MISS_NUM
641: ) AND
642: Bom_Globals.Get_Bo_Identifier = Bom_Globals.G_ECO_BO
643: THEN
644: Error_Handler.Add_Error_Token
645: ( p_message_name => 'BOM_ACD_TYPE_MISSING'
646: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
647: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
648: , p_Token_Tbl => g_Token_Tbl
656: ( p_rev_component_rec.from_end_item_unit_number IS NULL OR
657: p_rev_component_rec.from_end_item_unit_number = FND_API.G_MISS_CHAR
658: )
659: THEN
660: Error_Handler.Add_Error_Token
661: ( p_message_name => 'BOM_EFFECTIVITY_MISSING'
662: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
663: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
664: , p_Token_Tbl => g_Token_Tbl
866: *Config Item No Yes No Yes No Yes No Yes
867: *
868: **********************************************************************/
869: FUNCTION Verify_Item_Attributes
870: ( p_Mesg_token_tbl IN Error_Handler.Mesg_Token_Tbl_Type
871: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type)
872: RETURN BOOLEAN
873: IS
874: dummy NUMBER;
867: *
868: **********************************************************************/
869: FUNCTION Verify_Item_Attributes
870: ( p_Mesg_token_tbl IN Error_Handler.Mesg_Token_Tbl_Type
871: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type)
872: RETURN BOOLEAN
873: IS
874: dummy NUMBER;
875: l_allow_eng_comps VARCHAR2(10);
872: RETURN BOOLEAN
873: IS
874: dummy NUMBER;
875: l_allow_eng_comps VARCHAR2(10);
876: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
877:
878: BEGIN
879: l_Mesg_Token_Tbl := p_Mesg_Token_Tbl;
880:
889: --bug: 4161794
890: g_Comp_Eng_Flag = 'Y' and -- and component is Engineering
891: (l_allow_eng_comps is NULL or l_allow_eng_comps <> '1'))
892: THEN
893: Error_Handler.Add_Error_Token
894: ( x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
895: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
896: , p_message_name => 'BOM_ASSY_COMP_ENG_FLG_MISMATCH'
897: , p_Token_Tbl => g_Token_Tbl
955: g_rev_component_rec.revised_item_name;
956:
957: IF g_Assy_Item_Type IN ( Bom_Globals.G_MODEL, Bom_Globals.G_OPTION_CLASS)
958: THEN
959: Error_Handler.Add_Error_Token
960: ( p_message_name => 'BOM_ATO_PROP_MISMATCH'
961: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
962: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
963: , p_Token_Tbl => g_Token_Tbl
962: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
963: , p_Token_Tbl => g_Token_Tbl
964: );
965: ELSE
966: Error_Handler.Add_Error_Token
967: ( p_message_name => 'BOM_ATO_STD_PROP_MISMATCH'
968: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
969: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
970: , p_Token_Tbl => g_Token_Tbl
1001: g_token_tbl(2).token_name:='REVISED_ITEM_NAME';
1002: g_token_tbl(2).token_value :=
1003: g_rev_component_rec.revised_item_name;
1004:
1005: Error_Handler.Add_Error_Token
1006: ( p_message_name => 'BOM_CFG_SUPPLY_NOT_PHANTOM'
1007: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1008: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1009: , p_Token_Tbl => g_Token_Tbl
1030: g_token_tbl(2).token_name:= 'REVISED_ITEM_NAME';
1031: g_token_tbl(2).token_value :=
1032: g_rev_component_rec.revised_item_name;
1033:
1034: Error_Handler.Add_Error_Token
1035: ( p_message_name => 'BOM_CONFIG_PROP_MISMATCH'
1036: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1037: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1038: , p_Token_Tbl => g_Token_Tbl
1073: g_token_tbl(3).token_name := 'REVISED_ITEM_NAME';
1074: g_token_tbl(3).token_value :=
1075: g_rev_component_rec.revised_item_name;
1076:
1077: Error_Handler.Add_Error_Token
1078: ( p_message_name => 'BOM_MODEL_OC_PROP_MISMATCH'
1079: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1080: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1081: , p_Token_Tbl => g_Token_Tbl
1113: THEN
1114: g_token_tbl(2).token_name := 'REVISED_ITEM_NAME';
1115: g_token_tbl(2).token_value :=
1116: g_rev_component_rec.revised_item_name;
1117: Error_Handler.Add_Error_Token
1118: ( p_message_name => 'BOM_PTO_STD_PROP_MISMATCH'
1119: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1120: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1121: , p_Token_Tbl => g_Token_Tbl
1146: THEN
1147: g_token_tbl(2).token_name := 'REVISED_ITEM_NAME';
1148: g_token_tbl(2).token_value :=
1149: g_rev_component_rec.revised_item_name;
1150: Error_Handler.Add_Error_Token
1151: ( p_message_name => 'BOM_STANDARD_PROP_MISMATCH'
1152: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1153: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1154: , p_Token_Tbl => g_Token_Tbl
1166: -- Once the matrix is verified then check the ATP Components
1167: -- and ATP Check attributes
1168:
1169: IF BOM_Globals.get_debug = 'Y' THEN
1170: error_handler.write_debug('Check the ATP Components and ATP Check attribute.' );
1171: error_handler.write_debug('Assy ATP Comp Flag : ' || g_Assy_ATP_Comp_flag );
1172: error_handler.write_debug('Comp ATP Check Flag : ' || g_Comp_Atp_Check_Flag );
1173: END IF;
1174:
1167: -- and ATP Check attributes
1168:
1169: IF BOM_Globals.get_debug = 'Y' THEN
1170: error_handler.write_debug('Check the ATP Components and ATP Check attribute.' );
1171: error_handler.write_debug('Assy ATP Comp Flag : ' || g_Assy_ATP_Comp_flag );
1172: error_handler.write_debug('Comp ATP Check Flag : ' || g_Comp_Atp_Check_Flag );
1173: END IF;
1174:
1175: IF ( g_Assy_ATP_Comp_flag = 'N' AND
1168:
1169: IF BOM_Globals.get_debug = 'Y' THEN
1170: error_handler.write_debug('Check the ATP Components and ATP Check attribute.' );
1171: error_handler.write_debug('Assy ATP Comp Flag : ' || g_Assy_ATP_Comp_flag );
1172: error_handler.write_debug('Comp ATP Check Flag : ' || g_Comp_Atp_Check_Flag );
1173: END IF;
1174:
1175: IF ( g_Assy_ATP_Comp_flag = 'N' AND
1176: g_Comp_Atp_Check_Flag = 'Y'
1179: g_token_tbl(2).token_name := 'REVISED_ITEM_NAME';
1180: g_token_tbl(2).token_value :=
1181: g_rev_component_rec.revised_item_name;
1182:
1183: Error_Handler.Add_Error_Token
1184: ( p_message_name => 'BOM_ASSY_COMP_ATP_MISMATCH'
1185: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1186: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1187: , p_Token_Tbl => g_Token_Tbl
1192: END IF;
1193: -- dbms_output.put_line('End of Item Attribute Validation . . .');
1194:
1195: IF BOM_Globals.get_debug = 'Y' THEN
1196: error_handler.write_debug('Check the ATP Components and ATP Check attribute.' );
1197: END IF;
1198:
1199: **************************************************************/
1200:
1456: * 2. Wip_Supply_Type must be Phantom if the component is
1457: * Model or Option Class
1458: ********************************************************************/
1459: FUNCTION Check_Supply_Type
1460: ( p_Mesg_Token_Tbl IN Error_Handler.Mesg_Token_Tbl_Type
1461: , x_Mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type)
1462: RETURN BOOLEAN
1463: IS
1464: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
1457: * Model or Option Class
1458: ********************************************************************/
1459: FUNCTION Check_Supply_Type
1460: ( p_Mesg_Token_Tbl IN Error_Handler.Mesg_Token_Tbl_Type
1461: , x_Mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type)
1462: RETURN BOOLEAN
1463: IS
1464: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
1465: BEGIN
1460: ( p_Mesg_Token_Tbl IN Error_Handler.Mesg_Token_Tbl_Type
1461: , x_Mesg_token_tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type)
1462: RETURN BOOLEAN
1463: IS
1464: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
1465: BEGIN
1466: l_Mesg_token_Tbl := p_Mesg_Token_Tbl;
1467:
1468: IF g_rev_component_rec.WIP_Supply_Type IS NOT NULL
1484: RETURN TRUE;
1485:
1486: EXCEPTION
1487: WHEN NO_DATA_FOUND THEN
1488: Error_Handler.Add_Error_Token
1489: ( p_message_name => 'BOM_NO_BILL'
1490: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1491: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
1492: , p_message_type => 'W'
1503: IF g_Comp_Item_Type IN
1504: (l_MODEL, l_OPTION_CLASS) AND
1505: g_rev_component_rec.wip_supply_type <> 6
1506: THEN
1507: Error_Handler.Add_Error_Token
1508: ( p_message_name => 'BOM_WIP_SUPPLY_PHANTOM'
1509: ,p_Mesg_Token_Tbl=> l_Mesg_token_Tbl
1510: ,x_Mesg_Token_Tbl=> l_Mesg_Token_Tbl
1511: ,p_token_tbl => g_Token_Tbl
1786: -- calling Check_Supply_SubInventory . . .');
1787:
1788:
1789: IF Bom_Globals.Get_Debug = 'Y' THEN
1790: Error_Handler.Write_Debug('L_SUB_LOC_CONTROL :' || to_number( l_Sub_Locator_Control) );
1791: Error_Handler.Write_Debug('Now calling Check SupplySubInv: '|| g_rev_component_rec.supply_subinventory );
1792: END IF;
1793:
1794: IF l_Sub_Locator_Control IS NULL AND
1787:
1788:
1789: IF Bom_Globals.Get_Debug = 'Y' THEN
1790: Error_Handler.Write_Debug('L_SUB_LOC_CONTROL :' || to_number( l_Sub_Locator_Control) );
1791: Error_Handler.Write_Debug('Now calling Check SupplySubInv: '|| g_rev_component_rec.supply_subinventory );
1792: END IF;
1793:
1794: IF l_Sub_Locator_Control IS NULL AND
1795: g_rev_component_rec.supply_subinventory IS NOT NULL
1794: IF l_Sub_Locator_Control IS NULL AND
1795: g_rev_component_rec.supply_subinventory IS NOT NULL
1796: THEN
1797:
1798: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
1799: ('Now calling Check SupplySubInv. . .');
1800: END IF;
1801:
1802:
2729: l_to_wip_entity_id := BOM_Globals.Get_To_Wip_Entity_Id;
2730: l_from_cum_qty := BOM_Globals.Get_From_Cum_Qty;
2731:
2732: IF Bom_Globals.Get_Debug = 'Y' THEN
2733: Error_Handler.Write_Debug('Check if the rev component is valid in Eco by Prod. . .' );
2734: Error_Handler.Write_Debug('Lot Number in parent rev item : ' || l_lot_number );
2735: Error_Handler.Write_Debug('From WIP Entity Id in parent rev item : ' || to_char(l_from_wip_entity_id) );
2736: Error_Handler.Write_Debug('To WIP Entity Id in parent rev item : ' || to_char(l_to_wip_entity_id) );
2737: Error_Handler.Write_Debug('Cum Qty in parent rev item : ' || to_char(l_from_cum_qty) );
2730: l_from_cum_qty := BOM_Globals.Get_From_Cum_Qty;
2731:
2732: IF Bom_Globals.Get_Debug = 'Y' THEN
2733: Error_Handler.Write_Debug('Check if the rev component is valid in Eco by Prod. . .' );
2734: Error_Handler.Write_Debug('Lot Number in parent rev item : ' || l_lot_number );
2735: Error_Handler.Write_Debug('From WIP Entity Id in parent rev item : ' || to_char(l_from_wip_entity_id) );
2736: Error_Handler.Write_Debug('To WIP Entity Id in parent rev item : ' || to_char(l_to_wip_entity_id) );
2737: Error_Handler.Write_Debug('Cum Qty in parent rev item : ' || to_char(l_from_cum_qty) );
2738: END IF;
2731:
2732: IF Bom_Globals.Get_Debug = 'Y' THEN
2733: Error_Handler.Write_Debug('Check if the rev component is valid in Eco by Prod. . .' );
2734: Error_Handler.Write_Debug('Lot Number in parent rev item : ' || l_lot_number );
2735: Error_Handler.Write_Debug('From WIP Entity Id in parent rev item : ' || to_char(l_from_wip_entity_id) );
2736: Error_Handler.Write_Debug('To WIP Entity Id in parent rev item : ' || to_char(l_to_wip_entity_id) );
2737: Error_Handler.Write_Debug('Cum Qty in parent rev item : ' || to_char(l_from_cum_qty) );
2738: END IF;
2739:
2732: IF Bom_Globals.Get_Debug = 'Y' THEN
2733: Error_Handler.Write_Debug('Check if the rev component is valid in Eco by Prod. . .' );
2734: Error_Handler.Write_Debug('Lot Number in parent rev item : ' || l_lot_number );
2735: Error_Handler.Write_Debug('From WIP Entity Id in parent rev item : ' || to_char(l_from_wip_entity_id) );
2736: Error_Handler.Write_Debug('To WIP Entity Id in parent rev item : ' || to_char(l_to_wip_entity_id) );
2737: Error_Handler.Write_Debug('Cum Qty in parent rev item : ' || to_char(l_from_cum_qty) );
2738: END IF;
2739:
2740:
2733: Error_Handler.Write_Debug('Check if the rev component is valid in Eco by Prod. . .' );
2734: Error_Handler.Write_Debug('Lot Number in parent rev item : ' || l_lot_number );
2735: Error_Handler.Write_Debug('From WIP Entity Id in parent rev item : ' || to_char(l_from_wip_entity_id) );
2736: Error_Handler.Write_Debug('To WIP Entity Id in parent rev item : ' || to_char(l_to_wip_entity_id) );
2737: Error_Handler.Write_Debug('Cum Qty in parent rev item : ' || to_char(l_from_cum_qty) );
2738: END IF;
2739:
2740:
2741: -- Check if comp exists in ECO by Lot
2754: )
2755: LOOP
2756:
2757: IF Bom_Globals.Get_Debug = 'Y' THEN
2758: Error_Handler.Write_Debug('In Eco by Lot Number, this rev component is invalid. . .' );
2759: END IF;
2760: l_ret_status := FALSE ;
2761: END LOOP ;
2762:
2774: , p_operation_seq_num => p_operation_seq_num )
2775: LOOP
2776:
2777: IF Bom_Globals.Get_Debug = 'Y' THEN
2778: Error_Handler.Write_Debug('In Eco by Cum Qty, this rev component is invalid. . .' );
2779: END IF;
2780:
2781: l_ret_status := FALSE ;
2782: END LOOP ;
2795: , p_organization_id => p_organization_Id )
2796: LOOP
2797:
2798: IF Bom_Globals.Get_Debug = 'Y' THEN
2799: Error_Handler.Write_Debug('In Eco by range work order, this rev component is invalid. . .' );
2800: END IF;
2801:
2802: l_ret_status := FALSE ;
2803: END LOOP ;
2808: AND l_from_cum_qty IS NULL
2809: THEN
2810:
2811: IF Bom_Globals.Get_Debug = 'Y' THEN
2812: Error_Handler.Write_Debug('Parent revised item is not Eco by production. . .' );
2813: END IF;
2814:
2815: NULL ;
2816:
3022: * does not invalidate some other columns.
3023: **********************************************************************/
3024: PROCEDURE Check_Entity
3025: ( x_return_status IN OUT NOCOPY VARCHAR2
3026: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
3027: , p_rev_component_rec IN Bom_Bo_Pub.Rev_Component_Rec_Type
3028: , p_Rev_Comp_Unexp_Rec IN Bom_Bo_Pub.Rev_Comp_Unexposed_Rec_Type
3029: , p_control_rec IN BOM_BO_PUB.Control_Rec_Type
3030: := BOM_BO_PUB.G_DEFAULT_CONTROL_REC
3037: l_processed BOOLEAN;
3038: l_result NUMBER;
3039: l_Err_Text VARCHAR2(2000);
3040: l_bom_item_type NUMBER;
3041: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
3042: l_is_comp_unit_Controlled BOOLEAN := FALSE;
3043: l_is_item_unit_controlled BOOLEAN := FALSE;
3044: l_debug_error_mesg VARCHAR2(2000);
3045: l_new_compare_date DATE;
3043: l_is_item_unit_controlled BOOLEAN := FALSE;
3044: l_debug_error_mesg VARCHAR2(2000);
3045: l_new_compare_date DATE;
3046: l_total_rds NUMBER;
3047: l_Token_Tbl Error_Handler.Token_Tbl_Type;
3048: l_Structure_Type_Name VARCHAR2(30);
3049:
3050:
3051: CURSOR c_RefDesgs IS
3200: where nvl(p_rev_component_rec.acd_type,1) <>3 and component_sequence_id=p_Rev_Comp_Unexp_Rec.component_sequence_id;
3201: IF(l_total_rds <>0) THEN
3202: l_Token_Tbl(1).Token_Name := 'REVISED_COMPONENT_NAME';
3203: l_Token_Tbl(1).Token_Value := p_rev_component_rec.component_item_name;
3204: Error_Handler.Add_Error_Token
3205: ( x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3206: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3207: , p_message_name => 'BOM_LOT_BASED_RDS'
3208: , p_Token_Tbl => l_Token_Tbl
3215:
3216:
3217: IF Bom_Globals.Get_Debug = 'Y'
3218: THEN
3219: Error_Handler.Write_Debug('Performing Revised component Entity Validation. . .');
3220: END IF;
3221:
3222: l_is_comp_unit_controlled := BOM_GLOBALS.Get_Unit_Controlled_Component;
3223: l_is_item_unit_controlled := BOM_GLOBALS.Get_Unit_Controlled_Item;
3222: l_is_comp_unit_controlled := BOM_GLOBALS.Get_Unit_Controlled_Component;
3223: l_is_item_unit_controlled := BOM_GLOBALS.Get_Unit_Controlled_Item;
3224:
3225: IF Bom_Globals.Get_Debug = 'Y' THEN
3226: Error_Handler.Write_Debug('Checked if revised item is unit controlled. . .');
3227: Error_Handler.Write_Debug('Org id: ' || to_char(g_rev_Comp_Unexp_Rec.Organization_Id));
3228: Error_Handler.Write_Debug('Item id: ' || to_char(g_rev_Comp_Unexp_Rec.revised_item_id));
3229: Error_Handler.Write_Debug('Comp id: ' || to_char(g_rev_Comp_Unexp_Rec.Component_item_id));
3230: Error_Handler.Write_Debug('Trans type: ' || g_rev_component_rec.transaction_type);
3223: l_is_item_unit_controlled := BOM_GLOBALS.Get_Unit_Controlled_Item;
3224:
3225: IF Bom_Globals.Get_Debug = 'Y' THEN
3226: Error_Handler.Write_Debug('Checked if revised item is unit controlled. . .');
3227: Error_Handler.Write_Debug('Org id: ' || to_char(g_rev_Comp_Unexp_Rec.Organization_Id));
3228: Error_Handler.Write_Debug('Item id: ' || to_char(g_rev_Comp_Unexp_Rec.revised_item_id));
3229: Error_Handler.Write_Debug('Comp id: ' || to_char(g_rev_Comp_Unexp_Rec.Component_item_id));
3230: Error_Handler.Write_Debug('Trans type: ' || g_rev_component_rec.transaction_type);
3231: END IF;
3224:
3225: IF Bom_Globals.Get_Debug = 'Y' THEN
3226: Error_Handler.Write_Debug('Checked if revised item is unit controlled. . .');
3227: Error_Handler.Write_Debug('Org id: ' || to_char(g_rev_Comp_Unexp_Rec.Organization_Id));
3228: Error_Handler.Write_Debug('Item id: ' || to_char(g_rev_Comp_Unexp_Rec.revised_item_id));
3229: Error_Handler.Write_Debug('Comp id: ' || to_char(g_rev_Comp_Unexp_Rec.Component_item_id));
3230: Error_Handler.Write_Debug('Trans type: ' || g_rev_component_rec.transaction_type);
3231: END IF;
3232:
3225: IF Bom_Globals.Get_Debug = 'Y' THEN
3226: Error_Handler.Write_Debug('Checked if revised item is unit controlled. . .');
3227: Error_Handler.Write_Debug('Org id: ' || to_char(g_rev_Comp_Unexp_Rec.Organization_Id));
3228: Error_Handler.Write_Debug('Item id: ' || to_char(g_rev_Comp_Unexp_Rec.revised_item_id));
3229: Error_Handler.Write_Debug('Comp id: ' || to_char(g_rev_Comp_Unexp_Rec.Component_item_id));
3230: Error_Handler.Write_Debug('Trans type: ' || g_rev_component_rec.transaction_type);
3231: END IF;
3232:
3233: -- First Query all the attributes for the Assembly item and
3226: Error_Handler.Write_Debug('Checked if revised item is unit controlled. . .');
3227: Error_Handler.Write_Debug('Org id: ' || to_char(g_rev_Comp_Unexp_Rec.Organization_Id));
3228: Error_Handler.Write_Debug('Item id: ' || to_char(g_rev_Comp_Unexp_Rec.revised_item_id));
3229: Error_Handler.Write_Debug('Comp id: ' || to_char(g_rev_Comp_Unexp_Rec.Component_item_id));
3230: Error_Handler.Write_Debug('Trans type: ' || g_rev_component_rec.transaction_type);
3231: END IF;
3232:
3233: -- First Query all the attributes for the Assembly item and
3234: -- component item.
3336: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3337: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3338: END;
3339: END IF;
3340: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Check Eco Status . . .' || l_return_status); END IF;
3341:
3342: -- Added by MK on 01/26/2001 for ECO New Effectivities
3343: -- Verify the ECO Effectivity, If ECO by WO, Lot Num, Or Cum Qty, then
3344: -- Check if the component exists in the WO or Lot Num.
3361: g_token_tbl(2).token_name := 'REVISED_COMPONENT_NAME';
3362: g_token_tbl(2).token_value :=
3363: g_rev_component_rec.component_item_name;
3364:
3365: Error_Handler.Add_Error_Token
3366: ( p_message_name => 'BOM_CMP_RIT_ECO_WO_EFF_INVALID'
3367: , p_mesg_token_tbl => l_Mesg_Token_Tbl
3368: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3369: , p_token_tbl => g_token_tbl
3373: g_Token_Tbl(1).Token_Name := 'REVISED_COMPONENT_NAME';
3374: g_Token_Tbl(1).Token_Value := p_rev_component_rec.component_item_name;
3375: END IF ;
3376: IF Bom_Globals.Get_Debug = 'Y' THEN
3377: Error_Handler.Write_Debug('Check if the rev component is valid in Eco by Prod. . .' || l_return_status);
3378: END IF;
3379: END IF ;
3380:
3381:
3394: g_token_tbl.delete;
3395: g_token_tbl(1).token_name := 'REVISED_COMPONENT_NAME';
3396: g_token_tbl(1).token_value :=
3397: g_rev_component_rec.component_item_name;
3398: Error_Handler.Add_Error_Token
3399: ( p_message_name => 'BOM_TOUNIT_LESS_THAN_FROMUNIT'
3400: , p_mesg_token_tbl => l_Mesg_Token_Tbl
3401: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3402: , p_token_tbl => g_token_tbl
3403: );
3404:
3405: l_return_status := FND_API.G_RET_STS_ERROR;
3406:
3407: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Check to end item unit number. . .' || l_return_status); END IF;
3408:
3409: END IF;
3410:
3411: --
3417: g_token_tbl(1).token_name := 'REVISED_ITEM_NAME';
3418: g_token_tbl(1).token_value :=
3419: g_rev_component_rec.revised_item_name;
3420:
3421: Error_Handler.Add_Error_Token
3422: ( p_message_name => 'BOM_REV_ITEM_BOM_NOT_ENABLED'
3423: , p_mesg_token_tbl => l_Mesg_Token_Tbl
3424: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3425: , p_token_tbl => g_token_tbl
3457: g_token_tbl(1).token_name := 'REVISED_COMPONENT_NAME';
3458: g_token_tbl(1).token_value :=
3459: g_rev_component_rec.component_item_name;
3460:
3461: Error_Handler.Add_Error_Token
3462: ( p_message_name => 'BOM_DISABLE_TOUNIT_INVALID'
3463: , p_mesg_token_tbl => l_Mesg_Token_Tbl
3464: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3465: , p_token_tbl => g_token_tbl
3488: g_token_tbl(2).token_name := 'REVISED_ITEM_NAME';
3489: g_token_tbl(2).token_value :=
3490: g_rev_component_rec.revised_item_name;
3491:
3492: Error_Handler.Add_Error_Token
3493: ( p_message_name => 'BOM_CMP_UNIT_RIT_NOT_UNIT'
3494: , p_mesg_token_tbl => l_Mesg_Token_Tbl
3495: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3496: , p_token_tbl => g_token_tbl
3512: g_token_tbl(1).token_name := 'REVISED_ITEM_NAME';
3513: g_token_tbl(1).token_value :=
3514: g_rev_component_rec.revised_item_name;
3515:
3516: Error_Handler.Add_Error_Token
3517: ( p_message_name => 'BOM_CMP_UNIT_TYPE_NOT_VALID'
3518: , p_mesg_token_tbl => l_Mesg_Token_Tbl
3519: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3520: , p_token_tbl => g_token_tbl
3531: g_token_tbl(1).token_name := 'REVISED_ITEM_NAME';
3532: g_token_tbl(1).token_value :=
3533: g_rev_component_rec.revised_item_name;
3534:
3535: Error_Handler.Add_Error_Token
3536: ( p_message_name => 'BOM_REV_ITEM_BOM_NOT_ENABLED'
3537: , p_mesg_token_tbl => l_Mesg_Token_Tbl
3538: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3539: , p_token_tbl => g_token_tbl
3546:
3547: END IF; */
3548: IF NOT Check_PrimaryBill AND Nvl(Bom_Globals.Get_Validate_For_Plm,'N') = 'N'
3549: THEN
3550: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('ACD type to be add if primary bill does not exist . . .'); END IF;
3551: IF NVL(p_rev_component_rec.acd_type, 1) <> 1 AND
3552: Bom_Globals.Get_Bo_Identifier = Bom_Globals.G_ECO_BO
3553: THEN
3554: /*****************************************************
3559: ******************************************************/
3560: IF FND_MSG_PUB.Check_Msg_Level
3561: (FND_MSG_PUB.G_MSG_LVL_ERROR)
3562: THEN
3563: Error_Handler.Add_Error_Token
3564: ( p_message_name => 'BOM_CMP_ACD_TYPE_ADD'
3565: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3566: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3567: , p_token_tbl => g_token_tbl
3591: THEN
3592: g_token_tbl(2).token_name := 'REVISED_ITEM_NAME';
3593: g_token_tbl(2).token_value :=
3594: p_rev_component_rec.revised_item_name;
3595: Error_Handler.Add_Error_Token
3596: ( p_Message_Name => 'BOM_BILL_COMMON'
3597: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3598: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3599: , p_Token_Tbl => g_Token_Tbl
3618: THEN
3619: g_token_tbl(2).token_name := 'REVISED_ITEM_NAME';
3620: g_token_tbl(2).token_value :=
3621: p_rev_component_rec.revised_item_name;
3622: Error_Handler.Add_Error_Token
3623: ( p_Message_Name => 'BOM_BILL_COMMON'
3624: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3625: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3626: , p_Token_Tbl => g_Token_Tbl
3631: WHEN OTHERS THEN
3632: IF FND_MSG_PUB.Check_Msg_Level
3633: (FND_MSG_PUB.G_MSG_LVL_ERROR)
3634: THEN
3635: Error_Handler.Add_Error_Token
3636: ( p_message_name => NULL
3637: , p_message_text => 'Common Bill Check ' ||
3638: SUBSTR(SQLERRM, 1, 30) || ' '||
3639: TO_CHAR(SQLCODE)
3659: g_token_tbl(1).token_name := 'REVISED_ITEM_NAME';
3660: g_token_tbl(1).token_value :=
3661: g_rev_component_rec.revised_item_name;
3662:
3663: Error_Handler.Add_Error_Token
3664: ( x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3665: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3666: , p_Message_name => 'BOM_COMP_SAME_AS_BILL'
3667: , p_token_tbl => g_token_tbl
3690: -- Check if ACD type is not Disable or Update
3691: IF( nvl(p_rev_component_rec.acd_type, 1) NOT IN (2 , 3)) THEN -- Change or Disable
3692: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3693: THEN
3694: Error_Handler.Add_Error_Token
3695: ( x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3696: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3697: , p_Message_name => 'BOM_COMP_ITEM_BOM_NOT_ENABLED'
3698: , p_token_tbl => g_token_tbl
3743: END LOOP;
3744: END IF;
3745:
3746: IF item_num_for_bill = 1 THEN
3747: Error_Handler.Add_Error_Token
3748: ( x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3749: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3750: , p_message_name => 'BOM_ITEM_NUM_NOT_UNIQUE'
3751: , p_Token_Tbl => g_Token_Tbl
3770: IF g_Comp_Item_Type = 5
3771: THEN
3772: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3773: THEN
3774: Error_Handler.Add_Error_Token
3775: ( p_message_name => 'BOM_ITEM_PRODUCT_FAMILY'
3776: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3777: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3778: , p_token_tbl => g_token_tbl
3787: l_return_status := FND_API.G_RET_STS_ERROR;
3788: END IF;
3789:
3790: IF BOM_Globals.get_debug = 'Y' THEN
3791: error_handler.write_debug('Check Item Attribute Validation. . .' || l_Return_Status );
3792: END IF;
3793:
3794: --
3795: -- Verify if the revised item is being referenced as common in
3797: -- component to be on the bill.
3798: --
3799: l_result := Check_Common_Other_Orgs;
3800:
3801: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Check Common_Other_Orgs returned with result ' || to_char(l_result)); END IF;
3802:
3803: IF l_result <> 0
3804: THEN
3805: IF l_result = 1
3814: END IF;
3815:
3816: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3817: THEN
3818: Error_Handler.Add_Error_Token
3819: ( p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3820: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3821: , p_message_name => l_err_text
3822: , p_token_tbl => g_token_tbl
3844: p_rev_component_rec.shipping_allowed
3845: THEN
3846: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3847: THEN
3848: Error_Handler.Add_Error_Token
3849: ( p_message_name => 'BOM_SHIP_ALLOWED_NOT_UPDATE'
3850: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3851: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3852: , p_token_tbl => g_token_tbl
3870: --if the change on common bom is only in the wip attributes,
3871: --allow it.
3872: NULL;
3873: ELSE
3874: Error_Handler.Add_Error_Token
3875: ( p_message_name => 'BOM_INVALID_COMMON_BOM_CHANGE'
3876: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3877: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3878: , p_token_tbl => g_token_tbl
3890: IF Check_Optional_For_Comp_Ops
3891: THEN
3892: g_token_tbl(1).token_name := 'COMPONENT_ITEM_NAME';
3893: g_token_tbl(1).token_value := p_rev_component_rec.component_item_name;
3894: Error_Handler.Add_Error_Token
3895: ( p_message_name => 'BOM_COMP_OPERATION_EXIST'
3896: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3897: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3898: , p_token_tbl => g_token_tbl
3908: Bom_Globals.Get_Bo_Identifier = Bom_Globals.G_ECO_BO
3909: THEN
3910: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3911: THEN
3912: Error_Handler.Add_Error_Token
3913: ( p_message_name => 'BOM_OLD_EFFECTIVITY_GIVEN'
3914: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3915: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3916: , p_token_tbl => g_token_tbl
3926: Bom_Globals.Get_Bo_Identifier = Bom_Globals.G_ECO_BO
3927: THEN
3928: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3929: THEN
3930: Error_Handler.Add_Error_Token
3931: ( p_message_name => 'BOM_OLD_OP_SEQ_NUM_GIVEN'
3932: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3933: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3934: , p_token_tbl => g_token_tbl
3945: Bom_Globals.Get_Bo_Identifier = Bom_Globals.G_ECO_BO
3946: THEN
3947: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3948: THEN
3949: Error_Handler.Add_Error_Token
3950: ( p_message_name => 'BOM_ACD_TYPE_NOT_UPDATEABLE'
3951: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3952: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3953: , p_token_tbl => g_token_tbl
3964: Bom_Globals.Get_Bo_Identifier = Bom_Globals.G_ECO_BO
3965: THEN
3966: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3967: THEN
3968: Error_Handler.Add_Error_Token
3969: ( p_message_name => 'BOM_COMPONENT_DISABLED'
3970: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3971: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3972: , p_token_tbl => g_token_tbl
3983: p_old_rev_component_rec.to_end_item_unit_number
3984: THEN
3985: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
3986: THEN
3987: Error_Handler.Add_Error_Token
3988: ( p_message_name => 'BOM_DISABLE_TOUNIT_NONUPD'
3989: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3990: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
3991: , p_token_tbl => g_token_tbl
4030: g_token_tbl(2).token_name :=
4031: 'REVISED_ITEM_NAME';
4032: g_token_tbl(2).token_value :=
4033: g_rev_component_Rec.revised_item_name;
4034: Error_Handler.Add_Error_Token
4035: ( p_Message_Name => 'BOM_COMP_YIELD_NOT_ONE'
4036: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4037: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4038: , p_Token_Tbl => g_Token_Tbl
4050: g_token_tbl(2).token_name :=
4051: 'REVISED_ITEM_NAME';
4052: g_token_tbl(2).token_value :=
4053: g_rev_component_Rec.revised_item_name;
4054: Error_Handler.Add_Error_Token
4055: ( p_Message_Name => 'BOM_COMP_YIELD_NOT_NEGATIVE'
4056: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4057: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4058: , p_Token_Tbl => g_Token_Tbl
4068: (FND_MSG_PUB.G_MSG_LVL_ERROR)
4069: THEN
4070: -- Log warning
4071:
4072: Error_Handler.Add_Error_Token
4073: ( p_Message_Name => 'BOM_YIELD_WARNING'
4074: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4075: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4076: , p_message_type => 'W'
4083:
4084: IF not(p_rev_component_rec.BASIS_TYPE is null or p_rev_component_rec.BASIS_TYPE=2
4085: or p_rev_component_rec.BASIS_TYPE =FND_API.G_MISS_NUM)
4086: THEN
4087: Error_Handler.Add_Error_Token
4088: ( p_Message_Name => 'BOM_BASIS_TYPE_INVALID'
4089: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4090: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4091: , p_message_type => 'E'
4097: -- WIP supply type is Phantom. Basis_type can not be lot for Model/OC items
4098:
4099: IF (p_rev_component_rec.WIP_SUPPLY_TYPE =6 AND p_rev_component_rec.BASIS_TYPE=2)
4100: THEN
4101: Error_Handler.Add_Error_Token
4102: ( p_Message_Name => 'BOM_LOT_BASED_PHANTOM'
4103: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4104: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4105: , p_message_type => 'E'
4108: END IF;
4109:
4110: -- For Components of PTO Kits, Models, Option Classes, Basis type should be item.
4111: IF(g_Assy_PTO_flag ='Y' and p_rev_component_rec.BASIS_TYPE=2) then
4112: Error_Handler.Add_Error_Token
4113: ( p_Message_Name => 'BOM_LOT_BASED_PTO'
4114: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4115: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4116: , p_message_type => 'E'
4122: -- components should not be lot based.
4123: IF ( p_rev_component_rec.BASIS_TYPE=2
4124: and (p_rev_component_rec.OPTIONAL=1
4125: or g_Comp_Item_Type in (Bom_Globals.G_MODEL, Bom_Globals.G_OPTION_CLASS) )) THEN
4126: Error_Handler.Add_Error_Token
4127: ( p_Message_Name => 'BOM_LOT_BASED_ATO'
4128: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4129: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4130: , p_message_type => 'E'
4134:
4135: /* Validations for OPM convergence Project, Dual UOM tracking items should not be allowed
4136: for updates and creates */
4137: IF (G_Assy_Tracking_Quantity_Ind <>'P' or G_Comp_Tracking_Quantity_Ind <>'P') then
4138: Error_Handler.Add_Error_Token
4139: ( p_Message_Name => 'BOM_DUAL_UOM_ITEMS'
4140: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4141: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4142: , p_message_type => 'E'
4164: p_rev_component_rec.disable_date <
4165: p_rev_component_rec.start_effective_date THEN
4166: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
4167: THEN
4168: Error_Handler.Add_Error_Token
4169: ( p_message_name => 'BOM_COMP_DIS_DATE_INVALID'
4170: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4171: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4172: , p_Token_Tbl => g_Token_Tbl
4181: -- p_rev_component_rec.new_effectivity_date < SYSDATE OR -- Bug3281414
4182: p_rev_component_rec.disable_date < p_rev_component_rec.new_effectivity_date
4183: )
4184: THEN
4185: Error_Handler.Add_Error_Token
4186: ( p_message_name => 'BOM_COMP_DIS_DATE_INVALID'
4187: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4188: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4189: , p_Token_Tbl => g_Token_Tbl
4208: p_rev_component_rec.quantity_per_assembly
4209: THEN
4210: -- GIVE A WARNING
4211: --
4212: Error_Handler.Add_Error_Token
4213: ( p_message_name => 'BOM_QTY_REL_QTY_REF_DESG'
4214: , p_Mesg_Token_Tbl=> l_Mesg_Token_Tbl
4215: , x_Mesg_Token_Tbl=> l_Mesg_Token_Tbl
4216: , p_Token_Tbl => g_Token_Tbl
4230: IF round(p_rev_component_rec.quantity_per_assembly) <>
4231: p_rev_component_rec.quantity_per_assembly AND
4232: p_rev_component_rec.quantity_related = 1
4233: THEN
4234: Error_Handler.Add_Error_Token
4235: ( p_message_name => 'BOM_QTY_REL_QTY_FRACTIONAL'
4236: , p_Mesg_Token_Tbl=> l_Mesg_Token_Tbl
4237: , x_Mesg_Token_Tbl=> l_Mesg_Token_Tbl
4238: , p_Token_Tbl => g_Token_Tbl
4254:
4255: IF p_rev_component_rec.Transaction_Type = BOM_GLOBALS.G_OPR_CREATE AND
4256: p_rev_component_rec.acd_type IN (2, 3)
4257: THEN
4258: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Old sequence: ' || to_char(p_rev_comp_Unexp_rec.old_component_sequence_id)); END IF;
4259: BEGIN
4260: SELECT 'Component Implemented'
4261: INTO l_dummy
4262: FROM bom_inventory_components
4269: -- component is yet not implemented
4270: IF FND_MSG_PUB.Check_Msg_Level
4271: (FND_MSG_PUB.G_MSG_LVL_ERROR)
4272: THEN
4273: Error_Handler.Add_Error_Token
4274: ( p_message_name => 'BOM_OLD_COMP_SEQ_ID_INVALID'
4275: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4276: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4277: , p_Token_Tbl => g_Token_Tbl
4279: END IF;
4280: l_return_status := FND_API.G_RET_STS_ERROR;
4281: WHEN OTHERS THEN
4282: -- dbms_output.put_line(SQLERRM);
4283: Error_Handler.Add_Error_Token
4284: ( p_message_name => NULL
4285: , p_message_text => 'ERROR Rev Cmp entity validate ' ||
4286: SUBSTR(SQLERRM, 1, 30) || ' ' ||
4287: TO_CHAR(SQLCODE)
4310: g_Rev_Component_rec.revised_item_name;
4311: g_Token_Tbl(1).Token_Name := 'NEW_FROM_UNIT_NUMBER';
4312: g_Token_Tbl(1).Token_Value := g_Rev_Component_rec.new_from_end_item_unit_number;
4313:
4314: Error_Handler.Add_Error_Token
4315: ( p_Message_Name => 'BOM_NEW_FROM_UNIT_NUM_OVERLAP'
4316: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4317: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4318: , p_Token_Tbl => g_Token_Tbl
4338: p_rev_component_rec.acd_type IN (2, 3)
4339: THEN
4340:
4341: IF Bom_Globals.Get_Debug = 'Y' THEN
4342: Error_Handler.Write_Debug('Checking old component : '|| to_char(p_rev_comp_unexp_rec.old_component_sequence_id));
4343: END IF;
4344:
4345: l_eco_for_production := NVL(Bom_Globals.Get_Eco_For_Production,2) ;
4346:
4351: -- component is invalid
4352: IF FND_MSG_PUB.Check_Msg_Level
4353: (FND_MSG_PUB.G_MSG_LVL_ERROR)
4354: THEN
4355: Error_Handler.Add_Error_Token
4356: ( p_message_name => 'BOM_OLD_COMP_SEQ_ID_INVALID'
4357: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4358: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4359: , p_Token_Tbl => g_Token_Tbl
4362: l_return_status := FND_API.G_RET_STS_ERROR;
4363: END LOOP ;
4364:
4365: IF Bom_Globals.Get_Debug = 'Y' THEN
4366: Error_Handler.Write_Debug('After checking old component. Return status is '|| l_return_status);
4367: END IF;
4368:
4369: END IF;
4370:
4412: THEN
4413: IF FND_MSG_PUB.Check_Msg_Level
4414: (FND_MSG_PUB.G_MSG_LVL_ERROR)
4415: THEN
4416: Error_Handler.Add_Error_Token
4417: ( p_message_name => 'BOM_ONLY_ONE'
4418: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4419: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4420: , p_Token_Tbl => g_Token_Tbl
4433:
4434: l_result := Check_Op_Seq(l_is_item_unit_controlled);
4435: --arudresh_debug('Result after check_op_seq '||l_result);
4436:
4437: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Check_Op_Seq returned with : ' || l_result); END IF;
4438: IF l_result = 1
4439: THEN
4440: g_Token_Tbl(1).Token_Name := 'REVISED_ITEM_NAME';
4441: g_Token_Tbl(1).Token_Value :=
4439: THEN
4440: g_Token_Tbl(1).Token_Name := 'REVISED_ITEM_NAME';
4441: g_Token_Tbl(1).Token_Value :=
4442: g_Rev_Component_rec.revised_item_name;
4443: Error_Handler.Add_Error_Token
4444: ( p_Message_Name => 'BOM_OP_SEQ_NUM_INVALID'
4445: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4446: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4447: , p_Token_Tbl => g_Token_Tbl
4458: */
4459: ELSIF l_result = 3 THEN
4460: g_Token_Tbl(1).Token_Name := 'REVISED_COMPONENT_NAME';
4461: g_Token_Tbl(1).Token_Value := g_Rev_Component_rec.component_item_name;
4462: Error_Handler.Add_Error_Token
4463: ( p_Message_Name => 'BOM_COMP_OPS_OP_SEQ'
4464: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4465: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4466: , p_Token_Tbl => g_Token_Tbl
4471: g_Token_Tbl(2).Token_Name := 'OP_SEQ_NUM';
4472: g_Token_Tbl(2).Token_Value :=
4473: to_char
4474: (g_Rev_Component_rec.operation_sequence_number);
4475: Error_Handler.Add_Error_Token
4476: ( p_message_name => 'BOM_OP_SEQ_NUM_NOT_UNIQUE'
4477: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4478: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4479: , p_Token_Tbl => g_Token_Tbl
4484: g_Token_Tbl(2).Token_Name := 'OP_SEQ_NUM';
4485: g_Token_Tbl(2).Token_Value :=
4486: to_char
4487: (g_Rev_Component_rec.operation_sequence_number);
4488: Error_Handler.Add_Error_Token
4489: ( p_message_name => 'BOM_OP_SEQ_NUM_NOT_UNIQUE'
4490: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4491: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4492: , p_Token_Tbl => g_Token_Tbl
4494: );
4495: g_Token_Tbl.DELETE(2);
4496: END IF;
4497: ELSIF l_result = 4 THEN
4498: Error_Handler.Add_Error_Token
4499: ( p_Message_Name => 'BOM_COMMON_OP_SEQ_INVALID'
4500: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4501: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4502: , p_Token_Tbl => g_Token_Tbl
4527: g_Token_Tbl(2).Token_Name := 'OLD_OP_SEQUENCE_NUM';
4528: g_Token_Tbl(2).Token_Value :=
4529: to_char
4530: (g_Rev_Component_rec.old_operation_sequence_number);
4531: Error_Handler.Add_Error_Token
4532: ( p_message_name => 'BOM_OLD_OP_SEQ_NUM_GIVEN'
4533: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4534: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4535: , p_Token_Tbl => g_Token_Tbl
4542: END IF; -- Operation_seq_Num Check Ends.
4543: --END IF; -- Validate for plm ends
4544: END IF;
4545:
4546: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Op seq num validation completed with ' || l_return_status); END IF;
4547:
4548: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('BO identifier is '||Bom_Globals.Get_Bo_Identifier); END IF;
4549:
4550: IF Bom_Globals.Get_Bo_Identifier = Bom_Globals.G_ECO_BO AND NVL(p_rev_Component_rec.ACD_Type,1) <> 3 THEN
4544: END IF;
4545:
4546: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Op seq num validation completed with ' || l_return_status); END IF;
4547:
4548: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('BO identifier is '||Bom_Globals.Get_Bo_Identifier); END IF;
4549:
4550: IF Bom_Globals.Get_Bo_Identifier = Bom_Globals.G_ECO_BO AND NVL(p_rev_Component_rec.ACD_Type,1) <> 3 THEN
4551: IF Nvl(Bom_Globals.Get_Validate_For_Plm,'N') = 'N'
4552: THEN
4577: --if function return true then component dates overlapp
4578:
4579: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
4580: THEN
4581: Error_Handler.Add_Error_Token
4582: ( p_Message_Name => 'BOM_COMP_OPSEQ_DATE_OVERLAP'
4583: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4584: , p_token_tbl => g_token_tbl
4585: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4588: END IF;
4589: -- Since Open Interface allows for Dates to be
4590: -- overlapping do set the error status.
4591: END IF;
4592: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Verified overlapping dates . . . ' || l_return_status); END IF;
4593:
4594: ELSE
4595:
4596: /********************************************************************
4613: --if function return true then component dates overlapp
4614:
4615: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
4616: THEN
4617: Error_Handler.Add_Error_Token
4618: ( p_Message_Name => 'BOM_COMP_OPSEQ_UNIT_OVERLAP'
4619: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4620: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4621: , p_token_tbl => g_token_tbl
4664: --if function return true then component dates overlapp
4665:
4666: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
4667: THEN
4668: Error_Handler.Add_Error_Token
4669: ( p_Message_Name => 'BOM_COMP_OPSEQ_DATE_OVERLAP'
4670: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4671: , p_token_tbl => g_token_tbl
4672: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4674: );
4675: END IF;
4676: l_return_status := FND_API.G_RET_STS_ERROR;
4677: END IF;
4678: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Verified overlapping dates . . . ' || l_return_status); END IF;
4679:
4680: ELSE
4681: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('I am here Inside Unit Eff'); END IF;
4682:
4677: END IF;
4678: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Verified overlapping dates . . . ' || l_return_status); END IF;
4679:
4680: ELSE
4681: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('I am here Inside Unit Eff'); END IF;
4682:
4683: /********************************************************************
4684: --
4685: -- Check for Overlapping numbers for the component being inserted.
4701: --if function return true then component unit numbers overlapp
4702:
4703: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
4704: THEN
4705: Error_Handler.Add_Error_Token
4706: ( p_Message_Name => 'BOM_COMP_OPSEQ_UNIT_OVERLAP'
4707: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4708: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4709: , p_token_tbl => g_token_tbl
4715: END IF;
4716: END IF; -- Validate for Plm check ends
4717: END IF;
4718:
4719: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Verified overlapping unit numbers. . .' || l_return_status); END IF;
4720:
4721:
4722: If (p_rev_component_rec.Transaction_Type=BOM_GLOBALS.G_OPR_CREATE AND g_Assy_Item_Type = Bom_Globals.G_PRODUCT_FAMILY) THEN
4723: l_Result := CheckUnique_PF_Member;
4726: THEN
4727: g_Token_Tbl(2).Token_Name := 'pf_item';
4728: g_Token_Tbl(2).Token_Value :=
4729: g_rev_component_rec.revised_item_name;
4730: Error_Handler.Add_Error_Token
4731: ( p_message_name => 'BOM_PF_MEMBER_ALREADY_EXISTS'
4732: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4733: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4734: , p_Token_Tbl => g_Token_Tbl
4761: l_Result := Check_PTO_ATO_for_Optional;
4762: IF l_Result = 1 THEN
4763: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
4764: THEN
4765: Error_Handler.Add_Error_Token
4766: ( p_message_name => 'BOM_COMP_OPTIONAL'
4767: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4768: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4769: , p_Token_Tbl => g_Token_Tbl
4773: ELSIF l_Result = 2
4774: THEN
4775: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
4776: THEN
4777: Error_Handler.Add_Error_Token
4778: ( p_message_name => 'BOM_COMP_NOT_OPTIONAL'
4779: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4780: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4781: );
4815: THEN
4816: g_Token_Tbl(2).Token_Name := 'REVISED_ITEM_NAME';
4817: g_Token_Tbl(2).Token_Value :=
4818: g_rev_component_rec.revised_item_name;
4819: Error_Handler.Add_Error_Token
4820: ( p_Message_Name => 'BOM_NOT_A_PLANNING_PARENT'
4821: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4822: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4823: , p_Token_Tbl => g_Token_Tbl
4839: g_Token_Tbl(3).Token_Value :=
4840: 'BOM_OPTION_CLASS_TYPE';
4841: END IF;
4842: g_Token_Tbl(3).Translate := TRUE;
4843: Error_Handler.Add_Error_Token
4844: ( p_Message_Name => 'BOM_COMP_MODEL_OC_OPTIONAL'
4845: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4846: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4847: , p_Token_Tbl => g_Token_Tbl
4856: g_Token_Tbl(1).Token_Name := 'REVISED_ITEM_NAME';
4857: g_Token_Tbl(1).Token_Value :=
4858: g_rev_component_rec.revised_item_name;
4859:
4860: Error_Handler.Add_Error_Token
4861: ( p_Message_Name =>
4862: 'BOM_COMP_OPTIONAL_ATO_FORECAST'
4863: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4864: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4907: THEN
4908: g_Token_Tbl(2).Token_Name := 'REVISED_ITEM_NAME';
4909: g_Token_Tbl(2).Token_Value :=
4910: g_rev_component_rec.revised_item_name;
4911: Error_Handler.Add_Error_Token
4912: ( p_message_name => 'BOM_COMP_REQ_FOR_REV_INVALID'
4913: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4914: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4915: , p_Token_Tbl => g_Token_Tbl
4920: ELSIF l_Result = 2 THEN
4921: g_Token_Tbl(2).Token_Name := 'REVISED_ITEM_NAME';
4922: g_Token_Tbl(2).Token_Value :=
4923: g_rev_component_rec.revised_item_name;
4924: Error_Handler.Add_Error_Token
4925: ( p_message_name => 'BOM_COMP_REQ_TO_SHIP_INVALID'
4926: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4927: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4928: , p_Token_Tbl => g_Token_Tbl
4932: ELSIF l_Result = 3 THEN
4933: g_Token_Tbl(2).Token_Name := 'REVISED_ITEM_NAME';
4934: g_Token_Tbl(2).Token_Value :=
4935: g_rev_component_rec.revised_item_name;
4936: Error_Handler.Add_Error_Token
4937: ( p_message_name => 'BOM_COMP_REQ_TO_SHIP_INVALID'
4938: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4939: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4940: , p_Token_Tbl => g_Token_Tbl
4942:
4943: g_Token_Tbl(2).Token_Name := 'REVISED_ITEM_NAME';
4944: g_Token_Tbl(2).Token_Value :=
4945: g_rev_component_rec.revised_item_name;
4946: Error_Handler.Add_Error_Token
4947: ( p_message_name => 'BOM_COMP_REQ_FOR_REV_INVALID'
4948: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4949: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4950: , p_Token_Tbl => g_Token_Tbl
4954: l_return_status := FND_API.G_RET_STS_ERROR;
4955: END IF;
4956: END IF;
4957:
4958: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Verified Req for Rev and Shipping . . . ' || l_return_status); END IF;
4959:
4960: /*********************************************************************
4961: --
4962: -- Verify the value of SO_Basis
4965: IF -- p_control_rec.caller_type = 'FORM' AND
4966: p_rev_component_rec.so_basis = 1 AND
4967: g_Comp_Item_Type <> Bom_Globals.G_OPTION_CLASS
4968: THEN
4969: Error_Handler.Add_Error_Token
4970: ( p_message_name => 'BOM_SO_BASIS_ONE'
4971: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4972: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
4973: , p_Token_Tbl => g_Token_Tbl
5013: IF l_result <> 0
5014: THEN
5015: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5016: THEN
5017: Error_Handler.Add_Error_Token
5018: ( p_message_name => 'BOM_ATP_CHECK_NOT_NO'
5019: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5020: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5021: , p_Token_Tbl => g_Token_Tbl
5027: END IF ;
5028: END IF;
5029:
5030: IF Bom_Globals.Get_Debug = 'Y' THEN
5031: Error_Handler.Write_Debug('After verification of Check ATP . . . ' || l_return_status);
5032: END IF;
5033: -- dbms_output.put_line('After verification of Check ATP, Req for Rev' );
5034: ********************************************************************/
5035:
5050: IF l_result <> 0 THEN
5051: IF l_result = 1 THEN
5052: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5053: THEN
5054: Error_Handler.Add_Error_Token
5055: ( p_message_name => 'BOM_MUT_EXCL_BOM_NOT_INST'
5056: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5057: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5058: );
5059: END IF;
5060: ELSIF l_result = 2 THEN
5061: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5062: THEN
5063: Error_Handler.Add_Error_Token
5064: ( p_message_name => 'BOM_MUT_EXCL_NOT_MDL_OPTCLASS'
5065: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5066: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5067: , p_Token_Tbl => g_Token_Tbl
5124: AND
5125: NOT Check_Min_Quantity THEN
5126: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5127: THEN
5128: Error_Handler.Add_Error_Token
5129: ( p_message_name => 'BOM_MIN_QUANTITY_INVALID'
5130: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5131: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5132: , p_Token_Tbl => g_Token_Tbl
5144: AND
5145: NOT Check_Max_Quantity THEN
5146: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5147: THEN
5148: Error_Handler.Add_Error_Token
5149: ( p_message_name => 'BOM_MAX_QUANTITY_INVALID'
5150: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5151: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5152: , p_Token_Tbl => g_Token_Tbl
5194: )
5195: THEN
5196: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5197: THEN
5198: Error_Handler.Add_Error_Token
5199: ( p_message_name => 'BOM_COMP_QTY_FRACTIONAL'
5200: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5201: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5202: , p_Token_Tbl => g_Token_Tbl
5220: p_rev_component_rec.quantity_per_assembly < 0
5221: THEN
5222: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5223: THEN
5224: Error_Handler.Add_Error_Token
5225: ( p_message_name => 'BOM_COMP_QTY_NEGATIVE'
5226: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5227: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5228: , p_Token_Tbl => g_Token_Tbl
5241: p_rev_component_rec.quantity_per_assembly < 0
5242: THEN
5243: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5244: THEN
5245: Error_Handler.Add_Error_Token
5246: ( p_message_name => 'BOM_COMP_PTO_QTY_NEGATIVE'
5247: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5248: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5249: , p_Token_Tbl => g_Token_Tbl
5251: END IF;
5252: l_return_status := FND_API.G_RET_STS_ERROR;
5253: END IF;
5254:
5255: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Checking Supply Subinventory . . . ' || p_rev_component_rec.Supply_SubInventory); END IF;
5256:
5257: /*******************************************************************
5258: --
5259: -- Check Supply Subinventory
5281: NOT Check_Supply_SubInventory THEN
5282:
5283: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5284: THEN
5285: Error_Handler.Add_Error_Token
5286: ( p_message_name => 'BOM_SUBINV_INVALID'
5287: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5288: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5289: );
5289: );
5290: END IF;
5291: l_return_status := FND_API.G_RET_STS_ERROR;
5292: END IF;
5293: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('After checking Subinventory . . . ' || l_return_status); END IF;
5294:
5295: -- dbms_output.put_line('Checking Locators . . . .');
5296: /********************************************************************
5297: --
5324:
5325: IF l_locator_control = 4 THEN
5326: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5327: THEN
5328: Error_Handler.Add_Error_Token
5329: ( p_message_name => 'BOM_LOCATOR_REQUIRED'
5330: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5331: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5332: , p_Token_Tbl => g_Token_Tbl
5340: THEN
5341: g_Token_Tbl(1).token_name := 'REVISED_COMPONENT_NAME';
5342: g_Token_Tbl(1).token_value:= p_rev_component_rec.component_item_name;
5343:
5344: Error_Handler.Add_Error_Token
5345: ( p_message_name => 'BOM_LOCATOR_CANNOT_BE_DYNAMIC'
5346: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5347: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5348: , p_Token_Tbl => g_Token_Tbl
5362: -- Added Token by MK on 12/06/00
5363: g_Token_Tbl(2).Token_Name := 'SUPPLY_SUBINVENTORY';
5364: g_Token_Tbl(2).Token_Value := p_rev_component_rec.Supply_SubInventory ;
5365:
5366: Error_Handler.Add_Error_Token
5367: ( p_message_name => 'BOM_ITEM_LOCATOR_RESTRICTED'
5368: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5369: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5370: , p_Token_Tbl => g_Token_Tbl
5378: (FND_MSG_PUB.G_MSG_LVL_ERROR)
5379: THEN
5380: g_Token_Tbl(2).token_name := 'REVISED_COMPONENT_NAME';
5381: g_Token_Tbl(2).token_value:= p_rev_component_rec.component_item_name;
5382: Error_Handler.Add_Error_Token
5383: ( p_message_name => 'BOM_LOCATOR_NOT_IN_SUBINV'
5384: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5385: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5386: , p_Token_Tbl => g_Token_Tbl
5391: ELSIF l_locator_control = 1 THEN
5392: IF FND_MSG_PUB.Check_Msg_Level
5393: (FND_MSG_PUB.G_MSG_LVL_ERROR)
5394: THEN
5395: Error_Handler.Add_Error_Token
5396: ( p_message_name => 'BOM_ITEM_NO_LOCATOR_CONTROL'
5397: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5398: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5399: , p_Token_Tbl => g_Token_Tbl
5406: p_rev_component_rec.supply_subinventory IS NULL
5407: THEN
5408: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
5409: THEN
5410: Error_Handler.Add_Error_Token
5411: ( p_message_name => 'BOM_LOCATOR_MUST_BE_NULL'
5412: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5413: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5414: , p_Token_Tbl => g_Token_Tbl
5456: END LOOP;
5457: END IF;
5458:
5459: IF item_num_for_bill = 1 THEN
5460: Error_Handler.Add_Error_Token
5461: ( x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5462: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5463: , p_message_name => 'BOM_ITEM_NUM_NOT_UNIQUE'
5464: , p_Token_Tbl => g_Token_Tbl
5479: IF p_rev_comp_unexp_rec.Delete_Group_Name IS NULL OR
5480: p_rev_comp_unexp_rec.Delete_Group_Name = FND_API.G_MISS_CHAR
5481: THEN
5482:
5483: Error_Handler.Add_Error_Token
5484: ( p_message_name => 'BOM_DG_NAME_MISSING'
5485: , p_mesg_token_tbl => l_mesg_token_tbl
5486: , x_mesg_token_tbl => l_mesg_token_tbl
5487: );
5489: l_return_status := FND_API.G_RET_STS_ERROR;
5490:
5491: END IF;
5492:
5493: IF BOM_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
5494: ('Check if Delete Group is missing . . . ' || l_return_status) ;
5495: END IF ;
5496:
5497:
5512:
5513: IF (l_Structure_Type_Name ='Packaging Hierarchy') THEN
5514: IF p_rev_component_rec.quantity_per_assembly < 0
5515: THEN
5516: Error_Handler.Add_Error_Token
5517: ( p_message_name => 'BOM_PKG_HIER_NEGATIVE_QTY'
5518: , p_Mesg_Token_Tbl=> l_Mesg_Token_Tbl
5519: , x_Mesg_Token_Tbl=> l_Mesg_Token_Tbl
5520: , p_Token_Tbl => g_Token_Tbl
5523: l_return_status := FND_API.G_RET_STS_ERROR;
5524: END IF;
5525: IF round(p_rev_component_rec.quantity_per_assembly) <> p_rev_component_rec.quantity_per_assembly
5526: THEN
5527: Error_Handler.Add_Error_Token
5528: ( p_message_name => 'BOM_PKG_HIER_FRACTIONAL_QTY'
5529: , p_Mesg_Token_Tbl=> l_Mesg_Token_Tbl
5530: , x_Mesg_Token_Tbl=> l_Mesg_Token_Tbl
5531: , p_Token_Tbl => g_Token_Tbl
5552: );
5553:
5554: IF (l_return_status = FND_API.G_RET_STS_ERROR)
5555: THEN
5556: Error_Handler.Add_Error_Token
5557: ( p_Message_Text => l_debug_error_mesg
5558: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5559: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5560: );
5561: END IF;
5562: END IF;
5563: END IF;
5564:
5565: IF BOM_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug
5566: ('Check Component Type Rule . . . ' || l_return_status) ;
5567: END IF ;
5568:
5569: x_return_status := l_return_status;
5568:
5569: x_return_status := l_return_status;
5570: x_Mesg_Token_Tbl := l_Mesg_Token_Tbl;
5571:
5572: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Entity Validation done . . . Return Status is ' || l_return_status); END IF;
5573:
5574: EXCEPTION
5575:
5576: WHEN FND_API.G_EXC_ERROR THEN
5574: EXCEPTION
5575:
5576: WHEN FND_API.G_EXC_ERROR THEN
5577:
5578: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Expected Error in Rev. Comp. Entity Validation . . .'); END IF;
5579:
5580: x_return_status := FND_API.G_RET_STS_ERROR;
5581: x_Mesg_Token_Tbl := l_Mesg_Token_Tbl;
5582:
5581: x_Mesg_Token_Tbl := l_Mesg_Token_Tbl;
5582:
5583: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5584:
5585: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('UNExpected Error in Rev. Comp. Entity Validation . . .'); END IF;
5586:
5587: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5588: IF FND_MSG_PUB.Check_Msg_Level
5589: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
5590: THEN
5591: l_err_text := G_PKG_NAME ||
5592: ' : (Entity Validation) ' ||
5593: substrb(SQLERRM,1,200);
5594: Error_Handler.Add_Error_Token
5595: ( p_Message_Text => l_err_text
5596: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5597: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5598: );
5599: END IF;
5600: x_Mesg_Token_Tbl := l_Mesg_Token_Tbl;
5601:
5602: WHEN OTHERS THEN
5603: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug(SQLERRM || ' ' || TO_CHAR(SQLCODE)); END IF;
5604: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5605: IF FND_MSG_PUB.Check_Msg_Level
5606: (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
5607: THEN
5607: THEN
5608: l_err_text := G_PKG_NAME ||
5609: ' : (Entity Validation) ' ||
5610: substrb(SQLERRM,1,200);
5611: Error_Handler.Add_Error_Token
5612: ( p_Message_Text => l_err_text
5613: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5614: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5615: );
5633: * of 'E'.
5634: *********************************************************************/
5635: PROCEDURE Check_Attributes
5636: ( x_return_status IN OUT NOCOPY VARCHAR2
5637: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
5638: , p_rev_component_rec IN Bom_Bo_Pub.Rev_Component_Rec_Type
5639: , p_Rev_Comp_Unexp_Rec IN Bom_Bo_Pub.Rev_Comp_Unexposed_Rec_Type
5640: )
5641: IS
5643: l_return_status VARCHAR2(1);
5644: l_err_text VARCHAR2(2000);
5645: l_assembly_item_id NUMBER;
5646: l_org_id NUMBER;
5647: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
5648:
5649: CURSOR c_Geteffcontrol IS SELECT effectivity_control FROM mtl_system_items
5650: WHERE inventory_item_id = p_rev_comp_unexp_rec.component_item_id AND
5651: organization_id = l_org_id;
5670: -- missing value when the column value is required.
5671: --
5672: IF p_rev_component_rec.item_sequence_number = FND_API.G_MISS_NUM
5673: THEN
5674: Error_Handler.Add_Error_Token
5675: ( p_Message_Name => 'BOM_ITEM_NUM_MISSING'
5676: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5677: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5678: , p_Token_Tbl => g_Token_Tbl
5682:
5683: IF p_rev_component_rec.quantity_per_assembly =
5684: FND_API.G_MISS_NUM
5685: THEN
5686: Error_Handler.Add_Error_Token
5687: ( p_Message_Name => 'BOM_COMP_QUANTITY_MISSING'
5688: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5689: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5690: , p_Token_Tbl => g_Token_Tbl
5693: END IF;
5694:
5695: IF p_rev_component_rec.projected_yield = FND_API.G_MISS_NUM
5696: THEN
5697: Error_Handler.Add_Error_Token
5698: ( p_Message_Name => 'BOM_COMP_YIELD_MISSING'
5699: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5700: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5701: , p_Token_Tbl => g_Token_Tbl
5704: END IF;
5705:
5706: IF p_rev_component_rec.planning_percent = FND_API.G_MISS_NUM
5707: THEN
5708: Error_Handler.Add_Error_Token
5709: ( p_Message_Name => 'BOM_PLAN_PERCENT_MISSING'
5710: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5711: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5712: , p_Token_Tbl => g_Token_Tbl
5715: END IF;
5716:
5717: IF p_rev_component_rec.quantity_related = FND_API.G_MISS_NUM
5718: THEN
5719: Error_Handler.Add_Error_Token
5720: ( p_Message_Name => 'BOM_QUANTITY_RELATED_MISSING'
5721: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5722: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5723: , p_Token_Tbl => g_Token_Tbl
5726: END IF;
5727:
5728: IF p_rev_component_rec.include_in_cost_rollup = FND_API.G_MISS_NUM
5729: THEN
5730: Error_Handler.Add_Error_Token
5731: ( p_Message_Name => 'BOM_INCL_IN_CST_ROLLUP_MISSING'
5732: -- 'BOM_INCL_IN_COST_ROLLUP_MISSING'
5733: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5734: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5738: END IF;
5739:
5740: IF p_rev_component_rec.check_atp = FND_API.G_MISS_NUM
5741: THEN
5742: Error_Handler.Add_Error_Token
5743: ( p_Message_Name => 'BOM_CHECK_ATP_MISSING'
5744: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5745: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5746: , p_Token_Tbl => g_Token_Tbl
5755: THEN
5756: g_token_tbl(2).token_name := 'ACD_TYPE';
5757: g_token_tbl(2).token_value := p_rev_component_rec.acd_type;
5758:
5759: Error_Handler.Add_Error_Token
5760: ( p_Message_Name => 'BOM_ACD_TYPE_INVALID'
5761: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5762: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5763: , p_Token_Tbl => g_Token_Tbl
5786: g_token_tbl(2).token_name := 'REVISED_COMPONENT_NAME';
5787: g_token_tbl(2).token_value := p_rev_component_rec.component_item_name;
5788: g_token_tbl(3).token_name := 'ORGANIZATION_CODE';
5789: g_token_tbl(3).token_value := p_rev_component_rec.organization_code;
5790: Error_Handler.Add_Error_Token
5791: ( p_Message_Name=> 'BOM_CMP_FROM_UNIT_NUM_INVALID'
5792: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5793: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5794: , p_Token_Tbl => g_Token_Tbl
5827: g_token_tbl(3).token_name :=
5828: 'ORGANIZATION_CODE';
5829: g_token_tbl(3).token_value :=
5830: p_rev_component_rec.organization_code;
5831: Error_Handler.Add_Error_Token
5832: ( p_Message_Name=> 'BOM_CMP_TO_UNIT_NUM_INVALID'
5833: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5834: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5835: , p_Token_Tbl => g_Token_Tbl
5846: THEN
5847: g_token_tbl(2).token_name := 'AUTO_REQ_MATERIAL';
5848: g_token_tbl(2).token_value := p_rev_component_rec.auto_request_material;
5849:
5850: Error_Handler.Add_Error_Token
5851: ( p_Message_Name => 'BOM_AUTO_REQ_MAT_INVALID'
5852: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5853: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5854: , p_Token_Tbl => g_Token_Tbl
5865: p_rev_component_rec.from_end_item_unit_number IS NOT NULL ) AND
5866: ( p_rev_component_rec.to_end_item_unit_number = FND_API.G_MISS_CHAR OR
5867: p_rev_component_rec.to_end_item_unit_number IS NULL )
5868: THEN
5869: Error_Handler.Add_Error_Token
5870: ( p_Message_Name => 'BOM_CMP_TO_UNIT_NUM_NULL'
5871: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5872: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5873: , p_Token_Tbl => g_Token_Tbl
5887:
5888: FOR effctrlrec IN c_Geteffcontrol
5889: LOOP
5890: IF effctrlrec.effectivity_control <> 1 THEN
5891: Error_Handler.Add_Error_Token
5892: ( p_Message_Name => 'BOM_EFFCONTROL_INVALID'
5893: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5894: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5895: , p_Token_Tbl => g_Token_Tbl
5907: X_err_text => l_err_text ) THEN
5908: g_token_tbl(2).token_name := 'FROM_END_ITEM_UNIT_NUMBER';
5909: g_token_tbl(2).token_value :=
5910: p_rev_component_rec.from_end_item_unit_number;
5911: Error_Handler.Add_Error_Token
5912: ( p_Message_Name => 'BOM_INVALID_FROM_SERIAL_NO'
5913: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5914: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5915: , p_Token_Tbl => g_Token_Tbl
5931: X_err_text => l_err_text ) THEN
5932: g_token_tbl(2).token_name := 'TO_END_ITEM_UNIT_NUMBER';
5933: g_token_tbl(2).token_value :=
5934: p_rev_component_rec.to_end_item_unit_number;
5935: Error_Handler.Add_Error_Token
5936: ( p_Message_Name => 'BOM_INVALID_TO_SERIAL_NO'
5937: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5938: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5939: , p_Token_Tbl => g_Token_Tbl
5955:
5956: g_token_tbl(2).token_name := 'COMPONENT_ITEM_NAME';
5957: g_token_tbl(2).token_value :=
5958: p_rev_component_rec.component_item_name;
5959: Error_Handler.Add_Error_Token
5960: ( p_Message_Name => 'BOM_COMP_CANNOT_BE_AN_AG'
5961: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5962: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5963: , p_Token_Tbl => g_Token_Tbl
5975: IF p_rev_component_rec.wip_supply_type NOT IN (1,4) THEN
5976: g_token_tbl(2).token_name := 'WIP_SUPPLY_TYPE';
5977: g_token_tbl(2).token_value :=
5978: p_rev_component_rec.wip_supply_type;
5979: Error_Handler.Add_Error_Token
5980: ( p_Message_Name => 'BOM_INVALID_AA_SUPTYPES'
5981: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5982: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
5983: , p_Token_Tbl => g_Token_Tbl
5993:
5994: g_token_tbl(2).token_name := 'COMPONENT_ITEM_NAME';
5995: g_token_tbl(2).token_value :=
5996: p_rev_component_rec.component_item_name;
5997: Error_Handler.Add_Error_Token
5998: ( p_Message_Name => 'BOM_COMP_CANNOT_BE_AN_AG'
5999: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6000: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6001: , p_Token_Tbl => g_Token_Tbl
6015: THEN
6016: g_token_tbl(2).token_name := 'WIP_SUPPLY_TYPE';
6017: g_token_tbl(2).token_value :=
6018: p_rev_component_rec.wip_supply_type;
6019: Error_Handler.Add_Error_Token
6020: ( p_Message_Name => 'BOM_WIP_SUPPLY_TYPE_7'
6021: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6022: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6023: , p_Token_Tbl => g_Token_Tbl
6038: g_token_tbl(1).token_name := 'WIP_SUPPLY_TYPE';
6039: g_token_tbl(1).token_value :=
6040: p_rev_component_rec.wip_supply_type;
6041:
6042: Error_Handler.Add_Error_Token
6043: ( p_Message_Name => 'BOM_WIP_SUPPLY_TYPE_INVALID'
6044: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6045: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6046: , p_Token_Tbl => g_Token_Tbl
6057: p_rev_component_rec.operation_sequence_number <= 0
6058: THEN
6059: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
6060: THEN
6061: Error_Handler.Add_Error_Token
6062: ( p_Message_Name => 'BOM_OPSEQ_LESS_THAN_ZERO'
6063: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6064: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6065: , p_Token_Tbl => g_Token_Tbl
6078: )
6079: THEN
6080: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)
6081: THEN
6082: Error_Handler.Add_Error_Token
6083: ( p_Message_Name => 'BOM_ITEM_NUM_INVALID'
6084: , p_Mesg_token_Tbl => l_Mesg_token_Tbl
6085: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6086: , p_token_tbl => g_Token_Tbl
6096: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
6097: THEN
6098: g_token_tbl(1).token_name := 'REVISED_COMPONENT_NAME';
6099: g_token_tbl(1).token_value := p_rev_component_rec.component_item_name;
6100: Error_Handler.Add_Error_Token
6101: ( p_Message_Name => 'BOM_COMPYIELD_OUT_OF_RANGE'
6102: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6103: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6104: , p_token_tbl => g_token_tbl
6112: p_rev_component_rec.include_in_cost_rollup NOT IN (1,2)
6113: THEN
6114: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
6115: THEN
6116: Error_Handler.Add_Error_Token
6117: ( p_Message_Name => 'BOM_INCL_IN_COST_ROLL_INVALID'
6118: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6119: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6120: , p_Token_Tbl => g_Token_Tbl
6127: p_rev_component_rec.SO_Basis NOT IN (1, 2)
6128: THEN
6129: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
6130: THEN
6131: Error_Handler.Add_Error_Token
6132: ( p_Message_Name => 'BOM_SO_BASIS_INVALID'
6133: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6134: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6135: , p_Token_Tbl => g_Token_Tbl
6142: p_rev_component_rec.optional NOT IN (1, 2)
6143: THEN
6144: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
6145: THEN
6146: Error_Handler.Add_Error_Token
6147: ( p_Message_Name => 'BOM_OPTIONAL_INVALID'
6148: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6149: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6150: , p_Token_Tbl => g_Token_Tbl
6157: p_rev_component_rec.mutually_exclusive NOT IN (1, 2)
6158: THEN
6159: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
6160: THEN
6161: Error_Handler.Add_Error_Token
6162: ( p_Message_Name => 'BOM_MUTUALLY_EXCLUSIVE_INVALID'
6163: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6164: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6165: , p_Token_Tbl => g_Token_Tbl
6172: p_rev_component_rec.check_atp NOT IN (1, 2)
6173: THEN
6174: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
6175: THEN
6176: Error_Handler.Add_Error_Token
6177: ( p_Message_Name => 'BOM_CHECK_ATP_INVALID'
6178: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6179: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6180: , p_Token_Tbl => g_Token_Tbl
6187: p_rev_component_rec.shipping_allowed NOT IN (1, 2)
6188: THEN
6189: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
6190: THEN
6191: Error_Handler.Add_Error_Token
6192: ( p_Message_Name => 'BOM_SHIPPING_ALLOWED_INVALID'
6193: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6194: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6195: , p_Token_Tbl => g_Token_Tbl
6202: p_rev_component_rec.required_to_ship NOT IN (1, 2)
6203: THEN
6204: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
6205: THEN
6206: Error_Handler.Add_Error_Token
6207: ( p_Message_Name => 'BOM_REQUIRED_TO_SHIP_INVALID'
6208: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6209: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6210: , p_Token_Tbl => g_Token_Tbl
6217: p_rev_component_rec.required_for_revenue NOT IN (1, 2)
6218: THEN
6219: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
6220: THEN
6221: Error_Handler.Add_Error_Token
6222: ( p_Message_Name => 'BOM_REQ_FOR_REVENUE_INVALID'
6223: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6224: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6225: , p_Token_Tbl => g_Token_Tbl
6232: p_rev_component_rec.include_on_ship_docs NOT IN (1, 2)
6233: THEN
6234: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
6235: THEN
6236: Error_Handler.Add_Error_Token
6237: ( p_Message_Name => 'BOM_INCL_ON_SHIP_DOCS_INVALID'
6238: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6239: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6240: , p_Token_Tbl => g_Token_Tbl
6247: p_rev_component_rec.quantity_related NOT IN (1, 2)
6248: THEN
6249: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_SUCCESS)
6250: THEN
6251: Error_Handler.Add_Error_Token
6252: ( p_Message_Name => 'BOM_QTY_RELATED_INVALID'
6253: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6254: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6255: , p_Token_Tbl => g_Token_Tbl
6258: l_return_status := FND_API.G_RET_STS_ERROR;
6259: END IF;
6260:
6261: -- Validation specific to unimplemented BOM
6262: Error_handler.write_debug ('BOM Implementation date is '||p_rev_comp_unexp_rec.bom_implementation_date);
6263:
6264: IF p_rev_comp_unexp_rec.bom_implementation_date IS NULL
6265: /* added a dummy condition to make sure this validation happens for any BOM, no matter whether the BOM is fluid or not */
6266: OR 1=1
6280: g_token_tbl(2).token_value := p_rev_component_rec.start_effective_date;
6281: g_token_tbl(3).token_name := 'NEW_EFFECTIVE_DATE';
6282: g_token_tbl(3).token_value := p_rev_component_rec.new_effectivity_date;
6283:
6284: Error_Handler.Add_Error_Token
6285: ( p_Message_Name => 'BOM_DATE_LESS_ITEMREV'
6286: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6287: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6288: , p_Token_Tbl => g_Token_Tbl
6302: g_token_tbl(2).token_value := p_rev_component_rec.start_effective_date;
6303: g_token_tbl(3).token_name := 'NEW_EFFECTIVE_DATE';
6304: g_token_tbl(3).token_value := p_rev_component_rec.new_effectivity_date;
6305:
6306: Error_Handler.Add_Error_Token
6307: ( p_Message_Name => 'BOM_DATE_LESS_ITEMREV'
6308: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6309: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6310: , p_Token_Tbl => g_Token_Tbl
6331: g_token_tbl(2).token_value := p_rev_component_rec.start_effective_date;
6332: g_token_tbl(3).token_name := 'NEW_EFFECTIVE_DATE';
6333: g_token_tbl(3).token_value := p_rev_component_rec.new_effectivity_date;
6334:
6335: Error_Handler.Add_Error_Token
6336: ( p_Message_Name => 'BOM_NEW_DATE_LESS_CURR'
6337: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6338: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6339: , p_Token_Tbl => g_Token_Tbl
6353: p_rev_component_rec.start_effective_date <> FND_API.G_MISS_DATE AND
6354: Bom_Globals.Get_Bo_Identifier = Bom_Globals.G_BOM_BO
6355: THEN
6356: /* Check revision exists for revised item */
6357: Error_handler.write_debug ('Checking for item revision start date');
6358: IF NOT Item_Revision_Exists(p_rev_comp_unexp_rec.revised_item_id,
6359: p_rev_comp_unexp_rec.organization_id,
6360: p_rev_component_rec.start_effective_date)
6361: THEN
6358: IF NOT Item_Revision_Exists(p_rev_comp_unexp_rec.revised_item_id,
6359: p_rev_comp_unexp_rec.organization_id,
6360: p_rev_component_rec.start_effective_date)
6361: THEN
6362: Error_handler.write_debug ('Checking for item revision start date error');
6363: g_token_tbl(1).token_name := 'ITEM_NAME';
6364: g_token_tbl(1).token_value := p_rev_component_rec.revised_item_name;
6365: --g_token_tbl(1).token_value := to_char(p_rev_comp_unexp_rec.revised_item_id)||':'||to_char(p_rev_comp_unexp_rec.organization_id)||':'||to_char(p_rev_component_rec.start_effective_date,'dd-mon-yyyy hh24:mi:ss');
6366: g_token_tbl(2).token_name := 'EFFECTIVITY_DATE';
6365: --g_token_tbl(1).token_value := to_char(p_rev_comp_unexp_rec.revised_item_id)||':'||to_char(p_rev_comp_unexp_rec.organization_id)||':'||to_char(p_rev_component_rec.start_effective_date,'dd-mon-yyyy hh24:mi:ss');
6366: g_token_tbl(2).token_name := 'EFFECTIVITY_DATE';
6367: g_token_tbl(2).token_value := p_rev_component_rec.start_effective_date;
6368:
6369: Error_Handler.Add_Error_Token(
6370: p_Message_Name => 'BOM_SDATE_LESS_ITEMREV'
6371: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6372: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6373: , p_Token_Tbl => g_Token_Tbl
6386: --g_token_tbl(1).token_value := to_char(p_rev_comp_unexp_rec.component_item_id)||':'||to_char(p_rev_comp_unexp_rec.organization_id)||':'||to_char(p_rev_component_rec.start_effective_date,'dd-mon-yyyy hh24:mi:ss');
6387: g_token_tbl(2).token_name := 'EFFECTIVITY_DATE';
6388: g_token_tbl(2).token_value := p_rev_component_rec.start_effective_date;
6389:
6390: Error_Handler.Add_Error_Token
6391: ( p_Message_Name => 'BOM_SDATE_LESS_ITEMREV'
6392: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6393: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6394: , p_Token_Tbl => g_Token_Tbl
6415: g_token_tbl(1).token_value := p_rev_component_rec.component_item_name;
6416: g_token_tbl(2).token_name := 'EFFECTIVITY_DATE';
6417: g_token_tbl(2).token_value := p_rev_component_rec.start_effective_date;
6418:
6419: Error_Handler.Add_Error_Token
6420: ( p_Message_Name => 'BOM_START_DATE_LESS_CURR'
6421: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6422: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6423: , p_Token_Tbl => g_Token_Tbl
6444: AND rounding_control_type = 1;
6445:
6446: EXCEPTION WHEN NO_DATA_FOUND THEN
6447: g_token_tbl.DELETE;
6448: Error_Handler.Add_Error_Token
6449: ( p_Message_Name => 'BOM_ENFORCE_INT_INVALID'
6450: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6451: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6452: , p_Token_Tbl => g_Token_Tbl
6456:
6457: END IF;
6458:
6459: --Validation to ensure that a pending structure header cannot be modified without an ECO
6460: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Checking if the BOM header is implemented . . .'); END IF;
6461:
6462: IF BOM_GLOBALS.Get_Bill_Header_ECN(p_rev_comp_unexp_rec.bill_Sequence_id) IS NOT NULL
6463: AND (p_rev_component_rec.eco_name IS NULL OR p_rev_component_rec.eco_name = FND_API.G_MISS_CHAR)
6464: THEN
6468: g_token_tbl(2).token_value := p_rev_component_rec.Revised_Item_Name;
6469: g_token_tbl(3).token_name := 'CHANGE_NOTICE';
6470: g_token_tbl(3).token_value := BOM_GLOBALS.Get_Bill_Header_ECN(p_rev_comp_unexp_rec.bill_Sequence_id);
6471:
6472: Error_Handler.Add_Error_Token
6473: ( p_Message_Name => 'BOM_HEADER_UNIMPLEMENTED'
6474: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6475: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6476: , p_Token_Tbl => g_Token_Tbl
6486:
6487: EXCEPTION
6488:
6489: WHEN OTHERS THEN
6490: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Some unknown error in Attribute Validation . . .' || SQLERRM ); END IF;
6491:
6492: Error_Handler.Add_Error_Token
6493: ( p_Message_Name => NULL
6494: , p_Message_Text =>
6488:
6489: WHEN OTHERS THEN
6490: IF Bom_Globals.Get_Debug = 'Y' THEN Error_Handler.Write_Debug('Some unknown error in Attribute Validation . . .' || SQLERRM ); END IF;
6491:
6492: Error_Handler.Add_Error_Token
6493: ( p_Message_Name => NULL
6494: , p_Message_Text =>
6495: 'Error in Rev Comp Attr. Validation '
6496: || SUBSTR(SQLERRM, 1, 30) || ' ' ||
6513: * Procedure : Will check if a component can be deleted.
6514: *******************************************************************/
6515: PROCEDURE Check_Entity_Delete
6516: ( x_return_status IN OUT NOCOPY VARCHAR2
6517: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
6518: , p_rev_component_rec IN Bom_Bo_Pub.Rev_Component_Rec_Type
6519: , p_Rev_Comp_Unexp_Rec IN Bom_Bo_Pub.Rev_Comp_Unexposed_Rec_Type
6520: )
6521: IS
6519: , p_Rev_Comp_Unexp_Rec IN Bom_Bo_Pub.Rev_Comp_Unexposed_Rec_Type
6520: )
6521: IS
6522: l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
6523: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
6524:
6525: BEGIN
6526:
6527: g_Token_Tbl(1).Token_Name := 'REVISED_COMPONENT_NAME';
6553: --
6554: IF FND_MSG_PUB.Check_Msg_Level
6555: (FND_MSG_PUB.G_MSG_LVL_ERROR)
6556: THEN
6557: Error_Handler.Add_Error_Token
6558: ( p_Message_Name=> 'BOM_COMP_CANCELLED'
6559: , p_Mesg_Token_Tbl=> l_Mesg_Token_Tbl
6560: , x_Mesg_Token_Tbl=> l_Mesg_Token_Tbl
6561: , p_Token_Tbl => g_Token_Tbl
6609: ( p_rev_component_rec IN Bom_Bo_Pub.Rev_Component_Rec_Type
6610: , p_rev_comp_unexp_rec IN Bom_Bo_Pub.Rev_Comp_Unexposed_Rec_Type
6611: , x_old_rev_component_rec IN OUT NOCOPY Bom_Bo_Pub.Rev_Component_Rec_Type
6612: , x_old_rev_comp_unexp_rec IN OUT NOCOPY Bom_Bo_Pub.Rev_Comp_Unexposed_Rec_Type
6613: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
6614: , x_return_status IN OUT NOCOPY VARCHAR2
6615: )
6616: IS
6617: l_token_tbl Error_Handler.Token_Tbl_Type;
6613: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
6614: , x_return_status IN OUT NOCOPY VARCHAR2
6615: )
6616: IS
6617: l_token_tbl Error_Handler.Token_Tbl_Type;
6618: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
6619: l_return_status VARCHAR2(1);
6620: BEGIN
6621: l_Token_Tbl(1).Token_Name := 'REVISED_COMPONENT_NAME';
6614: , x_return_status IN OUT NOCOPY VARCHAR2
6615: )
6616: IS
6617: l_token_tbl Error_Handler.Token_Tbl_Type;
6618: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
6619: l_return_status VARCHAR2(1);
6620: BEGIN
6621: l_Token_Tbl(1).Token_Name := 'REVISED_COMPONENT_NAME';
6622: l_Token_Tbl(1).Token_Value :=
6643:
6644: IF l_return_status = BOM_Globals.G_RECORD_FOUND AND
6645: p_rev_component_rec.transaction_type = BOM_Globals.G_OPR_CREATE
6646: THEN
6647: Error_Handler.Add_Error_Token
6648: ( x_Mesg_token_tbl => l_Mesg_Token_Tbl
6649: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6650: , p_message_name => 'BOM_REV_COMP_ALREADY_EXISTS'
6651: , p_token_tbl => l_token_tbl
6654: ELSIF l_return_status = BOM_Globals.G_RECORD_NOT_FOUND AND
6655: p_rev_component_rec.transaction_type IN
6656: (BOM_Globals.G_OPR_UPDATE, BOM_Globals.G_OPR_DELETE)
6657: THEN
6658: Error_Handler.Add_Error_Token
6659: ( x_Mesg_token_tbl => l_Mesg_Token_Tbl
6660: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6661: , p_message_name => 'BOM_REV_COMP_DOESNOT_EXIST'
6662: , p_token_tbl => l_token_tbl
6663: );
6664: l_return_status := FND_API.G_RET_STS_ERROR;
6665: ELSIF l_Return_status = FND_API.G_RET_STS_UNEXP_ERROR
6666: THEN
6667: Error_Handler.Add_Error_Token
6668: ( x_Mesg_token_tbl => l_Mesg_Token_Tbl
6669: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6670: , p_message_name => NULL
6671: , p_message_text =>
6709: *********************************************************************/
6710: PROCEDURE Check_Lineage
6711: ( p_rev_component_rec IN Bom_Bo_Pub.Rev_Component_Rec_Type
6712: , p_rev_comp_unexp_rec IN Bom_Bo_Pub.Rev_Comp_Unexposed_Rec_Type
6713: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
6714: , x_Return_Status IN OUT NOCOPY VARCHAR2
6715: )
6716: IS
6717: CURSOR c_GetComponent IS
6722: AND operation_seq_num =
6723: p_rev_component_rec.operation_sequence_number
6724: AND effectivity_date = p_rev_component_rec.start_effective_date;
6725:
6726: l_Token_Tbl Error_Handler.Token_Tbl_Type;
6727: l_return_status VARCHAR2(1);
6728: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
6729:
6730: BEGIN
6724: AND effectivity_date = p_rev_component_rec.start_effective_date;
6725:
6726: l_Token_Tbl Error_Handler.Token_Tbl_Type;
6727: l_return_status VARCHAR2(1);
6728: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
6729:
6730: BEGIN
6731: l_return_status := FND_API.G_RET_STS_SUCCESS;
6732:
6758: l_token_tbl(3).token_name := 'ECO_NAME';
6759: l_token_tbl(3).token_value :=
6760: p_rev_component_rec.eco_name;
6761:
6762: Error_Handler.Add_Error_Token
6763: ( p_Message_Name =>
6764: 'BOM_REV_ITEM_MISMATCH'
6765: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6766: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6798: , p_component_item_id IN NUMBER
6799: , p_operation_seq_num IN NUMBER
6800: , p_bill_sequence_id IN NUMBER
6801: , p_component_name IN VARCHAR2
6802: , p_Mesg_Token_Tbl IN Error_Handler.Mesg_Token_Tbl_Type :=
6803: Error_Handler.G_MISS_MESG_TOKEN_TBL
6804: , p_entity_processed IN VARCHAR2 := 'RC'
6805: , p_rfd_sbc_name IN VARCHAR2 := NULL
6806: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
6799: , p_operation_seq_num IN NUMBER
6800: , p_bill_sequence_id IN NUMBER
6801: , p_component_name IN VARCHAR2
6802: , p_Mesg_Token_Tbl IN Error_Handler.Mesg_Token_Tbl_Type :=
6803: Error_Handler.G_MISS_MESG_TOKEN_TBL
6804: , p_entity_processed IN VARCHAR2 := 'RC'
6805: , p_rfd_sbc_name IN VARCHAR2 := NULL
6806: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
6807: , x_Return_Status IN OUT NOCOPY VARCHAR2
6802: , p_Mesg_Token_Tbl IN Error_Handler.Mesg_Token_Tbl_Type :=
6803: Error_Handler.G_MISS_MESG_TOKEN_TBL
6804: , p_entity_processed IN VARCHAR2 := 'RC'
6805: , p_rfd_sbc_name IN VARCHAR2 := NULL
6806: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
6807: , x_Return_Status IN OUT NOCOPY VARCHAR2
6808: )
6809: IS
6810: l_Token_Tbl Error_Handler.Token_Tbl_Type;
6806: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
6807: , x_Return_Status IN OUT NOCOPY VARCHAR2
6808: )
6809: IS
6810: l_Token_Tbl Error_Handler.Token_Tbl_Type;
6811: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type :=
6812: p_Mesg_Token_Tbl;
6813: l_return_status VARCHAR2(1);
6814: l_Rev_Comp_Item_Type NUMBER;
6807: , x_Return_Status IN OUT NOCOPY VARCHAR2
6808: )
6809: IS
6810: l_Token_Tbl Error_Handler.Token_Tbl_Type;
6811: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type :=
6812: p_Mesg_Token_Tbl;
6813: l_return_status VARCHAR2(1);
6814: l_Rev_Comp_Item_Type NUMBER;
6815: l_error_name VARCHAR2(30);
6892: THEN
6893: l_Token_Tbl(2).Token_Value := 'BOM_STANDARD';
6894: END IF;
6895:
6896: Error_Handler.Add_Error_Token
6897: ( p_Message_Name => 'BOM_REV_COMP_ACCESS_DENIED'
6898: , p_Mesg_Token_Tbl => l_mesg_token_tbl
6899: , x_Mesg_Token_Tbl => l_mesg_token_tbl
6900: , p_Token_Tbl => l_token_tbl
6904: END IF;
6905:
6906: IF l_rev_comp_item_type = 5 /* Product Family */
6907: THEN
6908: Error_Handler.Add_Error_Token
6909: ( p_Message_Name => 'BOM_REV_COMP_PRODUCT_FAMILY'
6910: , p_Mesg_Token_Tbl => l_mesg_token_tbl
6911: , x_Mesg_Token_Tbl => l_mesg_token_tbl
6912: , p_Token_Tbl => l_token_tbl
6930: LOOP
6931: l_token_tbl.DELETE;
6932: l_Token_Tbl(1).Token_Name := 'REVISED_COMPONENT_NAME';
6933: l_Token_Tbl(1).Token_value := p_component_name;
6934: Error_Handler.Add_Error_Token
6935: ( p_Message_Name => 'BOM_REV_COMP_CANCELLED'
6936: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6937: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
6938: , p_Token_Tbl => l_token_tbl
6956: p_component_name;
6957: l_token_tbl(2).token_name := 'ECO_NAME';
6958: l_token_tbl(2).token_value :=
6959: p_change_notice;
6960: Error_Handler.Add_Error_Token
6961: ( p_Message_Name => 'BOM_REV_COMP_UNIT_CONTROL'
6962: , p_Mesg_Token_Tbl => l_mesg_token_tbl
6963: , x_Mesg_Token_Tbl => l_mesg_token_tbl
6964: , p_Token_Tbl => l_token_tbl
6974: p_component_name;
6975: l_token_tbl(2).token_name := 'ECO_NAME';
6976: l_token_tbl(2).token_value :=
6977: p_change_notice;
6978: Error_Handler.Add_Error_Token
6979: ( p_Message_Name => 'BOM_REV_ITEM_NOT_UNIT_CONTROL'
6980: , p_Mesg_Token_Tbl => l_mesg_token_tbl
6981: , x_Mesg_Token_Tbl => l_mesg_token_tbl
6982: , p_Token_Tbl => l_token_tbl
7013: l_token_tbl.delete;
7014: l_token_tbl(1).token_name := 'REVISED_ITEM_NAME';
7015: l_token_tbl(1).token_value := p_revised_item_name ;
7016:
7017: Error_Handler.Add_Error_Token
7018: ( p_Message_Name => 'ENG_CANNOT_ADD_ALTERNATE'
7019: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
7020: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
7021: , p_Token_Tbl => l_Token_Tbl
7056: l_token_tbl(2).token_value := p_component_name;
7057:
7058: l_return_status := FND_API.G_RET_STS_ERROR;
7059:
7060: Error_Handler.Add_Error_Token
7061: ( p_Message_Name => l_error_name
7062: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
7063: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
7064: , p_Token_Tbl => l_token_tbl
7086: PROCEDURE Check_Direct_item_comps
7087: ( p_bom_component_rec IN Bom_Bo_Pub.Bom_Comps_Rec_Type
7088: , p_bom_comp_unexp_rec IN Bom_Bo_Pub.Bom_Comps_Unexposed_Rec_Type
7089: , x_bom_component_rec IN OUT NOCOPY Bom_Bo_Pub.Bom_Comps_Rec_Type
7090: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
7091: , x_Return_Status IN OUT NOCOPY VARCHAR2
7092: ) IS
7093: -- l_bom_component_rec Bom_Bo_Pub.Bom_Comps_Rec_Type;
7094: l_Token_Tbl Error_Handler.Token_Tbl_Type;
7090: , x_Mesg_Token_Tbl IN OUT NOCOPY Error_Handler.Mesg_Token_Tbl_Type
7091: , x_Return_Status IN OUT NOCOPY VARCHAR2
7092: ) IS
7093: -- l_bom_component_rec Bom_Bo_Pub.Bom_Comps_Rec_Type;
7094: l_Token_Tbl Error_Handler.Token_Tbl_Type;
7095: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
7096: l_return_status VARCHAR2(1);
7097: BEGIN
7098: l_return_status := FND_API.G_RET_STS_SUCCESS;
7091: , x_Return_Status IN OUT NOCOPY VARCHAR2
7092: ) IS
7093: -- l_bom_component_rec Bom_Bo_Pub.Bom_Comps_Rec_Type;
7094: l_Token_Tbl Error_Handler.Token_Tbl_Type;
7095: l_Mesg_Token_Tbl Error_Handler.Mesg_Token_Tbl_Type;
7096: l_return_status VARCHAR2(1);
7097: BEGIN
7098: l_return_status := FND_API.G_RET_STS_SUCCESS;
7099: IF BOM_EAMUTIL.Direct_Item ( item_id => p_bom_comp_unexp_rec.Component_Item_Id,
7102: OR p_bom_component_rec.Suggested_Vendor_Name <> FND_API.G_MISS_CHAR)
7103: THEN
7104: x_bom_component_rec.Suggested_Vendor_Name := '';
7105: -- x_bom_component_rec.Vendor_Id := '';
7106: Error_Handler.Add_Error_Token
7107: ( p_Message_Name => 'BOM_COMP_SUPPLIER_IGNORED'
7108: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
7109: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
7110: , p_Token_Tbl => l_token_tbl
7113: IF (p_bom_component_rec.Unit_Price IS NOT NULL
7114: OR p_bom_component_rec.Unit_Price <> FND_API.G_MISS_NUM)
7115: THEN
7116: x_bom_component_rec.Unit_Price := '';
7117: Error_Handler.Add_Error_Token
7118: ( p_Message_Name => 'BOM_COMP_PRICE_IGNORED'
7119: , p_Mesg_Token_Tbl => l_Mesg_Token_Tbl
7120: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
7121: , p_Token_Tbl => l_token_tbl
7207: l_rev_comp_unexp_rec Bom_Bo_Pub.Rev_Comp_Unexposed_Rec_Type;
7208: l_old_rev_component_rec Bom_Bo_Pub.Rev_Component_Rec_Type;
7209: l_old_rev_comp_unexp_rec Bom_Bo_Pub.Rev_Comp_Unexposed_Rec_Type;
7210: l_return_status VARCHAR2(1);
7211: l_mesg_token_tbl Error_Handler.Mesg_Token_Tbl_Type;
7212:
7213: l_message_list Error_Handler.Error_Tbl_Type;
7214: l_debug_error_status VARCHAR2(1);
7215: l_debug_error_mesg VARCHAR2(2000);
7209: l_old_rev_comp_unexp_rec Bom_Bo_Pub.Rev_Comp_Unexposed_Rec_Type;
7210: l_return_status VARCHAR2(1);
7211: l_mesg_token_tbl Error_Handler.Mesg_Token_Tbl_Type;
7212:
7213: l_message_list Error_Handler.Error_Tbl_Type;
7214: l_debug_error_status VARCHAR2(1);
7215: l_debug_error_mesg VARCHAR2(2000);
7216: l_debug_filename VARCHAR2(20) := 'compjbo'||to_char(sysdate,'MISS');
7217: l_Assembly_Item_Name VARCHAR2(2000);
7224:
7225: /* Construct the exposed and unexposed records for
7226: component and call check_attributes. check_entity */
7227:
7228: Error_Handler.Initialize;
7229: Error_Handler.Set_Debug ('Y');
7230: Bom_Globals.Set_Debug ('Y');
7231:
7232:
7225: /* Construct the exposed and unexposed records for
7226: component and call check_attributes. check_entity */
7227:
7228: Error_Handler.Initialize;
7229: Error_Handler.Set_Debug ('Y');
7230: Bom_Globals.Set_Debug ('Y');
7231:
7232:
7233: Error_Handler.Open_Debug_Session
7229: Error_Handler.Set_Debug ('Y');
7230: Bom_Globals.Set_Debug ('Y');
7231:
7232:
7233: Error_Handler.Open_Debug_Session
7234: ( p_debug_filename => l_debug_filename
7235: , p_output_dir =>'/appslog/bis_top/utl/plm115dv/out'
7236: , x_return_status => l_debug_error_status
7237: , x_error_mesg => l_debug_error_mesg
7267: THEN
7268: RAISE EXC_ERR_PVT_API_MAIN;
7269: END IF;
7270:
7271: Error_Handler.Write_Debug('After open debug ');
7272:
7273: Error_Handler.Set_BO_Identifier(p_bo_identifier);
7274: Bom_Globals.Set_BO_Identifier(p_bo_identifier);
7275:
7269: END IF;
7270:
7271: Error_Handler.Write_Debug('After open debug ');
7272:
7273: Error_Handler.Set_BO_Identifier(p_bo_identifier);
7274: Bom_Globals.Set_BO_Identifier(p_bo_identifier);
7275:
7276: /* Set the system information record values for assembly_item_id
7277: and org_id. These values will be used for validating serial effective
7279:
7280: Bom_Globals.Set_Org_Id (p_organization_id);
7281: Bom_Globals.Set_Assembly_Item_Id (p_revised_item_id);
7282:
7283: Error_Handler.Write_Debug('after set org ');
7284:
7285: x_return_status := 'S';
7286:
7287: /*Added code to get the parent name
7311: p_organization_code;
7312: l_rev_component_rec.revised_item_name :=
7313: l_Assembly_Item_Name;
7314: l_rev_component_rec.new_revised_item_revision := NULL;
7315: Error_Handler.Write_Debug('0 ');
7316: Error_Handler.Write_Debug('p_start_Effective_date '||to_char(p_start_Effective_date,'YYYY-MM-DD HH24:MI:SS'));
7317: l_rev_component_rec.start_effective_date := p_start_Effective_date;
7318: -- l_rev_component_rec.start_effective_date :=
7319: -- to_date(p_start_Effective_date,'YYYY-MM-DD HH24:MI:SS');
7312: l_rev_component_rec.revised_item_name :=
7313: l_Assembly_Item_Name;
7314: l_rev_component_rec.new_revised_item_revision := NULL;
7315: Error_Handler.Write_Debug('0 ');
7316: Error_Handler.Write_Debug('p_start_Effective_date '||to_char(p_start_Effective_date,'YYYY-MM-DD HH24:MI:SS'));
7317: l_rev_component_rec.start_effective_date := p_start_Effective_date;
7318: -- l_rev_component_rec.start_effective_date :=
7319: -- to_date(p_start_Effective_date,'YYYY-MM-DD HH24:MI:SS');
7320:
7323:
7324: l_rev_component_rec.disable_date :=
7325: p_disable_date;
7326:
7327: Error_Handler.Write_Debug('1 ');
7328: l_rev_component_rec.operation_sequence_number :=
7329: p_operation_sequence_number;
7330: l_rev_component_rec.component_item_name :=
7331: l_Component_Item_Name;
7336:
7337: l_rev_component_rec.old_effectivity_date :=
7338: p_old_effectivity_date; -- ECO Specific
7339:
7340: Error_Handler.Write_Debug('2 ');
7341: l_rev_component_rec.old_operation_sequence_number := p_old_operation_sequence_num; -- ECO Specific
7342:
7343: l_rev_component_rec.new_operation_sequence_number :=
7344: p_new_operation_sequence_num;
7422: l_rev_component_rec.original_system_reference :=
7423: p_original_system_reference;
7424: l_rev_component_rec.transaction_type :=
7425: p_transaction_type;
7426: Error_Handler.Write_Debug('3 ');
7427: l_rev_component_rec.From_End_Item_Unit_Number :=
7428: p_From_End_Item_Unit_Number;
7429: l_rev_component_rec.To_End_Item_Unit_Number :=
7430: p_To_End_Item_Unit_Number;
7451: p_pick_components;
7452: l_rev_comp_unexp_rec.supply_locator_id :=
7453: p_supply_locator_id;
7454:
7455: Error_Handler.Write_Debug('Rowid is '||p_rowid);
7456: l_rev_comp_unexp_rec.Rowid :=
7457: p_rowid ;
7458: /*
7459: l_rev_comp_unexp_rec.bom_item_type :=
7474: l_rev_comp_unexp_rec.revised_item_sequence_id := p_revised_item_sequence_id; -- ECO Specific
7475:
7476: l_rev_comp_unexp_rec.Enforce_Int_Requirements_Code :=
7477: p_Enforce_Int_Reqs_Code;
7478: Error_Handler.Write_Debug('4 ');
7479:
7480: l_rev_comp_unexp_rec.bom_implementation_date :=
7481: p_bom_implementation_date;
7482:
7496: p_old_rec_acd_type;
7497: l_old_rev_component_rec.to_end_item_unit_number :=
7498: p_old_rec_to_end_item_unit_num;
7499:
7500: Error_Handler.Write_Debug('after assignement ');
7501: /* validate parent access */
7502:
7503: Bom_Validate_Bom_Header.Check_Access
7504: ( p_assembly_item_id => p_revised_item_id
7507: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
7508: , x_Return_Status => x_return_status
7509: );
7510:
7511: Error_Handler.Write_Debug('after check access ');
7512: IF x_return_status <> 'S'
7513: THEN
7514: Error_Handler.Translate_And_Insert_Messages
7515: ( p_mesg_token_tbl => l_mesg_token_tbl
7510:
7511: Error_Handler.Write_Debug('after check access ');
7512: IF x_return_status <> 'S'
7513: THEN
7514: Error_Handler.Translate_And_Insert_Messages
7515: ( p_mesg_token_tbl => l_mesg_token_tbl
7516: , p_application_id => 'BOM'
7517: );
7518:
7515: ( p_mesg_token_tbl => l_mesg_token_tbl
7516: , p_application_id => 'BOM'
7517: );
7518:
7519: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7520: x_error_message := l_message_list(1).Message_Text;
7521: Error_Handler.Write_To_DebugFile;
7522: Error_Handler.Close_Debug_Session;
7523:
7517: );
7518:
7519: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7520: x_error_message := l_message_list(1).Message_Text;
7521: Error_Handler.Write_To_DebugFile;
7522: Error_Handler.Close_Debug_Session;
7523:
7524: Return;
7525: END IF;
7518:
7519: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7520: x_error_message := l_message_list(1).Message_Text;
7521: Error_Handler.Write_To_DebugFile;
7522: Error_Handler.Close_Debug_Session;
7523:
7524: Return;
7525: END IF;
7526:
7534: , x_Mesg_Token_Tbl => l_mesg_token_tbl
7535: , x_Return_Status => x_return_status
7536: );
7537:
7538: Error_Handler.Write_Debug('after component access ');
7539: IF x_return_status <> 'S'
7540: THEN
7541: Error_Handler.Translate_And_Insert_Messages
7542: ( p_mesg_token_tbl => l_mesg_token_tbl
7537:
7538: Error_Handler.Write_Debug('after component access ');
7539: IF x_return_status <> 'S'
7540: THEN
7541: Error_Handler.Translate_And_Insert_Messages
7542: ( p_mesg_token_tbl => l_mesg_token_tbl
7543: , p_application_id => 'BOM'
7544: );
7545:
7542: ( p_mesg_token_tbl => l_mesg_token_tbl
7543: , p_application_id => 'BOM'
7544: );
7545:
7546: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7547: x_error_message := l_message_list(1).Message_Text;
7548: Error_Handler.Write_To_DebugFile;
7549: Error_Handler.Close_Debug_Session;
7550:
7544: );
7545:
7546: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7547: x_error_message := l_message_list(1).Message_Text;
7548: Error_Handler.Write_To_DebugFile;
7549: Error_Handler.Close_Debug_Session;
7550:
7551: Return;
7552: END IF;
7545:
7546: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7547: x_error_message := l_message_list(1).Message_Text;
7548: Error_Handler.Write_To_DebugFile;
7549: Error_Handler.Close_Debug_Session;
7550:
7551: Return;
7552: END IF;
7553:
7567: );
7568:
7569: IF x_return_status <> 'S'
7570: THEN
7571: Error_Handler.Translate_And_Insert_Messages
7572: ( p_mesg_token_tbl => l_mesg_token_tbl
7573: , p_application_id => 'BOM'
7574: );
7575:
7572: ( p_mesg_token_tbl => l_mesg_token_tbl
7573: , p_application_id => 'BOM'
7574: );
7575:
7576: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7577: x_error_message := l_message_list(1).Message_Text;
7578: Error_Handler.Write_To_DebugFile;
7579: Error_Handler.Close_Debug_Session;
7580:
7574: );
7575:
7576: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7577: x_error_message := l_message_list(1).Message_Text;
7578: Error_Handler.Write_To_DebugFile;
7579: Error_Handler.Close_Debug_Session;
7580:
7581: Return;
7582: END IF;
7575:
7576: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7577: x_error_message := l_message_list(1).Message_Text;
7578: Error_Handler.Write_To_DebugFile;
7579: Error_Handler.Close_Debug_Session;
7580:
7581: Return;
7582: END IF;
7583:
7599: , x_Mesg_Token_Tbl => l_Mesg_Token_Tbl
7600: , x_return_status => x_Return_Status
7601: );
7602:
7603: Error_Handler.Write_Debug('after check entity ');
7604: IF x_return_status <> 'S'
7605: THEN
7606: Error_Handler.Translate_And_Insert_Messages
7607: ( p_mesg_token_tbl => l_mesg_token_tbl
7602:
7603: Error_Handler.Write_Debug('after check entity ');
7604: IF x_return_status <> 'S'
7605: THEN
7606: Error_Handler.Translate_And_Insert_Messages
7607: ( p_mesg_token_tbl => l_mesg_token_tbl
7608: , p_application_id => 'BOM'
7609: );
7610:
7607: ( p_mesg_token_tbl => l_mesg_token_tbl
7608: , p_application_id => 'BOM'
7609: );
7610:
7611: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7612: x_error_message := l_message_list(1).Message_Text;
7613:
7614: Error_Handler.Write_To_DebugFile;
7615: Error_Handler.Close_Debug_Session;
7610:
7611: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7612: x_error_message := l_message_list(1).Message_Text;
7613:
7614: Error_Handler.Write_To_DebugFile;
7615: Error_Handler.Close_Debug_Session;
7616:
7617: END IF;
7618: EXCEPTION WHEN OTHERS THEN
7611: Error_Handler.Get_Message_List( x_message_list => l_message_list);
7612: x_error_message := l_message_list(1).Message_Text;
7613:
7614: Error_Handler.Write_To_DebugFile;
7615: Error_Handler.Close_Debug_Session;
7616:
7617: END IF;
7618: EXCEPTION WHEN OTHERS THEN
7619: x_error_message := SQLCODE||'/'||SQLERRM;
7616:
7617: END IF;
7618: EXCEPTION WHEN OTHERS THEN
7619: x_error_message := SQLCODE||'/'||SQLERRM;
7620: Error_Handler.Write_To_DebugFile;
7621: Error_Handler.Close_Debug_Session;
7622:
7623: END;
7624:
7617: END IF;
7618: EXCEPTION WHEN OTHERS THEN
7619: x_error_message := SQLCODE||'/'||SQLERRM;
7620: Error_Handler.Write_To_DebugFile;
7621: Error_Handler.Close_Debug_Session;
7622:
7623: END;
7624:
7625: