296: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
297: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Lock_Documents');
298: END IF;
299: IF ( g_unexp_level >= g_debug_level ) THEN
300: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
301: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
302: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
303: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
304: END IF;
297: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Lock_Documents');
298: END IF;
299: IF ( g_unexp_level >= g_debug_level ) THEN
300: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
301: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
302: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
303: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
304: END IF;
305: APP_EXCEPTION.Raise_Exception;
298: END IF;
299: IF ( g_unexp_level >= g_debug_level ) THEN
300: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
301: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
302: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
303: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
304: END IF;
305: APP_EXCEPTION.Raise_Exception;
306: END Lock_Documents;
403: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
404: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Log_Error');
405: END IF;
406: IF ( g_unexp_level >= g_debug_level ) THEN
407: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
408: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
409: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
410: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
411: END IF;
404: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Log_Error');
405: END IF;
406: IF ( g_unexp_level >= g_debug_level ) THEN
407: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
408: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
409: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
410: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
411: END IF;
412: APP_EXCEPTION.Raise_Exception;
405: END IF;
406: IF ( g_unexp_level >= g_debug_level ) THEN
407: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
408: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
409: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
410: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
411: END IF;
412: APP_EXCEPTION.Raise_Exception;
413: END Log_Error;
505: ARGUMENT96 => NULL, ARGUMENT97 => NULL, ARGUMENT98 => NULL,
506: ARGUMENT99 => NULL, ARGUMENT100 => NULL );
507:
508: IF l_request_id = 0 THEN
509: fnd_message.set_name('IGC','IGC_CC_ER_SUBMIT_EXCPTION_RPT');
510: IF (g_debug_mode = 'Y') THEN
511: Put_Debug_Msg (l_full_path,fnd_message.get,g_event_level);
512: END IF;
513: app_exception.raise_exception;
507:
508: IF l_request_id = 0 THEN
509: fnd_message.set_name('IGC','IGC_CC_ER_SUBMIT_EXCPTION_RPT');
510: IF (g_debug_mode = 'Y') THEN
511: Put_Debug_Msg (l_full_path,fnd_message.get,g_event_level);
512: END IF;
513: app_exception.raise_exception;
514: END IF; -- l_request_id = 0
515:
584: ARGUMENT96 => NULL, ARGUMENT97 => NULL, ARGUMENT98 => NULL,
585: ARGUMENT99 => NULL, ARGUMENT100 => NULL );
586:
587: IF l_request_id = 0 THEN
588: fnd_message.set_name('IGC','IGC_CC_ER_SUBMIT_EXCPTION_RPT');
589: IF (g_debug_mode = 'Y') THEN
590: Put_Debug_Msg (l_full_path,fnd_message.get,g_event_level);
591: END IF;
592: app_exception.raise_exception;
586:
587: IF l_request_id = 0 THEN
588: fnd_message.set_name('IGC','IGC_CC_ER_SUBMIT_EXCPTION_RPT');
589: IF (g_debug_mode = 'Y') THEN
590: Put_Debug_Msg (l_full_path,fnd_message.get,g_event_level);
591: END IF;
592: app_exception.raise_exception;
593: END IF; -- l_request_id = 0
594: IF (g_debug_mode = 'Y') THEN
603:
604:
605: EXCEPTION
606: WHEN OTHERS THEN
607: fnd_message.set_name('IGC','IGC_CC_ER_SUBMIT_EXCPTION_RPT');
608: IF g_debug_mode = 'Y' THEN
609: Put_Debug_Msg (l_full_path,fnd_message.get,g_error_level);
610: END IF;
611: app_exception.raise_exception;
605: EXCEPTION
606: WHEN OTHERS THEN
607: fnd_message.set_name('IGC','IGC_CC_ER_SUBMIT_EXCPTION_RPT');
608: IF g_debug_mode = 'Y' THEN
609: Put_Debug_Msg (l_full_path,fnd_message.get,g_error_level);
610: END IF;
611: app_exception.raise_exception;
612: IF ( g_unexp_level >= g_debug_level ) THEN
613: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
609: Put_Debug_Msg (l_full_path,fnd_message.get,g_error_level);
610: END IF;
611: app_exception.raise_exception;
612: IF ( g_unexp_level >= g_debug_level ) THEN
613: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
614: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
615: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
616: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
617: END IF;
610: END IF;
611: app_exception.raise_exception;
612: IF ( g_unexp_level >= g_debug_level ) THEN
613: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
614: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
615: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
616: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
617: END IF;
618:
611: app_exception.raise_exception;
612: IF ( g_unexp_level >= g_debug_level ) THEN
613: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
614: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
615: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
616: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
617: END IF;
618:
619: END Execute_Exceptions_Report;
672: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
673: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Insert_Exception_Record');
674: END IF;
675: IF ( g_unexp_level >= g_debug_level ) THEN
676: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
677: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
678: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
679: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
680: END IF;
673: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Insert_Exception_Record');
674: END IF;
675: IF ( g_unexp_level >= g_debug_level ) THEN
676: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
677: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
678: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
679: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
680: END IF;
681: APP_EXCEPTION.Raise_Exception;
674: END IF;
675: IF ( g_unexp_level >= g_debug_level ) THEN
676: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
677: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
678: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
679: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
680: END IF;
681: APP_EXCEPTION.Raise_Exception;
682:
897: -- Record encumbrance exceptions
898: IF NOT x_req_enc_on
899: THEN
900: l_err_code := 'IGC_PO_YEP_REQ_ENC_OFF';
901: FND_MESSAGE.set_name('IGC',l_err_code);
902: l_msg_data := FND_MESSAGE.get;
903: Insert_Exception_Record(p_exception_reason => l_msg_data,
904: p_exception_code => l_err_code);
905: END IF; -- NOT x_req_enc_on
898: IF NOT x_req_enc_on
899: THEN
900: l_err_code := 'IGC_PO_YEP_REQ_ENC_OFF';
901: FND_MESSAGE.set_name('IGC',l_err_code);
902: l_msg_data := FND_MESSAGE.get;
903: Insert_Exception_Record(p_exception_reason => l_msg_data,
904: p_exception_code => l_err_code);
905: END IF; -- NOT x_req_enc_on
906:
906:
907: IF NOT x_po_enc_on
908: THEN
909: l_err_code := 'IGC_PO_YEP_PO_ENC_OFF';
910: FND_MESSAGE.set_name('IGC',l_err_code);
911: l_msg_data := FND_MESSAGE.get;
912: Insert_Exception_Record(p_exception_reason => l_msg_data,
913: p_exception_code => l_err_code);
914: END IF ; -- NOT x_po_enc_on
907: IF NOT x_po_enc_on
908: THEN
909: l_err_code := 'IGC_PO_YEP_PO_ENC_OFF';
910: FND_MESSAGE.set_name('IGC',l_err_code);
911: l_msg_data := FND_MESSAGE.get;
912: Insert_Exception_Record(p_exception_reason => l_msg_data,
913: p_exception_code => l_err_code);
914: END IF ; -- NOT x_po_enc_on
915:
925:
926: EXCEPTION
927: WHEN E_IGC_CBC_PO_DISABLE_YEP THEN
928: l_err_code := 'IGC_CBC_PO_DISABLE_YEP';
929: FND_MESSAGE.set_name('IGC',l_err_code);
930: IF(g_excep_level >= g_debug_level) THEN
931: FND_LOG.MESSAGE(g_excep_level, l_full_path, FALSE);
932: END IF;
933: x_msg_buf := FND_MESSAGE.Get;
929: FND_MESSAGE.set_name('IGC',l_err_code);
930: IF(g_excep_level >= g_debug_level) THEN
931: FND_LOG.MESSAGE(g_excep_level, l_full_path, FALSE);
932: END IF;
933: x_msg_buf := FND_MESSAGE.Get;
934: x_return_code := 2 ;
935: WHEN E_IGC_CBC_PO_ON_SBC_OFF THEN
936: l_err_code := 'IGC_CBC_PO_ON_SBC_OFF';
937: FND_MESSAGE.set_name('IGC',l_err_code);
933: x_msg_buf := FND_MESSAGE.Get;
934: x_return_code := 2 ;
935: WHEN E_IGC_CBC_PO_ON_SBC_OFF THEN
936: l_err_code := 'IGC_CBC_PO_ON_SBC_OFF';
937: FND_MESSAGE.set_name('IGC',l_err_code);
938: IF(g_excep_level >= g_debug_level) THEN
939: FND_LOG.MESSAGE(g_excep_level, l_full_path, FALSE);
940: END IF;
941: x_msg_buf := FND_MESSAGE.Get;
937: FND_MESSAGE.set_name('IGC',l_err_code);
938: IF(g_excep_level >= g_debug_level) THEN
939: FND_LOG.MESSAGE(g_excep_level, l_full_path, FALSE);
940: END IF;
941: x_msg_buf := FND_MESSAGE.Get;
942: x_return_code := 2 ;
943: WHEN E_IGC_CC_INVALID_SET_UP THEN
944: l_err_code := 'IGC_CC_INVALID_SET_UP';
945: FND_MESSAGE.set_name('IGC',l_err_code);
941: x_msg_buf := FND_MESSAGE.Get;
942: x_return_code := 2 ;
943: WHEN E_IGC_CC_INVALID_SET_UP THEN
944: l_err_code := 'IGC_CC_INVALID_SET_UP';
945: FND_MESSAGE.set_name('IGC',l_err_code);
946: IF(g_excep_level >= g_debug_level) THEN
947: FND_LOG.MESSAGE(g_excep_level, l_full_path, FALSE);
948: END IF;
949: x_msg_buf := FND_MESSAGE.Get;
945: FND_MESSAGE.set_name('IGC',l_err_code);
946: IF(g_excep_level >= g_debug_level) THEN
947: FND_LOG.MESSAGE(g_excep_level, l_full_path, FALSE);
948: END IF;
949: x_msg_buf := FND_MESSAGE.Get;
950: x_return_code := 2 ;
951: WHEN OTHERS THEN
952: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
953: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Validate_BC_Params');
951: WHEN OTHERS THEN
952: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
953: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Validate_BC_Params');
954: END IF;
955: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
956: x_msg_buf := fnd_message.get;
957: x_return_code := 2 ;
958: IF ( g_unexp_level >= g_debug_level ) THEN
959: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
952: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
953: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Validate_BC_Params');
954: END IF;
955: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
956: x_msg_buf := fnd_message.get;
957: x_return_code := 2 ;
958: IF ( g_unexp_level >= g_debug_level ) THEN
959: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
960: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
955: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
956: x_msg_buf := fnd_message.get;
957: x_return_code := 2 ;
958: IF ( g_unexp_level >= g_debug_level ) THEN
959: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
960: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
961: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
962: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
963: END IF;
956: x_msg_buf := fnd_message.get;
957: x_return_code := 2 ;
958: IF ( g_unexp_level >= g_debug_level ) THEN
959: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
960: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
961: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
962: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
963: END IF;
964:
957: x_return_code := 2 ;
958: IF ( g_unexp_level >= g_debug_level ) THEN
959: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
960: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
961: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
962: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
963: END IF;
964:
965:
1106: IF l_prd_dtls_rec.po_period_status(l_period_index) NOT IN ('C','P','N')
1107: AND p_process_phase = 'F'
1108: THEN
1109: l_err_code := 'IGC_PO_YEP_PO_PRD_STATUS';
1110: FND_MESSAGE.set_name('IGC',l_err_code);
1111: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1112: l_msg_data := FND_MESSAGE.get;
1113: Insert_Exception_Record(p_exception_reason => l_msg_data,
1114: p_exception_code => l_err_code);
1107: AND p_process_phase = 'F'
1108: THEN
1109: l_err_code := 'IGC_PO_YEP_PO_PRD_STATUS';
1110: FND_MESSAGE.set_name('IGC',l_err_code);
1111: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1112: l_msg_data := FND_MESSAGE.get;
1113: Insert_Exception_Record(p_exception_reason => l_msg_data,
1114: p_exception_code => l_err_code);
1115: END IF ; -- po_period_status
1108: THEN
1109: l_err_code := 'IGC_PO_YEP_PO_PRD_STATUS';
1110: FND_MESSAGE.set_name('IGC',l_err_code);
1111: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1112: l_msg_data := FND_MESSAGE.get;
1113: Insert_Exception_Record(p_exception_reason => l_msg_data,
1114: p_exception_code => l_err_code);
1115: END IF ; -- po_period_status
1116:
1129: IF l_prd_dtls_rec.po_period_status(l_period_index) <> 'O'
1130: AND p_process_phase = 'F'
1131: THEN
1132: l_err_code := 'IGC_PO_YEP_PO_LAST_PERIOD';
1133: FND_MESSAGE.set_name('IGC',l_err_code);
1134: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1135: l_msg_data := FND_MESSAGE.get;
1136: Insert_Exception_Record(p_exception_reason => l_msg_data,
1137: p_exception_code => l_err_code);
1130: AND p_process_phase = 'F'
1131: THEN
1132: l_err_code := 'IGC_PO_YEP_PO_LAST_PERIOD';
1133: FND_MESSAGE.set_name('IGC',l_err_code);
1134: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1135: l_msg_data := FND_MESSAGE.get;
1136: Insert_Exception_Record(p_exception_reason => l_msg_data,
1137: p_exception_code => l_err_code);
1138: END IF ; -- po_period_status
1131: THEN
1132: l_err_code := 'IGC_PO_YEP_PO_LAST_PERIOD';
1133: FND_MESSAGE.set_name('IGC',l_err_code);
1134: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1135: l_msg_data := FND_MESSAGE.get;
1136: Insert_Exception_Record(p_exception_reason => l_msg_data,
1137: p_exception_code => l_err_code);
1138: END IF ; -- po_period_status
1139:
1141: IF l_prd_dtls_rec.gl_period_status(l_period_index) <> 'O'
1142: AND p_process_phase = 'F'
1143: THEN
1144: l_err_code := 'IGC_PO_YEP_GL_LAST_PERIOD';
1145: FND_MESSAGE.set_name('IGC',l_err_code );
1146: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1147: l_msg_data := FND_MESSAGE.get;
1148: Insert_Exception_Record(p_exception_reason => l_msg_data,
1149: p_exception_code => l_err_code);
1142: AND p_process_phase = 'F'
1143: THEN
1144: l_err_code := 'IGC_PO_YEP_GL_LAST_PERIOD';
1145: FND_MESSAGE.set_name('IGC',l_err_code );
1146: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1147: l_msg_data := FND_MESSAGE.get;
1148: Insert_Exception_Record(p_exception_reason => l_msg_data,
1149: p_exception_code => l_err_code);
1150: END IF ; -- gl_period_status
1143: THEN
1144: l_err_code := 'IGC_PO_YEP_GL_LAST_PERIOD';
1145: FND_MESSAGE.set_name('IGC',l_err_code );
1146: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1147: l_msg_data := FND_MESSAGE.get;
1148: Insert_Exception_Record(p_exception_reason => l_msg_data,
1149: p_exception_code => l_err_code);
1150: END IF ; -- gl_period_status
1151:
1160: IF l_prd_dtls_rec.po_period_status(l_period_index) NOT IN ('C','P','N')
1161: AND p_process_phase = 'F'
1162: THEN
1163: l_err_code := 'IGC_PO_YEP_PO_PRD_STATUS';
1164: FND_MESSAGE.set_name('IGC',l_err_code);
1165: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1166: l_msg_data := FND_MESSAGE.get;
1167: Insert_Exception_Record(p_exception_reason => l_msg_data,
1168: p_exception_code => l_err_code);
1161: AND p_process_phase = 'F'
1162: THEN
1163: l_err_code := 'IGC_PO_YEP_PO_PRD_STATUS';
1164: FND_MESSAGE.set_name('IGC',l_err_code);
1165: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1166: l_msg_data := FND_MESSAGE.get;
1167: Insert_Exception_Record(p_exception_reason => l_msg_data,
1168: p_exception_code => l_err_code);
1169: END IF ; -- po_poeriod_status
1162: THEN
1163: l_err_code := 'IGC_PO_YEP_PO_PRD_STATUS';
1164: FND_MESSAGE.set_name('IGC',l_err_code);
1165: FND_MESSAGE.set_token('PREV_YEAR',p_year);
1166: l_msg_data := FND_MESSAGE.get;
1167: Insert_Exception_Record(p_exception_reason => l_msg_data,
1168: p_exception_code => l_err_code);
1169: END IF ; -- po_poeriod_status
1170:
1195: IF l_curr_period_rec.po_period_status(1) NOT IN ('O', 'F')
1196: AND p_process_phase = 'F'
1197: THEN
1198: l_err_code := 'IGC_PO_YEP_PO_FIRST_PERIOD';
1199: FND_MESSAGE.set_name('IGC',l_err_code);
1200: FND_MESSAGE.set_token('CURR_YEAR',(p_year + 1));
1201: l_msg_data := FND_MESSAGE.get;
1202: Insert_Exception_Record(p_exception_reason => l_msg_data,
1203: p_exception_code => l_err_code);
1196: AND p_process_phase = 'F'
1197: THEN
1198: l_err_code := 'IGC_PO_YEP_PO_FIRST_PERIOD';
1199: FND_MESSAGE.set_name('IGC',l_err_code);
1200: FND_MESSAGE.set_token('CURR_YEAR',(p_year + 1));
1201: l_msg_data := FND_MESSAGE.get;
1202: Insert_Exception_Record(p_exception_reason => l_msg_data,
1203: p_exception_code => l_err_code);
1204:
1197: THEN
1198: l_err_code := 'IGC_PO_YEP_PO_FIRST_PERIOD';
1199: FND_MESSAGE.set_name('IGC',l_err_code);
1200: FND_MESSAGE.set_token('CURR_YEAR',(p_year + 1));
1201: l_msg_data := FND_MESSAGE.get;
1202: Insert_Exception_Record(p_exception_reason => l_msg_data,
1203: p_exception_code => l_err_code);
1204:
1205: END IF ; -- po_period_status
1208: IF l_curr_period_rec.gl_period_status(1) NOT IN ('O', 'F')
1209: AND p_process_phase = 'F'
1210: THEN
1211: l_err_code := 'IGC_PO_YEP_GL_FIRST_PERIOD';
1212: FND_MESSAGE.set_name('IGC',l_err_code);
1213: FND_MESSAGE.set_token('CURR_YEAR',(p_year + 1));
1214: l_msg_data := FND_MESSAGE.get;
1215: Insert_Exception_Record(p_exception_reason => l_msg_data,
1216: p_exception_code => l_err_code);
1209: AND p_process_phase = 'F'
1210: THEN
1211: l_err_code := 'IGC_PO_YEP_GL_FIRST_PERIOD';
1212: FND_MESSAGE.set_name('IGC',l_err_code);
1213: FND_MESSAGE.set_token('CURR_YEAR',(p_year + 1));
1214: l_msg_data := FND_MESSAGE.get;
1215: Insert_Exception_Record(p_exception_reason => l_msg_data,
1216: p_exception_code => l_err_code);
1217:
1210: THEN
1211: l_err_code := 'IGC_PO_YEP_GL_FIRST_PERIOD';
1212: FND_MESSAGE.set_name('IGC',l_err_code);
1213: FND_MESSAGE.set_token('CURR_YEAR',(p_year + 1));
1214: l_msg_data := FND_MESSAGE.get;
1215: Insert_Exception_Record(p_exception_reason => l_msg_data,
1216: p_exception_code => l_err_code);
1217:
1218: END IF ; -- gl_period_status
1232: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
1233: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Validate_Period_Status');
1234: END IF;
1235: IF ( g_unexp_level >= g_debug_level ) THEN
1236: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1237: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1238: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1239: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1240: END IF;
1233: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Validate_Period_Status');
1234: END IF;
1235: IF ( g_unexp_level >= g_debug_level ) THEN
1236: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1237: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1238: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1239: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1240: END IF;
1241: APP_EXCEPTION.Raise_Exception;
1234: END IF;
1235: IF ( g_unexp_level >= g_debug_level ) THEN
1236: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1237: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1238: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1239: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1240: END IF;
1241: APP_EXCEPTION.Raise_Exception;
1242:
1341: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
1342: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Fetch_PO_And_Releases');
1343: END IF;
1344: IF ( g_unexp_level >= g_debug_level ) THEN
1345: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1346: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1347: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1348: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1349: END IF;
1342: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Fetch_PO_And_Releases');
1343: END IF;
1344: IF ( g_unexp_level >= g_debug_level ) THEN
1345: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1346: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1347: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1348: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1349: END IF;
1350: APP_EXCEPTION.Raise_Exception;
1343: END IF;
1344: IF ( g_unexp_level >= g_debug_level ) THEN
1345: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1346: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1347: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1348: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1349: END IF;
1350: APP_EXCEPTION.Raise_Exception;
1351:
1444: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
1445: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Fetch_Requisitions');
1446: END IF;
1447: IF ( g_unexp_level >= g_debug_level ) THEN
1448: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1449: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1450: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1451: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1452: END IF;
1445: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Fetch_Requisitions');
1446: END IF;
1447: IF ( g_unexp_level >= g_debug_level ) THEN
1448: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1449: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1450: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1451: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1452: END IF;
1453: APP_EXCEPTION.Raise_Exception;
1446: END IF;
1447: IF ( g_unexp_level >= g_debug_level ) THEN
1448: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1449: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1450: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1451: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1452: END IF;
1453: APP_EXCEPTION.Raise_Exception;
1454:
1541: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
1542: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Fetch_BPAs');
1543: END IF;
1544: IF ( g_unexp_level >= g_debug_level ) THEN
1545: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1546: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1547: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1548: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1549: END IF;
1542: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Fetch_BPAs');
1543: END IF;
1544: IF ( g_unexp_level >= g_debug_level ) THEN
1545: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1546: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1547: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1548: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1549: END IF;
1550: APP_EXCEPTION.Raise_Exception;
1543: END IF;
1544: IF ( g_unexp_level >= g_debug_level ) THEN
1545: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1546: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1547: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1548: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1549: END IF;
1550: APP_EXCEPTION.Raise_Exception;
1551:
1690: END IF;
1691: IF l_valid_dist_rec.result_error_code(l_index) IS NOT NULL
1692: THEN
1693: -- report any errors and set return status to error
1694: FND_MESSAGE.set_name('IGC',l_valid_dist_rec.result_error_code(l_index));
1695: IF l_valid_dist_rec.result_error_code(l_index) LIKE 'IGC_PO_YEP_INV_%'
1696: THEN
1697: FND_MESSAGE.set_token('INVOICE_NUM',l_valid_dist_rec.invoice_number(l_index));
1698: END IF;
1693: -- report any errors and set return status to error
1694: FND_MESSAGE.set_name('IGC',l_valid_dist_rec.result_error_code(l_index));
1695: IF l_valid_dist_rec.result_error_code(l_index) LIKE 'IGC_PO_YEP_INV_%'
1696: THEN
1697: FND_MESSAGE.set_token('INVOICE_NUM',l_valid_dist_rec.invoice_number(l_index));
1698: END IF;
1699: l_msg_data := FND_MESSAGE.get;
1700: Insert_Exception_Record(p_exception_reason => l_msg_data,
1701: p_exception_code => l_valid_dist_rec.result_error_code(l_index),
1695: IF l_valid_dist_rec.result_error_code(l_index) LIKE 'IGC_PO_YEP_INV_%'
1696: THEN
1697: FND_MESSAGE.set_token('INVOICE_NUM',l_valid_dist_rec.invoice_number(l_index));
1698: END IF;
1699: l_msg_data := FND_MESSAGE.get;
1700: Insert_Exception_Record(p_exception_reason => l_msg_data,
1701: p_exception_code => l_valid_dist_rec.result_error_code(l_index),
1702: p_document_type => p_document_type,
1703: p_document_id => p_document_id,
1724: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
1725: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Validate_Distributions');
1726: END IF;
1727: IF ( g_unexp_level >= g_debug_level ) THEN
1728: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1729: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1730: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1731: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1732: END IF;
1725: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Validate_Distributions');
1726: END IF;
1727: IF ( g_unexp_level >= g_debug_level ) THEN
1728: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1729: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1730: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1731: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1732: END IF;
1733: APP_EXCEPTION.Raise_Exception;
1726: END IF;
1727: IF ( g_unexp_level >= g_debug_level ) THEN
1728: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
1729: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
1730: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
1731: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
1732: END IF;
1733: APP_EXCEPTION.Raise_Exception;
1734:
3115: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
3116: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Create Journal Adjustment');
3117: END IF;
3118: IF ( g_unexp_level >= g_debug_level ) THEN
3119: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3120: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3121: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3122: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3123: END IF;
3116: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Create Journal Adjustment');
3117: END IF;
3118: IF ( g_unexp_level >= g_debug_level ) THEN
3119: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3120: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3121: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3122: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3123: END IF;
3124: APP_EXCEPTION.Raise_Exception;
3117: END IF;
3118: IF ( g_unexp_level >= g_debug_level ) THEN
3119: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3120: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3121: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3122: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3123: END IF;
3124: APP_EXCEPTION.Raise_Exception;
3125: END Create_Journal_Adjustments;
3263:
3264: IF l_distribution_id_tbl.FIRST IS NULL THEN
3265: Put_Debug_Msg (l_full_path,p_debug_msg => 'No encumbered distributions to process');
3266: l_err_code := 'IGC_PO_YEP_NO_ENC_DIST';
3267: FND_MESSAGE.set_name('IGC',l_err_code);
3268: l_msg_data := FND_MESSAGE.get;
3269: Insert_Exception_Record(p_exception_reason => l_msg_data,
3270: p_exception_code => l_err_code,
3271: p_document_type => p_document_type,
3264: IF l_distribution_id_tbl.FIRST IS NULL THEN
3265: Put_Debug_Msg (l_full_path,p_debug_msg => 'No encumbered distributions to process');
3266: l_err_code := 'IGC_PO_YEP_NO_ENC_DIST';
3267: FND_MESSAGE.set_name('IGC',l_err_code);
3268: l_msg_data := FND_MESSAGE.get;
3269: Insert_Exception_Record(p_exception_reason => l_msg_data,
3270: p_exception_code => l_err_code,
3271: p_document_type => p_document_type,
3272: p_document_id => p_document_id);
3307: p_exception_code => l_return_status,
3308: p_document_type => p_document_type,
3309: p_document_id => p_document_id);
3310: x_return_code := 2 ;
3311: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_ACCT_DATE_UPD_ERR');
3312: x_msg_buf := FND_MESSAGE.get ;
3313: RETURN;
3314: END LOOP;
3315: END IF; -- l_return_status <> fnd_api.g_ret_sts_success
3308: p_document_type => p_document_type,
3309: p_document_id => p_document_id);
3310: x_return_code := 2 ;
3311: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_ACCT_DATE_UPD_ERR');
3312: x_msg_buf := FND_MESSAGE.get ;
3313: RETURN;
3314: END LOOP;
3315: END IF; -- l_return_status <> fnd_api.g_ret_sts_success
3316:
3379:
3380: -- report any errors with the unreserve
3381: IF l_return_value <> 0 OR l_return_code IN ('R','F','T','P') OR length(trim(l_error_msg)) > 0 --l_error_msg IS NOT NULL
3382: THEN
3383: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_DOC_FAIL_FC');
3384: l_msg_data := FND_MESSAGE.get;
3385: l_msg_data := l_msg_data ||' - '||l_error_msg;
3386: Insert_Exception_Record(p_exception_reason => l_msg_data,
3387: p_exception_code => l_return_code,
3380: -- report any errors with the unreserve
3381: IF l_return_value <> 0 OR l_return_code IN ('R','F','T','P') OR length(trim(l_error_msg)) > 0 --l_error_msg IS NOT NULL
3382: THEN
3383: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_DOC_FAIL_FC');
3384: l_msg_data := FND_MESSAGE.get;
3385: l_msg_data := l_msg_data ||' - '||l_error_msg;
3386: Insert_Exception_Record(p_exception_reason => l_msg_data,
3387: p_exception_code => l_return_code,
3388: p_document_type => p_document_type,
3428: END IF; -- l_return_code NOT in ('S','A')
3429:
3430: -- as the unreserve failed, terminate processing with error
3431: x_return_code := 2;
3432: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_DOC_FAIL_FC');
3433: x_msg_buf := FND_MESSAGE.get;
3434: RETURN;
3435: END IF; -- l_return_value <> 0 ...
3436:
3429:
3430: -- as the unreserve failed, terminate processing with error
3431: x_return_code := 2;
3432: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_DOC_FAIL_FC');
3433: x_msg_buf := FND_MESSAGE.get;
3434: RETURN;
3435: END IF; -- l_return_value <> 0 ...
3436:
3437: -- Unreserve successful, so continue
3445: p_document_id => p_document_id) <> FND_API.G_RET_STS_SUCCESS
3446: THEN
3447: -- if unable to relock doc report error and do not process this doc any further
3448: l_err_code := 'IGC_PO_YEP_RELOCK_DOCUMENT';
3449: FND_MESSAGE.set_name('IGC',l_err_code);
3450: l_msg_data := FND_MESSAGE.get;
3451: Insert_Exception_Record(p_exception_reason => l_msg_data,
3452: p_document_type => p_document_type,
3453: p_document_id => p_document_id);
3446: THEN
3447: -- if unable to relock doc report error and do not process this doc any further
3448: l_err_code := 'IGC_PO_YEP_RELOCK_DOCUMENT';
3449: FND_MESSAGE.set_name('IGC',l_err_code);
3450: l_msg_data := FND_MESSAGE.get;
3451: Insert_Exception_Record(p_exception_reason => l_msg_data,
3452: p_document_type => p_document_type,
3453: p_document_id => p_document_id);
3454: -- do not process this doc any further
3469: EXCEPTION
3470: WHEN OTHERS THEN
3471: Rollback; -- release locks
3472: IF ( g_unexp_level >= g_debug_level ) THEN
3473: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3474: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3475: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3476: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3477: END IF;
3470: WHEN OTHERS THEN
3471: Rollback; -- release locks
3472: IF ( g_unexp_level >= g_debug_level ) THEN
3473: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3474: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3475: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3476: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3477: END IF;
3478: -- Terminate processing with error
3471: Rollback; -- release locks
3472: IF ( g_unexp_level >= g_debug_level ) THEN
3473: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3474: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3475: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3476: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3477: END IF;
3478: -- Terminate processing with error
3479: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
3479: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
3480: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Process_Document');
3481: END IF;
3482: x_return_code := 2;
3483: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
3484: x_msg_buf := fnd_message.get;
3485: RETURN;
3486: END;
3487: IF (g_debug_mode = 'Y') THEN
3480: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Process_Document');
3481: END IF;
3482: x_return_code := 2;
3483: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
3484: x_msg_buf := fnd_message.get;
3485: RETURN;
3486: END;
3487: IF (g_debug_mode = 'Y') THEN
3488: Put_Debug_Msg (l_full_path,p_debug_msg => 'completed update of po_req_distributions table');
3497: EXCEPTION
3498: WHEN OTHERS THEN
3499: Rollback; -- release locks
3500: IF ( g_unexp_level >= g_debug_level ) THEN
3501: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3502: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3503: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3504: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3505: END IF;
3498: WHEN OTHERS THEN
3499: Rollback; -- release locks
3500: IF ( g_unexp_level >= g_debug_level ) THEN
3501: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3502: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3503: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3504: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3505: END IF;
3506: -- Terminate processing with error
3499: Rollback; -- release locks
3500: IF ( g_unexp_level >= g_debug_level ) THEN
3501: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3502: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3503: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3504: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3505: END IF;
3506: -- Terminate processing with error
3507: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
3507: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
3508: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Process_Document');
3509: END IF;
3510: x_return_code := 2;
3511: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
3512: x_msg_buf := fnd_message.get;
3513: RETURN;
3514: END;
3515: IF (g_debug_mode = 'Y') THEN
3508: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Process_Document');
3509: END IF;
3510: x_return_code := 2;
3511: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
3512: x_msg_buf := fnd_message.get;
3513: RETURN;
3514: END;
3515: IF (g_debug_mode = 'Y') THEN
3516: Put_Debug_Msg (l_full_path,p_debug_msg => 'completed update of po_distributions table');
3548: p_document_type => p_document_type,
3549: p_document_id => p_document_id);
3550: END LOOP;
3551: x_return_code := 2;
3552: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_ACCT_DATE_UPD_ERR');
3553: x_msg_buf := FND_MESSAGE.get;
3554: END IF; -- l_return_status <> fnd_api.g_ret_sts_success
3555:
3556:
3549: p_document_id => p_document_id);
3550: END LOOP;
3551: x_return_code := 2;
3552: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_ACCT_DATE_UPD_ERR');
3553: x_msg_buf := FND_MESSAGE.get;
3554: END IF; -- l_return_status <> fnd_api.g_ret_sts_success
3555:
3556:
3557:
3601:
3602: IF l_return_value <> 0 OR l_return_code IN ('R','F','T','P') OR length(trim(l_error_msg)) > 0 --l_error_msg IS NOT NULL
3603: THEN
3604: -- if unsuccessful report errors
3605: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_DOC_FAIL_FC');
3606: l_msg_data := FND_MESSAGE.get;
3607: l_msg_data := l_msg_data ||' - '||l_error_msg;
3608: Insert_Exception_Record(p_exception_reason => l_msg_data,
3609: p_exception_code => l_return_code,
3602: IF l_return_value <> 0 OR l_return_code IN ('R','F','T','P') OR length(trim(l_error_msg)) > 0 --l_error_msg IS NOT NULL
3603: THEN
3604: -- if unsuccessful report errors
3605: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_DOC_FAIL_FC');
3606: l_msg_data := FND_MESSAGE.get;
3607: l_msg_data := l_msg_data ||' - '||l_error_msg;
3608: Insert_Exception_Record(p_exception_reason => l_msg_data,
3609: p_exception_code => l_return_code,
3610: p_document_type => p_document_type,
3619: p_document_id => p_document_id) <> FND_API.G_RET_STS_SUCCESS
3620: THEN
3621: -- if unable to relock doc report error and do not process this doc any further
3622: l_err_code := 'IGC_PO_YEP_RELOCK_DOCUMENT';
3623: FND_MESSAGE.set_name('IGC',l_err_code);
3624: l_msg_data := FND_MESSAGE.get;
3625: Insert_Exception_Record(p_exception_reason => l_msg_data,
3626: p_exception_code => l_err_code,
3627: p_document_type => p_document_type,
3620: THEN
3621: -- if unable to relock doc report error and do not process this doc any further
3622: l_err_code := 'IGC_PO_YEP_RELOCK_DOCUMENT';
3623: FND_MESSAGE.set_name('IGC',l_err_code);
3624: l_msg_data := FND_MESSAGE.get;
3625: Insert_Exception_Record(p_exception_reason => l_msg_data,
3626: p_exception_code => l_err_code,
3627: p_document_type => p_document_type,
3628: p_document_id => p_document_id);
3675: EXCEPTION
3676: WHEN OTHERS THEN
3677: Rollback; -- release locks
3678: IF ( g_unexp_level >= g_debug_level ) THEN
3679: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3680: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3681: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3682: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3683: END IF;
3676: WHEN OTHERS THEN
3677: Rollback; -- release locks
3678: IF ( g_unexp_level >= g_debug_level ) THEN
3679: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3680: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3681: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3682: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3683: END IF;
3684: -- Terminate processing with error
3677: Rollback; -- release locks
3678: IF ( g_unexp_level >= g_debug_level ) THEN
3679: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3680: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3681: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3682: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3683: END IF;
3684: -- Terminate processing with error
3685: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
3685: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
3686: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Process_Document');
3687: END IF;
3688: x_return_code := 2;
3689: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
3690: x_msg_buf := fnd_message.get;
3691: RETURN;
3692: END;
3693: IF (g_debug_mode = 'Y') THEN
3686: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Process_Document');
3687: END IF;
3688: x_return_code := 2;
3689: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
3690: x_msg_buf := fnd_message.get;
3691: RETURN;
3692: END;
3693: IF (g_debug_mode = 'Y') THEN
3694: Put_Debug_Msg (l_full_path,p_debug_msg => 'completed 2nd update of po_req_distributions table');
3703: EXCEPTION
3704: WHEN OTHERS THEN
3705: Rollback; -- release locks
3706: IF ( g_unexp_level >= g_debug_level ) THEN
3707: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3708: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3709: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3710: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3711: END IF;
3704: WHEN OTHERS THEN
3705: Rollback; -- release locks
3706: IF ( g_unexp_level >= g_debug_level ) THEN
3707: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3708: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3709: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3710: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3711: END IF;
3712: -- Terminate processing with error
3705: Rollback; -- release locks
3706: IF ( g_unexp_level >= g_debug_level ) THEN
3707: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3708: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3709: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3710: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3711: END IF;
3712: -- Terminate processing with error
3713: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
3713: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
3714: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Process_Document');
3715: END IF;
3716: x_return_code := 2;
3717: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
3718: x_msg_buf := fnd_message.get;
3719: RETURN;
3720: END;
3721: IF (g_debug_mode = 'Y') THEN
3714: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Process_Document');
3715: END IF;
3716: x_return_code := 2;
3717: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
3718: x_msg_buf := fnd_message.get;
3719: RETURN;
3720: END;
3721: IF (g_debug_mode = 'Y') THEN
3722: Put_Debug_Msg (l_full_path,p_debug_msg => 'completed 2nd update of po_distributions table');
3728:
3729:
3730: -- terminate processing with error
3731: x_return_code := 2;
3732: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_DOC_FAIL_FC');
3733: x_msg_buf := FND_MESSAGE.get;
3734: RETURN;
3735:
3736: END IF; -- l_return_code NOT IN ('S','A')
3729:
3730: -- terminate processing with error
3731: x_return_code := 2;
3732: FND_MESSAGE.set_name('IGC','IGC_PO_YEP_DOC_FAIL_FC');
3733: x_msg_buf := FND_MESSAGE.get;
3734: RETURN;
3735:
3736: END IF; -- l_return_code NOT IN ('S','A')
3737:
3762: -- THEN
3763: -- -- Commit anyway so that the record in gl_bc_packet gets
3764: -- -- saved and gives us a chance to see why the funds check failed.
3765: -- COMMIT;
3766: -- FND_MESSAGE.set_name('IGC','IGC_PO_YEP_DOC_FAIL_FC');
3767: -- x_msg_buf := FND_MESSAGE.get;
3768: -- Insert_Exception_Record(p_exception_reason => x_msg_buf,
3769: -- p_exception_code => 'IGC_PO_YEP_DOC_FAIL_FC',
3770: -- p_document_type => p_document_type,
3763: -- -- Commit anyway so that the record in gl_bc_packet gets
3764: -- -- saved and gives us a chance to see why the funds check failed.
3765: -- COMMIT;
3766: -- FND_MESSAGE.set_name('IGC','IGC_PO_YEP_DOC_FAIL_FC');
3767: -- x_msg_buf := FND_MESSAGE.get;
3768: -- Insert_Exception_Record(p_exception_reason => x_msg_buf,
3769: -- p_exception_code => 'IGC_PO_YEP_DOC_FAIL_FC',
3770: -- p_document_type => p_document_type,
3771: -- p_document_id => p_document_id);
3783: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
3784: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Process_Document');
3785: END IF;
3786: IF ( g_unexp_level >= g_debug_level ) THEN
3787: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3788: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3789: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3790: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3791: END IF;
3784: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Process_Document');
3785: END IF;
3786: IF ( g_unexp_level >= g_debug_level ) THEN
3787: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3788: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3789: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3790: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3791: END IF;
3792: x_return_code := 2;
3785: END IF;
3786: IF ( g_unexp_level >= g_debug_level ) THEN
3787: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
3788: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
3789: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3790: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3791: END IF;
3792: x_return_code := 2;
3793: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
3789: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
3790: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3791: END IF;
3792: x_return_code := 2;
3793: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
3794: x_msg_buf := fnd_message.get;
3795:
3796: END Process_Document;
3797:
3790: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
3791: END IF;
3792: x_return_code := 2;
3793: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
3794: x_msg_buf := fnd_message.get;
3795:
3796: END Process_Document;
3797:
3798:
3991: p_document_id => p_po_release_id) <> FND_API.G_RET_STS_SUCCESS
3992: THEN
3993: -- if unable to lock doc, then report error and do not process this doc any further
3994: l_err_code := 'IGC_PO_YEP_LOCK_DOCUMENT';
3995: FND_MESSAGE.set_name('IGC',l_err_code);
3996: l_msg_data := FND_MESSAGE.get;
3997: Insert_Exception_Record(p_exception_reason => l_msg_data,
3998: p_document_type => p_document_type,
3999: p_document_id => p_po_release_id);
3992: THEN
3993: -- if unable to lock doc, then report error and do not process this doc any further
3994: l_err_code := 'IGC_PO_YEP_LOCK_DOCUMENT';
3995: FND_MESSAGE.set_name('IGC',l_err_code);
3996: l_msg_data := FND_MESSAGE.get;
3997: Insert_Exception_Record(p_exception_reason => l_msg_data,
3998: p_document_type => p_document_type,
3999: p_document_id => p_po_release_id);
4000: x_return_code := -99;
4017: OR l_release.hold_flag = 'Y'
4018: THEN
4019: -- if not valid then report error and do not process this doc any further
4020: l_err_code := 'IGC_PO_YEP_REL_INV_STATE';
4021: FND_MESSAGE.set_name('IGC',l_err_code);
4022: IF l_release.hold_flag = 'Y' THEN
4023: FND_MESSAGE.set_token('REL_STATE','ON HOLD');
4024: ELSE
4025: FND_MESSAGE.set_token('REL_STATE',NVL(l_release.auth_status,'INCOMPLETE'));
4019: -- if not valid then report error and do not process this doc any further
4020: l_err_code := 'IGC_PO_YEP_REL_INV_STATE';
4021: FND_MESSAGE.set_name('IGC',l_err_code);
4022: IF l_release.hold_flag = 'Y' THEN
4023: FND_MESSAGE.set_token('REL_STATE','ON HOLD');
4024: ELSE
4025: FND_MESSAGE.set_token('REL_STATE',NVL(l_release.auth_status,'INCOMPLETE'));
4026: END IF;
4027: l_msg_data := FND_MESSAGE.get;
4021: FND_MESSAGE.set_name('IGC',l_err_code);
4022: IF l_release.hold_flag = 'Y' THEN
4023: FND_MESSAGE.set_token('REL_STATE','ON HOLD');
4024: ELSE
4025: FND_MESSAGE.set_token('REL_STATE',NVL(l_release.auth_status,'INCOMPLETE'));
4026: END IF;
4027: l_msg_data := FND_MESSAGE.get;
4028: Insert_Exception_Record(p_exception_reason => l_msg_data,
4029: p_exception_code => l_err_code,
4023: FND_MESSAGE.set_token('REL_STATE','ON HOLD');
4024: ELSE
4025: FND_MESSAGE.set_token('REL_STATE',NVL(l_release.auth_status,'INCOMPLETE'));
4026: END IF;
4027: l_msg_data := FND_MESSAGE.get;
4028: Insert_Exception_Record(p_exception_reason => l_msg_data,
4029: p_exception_code => l_err_code,
4030: p_document_type => p_document_type,
4031: p_document_id => p_po_release_id);
4043: THEN
4044: -- if frozen and user requested not to process frozen docs then report error and
4045: -- do not process this doc any further
4046: l_err_code := 'IGC_PO_YEP_REL_FROZEN';
4047: FND_MESSAGE.set_name('IGC',l_err_code);
4048: l_msg_data := FND_MESSAGE.get;
4049: Insert_Exception_Record(p_exception_reason => l_msg_data,
4050: p_exception_code => l_err_code,
4051: p_document_type => p_document_type,
4044: -- if frozen and user requested not to process frozen docs then report error and
4045: -- do not process this doc any further
4046: l_err_code := 'IGC_PO_YEP_REL_FROZEN';
4047: FND_MESSAGE.set_name('IGC',l_err_code);
4048: l_msg_data := FND_MESSAGE.get;
4049: Insert_Exception_Record(p_exception_reason => l_msg_data,
4050: p_exception_code => l_err_code,
4051: p_document_type => p_document_type,
4052: p_document_id => p_po_release_id);
4134: p_document_id => p_po_header_id) <> FND_API.G_RET_STS_SUCCESS
4135: THEN
4136: -- if unable to lock doc then do not process this doc any further
4137: l_err_code := 'IGC_PO_YEP_LOCK_DOCUMENT';
4138: FND_MESSAGE.set_name('IGC',l_err_code);
4139: l_msg_data := FND_MESSAGE.get;
4140: Insert_Exception_Record(p_exception_reason => l_msg_data,
4141: p_exception_code => l_err_code,
4142: p_document_type => p_document_type,
4135: THEN
4136: -- if unable to lock doc then do not process this doc any further
4137: l_err_code := 'IGC_PO_YEP_LOCK_DOCUMENT';
4138: FND_MESSAGE.set_name('IGC',l_err_code);
4139: l_msg_data := FND_MESSAGE.get;
4140: Insert_Exception_Record(p_exception_reason => l_msg_data,
4141: p_exception_code => l_err_code,
4142: p_document_type => p_document_type,
4143: p_document_id => p_po_header_id);
4161: OR l_po.hold_flag = 'Y'
4162: THEN
4163: -- if invalid then report error and do not process this doc any further
4164: l_err_code := 'IGC_PO_YEP_PO_INV_STATE';
4165: FND_MESSAGE.set_name('IGC',l_err_code);
4166: IF l_po.hold_flag = 'Y' THEN
4167: FND_MESSAGE.set_token('PO_STATE','ON HOLD');
4168: ELSE
4169: FND_MESSAGE.set_token('PO_STATE',NVL(l_po.auth_status,'INCOMPLETE'));
4163: -- if invalid then report error and do not process this doc any further
4164: l_err_code := 'IGC_PO_YEP_PO_INV_STATE';
4165: FND_MESSAGE.set_name('IGC',l_err_code);
4166: IF l_po.hold_flag = 'Y' THEN
4167: FND_MESSAGE.set_token('PO_STATE','ON HOLD');
4168: ELSE
4169: FND_MESSAGE.set_token('PO_STATE',NVL(l_po.auth_status,'INCOMPLETE'));
4170: END IF;
4171: l_msg_data := FND_MESSAGE.get;
4165: FND_MESSAGE.set_name('IGC',l_err_code);
4166: IF l_po.hold_flag = 'Y' THEN
4167: FND_MESSAGE.set_token('PO_STATE','ON HOLD');
4168: ELSE
4169: FND_MESSAGE.set_token('PO_STATE',NVL(l_po.auth_status,'INCOMPLETE'));
4170: END IF;
4171: l_msg_data := FND_MESSAGE.get;
4172: Insert_Exception_Record(p_exception_reason => l_msg_data,
4173: p_exception_code => l_err_code,
4167: FND_MESSAGE.set_token('PO_STATE','ON HOLD');
4168: ELSE
4169: FND_MESSAGE.set_token('PO_STATE',NVL(l_po.auth_status,'INCOMPLETE'));
4170: END IF;
4171: l_msg_data := FND_MESSAGE.get;
4172: Insert_Exception_Record(p_exception_reason => l_msg_data,
4173: p_exception_code => l_err_code,
4174: p_document_type => p_document_type,
4175: p_document_id => p_po_header_id);
4188: THEN
4189: -- if frozen and user requested not to process frozen docs then report error and
4190: -- do not process this doc any further
4191: l_err_code := 'IGC_PO_YEP_PO_FROZEN';
4192: FND_MESSAGE.set_name('IGC',l_err_code);
4193: l_msg_data := FND_MESSAGE.get;
4194: Insert_Exception_Record(p_exception_reason => l_msg_data,
4195: p_exception_code => l_err_code,
4196: p_document_type => p_document_type,
4189: -- if frozen and user requested not to process frozen docs then report error and
4190: -- do not process this doc any further
4191: l_err_code := 'IGC_PO_YEP_PO_FROZEN';
4192: FND_MESSAGE.set_name('IGC',l_err_code);
4193: l_msg_data := FND_MESSAGE.get;
4194: Insert_Exception_Record(p_exception_reason => l_msg_data,
4195: p_exception_code => l_err_code,
4196: p_document_type => p_document_type,
4197: p_document_id => p_po_header_id);
4213: IF c_get_release_errors%FOUND
4214: THEN
4215: -- if any releases in error then report error and do not process this doc any further
4216: l_err_code := 'IGC_PO_YEP_REL_NOT_APP';
4217: FND_MESSAGE.set_name('IGC',l_err_code);
4218: l_msg_data := FND_MESSAGE.get;
4219: Insert_Exception_Record(p_exception_reason => l_msg_data,
4220: p_exception_code => l_err_code,
4221: p_document_type => p_document_type,
4214: THEN
4215: -- if any releases in error then report error and do not process this doc any further
4216: l_err_code := 'IGC_PO_YEP_REL_NOT_APP';
4217: FND_MESSAGE.set_name('IGC',l_err_code);
4218: l_msg_data := FND_MESSAGE.get;
4219: Insert_Exception_Record(p_exception_reason => l_msg_data,
4220: p_exception_code => l_err_code,
4221: p_document_type => p_document_type,
4222: p_document_id => p_po_header_id);
4240: IF c_get_release_future%FOUND
4241: THEN
4242: -- if any releases in future then report error and do not process this doc any further
4243: l_err_code := 'IGC_PO_YEP_PO_REL_FUTURE';
4244: FND_MESSAGE.set_name('IGC',l_err_code);
4245: l_msg_data := FND_MESSAGE.get;
4246: Insert_Exception_Record(p_exception_reason => l_msg_data,
4247: p_exception_code => l_err_code,
4248: p_document_type => p_document_type,
4241: THEN
4242: -- if any releases in future then report error and do not process this doc any further
4243: l_err_code := 'IGC_PO_YEP_PO_REL_FUTURE';
4244: FND_MESSAGE.set_name('IGC',l_err_code);
4245: l_msg_data := FND_MESSAGE.get;
4246: Insert_Exception_Record(p_exception_reason => l_msg_data,
4247: p_exception_code => l_err_code,
4248: p_document_type => p_document_type,
4249: p_document_id => p_po_header_id);
4336: p_document_id => p_req_header_id) <> FND_API.G_RET_STS_SUCCESS
4337: THEN
4338: -- if unable to lock doc then report error and do not process this doc any further
4339: l_err_code := 'IGC_PO_YEP_LOCK_DOCUMENT';
4340: FND_MESSAGE.set_name('IGC',l_err_code);
4341: l_msg_data := FND_MESSAGE.get;
4342: Insert_Exception_Record(p_exception_reason => l_msg_data,
4343: p_exception_code => l_err_code,
4344: p_document_type => p_document_type,
4337: THEN
4338: -- if unable to lock doc then report error and do not process this doc any further
4339: l_err_code := 'IGC_PO_YEP_LOCK_DOCUMENT';
4340: FND_MESSAGE.set_name('IGC',l_err_code);
4341: l_msg_data := FND_MESSAGE.get;
4342: Insert_Exception_Record(p_exception_reason => l_msg_data,
4343: p_exception_code => l_err_code,
4344: p_document_type => p_document_type,
4345: p_document_id => p_req_header_id);
4364: OR l_requisition.closed_code = 'ON HOLD'
4365: THEN
4366: -- if invalid status then report error and do not process this doc any further
4367: l_err_code := 'IGC_PO_YEP_REQ_INV_STATE';
4368: FND_MESSAGE.set_name('IGC',l_err_code);
4369: IF l_requisition.closed_code = 'ON HOLD' THEN
4370: FND_MESSAGE.set_token('REQ_STATE','ON HOLD');
4371: ELSE
4372: FND_MESSAGE.set_token('REQ_STATE',NVL(l_requisition.auth_status,'INCOMPLETE'));
4366: -- if invalid status then report error and do not process this doc any further
4367: l_err_code := 'IGC_PO_YEP_REQ_INV_STATE';
4368: FND_MESSAGE.set_name('IGC',l_err_code);
4369: IF l_requisition.closed_code = 'ON HOLD' THEN
4370: FND_MESSAGE.set_token('REQ_STATE','ON HOLD');
4371: ELSE
4372: FND_MESSAGE.set_token('REQ_STATE',NVL(l_requisition.auth_status,'INCOMPLETE'));
4373: END IF;
4374: l_msg_data := FND_MESSAGE.get;
4368: FND_MESSAGE.set_name('IGC',l_err_code);
4369: IF l_requisition.closed_code = 'ON HOLD' THEN
4370: FND_MESSAGE.set_token('REQ_STATE','ON HOLD');
4371: ELSE
4372: FND_MESSAGE.set_token('REQ_STATE',NVL(l_requisition.auth_status,'INCOMPLETE'));
4373: END IF;
4374: l_msg_data := FND_MESSAGE.get;
4375: Insert_Exception_Record(p_exception_reason => l_msg_data,
4376: p_exception_code => l_err_code,
4370: FND_MESSAGE.set_token('REQ_STATE','ON HOLD');
4371: ELSE
4372: FND_MESSAGE.set_token('REQ_STATE',NVL(l_requisition.auth_status,'INCOMPLETE'));
4373: END IF;
4374: l_msg_data := FND_MESSAGE.get;
4375: Insert_Exception_Record(p_exception_reason => l_msg_data,
4376: p_exception_code => l_err_code,
4377: p_document_type => p_document_type,
4378: p_document_id => p_req_header_id);
4391: IF c_get_po_errors%FOUND
4392: THEN
4393: -- If any PO's in error then report and do not process this doc any further
4394: l_err_code := 'IGC_PO_YEP_REQ_PO_NAPPR';
4395: FND_MESSAGE.set_name('IGC',l_err_code);
4396: l_msg_data := FND_MESSAGE.get;
4397: Insert_Exception_Record(p_exception_reason => l_msg_data,
4398: p_exception_code => l_err_code,
4399: p_document_type => p_document_type,
4392: THEN
4393: -- If any PO's in error then report and do not process this doc any further
4394: l_err_code := 'IGC_PO_YEP_REQ_PO_NAPPR';
4395: FND_MESSAGE.set_name('IGC',l_err_code);
4396: l_msg_data := FND_MESSAGE.get;
4397: Insert_Exception_Record(p_exception_reason => l_msg_data,
4398: p_exception_code => l_err_code,
4399: p_document_type => p_document_type,
4400: p_document_id => p_req_header_id);
4418: IF c_get_po_future%FOUND
4419: THEN
4420: -- If any related PO's with GL dates in future years, then do not process this doc any further
4421: l_err_code := 'IGC_PO_YEP_REQ_PO_FUTURE';
4422: FND_MESSAGE.set_name('IGC',l_err_code);
4423: l_msg_data := FND_MESSAGE.get;
4424: Insert_Exception_Record(p_exception_reason => l_msg_data,
4425: p_exception_code => l_err_code,
4426: p_document_type => p_document_type,
4419: THEN
4420: -- If any related PO's with GL dates in future years, then do not process this doc any further
4421: l_err_code := 'IGC_PO_YEP_REQ_PO_FUTURE';
4422: FND_MESSAGE.set_name('IGC',l_err_code);
4423: l_msg_data := FND_MESSAGE.get;
4424: Insert_Exception_Record(p_exception_reason => l_msg_data,
4425: p_exception_code => l_err_code,
4426: p_document_type => p_document_type,
4427: p_document_id => p_req_header_id);
4518: p_document_id => p_po_header_id) <> FND_API.G_RET_STS_SUCCESS
4519: THEN
4520: -- if unable to lock doc then report error and do not process this doc any further
4521: l_err_code := 'IGC_PO_YEP_LOCK_DOCUMENT';
4522: FND_MESSAGE.set_name('IGC',l_err_code);
4523: l_msg_data := FND_MESSAGE.get;
4524: Insert_Exception_Record(p_exception_reason => l_msg_data,
4525: p_exception_code => l_err_code,
4526: p_document_type => p_document_type,
4519: THEN
4520: -- if unable to lock doc then report error and do not process this doc any further
4521: l_err_code := 'IGC_PO_YEP_LOCK_DOCUMENT';
4522: FND_MESSAGE.set_name('IGC',l_err_code);
4523: l_msg_data := FND_MESSAGE.get;
4524: Insert_Exception_Record(p_exception_reason => l_msg_data,
4525: p_exception_code => l_err_code,
4526: p_document_type => p_document_type,
4527: p_document_id => p_po_header_id);
4546: OR l_bpa.hold_flag = 'Y'
4547: THEN
4548: -- if invalid status then report error and do not process this doc any further
4549: l_err_code := 'IGC_PO_YEP_BPA_INV_STATE';
4550: FND_MESSAGE.set_name('IGC',l_err_code);
4551: IF l_bpa.hold_flag = 'Y'
4552: THEN
4553: FND_MESSAGE.set_token('BPA_STATE','ON HOLD');
4554: ELSE
4549: l_err_code := 'IGC_PO_YEP_BPA_INV_STATE';
4550: FND_MESSAGE.set_name('IGC',l_err_code);
4551: IF l_bpa.hold_flag = 'Y'
4552: THEN
4553: FND_MESSAGE.set_token('BPA_STATE','ON HOLD');
4554: ELSE
4555: FND_MESSAGE.set_token('BPA_STATE',NVL(l_bpa.auth_status,'INCOMPLETE'));
4556: END IF;
4557: l_msg_data := FND_MESSAGE.get;
4551: IF l_bpa.hold_flag = 'Y'
4552: THEN
4553: FND_MESSAGE.set_token('BPA_STATE','ON HOLD');
4554: ELSE
4555: FND_MESSAGE.set_token('BPA_STATE',NVL(l_bpa.auth_status,'INCOMPLETE'));
4556: END IF;
4557: l_msg_data := FND_MESSAGE.get;
4558: Insert_Exception_Record(p_exception_reason => l_msg_data,
4559: p_exception_code => l_err_code,
4553: FND_MESSAGE.set_token('BPA_STATE','ON HOLD');
4554: ELSE
4555: FND_MESSAGE.set_token('BPA_STATE',NVL(l_bpa.auth_status,'INCOMPLETE'));
4556: END IF;
4557: l_msg_data := FND_MESSAGE.get;
4558: Insert_Exception_Record(p_exception_reason => l_msg_data,
4559: p_exception_code => l_err_code,
4560: p_document_type => p_document_type,
4561: p_document_id => p_po_header_id);
4574: THEN
4575: -- if frozen and user requested not to process frozen docs then report error and
4576: -- do not process this doc any further
4577: l_err_code := 'IGC_PO_YEP_PO_FROZEN';
4578: FND_MESSAGE.set_name('IGC',l_err_code);
4579: l_msg_data := FND_MESSAGE.get;
4580: Insert_Exception_Record(p_exception_reason => l_msg_data,
4581: p_exception_code => l_err_code,
4582: p_document_type => p_document_type,
4575: -- if frozen and user requested not to process frozen docs then report error and
4576: -- do not process this doc any further
4577: l_err_code := 'IGC_PO_YEP_PO_FROZEN';
4578: FND_MESSAGE.set_name('IGC',l_err_code);
4579: l_msg_data := FND_MESSAGE.get;
4580: Insert_Exception_Record(p_exception_reason => l_msg_data,
4581: p_exception_code => l_err_code,
4582: p_document_type => p_document_type,
4583: p_document_id => p_po_header_id);
4597: THEN
4598: -- If any PO's in error then report
4599: -- and do not process this doc any further
4600: l_err_code := 'IGC_PO_YEP_BPA_PO_NAPPR';
4601: FND_MESSAGE.set_name('IGC',l_err_code);
4602: l_msg_data := FND_MESSAGE.get;
4603: Insert_Exception_Record(p_exception_reason => l_msg_data,
4604: p_exception_code => l_err_code,
4605: p_document_type => p_document_type,
4598: -- If any PO's in error then report
4599: -- and do not process this doc any further
4600: l_err_code := 'IGC_PO_YEP_BPA_PO_NAPPR';
4601: FND_MESSAGE.set_name('IGC',l_err_code);
4602: l_msg_data := FND_MESSAGE.get;
4603: Insert_Exception_Record(p_exception_reason => l_msg_data,
4604: p_exception_code => l_err_code,
4605: p_document_type => p_document_type,
4606: p_document_id => p_po_header_id);
4624: IF c_get_release_errors%FOUND
4625: THEN
4626: -- if any releases in error then report error and do not process this doc any further
4627: l_err_code := 'IGC_PO_YEP_REL_NOT_APP';
4628: FND_MESSAGE.set_name('IGC',l_err_code);
4629: l_msg_data := FND_MESSAGE.get;
4630: Insert_Exception_Record(p_exception_reason => l_msg_data,
4631: p_exception_code => l_err_code,
4632: p_document_type => p_document_type,
4625: THEN
4626: -- if any releases in error then report error and do not process this doc any further
4627: l_err_code := 'IGC_PO_YEP_REL_NOT_APP';
4628: FND_MESSAGE.set_name('IGC',l_err_code);
4629: l_msg_data := FND_MESSAGE.get;
4630: Insert_Exception_Record(p_exception_reason => l_msg_data,
4631: p_exception_code => l_err_code,
4632: p_document_type => p_document_type,
4633: p_document_id => p_po_header_id);
4655: THEN
4656: -- If any REQs in error then report
4657: -- and do not process this doc any further
4658: l_err_code := 'IGC_PO_YEP_BPA_REQ_NAPPR';
4659: FND_MESSAGE.set_name('IGC',l_err_code);
4660: l_msg_data := FND_MESSAGE.get;
4661: Insert_Exception_Record(p_exception_reason => l_msg_data,
4662: p_exception_code => l_err_code,
4663: p_document_type => p_document_type,
4656: -- If any REQs in error then report
4657: -- and do not process this doc any further
4658: l_err_code := 'IGC_PO_YEP_BPA_REQ_NAPPR';
4659: FND_MESSAGE.set_name('IGC',l_err_code);
4660: l_msg_data := FND_MESSAGE.get;
4661: Insert_Exception_Record(p_exception_reason => l_msg_data,
4662: p_exception_code => l_err_code,
4663: p_document_type => p_document_type,
4664: p_document_id => p_po_header_id);
4726: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
4727: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Validate_And_Process_Doc');
4728: END IF;
4729: IF ( g_unexp_level >= g_debug_level ) THEN
4730: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
4731: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
4732: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
4733: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
4734: END IF;
4727: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Validate_And_Process_Doc');
4728: END IF;
4729: IF ( g_unexp_level >= g_debug_level ) THEN
4730: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
4731: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
4732: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
4733: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
4734: END IF;
4735: x_return_code := 2 ;
4728: END IF;
4729: IF ( g_unexp_level >= g_debug_level ) THEN
4730: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
4731: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
4732: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
4733: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
4734: END IF;
4735: x_return_code := 2 ;
4736: fnd_message.set_name('IGC','IGC_LOGGIN_USER_ERROR');
4732: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
4733: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
4734: END IF;
4735: x_return_code := 2 ;
4736: fnd_message.set_name('IGC','IGC_LOGGIN_USER_ERROR');
4737: x_msg_buf := fnd_message.get;
4738:
4739: END Validate_And_Process_Doc;
4740:
4733: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
4734: END IF;
4735: x_return_code := 2 ;
4736: fnd_message.set_name('IGC','IGC_LOGGIN_USER_ERROR');
4737: x_msg_buf := fnd_message.get;
4738:
4739: END Validate_And_Process_Doc;
4740:
4741:
5080: IF (FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)) THEN
5081: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Year_End_Main');
5082: END IF;
5083: IF ( g_unexp_level >= g_debug_level ) THEN
5084: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
5085: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
5086: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
5087: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
5088: END IF;
5081: FND_MSG_PUB.Add_Exc_Msg (G_PKG_NAME, 'Year_End_Main');
5082: END IF;
5083: IF ( g_unexp_level >= g_debug_level ) THEN
5084: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
5085: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
5086: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
5087: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
5088: END IF;
5089: APP_EXCEPTION.Raise_Exception;
5082: END IF;
5083: IF ( g_unexp_level >= g_debug_level ) THEN
5084: FND_MESSAGE.SET_NAME('IGC','IGC_LOGGING_UNEXP_ERROR');
5085: FND_MESSAGE.SET_TOKEN('CODE',SQLCODE);
5086: FND_MESSAGE.SET_TOKEN('MSG', SQLERRM);
5087: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
5088: END IF;
5089: APP_EXCEPTION.Raise_Exception;
5090: retcode := 2 ;
5087: FND_LOG.MESSAGE ( g_unexp_level,l_full_path, TRUE);
5088: END IF;
5089: APP_EXCEPTION.Raise_Exception;
5090: retcode := 2 ;
5091: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
5092: errbuf := fnd_message.get;
5093:
5094:
5095: END Year_End_Main ;
5088: END IF;
5089: APP_EXCEPTION.Raise_Exception;
5090: retcode := 2 ;
5091: fnd_message.set_name('IGC','IGC_LOGGING_USER_ERROR');
5092: errbuf := fnd_message.get;
5093:
5094:
5095: END Year_End_Main ;
5096: