860:
861: -- Check Whether Profile is created or not
862: IF(p_x_nr_prof_est_tbl(i).nr_profile_header_id IS NULL)
863: THEN
864: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_MR_TIT_MIS');
865: FND_MSG_PUB.add;
866: END IF;
867:
868: /* Resource Type is not validated because it is not stored in Table : AHL_NR_PROFILE_DETAILS
878: OPEN get_resource_id(p_x_nr_prof_est_tbl(i).cmro_resource_name);
879: FETCH get_resource_id into p_x_nr_prof_est_tbl(i).cmro_resource_id;
880: IF(get_resource_id%NOTFOUND)
881: THEN
882: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_RES_NAME' );
883: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i) ));
884: FND_MSG_PUB.add;
885: END IF;
886: CLOSE get_resource_id;
879: FETCH get_resource_id into p_x_nr_prof_est_tbl(i).cmro_resource_id;
880: IF(get_resource_id%NOTFOUND)
881: THEN
882: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_RES_NAME' );
883: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i) ));
884: FND_MSG_PUB.add;
885: END IF;
886: CLOSE get_resource_id;
887: ELSIF (p_x_nr_prof_est_tbl(i).cmro_resource_id IS NOT NULL AND p_x_nr_prof_est_tbl(i).cmro_resource_id <> FND_API.G_MISS_NUM AND p_x_nr_prof_est_tbl(i).cmro_resource_name IS NULL)
889: OPEN check_resource_id(p_x_nr_prof_est_tbl(i).cmro_resource_id);
890: FETCH check_resource_id into l_dummy;
891: IF(check_resource_id%NOTFOUND)
892: THEN
893: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_RES_ID' );
894: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
895: FND_MSG_PUB.add;
896: END IF;
897: CLOSE check_resource_id;
890: FETCH check_resource_id into l_dummy;
891: IF(check_resource_id%NOTFOUND)
892: THEN
893: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_RES_ID' );
894: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
895: FND_MSG_PUB.add;
896: END IF;
897: CLOSE check_resource_id;
898: ELSIF ( (p_x_nr_prof_est_tbl(i).cmro_resource_id IS NULL OR p_x_nr_prof_est_tbl(i).cmro_resource_id = FND_API.G_MISS_NUM)
898: ELSIF ( (p_x_nr_prof_est_tbl(i).cmro_resource_id IS NULL OR p_x_nr_prof_est_tbl(i).cmro_resource_id = FND_API.G_MISS_NUM)
899: AND (p_x_nr_prof_est_tbl(i).cmro_resource_name IS NULL OR p_x_nr_prof_est_tbl(i).cmro_resource_name = FND_API.G_MISS_CHAR)
900: AND p_x_nr_prof_est_tbl(i).profile_detail_type = G_RESOURCE)
901: THEN
902: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_RES_MAND' );
903: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
904: FND_MSG_PUB.add;
905: END IF;
906:
899: AND (p_x_nr_prof_est_tbl(i).cmro_resource_name IS NULL OR p_x_nr_prof_est_tbl(i).cmro_resource_name = FND_API.G_MISS_CHAR)
900: AND p_x_nr_prof_est_tbl(i).profile_detail_type = G_RESOURCE)
901: THEN
902: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_RES_MAND' );
903: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
904: FND_MSG_PUB.add;
905: END IF;
906:
907: -- Item Validtion (Material Estimations)
912: OPEN get_inventory_item_id(p_x_nr_prof_est_tbl(i).inventory_item);
913: FETCH get_inventory_item_id into p_x_nr_prof_est_tbl(i).inventory_item_id;
914: IF(get_inventory_item_id%NOTFOUND)
915: THEN
916: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_INV_ITEM_NAME' );
917: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i) ));
918: FND_MSG_PUB.add;
919: END IF;
920: CLOSE get_inventory_item_id;
913: FETCH get_inventory_item_id into p_x_nr_prof_est_tbl(i).inventory_item_id;
914: IF(get_inventory_item_id%NOTFOUND)
915: THEN
916: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_INV_ITEM_NAME' );
917: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i) ));
918: FND_MSG_PUB.add;
919: END IF;
920: CLOSE get_inventory_item_id;
921: ELSIF ( p_x_nr_prof_est_tbl(i).inventory_item_id IS NOT NULL AND p_x_nr_prof_est_tbl(i).inventory_item_id <> FND_API.G_MISS_NUM AND p_x_nr_prof_est_tbl(i).inventory_item IS NULL)
923: OPEN check_inventory_item_id(p_x_nr_prof_est_tbl(i).inventory_item_id);
924: FETCH check_inventory_item_id into l_dummy;
925: IF(check_inventory_item_id%NOTFOUND)
926: THEN
927: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_INV_ITEM_ID' );
928: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
929: FND_MSG_PUB.add;
930: END IF;
931: CLOSE check_inventory_item_id;
924: FETCH check_inventory_item_id into l_dummy;
925: IF(check_inventory_item_id%NOTFOUND)
926: THEN
927: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_INV_ITEM_ID' );
928: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
929: FND_MSG_PUB.add;
930: END IF;
931: CLOSE check_inventory_item_id;
932: ELSIF ( (p_x_nr_prof_est_tbl(i).inventory_item_id IS NULL OR p_x_nr_prof_est_tbl(i).inventory_item_id = FND_API.G_MISS_NUM)
932: ELSIF ( (p_x_nr_prof_est_tbl(i).inventory_item_id IS NULL OR p_x_nr_prof_est_tbl(i).inventory_item_id = FND_API.G_MISS_NUM)
933: AND (p_x_nr_prof_est_tbl(i).inventory_item IS NULL OR p_x_nr_prof_est_tbl(i).inventory_item = FND_API.G_MISS_CHAR)
934: AND p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
935: THEN
936: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_ITEM_MAND' );
937: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
938: FND_MSG_PUB.add;
939: END IF;
940:
933: AND (p_x_nr_prof_est_tbl(i).inventory_item IS NULL OR p_x_nr_prof_est_tbl(i).inventory_item = FND_API.G_MISS_CHAR)
934: AND p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
935: THEN
936: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_ITEM_MAND' );
937: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
938: FND_MSG_PUB.add;
939: END IF;
940:
941: -- UOM Validation
946: OPEN get_uom_code(p_x_nr_prof_est_tbl(i).uom);
947: FETCH get_uom_code into p_x_nr_prof_est_tbl(i).uom_code;
948: IF(get_uom_code%NOTFOUND)
949: THEN
950: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_UOM' );
951: FND_MESSAGE.set_token('FIELD', p_x_nr_prof_est_tbl(i).uom);
952: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i) ));
953: FND_MSG_PUB.add;
954: END IF;
947: FETCH get_uom_code into p_x_nr_prof_est_tbl(i).uom_code;
948: IF(get_uom_code%NOTFOUND)
949: THEN
950: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_UOM' );
951: FND_MESSAGE.set_token('FIELD', p_x_nr_prof_est_tbl(i).uom);
952: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i) ));
953: FND_MSG_PUB.add;
954: END IF;
955: CLOSE get_uom_code;
948: IF(get_uom_code%NOTFOUND)
949: THEN
950: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_UOM' );
951: FND_MESSAGE.set_token('FIELD', p_x_nr_prof_est_tbl(i).uom);
952: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i) ));
953: FND_MSG_PUB.add;
954: END IF;
955: CLOSE get_uom_code;
956: ELSIF ( p_x_nr_prof_est_tbl(i).uom_code IS NOT NULL AND p_x_nr_prof_est_tbl(i).uom_code <> FND_API.G_MISS_CHAR AND p_x_nr_prof_est_tbl(i).uom IS NULL)
958: OPEN check_uom_code(p_x_nr_prof_est_tbl(i).uom_code);
959: FETCH check_uom_code into l_dummy;
960: IF(check_uom_code%NOTFOUND)
961: THEN
962: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_UOM' );
963: FND_MESSAGE.set_token('FIELD', p_x_nr_prof_est_tbl(i).uom_code);
964: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
965: FND_MSG_PUB.add;
966: END IF;
959: FETCH check_uom_code into l_dummy;
960: IF(check_uom_code%NOTFOUND)
961: THEN
962: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_UOM' );
963: FND_MESSAGE.set_token('FIELD', p_x_nr_prof_est_tbl(i).uom_code);
964: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
965: FND_MSG_PUB.add;
966: END IF;
967: CLOSE check_uom_code;
960: IF(check_uom_code%NOTFOUND)
961: THEN
962: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_UOM' );
963: FND_MESSAGE.set_token('FIELD', p_x_nr_prof_est_tbl(i).uom_code);
964: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
965: FND_MSG_PUB.add;
966: END IF;
967: CLOSE check_uom_code;
968: ELSIF ( (p_x_nr_prof_est_tbl(i).uom_code IS NULL OR p_x_nr_prof_est_tbl(i).uom_code = FND_API.G_MISS_CHAR)
968: ELSIF ( (p_x_nr_prof_est_tbl(i).uom_code IS NULL OR p_x_nr_prof_est_tbl(i).uom_code = FND_API.G_MISS_CHAR)
969: AND (p_x_nr_prof_est_tbl(i).uom IS NULL OR p_x_nr_prof_est_tbl(i).uom = FND_API.G_MISS_CHAR)
970: AND p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
971: THEN
972: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_UOM_NULL' );
973: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
974: FND_MSG_PUB.add;
975: END IF;
976:
969: AND (p_x_nr_prof_est_tbl(i).uom IS NULL OR p_x_nr_prof_est_tbl(i).uom = FND_API.G_MISS_CHAR)
970: AND p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
971: THEN
972: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_UOM_NULL' );
973: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
974: FND_MSG_PUB.add;
975: END IF;
976:
977: -- Stage Type Validation
991: );
992:
993: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
994: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
995: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_DEP_TYPE' );
996: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
997: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_TOO_MANY_STG_TYP' );
998: ELSE
999: FND_MESSAGE.set_name( 'AHL', l_msg_data );
993: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
994: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
995: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_DEP_TYPE' );
996: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
997: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_TOO_MANY_STG_TYP' );
998: ELSE
999: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1000: END IF;
1001:
995: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_DEP_TYPE' );
996: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
997: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_TOO_MANY_STG_TYP' );
998: ELSE
999: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1000: END IF;
1001:
1002: IF ( p_x_nr_prof_est_tbl(i).stage_type IS NULL OR
1003: p_x_nr_prof_est_tbl(i).stage_type = FND_API.G_MISS_CHAR )
1002: IF ( p_x_nr_prof_est_tbl(i).stage_type IS NULL OR
1003: p_x_nr_prof_est_tbl(i).stage_type = FND_API.G_MISS_CHAR )
1004: THEN
1005: p_x_nr_prof_est_tbl(i).stage_type := p_x_nr_prof_est_tbl(i).stage_type_code;
1006: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).stage_type );
1007: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1008: ELSE
1009: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).stage_type );
1010: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1003: p_x_nr_prof_est_tbl(i).stage_type = FND_API.G_MISS_CHAR )
1004: THEN
1005: p_x_nr_prof_est_tbl(i).stage_type := p_x_nr_prof_est_tbl(i).stage_type_code;
1006: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).stage_type );
1007: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1008: ELSE
1009: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).stage_type );
1010: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1011: END IF;
1005: p_x_nr_prof_est_tbl(i).stage_type := p_x_nr_prof_est_tbl(i).stage_type_code;
1006: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).stage_type );
1007: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1008: ELSE
1009: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).stage_type );
1010: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1011: END IF;
1012: FND_MSG_PUB.add;
1013: END IF;
1006: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).stage_type );
1007: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1008: ELSE
1009: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).stage_type );
1010: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1011: END IF;
1012: FND_MSG_PUB.add;
1013: END IF;
1014: END IF;
1021: OPEN get_fleet_id(p_x_nr_prof_est_tbl(i).fleet_name);
1022: FETCH get_fleet_id into p_x_nr_prof_est_tbl(i).fleet_header_id;
1023: IF(get_fleet_id%NOTFOUND)
1024: THEN
1025: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_FLEET_NAME' );
1026: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i) ));
1027: FND_MSG_PUB.add;
1028: END IF;
1029: CLOSE get_fleet_id;
1022: FETCH get_fleet_id into p_x_nr_prof_est_tbl(i).fleet_header_id;
1023: IF(get_fleet_id%NOTFOUND)
1024: THEN
1025: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_FLEET_NAME' );
1026: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i) ));
1027: FND_MSG_PUB.add;
1028: END IF;
1029: CLOSE get_fleet_id;
1030: ELSIF ( (p_x_nr_prof_est_tbl(i).fleet_header_id IS NOT NULL) AND p_x_nr_prof_est_tbl(i).fleet_header_id <> FND_API.G_MISS_NUM AND p_x_nr_prof_est_tbl(i).fleet_name IS NULL)
1032: OPEN check_fleet_id(p_x_nr_prof_est_tbl(i).fleet_header_id);
1033: FETCH check_fleet_id into l_dummy;
1034: IF(check_fleet_id%NOTFOUND)
1035: THEN
1036: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_FLEET_ID' );
1037: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1038: FND_MSG_PUB.add;
1039: END IF;
1040: CLOSE check_fleet_id;
1033: FETCH check_fleet_id into l_dummy;
1034: IF(check_fleet_id%NOTFOUND)
1035: THEN
1036: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_FLEET_ID' );
1037: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1038: FND_MSG_PUB.add;
1039: END IF;
1040: CLOSE check_fleet_id;
1041: END IF;
1048: OPEN get_operating_org_id(p_x_nr_prof_est_tbl(i).operating_org_name);
1049: FETCH get_operating_org_id into p_x_nr_prof_est_tbl(i).operating_org_id;
1050: IF(get_operating_org_id%NOTFOUND)
1051: THEN
1052: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_ORG_NAME' );
1053: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i) ));
1054: FND_MSG_PUB.add;
1055: END IF;
1056: CLOSE get_operating_org_id;
1049: FETCH get_operating_org_id into p_x_nr_prof_est_tbl(i).operating_org_id;
1050: IF(get_operating_org_id%NOTFOUND)
1051: THEN
1052: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_ORG_NAME' );
1053: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i) ));
1054: FND_MSG_PUB.add;
1055: END IF;
1056: CLOSE get_operating_org_id;
1057: ELSIF ( (p_x_nr_prof_est_tbl(i).operating_org_id IS NOT NULL) AND p_x_nr_prof_est_tbl(i).operating_org_id <> FND_API.G_MISS_NUM AND p_x_nr_prof_est_tbl(i).operating_org_name IS NULL)
1059: OPEN check_operating_org_id(p_x_nr_prof_est_tbl(i).operating_org_id);
1060: FETCH check_operating_org_id into l_dummy;
1061: IF(check_operating_org_id%NOTFOUND)
1062: THEN
1063: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_ORG_ID' );
1064: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1065: FND_MSG_PUB.add;
1066: END IF;
1067: CLOSE check_operating_org_id;
1060: FETCH check_operating_org_id into l_dummy;
1061: IF(check_operating_org_id%NOTFOUND)
1062: THEN
1063: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_INVL_ORG_ID' );
1064: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1065: FND_MSG_PUB.add;
1066: END IF;
1067: CLOSE check_operating_org_id;
1068: END IF;
1084: );
1085:
1086: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
1087: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
1088: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_DEP_TYPE' );
1089: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
1090: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_TOO_MANY_OPR_TYP' );
1091: ELSE
1092: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1086: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
1087: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
1088: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_DEP_TYPE' );
1089: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
1090: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_TOO_MANY_OPR_TYP' );
1091: ELSE
1092: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1093: END IF;
1094:
1088: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_DEP_TYPE' );
1089: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
1090: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_TOO_MANY_OPR_TYP' );
1091: ELSE
1092: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1093: END IF;
1094:
1095: IF ( p_x_nr_prof_est_tbl(i).operations_type IS NULL OR
1096: p_x_nr_prof_est_tbl(i).operations_type = FND_API.G_MISS_CHAR )
1095: IF ( p_x_nr_prof_est_tbl(i).operations_type IS NULL OR
1096: p_x_nr_prof_est_tbl(i).operations_type = FND_API.G_MISS_CHAR )
1097: THEN
1098: p_x_nr_prof_est_tbl(i).operations_type := p_x_nr_prof_est_tbl(i).operations_type_code;
1099: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).operations_type);
1100: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1101: ELSE
1102: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).operations_type);
1103: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1096: p_x_nr_prof_est_tbl(i).operations_type = FND_API.G_MISS_CHAR )
1097: THEN
1098: p_x_nr_prof_est_tbl(i).operations_type := p_x_nr_prof_est_tbl(i).operations_type_code;
1099: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).operations_type);
1100: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1101: ELSE
1102: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).operations_type);
1103: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1104: END IF;
1098: p_x_nr_prof_est_tbl(i).operations_type := p_x_nr_prof_est_tbl(i).operations_type_code;
1099: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).operations_type);
1100: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1101: ELSE
1102: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).operations_type);
1103: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1104: END IF;
1105:
1106: FND_MSG_PUB.add;
1099: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).operations_type);
1100: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1101: ELSE
1102: FND_MESSAGE.set_token( 'FIELD', p_x_nr_prof_est_tbl(i).operations_type);
1103: FND_MESSAGE.set_token( 'RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1104: END IF;
1105:
1106: FND_MSG_PUB.add;
1107: END IF;
1109:
1110: /* IF Fleet is given , Operating org and Operations Type are not allowed*/
1111: IF(p_x_nr_prof_est_tbl(i).fleet_header_id IS NOT NULL AND (p_x_nr_prof_est_tbl(i).operations_type_code IS NOT NULL OR p_x_nr_prof_est_tbl(i).operating_org_id IS NOT NULL))
1112: THEN
1113: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_FLT_NO_ORG_OPR_TYP' );
1114: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1115: FND_MSG_PUB.add;
1116: END IF;
1117:
1110: /* IF Fleet is given , Operating org and Operations Type are not allowed*/
1111: IF(p_x_nr_prof_est_tbl(i).fleet_header_id IS NOT NULL AND (p_x_nr_prof_est_tbl(i).operations_type_code IS NOT NULL OR p_x_nr_prof_est_tbl(i).operating_org_id IS NOT NULL))
1112: THEN
1113: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_FLT_NO_ORG_OPR_TYP' );
1114: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1115: FND_MSG_PUB.add;
1116: END IF;
1117:
1118: END IF; -- Exluded date Close
1126: IF ( p_x_nr_prof_est_tbl(i).required_qty IS NULL OR p_x_nr_prof_est_tbl(i).required_qty = FND_API.G_MISS_NUM )
1127: THEN
1128: IF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_RESOURCE)
1129: THEN
1130: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REQ_HRS_MAND' );
1131: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1132: FND_MSG_PUB.add;
1133: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1134: THEN
1127: THEN
1128: IF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_RESOURCE)
1129: THEN
1130: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REQ_HRS_MAND' );
1131: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1132: FND_MSG_PUB.add;
1133: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1134: THEN
1135: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REQ_QTY_MAND' );
1131: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1132: FND_MSG_PUB.add;
1133: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1134: THEN
1135: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REQ_QTY_MAND' );
1136: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1137: FND_MSG_PUB.add;
1138: END IF;
1139: ELSIF(p_x_nr_prof_est_tbl(i).required_qty < 0)
1132: FND_MSG_PUB.add;
1133: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1134: THEN
1135: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REQ_QTY_MAND' );
1136: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1137: FND_MSG_PUB.add;
1138: END IF;
1139: ELSIF(p_x_nr_prof_est_tbl(i).required_qty < 0)
1140: THEN
1139: ELSIF(p_x_nr_prof_est_tbl(i).required_qty < 0)
1140: THEN
1141: IF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_RESOURCE)
1142: THEN
1143: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REQ_HRS_LESS_ZERO' );
1144: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1145: FND_MSG_PUB.add;
1146: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1147: THEN
1140: THEN
1141: IF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_RESOURCE)
1142: THEN
1143: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REQ_HRS_LESS_ZERO' );
1144: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1145: FND_MSG_PUB.add;
1146: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1147: THEN
1148: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REQ_QTY_LESS_ZERO' );
1144: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1145: FND_MSG_PUB.add;
1146: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1147: THEN
1148: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REQ_QTY_LESS_ZERO' );
1149: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1150: FND_MSG_PUB.add;
1151: END IF;
1152: ELSIF(p_x_nr_prof_est_tbl(i).analysis_qty < 0)
1145: FND_MSG_PUB.add;
1146: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1147: THEN
1148: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REQ_QTY_LESS_ZERO' );
1149: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1150: FND_MSG_PUB.add;
1151: END IF;
1152: ELSIF(p_x_nr_prof_est_tbl(i).analysis_qty < 0)
1153: THEN
1152: ELSIF(p_x_nr_prof_est_tbl(i).analysis_qty < 0)
1153: THEN
1154: IF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_RESOURCE)
1155: THEN
1156: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_ANL_HRS_LESS_ZERO' );
1157: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1158: FND_MSG_PUB.add;
1159: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1160: THEN
1153: THEN
1154: IF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_RESOURCE)
1155: THEN
1156: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_ANL_HRS_LESS_ZERO' );
1157: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1158: FND_MSG_PUB.add;
1159: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1160: THEN
1161: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_ANL_QTY_LESS_ZERO' );
1157: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1158: FND_MSG_PUB.add;
1159: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1160: THEN
1161: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_ANL_QTY_LESS_ZERO' );
1162: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1163: FND_MSG_PUB.add;
1164: END IF;
1165: END IF;
1158: FND_MSG_PUB.add;
1159: ELSIF(p_x_nr_prof_est_tbl(i).profile_detail_type = G_ITEM)
1160: THEN
1161: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_ANL_QTY_LESS_ZERO' );
1162: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1163: FND_MSG_PUB.add;
1164: END IF;
1165: END IF;
1166: END IF;
1171: OPEN get_object_version_number(p_x_nr_prof_est_tbl(i).nr_profile_det_id, p_x_nr_prof_est_tbl(i).object_version_number);
1172: FETCH get_object_version_number INTO l_object_version_number;
1173: IF(get_object_version_number%NOTFOUND)
1174: THEN
1175: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_RECORD_CHANGED' );
1176: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1177: FND_MSG_PUB.add;
1178: END IF;
1179: CLOSE get_object_version_number;
1172: FETCH get_object_version_number INTO l_object_version_number;
1173: IF(get_object_version_number%NOTFOUND)
1174: THEN
1175: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_RECORD_CHANGED' );
1176: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1177: FND_MSG_PUB.add;
1178: END IF;
1179: CLOSE get_object_version_number;
1180: END IF;
1367: FETCH check_duplicate_record INTO l_nr_profile_det_id , l_required_qty, l_excluded_date ;
1368:
1369: IF(check_duplicate_record%FOUND)
1370: THEN
1371: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_DUP_REC' );
1372: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1373: FND_MSG_PUB.add;
1374: END IF;
1375:
1368:
1369: IF(check_duplicate_record%FOUND)
1370: THEN
1371: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_DUP_REC' );
1372: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1373: FND_MSG_PUB.add;
1374: END IF;
1375:
1376: CLOSE check_duplicate_record;
1434: NULL,
1435: p_x_nr_prof_est_tbl(i).security_group_id
1436: );
1437: ELSE
1438: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_DUP_REC' );
1439: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1440: FND_MSG_PUB.add;
1441: END IF;
1442:
1435: p_x_nr_prof_est_tbl(i).security_group_id
1436: );
1437: ELSE
1438: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_DUP_REC' );
1439: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1440: FND_MSG_PUB.add;
1441: END IF;
1442:
1443: CLOSE check_duplicate_record;
1560: FETCH check_exclude_record INTO l_nr_profile_det_id , l_required_qty, l_excluded_date;
1561:
1562: IF(check_exclude_record%FOUND)
1563: THEN
1564: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REC_EXLD' );
1565: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1566: FND_MSG_PUB.add;
1567: ELSE
1568:
1561:
1562: IF(check_exclude_record%FOUND)
1563: THEN
1564: FND_MESSAGE.set_name( 'AHL', 'AHL_RA_NP_REC_EXLD' );
1565: FND_MESSAGE.set_token('RECORD', get_record_identifier( p_x_nr_prof_est_tbl(i)) );
1566: FND_MSG_PUB.add;
1567: ELSE
1568:
1569: INSERT INTO AHL_NR_PROFILE_DETAILS
1860:
1861: -- Profile Header ID Mandatory
1862: IF( p_x_nr_profile_header_rec.DML_OPERATION = 'U' AND p_x_nr_profile_header_rec.nr_profile_header_id IS NULL )
1863: THEN
1864: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_HDR_ID_MAND');
1865: FND_MSG_PUB.ADD;
1866: END IF;
1867:
1868: --Object version Number Validation
1874: OPEN get_object_version_number(p_x_nr_profile_header_rec.nr_profile_header_id, p_x_nr_profile_header_rec.object_version_number);
1875: FETCH get_object_version_number into l_object_version_number;
1876: IF(get_object_version_number%NOTFOUND)
1877: THEN
1878: FND_MESSAGE.set_name( 'AHL', 'AHL_COM_RECORD_CHANGED' );
1879: FND_MSG_PUB.add;
1880: END IF;
1881: CLOSE get_object_version_number;
1882: END IF;
1885: IF (p_x_nr_profile_header_rec.dml_operation = 'C' OR p_x_nr_profile_header_rec.dml_operation = 'U' )
1886: THEN
1887: IF (p_x_nr_profile_header_rec.ident_seq_third IS NULL AND p_x_nr_profile_header_rec.ident_seq_fourth IS NOT NULL )
1888: THEN
1889: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_IDENT_SEQ_THR_REQ');
1890: FND_MSG_PUB.ADD;
1891: END IF;
1892:
1893: IF (p_x_nr_profile_header_rec.ident_seq_third IS NOT NULL AND p_x_nr_profile_header_rec.ident_seq_fourth IS NOT NULL AND p_x_nr_profile_header_rec.ident_seq_third = p_x_nr_profile_header_rec.ident_seq_fourth)
1891: END IF;
1892:
1893: IF (p_x_nr_profile_header_rec.ident_seq_third IS NOT NULL AND p_x_nr_profile_header_rec.ident_seq_fourth IS NOT NULL AND p_x_nr_profile_header_rec.ident_seq_third = p_x_nr_profile_header_rec.ident_seq_fourth)
1894: THEN
1895: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_IDENT_SEQ_SAME');
1896: FND_MSG_PUB.ADD;
1897: END IF;
1898:
1899: --Status Code Validation
1898:
1899: --Status Code Validation
1900: IF(p_x_nr_profile_header_rec.status_code IS NULL)
1901: THEN
1902: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_PROF_STAT_MAN');
1903: FND_MSG_PUB.ADD;
1904: END IF;
1905:
1906:
1915: FETCH get_mr_title INTO l_mr_title;
1916:
1917: IF(get_mr_title%NOTFOUND)
1918: THEN
1919: FND_MESSAGE.SET_NAME('AHL', 'AHL_FMP_INVALID_MR');
1920: FND_MSG_PUB.ADD;
1921: END IF;
1922:
1923: CLOSE get_mr_title;
1926: FETCH check_duplicate INTO l_mr_title;
1927:
1928: IF(check_duplicate%FOUND)
1929: THEN
1930: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_DUP_NR_PROFILE');
1931: FND_MSG_PUB.ADD;
1932: END IF;
1933:
1934: CLOSE check_duplicate;
1933:
1934: CLOSE check_duplicate;
1935:
1936: ELSE
1937: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_MR_TIT_MIS');
1938: FND_MSG_PUB.ADD;
1939: END IF;
1940:
1941: END IF;
1954: FETCH get_valid_mr_title INTO l_mr_title;
1955:
1956: IF(get_valid_mr_title%NOTFOUND)
1957: THEN
1958: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_NO_ACTIVE_MR');
1959: FND_MESSAGE.set_token( 'FIELD2', p_x_nr_profile_header_rec.status_code );
1960: FND_MESSAGE.set_token( 'FIELD1', l_prof_status_code );
1961: FND_MSG_PUB.ADD;
1962: END IF;
1955:
1956: IF(get_valid_mr_title%NOTFOUND)
1957: THEN
1958: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_NO_ACTIVE_MR');
1959: FND_MESSAGE.set_token( 'FIELD2', p_x_nr_profile_header_rec.status_code );
1960: FND_MESSAGE.set_token( 'FIELD1', l_prof_status_code );
1961: FND_MSG_PUB.ADD;
1962: END IF;
1963: CLOSE get_valid_mr_title;
1956: IF(get_valid_mr_title%NOTFOUND)
1957: THEN
1958: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_NO_ACTIVE_MR');
1959: FND_MESSAGE.set_token( 'FIELD2', p_x_nr_profile_header_rec.status_code );
1960: FND_MESSAGE.set_token( 'FIELD1', l_prof_status_code );
1961: FND_MSG_PUB.ADD;
1962: END IF;
1963: CLOSE get_valid_mr_title;
1964: END IF;
2094: OPEN get_nr_profile_title(l_nr_profile_header_id);
2095: FETCH get_nr_profile_title INTO l_mr_title;
2096: IF(get_nr_profile_title%NOTFOUND)
2097: THEN
2098: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_HDR_IS_INVLD');
2099: FND_MSG_PUB.ADD;
2100: RAISE FND_API.G_EXC_ERROR;
2101: END IF;
2102: CLOSE get_nr_profile_title;
2101: END IF;
2102: CLOSE get_nr_profile_title;
2103: ELSIF(p_x_nr_profile_header_rec.MR_TITLE IS NULL )
2104: THEN
2105: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_MR_TITL_MAND');
2106: FND_MSG_PUB.ADD;
2107: RAISE FND_API.G_EXC_ERROR;
2108: ELSE
2109: l_mr_title := p_x_nr_profile_header_rec.MR_TITLE;
2111: OPEN get_nr_profile_id(l_mr_title);
2112: FETCH get_nr_profile_id INTO l_nr_profile_header_id;
2113: IF(get_nr_profile_id%NOTFOUND)
2114: THEN
2115: FND_MESSAGE.SET_NAME('AHL', 'AHL_RA_NP_MR_TITL_INVLD');
2116: FND_MSG_PUB.ADD;
2117: RAISE FND_API.G_EXC_ERROR;
2118: END IF;
2119: CLOSE get_nr_profile_id;