596: RAISE FND_API.G_EXC_ERROR;
597:
598: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
599:
600: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
601: THEN
602: OE_MSG_PUB.Add_Exc_Msg
603: ( G_PKG_NAME
604: , 'Build_Included_Items'
598: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
599:
600: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
601: THEN
602: OE_MSG_PUB.Add_Exc_Msg
603: ( G_PKG_NAME
604: , 'Build_Included_Items'
605: );
606: END IF;
608:
609: WHEN OTHERS THEN
610:
611:
612: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
613: THEN
614: OE_MSG_PUB.Add_Exc_Msg
615: ( G_PKG_NAME
616: , 'Build_Included_Items'
610:
611:
612: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
613: THEN
614: OE_MSG_PUB.Add_Exc_Msg
615: ( G_PKG_NAME
616: , 'Build_Included_Items'
617: );
618: END IF;
1000: WHEN OTHERS THEN
1001:
1002: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1003:
1004: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1005: THEN
1006: OE_MSG_PUB.Add_Exc_Msg
1007: ( G_PKG_NAME
1008: , 'Schedule_Parent_line'
1002: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1003:
1004: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1005: THEN
1006: OE_MSG_PUB.Add_Exc_Msg
1007: ( G_PKG_NAME
1008: , 'Schedule_Parent_line'
1009: );
1010: END IF;
2059:
2060: G_LINE_PART_OF_SET := FALSE;
2061: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2062:
2063: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
2064: THEN
2065: OE_MSG_PUB.Add_Exc_Msg
2066: ( G_PKG_NAME
2067: , 'Schedule_line'
2061: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2062:
2063: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
2064: THEN
2065: OE_MSG_PUB.Add_Exc_Msg
2066: ( G_PKG_NAME
2067: , 'Schedule_line'
2068: );
2069: END IF;
2324: IF is_set_recursion = 'N' THEN
2325: oe_set_util.g_set_recursive_flag := FALSE;
2326: END IF;
2327:
2328: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
2329: THEN
2330: OE_MSG_PUB.Add_Exc_Msg
2331: ( G_PKG_NAME
2332: , 'Schedule_line'
2326: END IF;
2327:
2328: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
2329: THEN
2330: OE_MSG_PUB.Add_Exc_Msg
2331: ( G_PKG_NAME
2332: , 'Schedule_line'
2333: );
2334: END IF;
2451: (l_schedule_action_code = OESCH_ACT_UNDEMAND) OR
2452: (l_schedule_action_code = OESCH_ACT_UNRESERVE))
2453: THEN
2454: FND_MESSAGE.SET_NAME('ONT','OE_SCH_NO_ACTION_DONE_NO_EXP');
2455: OE_MSG_PUB.Add;
2456: RETURN FALSE;
2457: END IF;
2458:
2459: IF l_debug_level > 0 THEN
2792: (p_line_rec.ordered_quantity is null OR
2793: p_line_rec.ordered_quantity = FND_API.G_MISS_NUM)) THEN
2794:
2795: FND_MESSAGE.SET_NAME('ONT','OE_SCH_MISSING_QUANTITY');
2796: OE_MSG_PUB.Add;
2797:
2798: l_return_status := FND_API.G_RET_STS_ERROR;
2799: END IF;
2800:
2810:
2811: IF p_line_rec.schedule_action_code is not null THEN
2812:
2813: FND_MESSAGE.SET_NAME('ONT','OE_SCH_ZERO_QTY');
2814: OE_MSG_PUB.Add;
2815:
2816: IF l_debug_level > 0 THEN
2817: oe_debug_pub.add( 'E2' , 1 ) ;
2818: END IF;
2830: -- The line is cancelled. Cannot perform scheduling
2831: -- on it.
2832:
2833: FND_MESSAGE.SET_NAME('ONT','OE_SCH_LINE_FULLY_CANCELLED');
2834: OE_MSG_PUB.Add;
2835:
2836: IF l_debug_level > 0 THEN
2837: oe_debug_pub.add( 'E3' , 1 ) ;
2838: END IF;
2856: -- The line is cancelled. Cannot perform scheduling
2857: -- on it.
2858:
2859: FND_MESSAGE.SET_NAME('ONT','OE_SCH_LINE_SHIPPED');
2860: OE_MSG_PUB.Add;
2861:
2862: IF l_debug_level > 0 THEN
2863: oe_debug_pub.add( 'OE_SCH_LINE_SHIPPED' , 1 ) ;
2864: END IF;
2879: oe_debug_pub.add( 'INSIDE CONFIG ITEM...RESERVED QTY CHANGED' , 1 ) ;
2880: END IF;
2881: FND_MESSAGE.SET_NAME('ONT','OE_INVALID_ACTION');
2882: FND_MESSAGE.SET_TOKEN('ACTION',OE_Id_To_Value.Inventory_Item(p_line_rec.inventory_item_id));
2883: OE_MSG_PUB.Add;
2884: l_return_status := FND_API.G_RET_STS_ERROR;
2885: END IF;
2886: -- Bug 2314463 End
2887:
2889: IF (p_line_rec.ordered_quantity < p_line_rec.reserved_quantity)
2890: THEN
2891:
2892: FND_MESSAGE.SET_NAME('ONT','OE_SCH_RES_MORE_ORD_QTY');
2893: OE_MSG_PUB.Add;
2894:
2895: IF l_debug_level > 0 THEN
2896: oe_debug_pub.add( 'E4' , 1 ) ;
2897: END IF;
2902: IF (p_line_rec.ordered_quantity2 < p_line_rec.reserved_quantity2)
2903: THEN
2904:
2905: FND_MESSAGE.SET_NAME('ONT','OE_SCH_RES_MORE_ORD_QTY');
2906: OE_MSG_PUB.Add;
2907:
2908: IF l_debug_level > 0 THEN
2909: oe_debug_pub.add( 'E4a' , 1 ) ;
2910: END IF;
2918: p_line_rec.schedule_action_code = OESCH_ACT_UNRESERVE) AND
2919: (p_line_rec.reserved_quantity is not null) THEN
2920:
2921: FND_MESSAGE.SET_NAME('ONT','OE_SCH_RES_QTY_CHG_NOT_ALLOWED');
2922: OE_MSG_PUB.Add;
2923: l_return_status := FND_API.G_RET_STS_ERROR;
2924: IF l_debug_level > 0 THEN
2925: oe_debug_pub.add( 'E5' , 1 ) ;
2926: END IF;
2941: IF (p_line_rec.ordered_quantity < p_line_rec.reserved_quantity)
2942: THEN
2943:
2944: FND_MESSAGE.SET_NAME('ONT','OE_SCH_RES_MORE_ORD_QTY');
2945: OE_MSG_PUB.Add;
2946:
2947: l_return_status := FND_API.G_RET_STS_ERROR;
2948: IF l_debug_level > 0 THEN
2949: oe_debug_pub.add( 'E6' , 1 ) ;
2967: IF (p_line_rec.ordered_quantity2 < p_line_rec.reserved_quantity2)
2968: THEN
2969:
2970: FND_MESSAGE.SET_NAME('ONT','OE_SCH_RES_MORE_ORD_QTY');
2971: OE_MSG_PUB.Add;
2972:
2973: l_return_status := FND_API.G_RET_STS_ERROR;
2974: IF l_debug_level > 0 THEN
2975: oe_debug_pub.add( 'E6a' , 1 ) ;
2986: IF (p_line_rec.order_quantity_uom is null OR
2987: p_line_rec.order_quantity_uom = FND_API.G_MISS_CHAR) THEN
2988:
2989: FND_MESSAGE.SET_NAME('ONT','OE_SCH_MISSING_UOM');
2990: OE_MSG_PUB.Add;
2991:
2992: l_return_status := FND_API.G_RET_STS_ERROR;
2993: IF l_debug_level > 0 THEN
2994: oe_debug_pub.add( 'E7' , 1 ) ;
3005: IF (p_line_rec.inventory_item_id is null OR
3006: p_line_rec.inventory_item_id = FND_API.G_MISS_NUM) THEN
3007:
3008: FND_MESSAGE.SET_NAME('ONT','OE_SCH_MISSING_ITEM');
3009: OE_MSG_PUB.Add;
3010:
3011: l_return_status := FND_API.G_RET_STS_ERROR;
3012: END IF;
3013:
3021: IF (p_line_rec.request_date is null OR
3022: p_line_rec.request_date = FND_API.G_MISS_DATE) THEN
3023:
3024: FND_MESSAGE.SET_NAME('ONT','OE_SCH_MISSING_REQUEST_DATE');
3025: OE_MSG_PUB.Add;
3026: l_return_status := FND_API.G_RET_STS_ERROR;
3027: END IF;
3028:
3029: -- If the line belongs to a set, you cannot unschedule the line
3036: p_line_rec.schedule_action_code = OESCH_ACT_UNSCHEDULE))
3037: THEN
3038:
3039: FND_MESSAGE.SET_NAME('ONT','OE_SCH_OE_ORDER_FAILED');
3040: OE_MSG_PUB.Add;
3041:
3042: l_return_status := FND_API.G_RET_STS_ERROR;
3043: END IF;
3044:
3097: END IF;
3098:
3099: IF (l_result = FND_API.G_TRUE) THEN
3100: FND_MESSAGE.SET_NAME('ONT','OE_SCH_LINE_ON_HOLD');
3101: OE_MSG_PUB.Add;
3102: l_return_status := FND_API.G_RET_STS_ERROR;
3103: END IF;
3104:
3105: END IF;
3131: FND_MESSAGE.SET_TOKEN('ACTION',
3132: nvl(p_line_rec.schedule_action_code,OESCH_ACT_SCHEDULE));
3133: FND_MESSAGE.SET_TOKEN('ORDER_TYPE',
3134: nvl(sch_cached_line_type,sch_cached_order_type));
3135: OE_MSG_PUB.Add;
3136: l_return_status := FND_API.G_RET_STS_ERROR;
3137: END IF;
3138: ELSIF l_scheduling_level_code = SCH_LEVEL_TWO OR
3139: p_line_rec.reserved_quantity > 0 THEN
3142: FND_MESSAGE.SET_TOKEN('ACTION',
3143: nvl(p_line_rec.schedule_action_code,OESCH_ACT_RESERVE));
3144: FND_MESSAGE.SET_TOKEN('ORDER_TYPE',
3145: nvl(sch_cached_line_type,sch_cached_order_type));
3146: OE_MSG_PUB.Add;
3147: l_return_status := FND_API.G_RET_STS_ERROR;
3148: END IF;
3149: END IF;
3150: END IF;
3192: END IF;
3193: FND_MESSAGE.SET_NAME('ONT','OE_BOM_NO_BILL_IN_VAL_ORG');
3194: FND_MESSAGE.SET_TOKEN('ITEM',nvl(p_line_rec.ordered_item,p_line_rec.inventory_item_id));
3195: FND_MESSAGE.SET_TOKEN('ORG',l_org_id);
3196: OE_MSG_PUB.Add;
3197: l_return_status := FND_API.G_RET_STS_ERROR;
3198:
3199: WHEN OTHERS THEN
3200: Null;
3374: , x_msg_data => l_msg_data
3375: );
3376:
3377: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3378: oe_msg_pub.transfer_msg_stack;
3379: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
3380: for I in 1..l_msg_count loop
3381: l_msg_data := OE_MSG_PUB.Get(I,'F');
3382: IF l_debug_level > 0 THEN
3375: );
3376:
3377: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3378: oe_msg_pub.transfer_msg_stack;
3379: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
3380: for I in 1..l_msg_count loop
3381: l_msg_data := OE_MSG_PUB.Get(I,'F');
3382: IF l_debug_level > 0 THEN
3383: oe_debug_pub.add( L_MSG_DATA , 1 ) ;
3377: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3378: oe_msg_pub.transfer_msg_stack;
3379: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
3380: for I in 1..l_msg_count loop
3381: l_msg_data := OE_MSG_PUB.Get(I,'F');
3382: IF l_debug_level > 0 THEN
3383: oe_debug_pub.add( L_MSG_DATA , 1 ) ;
3384: END IF;
3385: end loop;
3384: END IF;
3385: end loop;
3386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3387: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
3388: oe_msg_pub.transfer_msg_stack;
3389: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
3390: for I in 1..l_msg_count loop
3391: l_msg_data := OE_MSG_PUB.Get(I,'F');
3392: IF l_debug_level > 0 THEN
3385: end loop;
3386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3387: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
3388: oe_msg_pub.transfer_msg_stack;
3389: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
3390: for I in 1..l_msg_count loop
3391: l_msg_data := OE_MSG_PUB.Get(I,'F');
3392: IF l_debug_level > 0 THEN
3393: oe_debug_pub.add( L_MSG_DATA , 1 ) ;
3387: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
3388: oe_msg_pub.transfer_msg_stack;
3389: l_msg_count:=OE_MSG_PUB.COUNT_MSG;
3390: for I in 1..l_msg_count loop
3391: l_msg_data := OE_MSG_PUB.Get(I,'F');
3392: IF l_debug_level > 0 THEN
3393: oe_debug_pub.add( L_MSG_DATA , 1 ) ;
3394: END IF;
3395: end loop;
3792: EXCEPTION
3793: WHEN OTHERS THEN
3794: l_return_status := FND_API.G_RET_STS_ERROR;
3795: fnd_message.set_name('ONT', 'OE_INVALID_ITEM_WHSE');
3796: OE_MSG_PUB.Add;
3797: END;
3798:
3799:
3800: IF l_revision_code = 2 OR l_lot_code = 2 THEN
3799:
3800: IF l_revision_code = 2 OR l_lot_code = 2 THEN
3801: -- 2 == YES
3802: fnd_message.set_name('ONT', 'OE_SUBINV_NOT_ALLOWED');
3803: OE_MSG_PUB.Add;
3804: IF p_action = OESCH_ACT_RESERVE THEN
3805: l_return_status := FND_API.G_RET_STS_ERROR;
3806: RAISE FND_API.G_EXC_ERROR;
3807: ELSE
3860: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
3861: IF l_msg_data is not null THEN
3862: fnd_message.set_encoded(l_msg_data);
3863: l_buffer := fnd_message.get;
3864: oe_msg_pub.add_text(p_message_text => l_buffer);
3865: IF l_debug_level > 0 THEN
3866: oe_debug_pub.add( L_MSG_DATA , 1 ) ;
3867: END IF;
3868: END IF;
3925: WHEN OTHERS THEN
3926:
3927: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3928:
3929: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
3930: THEN
3931: OE_MSG_PUB.Add_Exc_Msg
3932: ( G_PKG_NAME
3933: , 'Action_Schedule'
3927: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3928:
3929: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
3930: THEN
3931: OE_MSG_PUB.Add_Exc_Msg
3932: ( G_PKG_NAME
3933: , 'Action_Schedule'
3934: );
3935: END IF;
4536: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
4537: IF l_msg_data is not null THEN
4538: fnd_message.set_encoded(l_msg_data);
4539: l_buffer := fnd_message.get;
4540: oe_msg_pub.add_text(p_message_text => l_buffer);
4541: IF l_debug_level > 0 THEN
4542: oe_debug_pub.add( 'ERROR : '|| L_BUFFER , 1 ) ;
4543: END IF;
4544: END IF;
4647: EXCEPTION
4648: WHEN OTHERS THEN
4649: l_return_status := FND_API.G_RET_STS_ERROR;
4650: fnd_message.set_name('ONT', 'OE_INVALID_ITEM_WHSE');
4651: OE_MSG_PUB.Add;
4652: END;
4653:
4654:
4655: IF l_revision_code = 2 OR l_lot_code = 2 THEN
4654:
4655: IF l_revision_code = 2 OR l_lot_code = 2 THEN
4656: -- 2 == YES
4657: fnd_message.set_name('ONT', 'OE_SUBINV_NOT_ALLOWED');
4658: OE_MSG_PUB.Add;
4659: IF l_line_rec.schedule_action_code = OESCH_ACT_RESERVE THEN
4660: l_return_status := FND_API.G_RET_STS_ERROR;
4661: RAISE FND_API.G_EXC_ERROR;
4662: ELSE
4722: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
4723: IF l_msg_data is not null THEN
4724: fnd_message.set_encoded(l_msg_data);
4725: l_buffer := fnd_message.get;
4726: oe_msg_pub.add_text(p_message_text => l_buffer);
4727: END IF;
4728:
4729: IF l_line_rec.Schedule_action_code = OESCH_ACT_RESERVE THEN
4730: RAISE FND_API.G_EXC_ERROR;
4808: -- interfaced to wsh.
4809: -- Give a message here tell the user we are not unreserving
4810: -- Added code here to fix bug 2038201.
4811: FND_MESSAGE.SET_NAME('ONT','OE_SCH_UNRSV_NOT_ALLOWED');
4812: OE_MSG_PUB.Add;
4813:
4814: goto end_of_processing;
4815:
4816:
5063: -- interfaced to wsh.
5064: -- Give a message here tell the user we are not unreserving
5065: -- Added code here to fix bug 2038201.
5066: FND_MESSAGE.SET_NAME('ONT','OE_SCH_UNRSV_NOT_ALLOWED');
5067: OE_MSG_PUB.Add;
5068:
5069: goto end_of_processing;
5070:
5071:
5170: ELSE
5171: -- Action_Unschedule will only unreserve if not interfaced to WSH
5172: -- Give a message here tell the user we are not unreserving
5173: FND_MESSAGE.SET_NAME('ONT','OE_SCH_UNRSV_NOT_ALLOWED');
5174: OE_MSG_PUB.Add;
5175: goto end_of_processing;
5176: END IF;
5177:
5178: ELSE
5176: END IF;
5177:
5178: ELSE
5179: FND_MESSAGE.SET_NAME('ONT','OE_SCH_NO_ACTION_DONE_NO_EXP');
5180: OE_MSG_PUB.Add;
5181: goto end_of_processing;
5182: END IF;
5183:
5184: -- schedule_action_code --> OESCH_ACT_UNDEMAND
5197: goto end_of_processing;
5198:
5199: ELSE
5200: FND_MESSAGE.SET_NAME('ONT','OE_SCH_NO_ACTION_DONE_NO_EXP');
5201: OE_MSG_PUB.Add;
5202: goto end_of_processing;
5203: END IF;
5204:
5205:
5392: --Commenting this code not to display the message when
5393: --scheduled inclued lines being re-scheduled through schedule_parent-line.
5394: IF (l_line_rec.schedule_status_code IS NOT NULL) THEN
5395: /* FND_MESSAGE.SET_NAME('ONT','OE_SCH_NO_ACTION_DONE_NO_EXP');
5396: OE_MSG_PUB.Add;*/
5397: IF l_debug_level > 0 THEN
5398: oe_debug_pub.add( ' SCHEDULED LINE , GOTO END OF PROCESSING' , 3 ) ;
5399: END IF;
5400: goto end_of_processing;
5426:
5427: IF OE_GLOBALS.Equal(l_line_rec.ordered_quantity,
5428: l_line_rec.reserved_quantity) THEN
5429: FND_MESSAGE.SET_NAME('ONT','OE_SCH_NO_ACTION_DONE_NO_EXP');
5430: OE_MSG_PUB.Add;
5431: goto end_of_processing;
5432:
5433: END IF;
5434:
6462:
6463: /*
6464: IF l_result <> 1 THEN
6465: IF lErrorMessage is not null THEN
6466: oe_msg_pub.add_text(p_message_text => lErrorMessage);
6467: END IF;
6468: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6469: END IF;
6470: */
6575: oe_debug_pub.add( '....EXITING OE_ORDER_SCH_UTIL.LOAD_REQUEST' , 1 ) ;
6576: END IF;
6577: EXCEPTION
6578: WHEN OTHERS THEN
6579: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
6580: THEN
6581: OE_MSG_PUB.Add_Exc_Msg
6582: ( G_PKG_NAME
6583: , 'Load_MRP_Request'
6577: EXCEPTION
6578: WHEN OTHERS THEN
6579: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
6580: THEN
6581: OE_MSG_PUB.Add_Exc_Msg
6582: ( G_PKG_NAME
6583: , 'Load_MRP_Request'
6584: );
6585: END IF;
7030: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
7031: IF l_msg_data is not null THEN
7032: fnd_message.set_encoded(l_msg_data);
7033: l_buffer := fnd_message.get;
7034: oe_msg_pub.add_text(p_message_text => l_buffer);
7035: IF l_debug_level > 0 THEN
7036: oe_debug_pub.add( 'ERROR : '|| L_BUFFER , 1 ) ;
7037: END IF;
7038: END IF;
7067: WHEN OTHERS THEN
7068:
7069: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
7070:
7071: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
7072: THEN
7073: OE_MSG_PUB.Add_Exc_Msg
7074: ( G_PKG_NAME
7075: , 'Schedule_line'
7069: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
7070:
7071: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
7072: THEN
7073: OE_MSG_PUB.Add_Exc_Msg
7074: ( G_PKG_NAME
7075: , 'Schedule_line'
7076: );
7077: END IF;
7421: oe_debug_pub.add( 'ERROR FROM MRP: ' || P_ATP_TABLE.ERROR_CODE ( J ) , 1 ) ;
7422: END IF;
7423: IF p_atp_table.error_code(J) = 80 THEN
7424: FND_MESSAGE.SET_NAME('ONT','OE_SCH_NO_SOURCE');
7425: OE_MSG_PUB.Add;
7426: ELSE
7427:
7428: IF l_debug_level > 0 THEN
7429: oe_debug_pub.add( 'SCHEDULING FAILED' , 1 ) ;
7429: oe_debug_pub.add( 'SCHEDULING FAILED' , 1 ) ;
7430: oe_debug_pub.add( P_ATP_TABLE.ERROR_CODE ( J ) , 1 ) ;
7431: END IF;
7432:
7433: OE_MSG_PUB.set_msg_context(
7434: p_entity_code => 'LINE'
7435: ,p_entity_id => l_line_rec.line_id
7436: ,p_header_id => l_line_rec.header_id
7437: ,p_line_id => l_line_rec.line_id
7480: oe_debug_pub.add( 'ADDING MESSAGE TO THE STACK' , 1 ) ;
7481: END IF;
7482: FND_MESSAGE.SET_NAME('ONT','OE_SCH_OE_ORDER_FAILED');
7483: FND_MESSAGE.SET_TOKEN('EXPLANATION',l_explanation);
7484: OE_MSG_PUB.Add;
7485: END IF;
7486: END IF;
7487:
7488: l_atp_rec.error_message := l_explanation;
7585: oe_debug_pub.add( 'EXPLANATION IS : ' || L_EXPLANATION , 1 ) ;
7586: END IF;
7587:
7588: IF p_atp_table.error_code(J) = 150 THEN -- to fix bug 1880166.
7589: OE_MSG_PUB.add_text(l_explanation);
7590: END IF;
7591:
7592: EXCEPTION
7593: WHEN OTHERS THEN
7827: oe_debug_pub.add( 'SCH: MRP HAS RETURNED A NULL SHIP DATE' , 2 ) ;
7828: END IF;
7829: l_line_rec.visible_demand_flag := 'N';
7830: FND_MESSAGE.SET_NAME('ONT','OE_SCH_ATP_ERROR');
7831: OE_MSG_PUB.Add;
7832: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7833: END IF;
7834: -- Bug 2375055 End
7835:
8023: oe_debug_pub.add( 'SCH: MRP HAS RETURNED A NULL SHIP DATE' , 2 ) ;
8024: END IF;
8025: l_line_rec.visible_demand_flag := 'N';
8026: FND_MESSAGE.SET_NAME('ONT','OE_SCH_ATP_ERROR');
8027: OE_MSG_PUB.Add;
8028: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8029: END IF;
8030: -- Bug 2375055 End
8031:
8112: END IF;
8113:
8114: EXCEPTION
8115: WHEN OTHERS THEN
8116: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
8117: THEN
8118: OE_MSG_PUB.Add_Exc_Msg
8119: ( G_PKG_NAME
8120: , 'Load_Results'
8114: EXCEPTION
8115: WHEN OTHERS THEN
8116: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
8117: THEN
8118: OE_MSG_PUB.Add_Exc_Msg
8119: ( G_PKG_NAME
8120: , 'Load_Results'
8121: );
8122: END IF;
8211: EXCEPTION
8212:
8213: WHEN OTHERS THEN
8214:
8215: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
8216: THEN
8217: OE_MSG_PUB.Add_Exc_Msg
8218: ( G_PKG_NAME
8219: , 'Insert_Into_Mtl_Sales_Orders'
8213: WHEN OTHERS THEN
8214:
8215: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
8216: THEN
8217: OE_MSG_PUB.Add_Exc_Msg
8218: ( G_PKG_NAME
8219: , 'Insert_Into_Mtl_Sales_Orders'
8220: );
8221: END IF;
8568: END IF;
8569: EXCEPTION
8570: WHEN OTHERS THEN
8571:
8572: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
8573: THEN
8574: OE_MSG_PUB.Add_Exc_Msg
8575: ( G_PKG_NAME
8576: , 'PROCESS_SPLIT'
8570: WHEN OTHERS THEN
8571:
8572: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
8573: THEN
8574: OE_MSG_PUB.Add_Exc_Msg
8575: ( G_PKG_NAME
8576: , 'PROCESS_SPLIT'
8577: );
8578: END IF;
9065: THEN
9066: IF l_msg_data is not null THEN
9067: fnd_message.set_encoded(l_msg_data);
9068: l_buffer := fnd_message.get;
9069: oe_msg_pub.add_text(p_message_text => l_buffer);
9070: IF l_debug_level > 0 THEN
9071: oe_debug_pub.add( 'ERROR : '|| L_BUFFER , 1 ) ;
9072: END IF;
9073: END IF;
9130: THEN
9131: IF l_msg_data is not null THEN
9132: fnd_message.set_encoded(l_msg_data);
9133: l_buffer := fnd_message.get;
9134: oe_msg_pub.add_text(p_message_text => l_buffer);
9135: IF l_debug_level > 0 THEN
9136: oe_debug_pub.add( 'ERROR : '|| L_BUFFER , 1 ) ;
9137: END IF;
9138: END IF;
9290: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
9291: IF l_msg_data is not null THEN
9292: fnd_message.set_encoded(l_msg_data);
9293: l_buffer := fnd_message.get;
9294: oe_msg_pub.add_text(p_message_text => l_buffer);
9295: IF l_debug_level > 0 THEN
9296: oe_debug_pub.add( 'ERROR : '|| L_BUFFER , 1 ) ;
9297: END IF;
9298: END IF;
9358: EXCEPTION
9359: WHEN OTHERS THEN
9360: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9361:
9362: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
9363: THEN
9364: OE_MSG_PUB.Add_Exc_Msg
9365: ( G_PKG_NAME
9366: , 'Split_Scheduling'
9360: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9361:
9362: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
9363: THEN
9364: OE_MSG_PUB.Add_Exc_Msg
9365: ( G_PKG_NAME
9366: , 'Split_Scheduling'
9367: );
9368: END IF;
9515: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
9516: IF l_msg_data is not null THEN
9517: fnd_message.set_encoded(l_msg_data);
9518: l_buffer := fnd_message.get;
9519: oe_msg_pub.add_text(p_message_text => l_buffer);
9520: IF l_debug_level > 0 THEN
9521: oe_debug_pub.add( 'ERROR : '|| L_BUFFER , 1 ) ;
9522: END IF;
9523: END IF;
9639: WHEN OTHERS THEN
9640:
9641: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9642:
9643: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
9644: THEN
9645: OE_MSG_PUB.Add_Exc_Msg
9646: ( G_PKG_NAME
9647: , 'Schedule_line'
9641: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9642:
9643: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
9644: THEN
9645: OE_MSG_PUB.Add_Exc_Msg
9646: ( G_PKG_NAME
9647: , 'Schedule_line'
9648: );
9649: END IF;
9897:
9898: /*
9899: IF l_result <> 1 THEN
9900: IF lErrorMessage is not null THEN
9901: oe_msg_pub.add_text(p_message_text => lErrorMessage);
9902: END IF;
9903: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9904: END IF;
9905: */
10195: EXCEPTION
10196:
10197: WHEN OTHERS THEN
10198:
10199: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
10200: THEN
10201: OE_MSG_PUB.Add_Exc_Msg
10202: ( G_PKG_NAME
10203: , 'Delete_row'
10197: WHEN OTHERS THEN
10198:
10199: IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
10200: THEN
10201: OE_MSG_PUB.Add_Exc_Msg
10202: ( G_PKG_NAME
10203: , 'Delete_row'
10204: );
10205: END IF;
10314: IF l_debug_level > 0 THEN
10315: oe_debug_pub.add( ' THE RESERVATION PROCESS HAS FAILED ' , 1 ) ;
10316: END IF;
10317: FND_MESSAGE.SET_NAME('ONT','OE_SCH_RSV_FAILURE');
10318: OE_MSG_PUB.Add;
10319: END IF;
10320:
10321: -- Error Handling Start
10322: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
10322: IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
10323: IF l_debug_level > 0 THEN
10324: oe_debug_pub.add( 'INSIDE UNEXPECTED ERROR' , 1 ) ;
10325: END IF;
10326: OE_MSG_PUB.Transfer_Msg_Stack;
10327: l_msg_count := OE_MSG_PUB.COUNT_MSG;
10328:
10329: FOR I IN 1..l_msg_count LOOP
10330: l_msg_data := OE_MSG_PUB.Get(I,'F');
10323: IF l_debug_level > 0 THEN
10324: oe_debug_pub.add( 'INSIDE UNEXPECTED ERROR' , 1 ) ;
10325: END IF;
10326: OE_MSG_PUB.Transfer_Msg_Stack;
10327: l_msg_count := OE_MSG_PUB.COUNT_MSG;
10328:
10329: FOR I IN 1..l_msg_count LOOP
10330: l_msg_data := OE_MSG_PUB.Get(I,'F');
10331: IF l_debug_level > 0 THEN
10326: OE_MSG_PUB.Transfer_Msg_Stack;
10327: l_msg_count := OE_MSG_PUB.COUNT_MSG;
10328:
10329: FOR I IN 1..l_msg_count LOOP
10330: l_msg_data := OE_MSG_PUB.Get(I,'F');
10331: IF l_debug_level > 0 THEN
10332: oe_debug_pub.add( L_MSG_DATA , 1 ) ;
10333: END IF;
10334: END LOOP;
10337: ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
10338: IF l_debug_level > 0 THEN
10339: oe_debug_pub.add( ' INSIDE EXPECTED ERROR' , 1 ) ;
10340: END IF;
10341: OE_MSG_PUB.Transfer_Msg_Stack;
10342: l_msg_count := OE_MSG_PUB.COUNT_MSG;
10343:
10344: FOR I IN 1..l_msg_count LOOP
10345: l_msg_data := OE_MSG_PUB.Get(I,'F');
10338: IF l_debug_level > 0 THEN
10339: oe_debug_pub.add( ' INSIDE EXPECTED ERROR' , 1 ) ;
10340: END IF;
10341: OE_MSG_PUB.Transfer_Msg_Stack;
10342: l_msg_count := OE_MSG_PUB.COUNT_MSG;
10343:
10344: FOR I IN 1..l_msg_count LOOP
10345: l_msg_data := OE_MSG_PUB.Get(I,'F');
10346: IF l_debug_level > 0 THEN
10341: OE_MSG_PUB.Transfer_Msg_Stack;
10342: l_msg_count := OE_MSG_PUB.COUNT_MSG;
10343:
10344: FOR I IN 1..l_msg_count LOOP
10345: l_msg_data := OE_MSG_PUB.Get(I,'F');
10346: IF l_debug_level > 0 THEN
10347: oe_debug_pub.add( L_MSG_DATA , 1 ) ;
10348: END IF;
10349: END LOOP;
10358: END IF;
10359:
10360: -- Get message count and data
10361:
10362: oe_msg_pub.count_and_get
10363: ( p_count => x_msg_count
10364: , p_data => x_msg_data
10365: );
10366:
10376: x_return_status := FND_API.G_RET_STS_ERROR;
10377:
10378: -- Get message count and data
10379:
10380: oe_msg_pub.count_and_get
10381: ( p_count => x_msg_count
10382: , p_data => x_msg_data);
10383:
10384: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10382: , p_data => x_msg_data);
10383:
10384: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10385: -- OESCH_PERFORMED_RESERVATION := 'N';
10386: IF OE_MSG_PUB.Check_Msg_Level
10387: (OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
10388: THEN
10389: OE_MSG_PUB.Add_Exc_Msg
10390: (G_PKG_NAME , 'Post_Forms_Commit');
10383:
10384: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10385: -- OESCH_PERFORMED_RESERVATION := 'N';
10386: IF OE_MSG_PUB.Check_Msg_Level
10387: (OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
10388: THEN
10389: OE_MSG_PUB.Add_Exc_Msg
10390: (G_PKG_NAME , 'Post_Forms_Commit');
10391: END IF;
10385: -- OESCH_PERFORMED_RESERVATION := 'N';
10386: IF OE_MSG_PUB.Check_Msg_Level
10387: (OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
10388: THEN
10389: OE_MSG_PUB.Add_Exc_Msg
10390: (G_PKG_NAME , 'Post_Forms_Commit');
10391: END IF;
10392:
10393: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10393: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10394:
10395: -- Get message count and data
10396:
10397: oe_msg_pub.count_and_get
10398: ( p_count => x_msg_count
10399: , p_data => x_msg_data);
10400:
10401: