70: l_debug_level3 CONSTANT NUMBER := 3;
71: BEGIN
72:
73: x_msg_count :=0;
74: x_return_status := FND_API.G_RET_STS_SUCCESS;
75: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
76: l_module_name := 'valid_rate_type: ' || g_module_name;
77:
78: IF l_debug_mode = 'Y' THEN
118: END IF;
119: EXCEPTION
120:
121: WHEN OTHERS THEN
122: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
123: x_msg_count := 1;
124: x_msg_data := SQLERRM;
125:
126: FND_MSG_PUB.add_exc_msg
444: l_workplan_flag VARCHAR2(1) := NULL;
445: l_exists VARCHAR2(1) := NULL;
446:
447: -- for bug 3954329
448: l_res_list_migration_code pa_resource_list_members.migration_code%TYPE := FND_API.G_MISS_CHAR;
449: l_targ_request_id pa_budget_versions.request_id%TYPE;
450: px_pa_project_id_in pa_projects_all.project_id%TYPE;
451: px_resource_list_id_in pa_resource_lists_all_bg.resource_list_id%TYPE;
452: px_fin_plan_type_id_in pa_fin_plan_types_b.fin_plan_type_id%TYPE;
454: BEGIN
455:
456: --dbms_output.put_line('In validate header info');
457: x_msg_count :=0;
458: x_return_status := FND_API.G_RET_STS_SUCCESS;
459: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
460: l_module_name := 'validate_header_info: ' || g_module_name;
461:
462: IF l_debug_mode = 'Y' THEN
469: --dbms_output.put_line('About to validate budget type code and fin plan type id');
470:
471: -- Initialize the message table if requested.Moved this above as the messages will be added from
472: -- this point.
473: IF FND_API.TO_BOOLEAN( p_init_msg_list )
474: THEN
475:
476: FND_MSG_PUB.initialize;
477:
544: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
545: END IF;
546:
547: END IF;
548: x_return_status := FND_API.G_RET_STS_ERROR;
549: l_any_error_occurred_flag := 'Y';
550:
551:
552: --dbms_output.put_line('pm product code is null or miss');
551:
552: --dbms_output.put_line('pm product code is null or miss');
553:
554:
555: -- RAISE FND_API.G_EXC_ERROR;
556: ELSE
557:
558: -- added for bug no :2413400
559: OPEN p_product_code_csr (p_pm_product_code);
578: pa_debug.g_err_stage:= 'PM Product code is invalid';
579: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
580: END IF;
581:
582: x_return_status := FND_API.G_RET_STS_ERROR;
583: l_any_error_occurred_flag := 'Y';
584: -- RAISE FND_API.G_EXC_ERROR;
585: END IF;
586:
580: END IF;
581:
582: x_return_status := FND_API.G_RET_STS_ERROR;
583: l_any_error_occurred_flag := 'Y';
584: -- RAISE FND_API.G_EXC_ERROR;
585: END IF;
586:
587: --dbms_output.put_line('pm product code is not valid '||l_pm_product_code);
588: END IF;-- p_pm_product_code IS NULL
620: p_msg_data => l_msg_data,
621: p_return_status => x_return_status,
622: p_function_allowed => l_function_allowed );
623:
624: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
625: THEN
626: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
627: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
628: THEN
622: p_function_allowed => l_function_allowed );
623:
624: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
625: THEN
626: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
627: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
628: THEN
629: RAISE FND_API.G_EXC_ERROR;
630: END IF;
623:
624: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
625: THEN
626: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
627: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
628: THEN
629: RAISE FND_API.G_EXC_ERROR;
630: END IF;
631:
625: THEN
626: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
627: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
628: THEN
629: RAISE FND_API.G_EXC_ERROR;
630: END IF;
631:
632: IF l_function_allowed = 'N' THEN
633: pa_interface_utils_pub.map_new_amg_msg
639: ,p_attribute2 => ''
640: ,p_attribute3 => ''
641: ,p_attribute4 => ''
642: ,p_attribute5 => '');
643: x_return_status := FND_API.G_RET_STS_ERROR;
644: -- RAISE FND_API.G_EXC_ERROR;
645: END IF;
646: */
647:
640: ,p_attribute3 => ''
641: ,p_attribute4 => ''
642: ,p_attribute5 => '');
643: x_return_status := FND_API.G_RET_STS_ERROR;
644: -- RAISE FND_API.G_EXC_ERROR;
645: END IF;
646: */
647:
648: -- CHECK FOR MANDATORY FIELDS and CONVERT VALUES to ID's
656: p_out_project_id => px_pa_project_id,
657: p_return_status => x_return_status );
658:
659: --dbms_output.put_line('x_return_status is '|| x_return_status);
660: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
661: THEN
662: --dbms_output.put_line('unexpected error while deriving project id '|| px_pa_project_id);
663: --dbms_output.put_line('expected error while deriving l project id '||px_pa_project_id );
664: IF l_debug_mode = 'Y' THEN
664: IF l_debug_mode = 'Y' THEN
665: pa_debug.g_err_stage:= 'Unexpected error while deriving project id';
666: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
667: END IF;
668: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
669:
670: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
671: THEN
672: --dbms_output.put_line('expected error while deriving px project id '||px_pa_project_id );
666: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
667: END IF;
668: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
669:
670: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
671: THEN
672: --dbms_output.put_line('expected error while deriving px project id '||px_pa_project_id );
673: --dbms_output.put_line('expected error while deriving l project id '||px_pa_project_id );
674: IF l_debug_mode = 'Y' THEN
675: pa_debug.g_err_stage:= 'Error while deriving project id';
676: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
677: END IF;
678:
679: --RAISE FND_API.G_EXC_ERROR; --AMG UT2
680: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
681:
682: END IF;
683:
705: ,p_attribute2 => ''
706: ,p_attribute3 => ''
707: ,p_attribute4 => ''
708: ,p_attribute5 => '');
709: x_return_status := FND_API.G_RET_STS_ERROR;
710: -- RAISE FND_API.G_EXC_ERROR;
711: ELSE
712: -- If the user has query privileges, then check whether
713: -- update privileges are also available
706: ,p_attribute3 => ''
707: ,p_attribute4 => ''
708: ,p_attribute5 => '');
709: x_return_status := FND_API.G_RET_STS_ERROR;
710: -- RAISE FND_API.G_EXC_ERROR;
711: ELSE
712: -- If the user has query privileges, then check whether
713: -- update privileges are also available
714: IF pa_security.allow_update (x_project_id => px_pa_project_id ) = 'N' THEN
725: ,p_attribute2 => ''
726: ,p_attribute3 => ''
727: ,p_attribute4 => ''
728: ,p_attribute5 => '');
729: x_return_status := FND_API.G_RET_STS_ERROR;
730: -- RAISE FND_API.G_EXC_ERROR;
731: END IF;
732: END IF;
733: */
726: ,p_attribute3 => ''
727: ,p_attribute4 => ''
728: ,p_attribute5 => '');
729: x_return_status := FND_API.G_RET_STS_ERROR;
730: -- RAISE FND_API.G_EXC_ERROR;
731: END IF;
732: END IF;
733: */
734:
766:
767: -- the above API adds the error message to stack. Hence the message is not added here.
768: -- Also, as security check is important further validations are not done in case this
769: -- validation fails.
770: IF (x_return_status<>FND_API.G_RET_STS_SUCCESS OR
771: l_security_ret_code = 'N') THEN
772: --dbms_output.put_line('Security api failed l_security_ret_code '||l_security_ret_code);
773: IF l_debug_mode = 'Y' THEN
774: pa_debug.g_err_stage:= 'Security API Failed';
807: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
808: END IF;
809:
810: END IF;
811: x_return_status := FND_API.G_RET_STS_ERROR;
812: l_any_error_occurred_flag := 'Y';
813:
814: CLOSE l_budget_amount_code_csr;
815: -- RAISE FND_API.G_EXC_ERROR;
811: x_return_status := FND_API.G_RET_STS_ERROR;
812: l_any_error_occurred_flag := 'Y';
813:
814: CLOSE l_budget_amount_code_csr;
815: -- RAISE FND_API.G_EXC_ERROR;
816:
817: ELSE
818:
819: CLOSE l_budget_amount_code_csr;
835: pa_debug.g_err_stage:= 'Creation of cost version is not allowed';
836: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
837: END IF;
838: END IF;
839: x_return_status := FND_API.G_RET_STS_ERROR;
840: l_any_error_occurred_flag := 'Y';
841:
842: -- RAISE FND_API.G_EXC_ERROR;
843: END IF;
838: END IF;
839: x_return_status := FND_API.G_RET_STS_ERROR;
840: l_any_error_occurred_flag := 'Y';
841:
842: -- RAISE FND_API.G_EXC_ERROR;
843: END IF;
844:
845: ELSIF l_budget_amount_code = PA_FP_CONSTANTS_PKG.G_BUDGET_AMOUNT_CODE_R THEN
846:
858: pa_debug.g_err_stage:= 'Creation of rev version is not allowed';
859: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
860: END IF;
861: END IF;
862: x_return_status := FND_API.G_RET_STS_ERROR;
863: l_any_error_occurred_flag := 'Y';
864:
865: -- RAISE FND_API.G_EXC_ERROR;
866: END IF;
861: END IF;
862: x_return_status := FND_API.G_RET_STS_ERROR;
863: l_any_error_occurred_flag := 'Y';
864:
865: -- RAISE FND_API.G_EXC_ERROR;
866: END IF;
867:
868: END IF; --End of l_budget_amount_code = PA_FP_CONSTANTS_PKG.G_BUDGET_AMOUNT_CODE_C
869:
881: IF l_debug_mode = 'Y' THEN
882: pa_debug.g_err_stage := 'Budget of type FORECASTING_BUDGET_TYPE' ;
883: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
884: END IF;
885: x_return_status := FND_API.G_RET_STS_ERROR;
886: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
887: END IF;
888:
889: -- Budget Integration Validation ---------------------------------------
903: , x_msg_count => x_msg_count
904: );
905:
906: -- calling api above adds the error message to stack hence not adding the error message here.
907: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
908: THEN
909:
910: IF l_debug_mode = 'Y' THEN
911: pa_debug.g_err_stage:= 'get_budget_ctrl_options returned unexp error';
911: pa_debug.g_err_stage:= 'get_budget_ctrl_options returned unexp error';
912: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
913: END IF;
914:
915: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
916:
917: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
918: THEN
919: -- RAISE FND_API.G_EXC_ERROR;
913: END IF;
914:
915: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
916:
917: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
918: THEN
919: -- RAISE FND_API.G_EXC_ERROR;
920: IF l_debug_mode = 'Y' THEN
921: pa_debug.g_err_stage:= 'get_budget_ctrl_options returned error';
915: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
916:
917: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
918: THEN
919: -- RAISE FND_API.G_EXC_ERROR;
920: IF l_debug_mode = 'Y' THEN
921: pa_debug.g_err_stage:= 'get_budget_ctrl_options returned error';
922: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
923: END IF;
939: ,p_attribute3 => p_budget_type_code
940: ,p_attribute4 => ''
941: ,p_attribute5 => '');
942: END IF;
943: x_return_status := FND_API.G_RET_STS_ERROR;
944: l_any_error_occurred_flag := 'Y';
945:
946: -- RAISE FND_API.G_EXC_ERROR;
947: END IF;
942: END IF;
943: x_return_status := FND_API.G_RET_STS_ERROR;
944: l_any_error_occurred_flag := 'Y';
945:
946: -- RAISE FND_API.G_EXC_ERROR;
947: END IF;
948:
949: -- ----------------------------------------------------------------------
950:
971: pa_debug.g_err_stage:= 'Budget entry method is missing';
972: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
973: END IF;
974: END IF;
975: x_return_status := FND_API.G_RET_STS_ERROR;
976: l_any_error_occurred_flag := 'Y';
977:
978: -- RAISE FND_API.G_EXC_ERROR;
979: ELSE -- entry method is not null
974: END IF;
975: x_return_status := FND_API.G_RET_STS_ERROR;
976: l_any_error_occurred_flag := 'Y';
977:
978: -- RAISE FND_API.G_EXC_ERROR;
979: ELSE -- entry method is not null
980:
981: -- check validity of this budget entry method code, and store associated fields in record
982:
1002: pa_debug.g_err_stage:= 'Budget entry method is invlaid';
1003: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
1004: END IF;
1005: END IF;
1006: x_return_status := FND_API.G_RET_STS_ERROR;
1007: l_any_error_occurred_flag := 'Y';
1008:
1009: CLOSE l_budget_entry_method_csr;
1010: -- RAISE FND_API.G_EXC_ERROR;
1006: x_return_status := FND_API.G_RET_STS_ERROR;
1007: l_any_error_occurred_flag := 'Y';
1008:
1009: CLOSE l_budget_entry_method_csr;
1010: -- RAISE FND_API.G_EXC_ERROR;
1011:
1012: ELSE
1013:
1014: CLOSE l_budget_entry_method_csr;
1061: ELSE
1062:
1063: px_resource_list_id := l_uncategorized_list_id;
1064:
1065: -- RAISE FND_API.G_EXC_ERROR;
1066: END IF; -- IF l_err_code <> 0 THEN
1067:
1068:
1069: ELSIF l_budget_entry_method_rec.categorization_code = 'R' THEN
1078: p_resource_list_id => px_resource_list_id_in,
1079: p_out_resource_list_id => px_resource_list_id,
1080: p_return_status => x_return_status );
1081:
1082: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1083: x_return_status := x_return_status;
1084: --dbms_output.put_line('Unexp error as Resource list id not derived properly');
1085: IF l_debug_mode = 'Y' THEN
1086: pa_debug.g_err_stage:= 'Unexp error while deriving res list';
1086: pa_debug.g_err_stage:= 'Unexp error while deriving res list';
1087: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
1088: END IF;
1089:
1090: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1091:
1092: ELSIF x_return_status = FND_API.G_RET_STS_ERROR THEN
1093: x_return_status := x_return_status;
1094: -- RAISE FND_API.G_EXC_ERROR;
1088: END IF;
1089:
1090: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1091:
1092: ELSIF x_return_status = FND_API.G_RET_STS_ERROR THEN
1093: x_return_status := x_return_status;
1094: -- RAISE FND_API.G_EXC_ERROR;
1095: PA_UTILS.ADD_MESSAGE
1096: (p_app_short_name => 'PA',
1090: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1091:
1092: ELSIF x_return_status = FND_API.G_RET_STS_ERROR THEN
1093: x_return_status := x_return_status;
1094: -- RAISE FND_API.G_EXC_ERROR;
1095: PA_UTILS.ADD_MESSAGE
1096: (p_app_short_name => 'PA',
1097: p_msg_name => 'PA_FP_INVALID_RESOURCE_LIST',
1098: p_token1 => 'PROJECT',
1096: (p_app_short_name => 'PA',
1097: p_msg_name => 'PA_FP_INVALID_RESOURCE_LIST',
1098: p_token1 => 'PROJECT',
1099: p_value1 => l_amg_project_rec.segment1);
1100: x_return_status := FND_API.G_RET_STS_ERROR;
1101: --dbms_output.put_line('exp error as Resource list id not derived properly');
1102: l_any_error_occurred_flag := 'Y';
1103: IF l_debug_mode = 'Y' THEN
1104: pa_debug.g_err_stage:= 'error while deriving uncat res list';
1114: FROM pa_resource_lists_all_bg
1115: WHERE resource_list_id = px_resource_list_id;
1116: EXCEPTION
1117: WHEN NO_DATA_FOUND THEN
1118: x_return_status := FND_API.G_RET_STS_ERROR;
1119: PA_UTILS.ADD_MESSAGE
1120: (p_app_short_name => 'PA',
1121: p_msg_name => 'PA_FP_INVALID_RESOURCE_LIST',
1122: p_token1 => 'PROJECT',
1120: (p_app_short_name => 'PA',
1121: p_msg_name => 'PA_FP_INVALID_RESOURCE_LIST',
1122: p_token1 => 'PROJECT',
1123: p_value1 => l_amg_project_rec.segment1);
1124: x_return_status := FND_API.G_RET_STS_ERROR;
1125:
1126: l_any_error_occurred_flag := 'Y';
1127: IF l_debug_mode = 'Y' THEN
1128: pa_debug.g_err_stage:= 'error while deriving uncat res list';
1129: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
1130: END IF;
1131: END;
1132: IF l_res_list_migration_code = 'N' THEN
1133: x_return_status := FND_API.G_RET_STS_ERROR;
1134: l_any_error_occurred_flag := 'Y';
1135: PA_UTILS.ADD_MESSAGE
1136: (p_app_short_name => 'PA',
1137: p_msg_name => 'PA_FP_NEW_RES_LIST_OLD_MODEL');
1141: END IF;
1142: END IF;
1143: /* bug 3954329 ends */
1144: ELSE -- There is no valid resource list id
1145: x_return_status := FND_API.G_RET_STS_ERROR; --AMG UT2
1146: l_any_error_occurred_flag := 'Y';
1147:
1148: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1149: pa_interface_utils_pub.map_new_amg_msg
1161: pa_debug.g_err_stage:= 'res list is missing';
1162: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
1163: END IF;
1164:
1165: -- RAISE FND_API.G_EXC_ERROR;
1166: END IF;
1167: END IF ; -- If l_budget_entry_method_rec.categorization_code = 'N
1168: END IF;--l_budget_entry_method_csr%NOTFOUND
1169: END IF;--p_entry_method_code IS NULL
1196: (p_app_short_name => 'PA',
1197: p_msg_name => 'PA_FP_AUTO_BASELINE_ENABLED',
1198: p_token1 => 'PROJECT',
1199: p_value1 => l_amg_project_rec.segment1);
1200: x_return_status := FND_API.G_RET_STS_ERROR;
1201: l_any_error_occurred_flag := 'Y';
1202:
1203: --RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
1204: --dbms_output.put_line('Autobaseline error');
1217: PA_UTILS.ADD_MESSAGE
1218: (p_app_short_name => 'PA',
1219: p_msg_name => 'PA_FP_BUDGET_TYPE_UPGRADED');
1220:
1221: x_return_status := FND_API.G_RET_STS_ERROR;
1222: l_any_error_occurred_flag := 'Y';
1223: --dbms_output.put_line('Budget type upgraded error');
1224: IF l_debug_mode = 'Y' THEN
1225: pa_debug.g_err_stage:= 'Budget type is already upgraded';
1246: ,x_msg_count => x_msg_count
1247: ,x_msg_data => x_msg_data);
1248:
1249: -- Throw the error if the above API is not successfully executed
1250: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1251:
1252: IF l_debug_mode = 'Y' THEN
1253: pa_debug.g_err_stage := 'Get_Appr_Cost_Plan_Type_Info API returned error' ;
1254: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
1267: PA_UTILS.ADD_MESSAGE
1268: (p_app_short_name => 'PA',
1269: p_msg_name => 'PA_FP_AC_PLAN_TYPE_EXISTS');
1270:
1271: x_return_status := FND_API.G_RET_STS_ERROR;
1272: l_any_error_occurred_flag := 'Y';
1273:
1274: END IF; --IF x_return_status <> FND_API.G_RET_STS_SUCCESS
1275:
1270:
1271: x_return_status := FND_API.G_RET_STS_ERROR;
1272: l_any_error_occurred_flag := 'Y';
1273:
1274: END IF; --IF x_return_status <> FND_API.G_RET_STS_SUCCESS
1275:
1276: END IF; --IF (p_budget_type_code = PA_FP_CONSTANTS_PKG.G_BUDGET_TYPE_CODE_AC)
1277:
1278: -- If an Approved Revenue plan version exists for the project in new model then a budget
1288: ,x_msg_count => x_msg_count
1289: ,x_msg_data => x_msg_data) ;
1290:
1291: -- Throw the error if the above API is not successfully executed
1292: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1293:
1294: IF l_debug_mode = 'Y' THEN
1295: pa_debug.g_err_stage := 'Get_Appr_Cost_Plan_Type_Info API returned error' ;
1296: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
1308:
1309: PA_UTILS.ADD_MESSAGE
1310: (p_app_short_name => 'PA',
1311: p_msg_name => 'PA_FP_AR_PLAN_TYPE_EXISTS');
1312: x_return_status := FND_API.G_RET_STS_ERROR;
1313: l_any_error_occurred_flag := 'Y';
1314:
1315: END IF;
1316: END IF;
1338: ,p_attribute3 => p_budget_type_code
1339: ,p_attribute4 => ''
1340: ,p_attribute5 => '');
1341: END IF;
1342: x_return_status := FND_API.G_RET_STS_ERROR;
1343: l_any_error_occurred_flag := 'Y';
1344: --RAISE FND_API.G_EXC_ERROR;
1345:
1346: END IF;--l_budget_status_code = 'S'
1340: ,p_attribute5 => '');
1341: END IF;
1342: x_return_status := FND_API.G_RET_STS_ERROR;
1343: l_any_error_occurred_flag := 'Y';
1344: --RAISE FND_API.G_EXC_ERROR;
1345:
1346: END IF;--l_budget_status_code = 'S'
1347:
1348:
1358: ,x_msg_data => x_msg_data);
1359: --dbms_output.put_line('After the getting plan id');
1360:
1361: -- Throw the error if the above API is not successfully executed
1362: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1363:
1364: IF l_debug_mode = 'Y' THEN
1365: pa_debug.g_err_stage := 'Can not get the value of Fin Plan Type Id' ;
1366: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
1398: (p_app_short_name => 'PA',
1399: p_msg_name => 'PA_FP_WP_BV_CR_NO_ALLOWED');
1400:
1401: --Bug # 3507156 : Patchset M: B and F impact changes : AMG
1402: x_return_status := FND_API.G_RET_STS_ERROR;
1403: l_any_error_occurred_flag := 'Y';
1404:
1405: END IF;
1406:
1464: ,x_return_status => x_return_status
1465: ,x_msg_count => x_msg_count
1466: ,x_msg_data => x_msg_data);
1467:
1468: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1469:
1470: IF l_debug_mode = 'Y' THEN
1471: pa_debug.g_err_stage := 'Faied in get_Version_type' ;
1472: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
1492: ,X_msg_data => x_msg_data);
1493:
1494: -- Throw the error if the above API is not successfully executed
1495:
1496: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1497:
1498: IF l_debug_mode = 'Y' THEN
1499: pa_debug.g_err_stage := 'Can not check if plan type is editable' ;
1500: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
1523:
1524: --
1525: --Setting the error statuses if plan type is not editable.
1526:
1527: x_return_status := FND_API.G_RET_STS_ERROR;
1528: l_any_error_occurred_flag := 'Y';
1529:
1530: END IF;
1531: END IF;
1560: p_msg_name => 'PA_FP_AUTO_BASELINE_ENABLED',
1561: p_token1 => 'PROJECT',
1562: p_value1 => l_amg_project_rec.segment1);
1563:
1564: x_return_status := FND_API.G_RET_STS_ERROR;
1565: l_any_error_occurred_flag := 'Y';
1566:
1567: --RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
1568: --dbms_output.put_line('Autobaseline error');
1578: ,p_version_type => px_version_type
1579: ,x_return_status => x_return_status
1580: ,x_ret_code => l_security_ret_code );
1581:
1582: IF (x_return_status <>FND_API.G_RET_STS_SUCCESS OR
1583: l_security_ret_code='N') THEN
1584: --dbms_output.put_line('Exc in security');
1585: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
1586: END IF;
1617: p_msg_name => 'PA_FP_AUTO_BASELINE_ENABLED',
1618: p_token1 => 'PROJECT',
1619: p_value1 => l_amg_project_rec.segment1);
1620:
1621: x_return_status := FND_API.G_RET_STS_ERROR;
1622: l_any_error_occurred_flag := 'Y';
1623: --RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
1624:
1625: END IF;
1683: p_value1 => l_amg_project_rec.segment1,
1684: p_token2 => 'PLAN_TYPE',
1685: p_value2 => l_fin_plan_type_name);
1686:
1687: x_return_status := FND_API.G_RET_STS_ERROR;
1688: l_any_error_occurred_flag := 'Y';
1689:
1690: END IF;
1691:
1740: ELSE
1741:
1742: px_resource_list_id := l_uncategorized_list_id;
1743:
1744: -- RAISE FND_API.G_EXC_ERROR;
1745: END IF; -- IF l_err_code <> 0 THEN
1746: ELSE
1747: IF( px_resource_list_name IS NULL OR
1748: px_resource_list_name = PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR )AND
1764: p_resource_list_id => px_resource_list_id_in,
1765: p_out_resource_list_id => px_resource_list_id,
1766: p_return_status => x_return_status );
1767:
1768: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1769:
1770: PA_UTILS.ADD_MESSAGE
1771: (p_app_short_name => 'PA',
1772: p_msg_name => 'PA_FP_INVALID_RESOURCE_LIST',
1778: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
1779: END IF;
1780:
1781:
1782: x_return_status := FND_API.G_RET_STS_ERROR;
1783: l_any_error_occurred_flag := 'Y';
1784:
1785: END IF;
1786:
1791: FROM pa_resource_lists_all_bg
1792: WHERE resource_list_id = px_resource_list_id;
1793: EXCEPTION
1794: WHEN NO_DATA_FOUND THEN
1795: x_return_status := FND_API.G_RET_STS_ERROR;
1796: PA_UTILS.ADD_MESSAGE
1797: (p_app_short_name => 'PA',
1798: p_msg_name => 'PA_FP_INVALID_RESOURCE_LIST',
1799: p_token1 => 'PROJECT',
1797: (p_app_short_name => 'PA',
1798: p_msg_name => 'PA_FP_INVALID_RESOURCE_LIST',
1799: p_token1 => 'PROJECT',
1800: p_value1 => l_amg_project_rec.segment1);
1801: x_return_status := FND_API.G_RET_STS_ERROR;
1802:
1803: l_any_error_occurred_flag := 'Y';
1804: IF l_debug_mode = 'Y' THEN
1805: pa_debug.g_err_stage:= 'error while deriving uncat res list';
1806: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
1807: END IF;
1808: END;
1809: IF l_res_list_migration_code IS NULL THEN
1810: x_return_status := FND_API.G_RET_STS_ERROR;
1811: l_any_error_occurred_flag := 'Y';
1812: PA_UTILS.ADD_MESSAGE
1813: (p_app_short_name => 'PA',
1814: p_msg_name => 'PA_FP_OLD_RES_LIST_NEW_MODEL');
1851: p_value1 => l_amg_project_rec.segment1,
1852: p_token2 => 'PLAN_TYPE',
1853: p_value2 => l_fin_plan_type_name);
1854:
1855: x_return_status := FND_API.G_RET_STS_ERROR;
1856: l_any_error_occurred_flag := 'Y';
1857:
1858:
1859: --
1884: x_return_status => x_return_status,
1885: x_msg_count => x_msg_count,
1886: x_msg_data => x_msg_data );
1887:
1888: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1889:
1890: IF l_debug_mode = 'Y' THEN
1891: pa_debug.g_err_stage:= 'get current period profile gave error' ||px_pa_project_id;
1892: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
1899: IF(l_period_profile_id IS NULL) THEN
1900:
1901: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
1902: p_msg_name => 'PA_FP_NO_PERIOD_PROFILE');
1903: x_return_status := FND_API.G_RET_STS_ERROR;
1904: l_any_error_occurred_flag := 'Y';
1905: IF l_debug_mode = 'Y' THEN
1906: pa_debug.g_err_stage:= 'Project does not have a period profile';
1907: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
1934: PA_UTILS.ADD_MESSAGE
1935: (p_app_short_name => 'PA',
1936: p_msg_name => 'PA_FP_NO_PERIOD_MASK');
1937:
1938: x_return_status := FND_API.G_RET_STS_ERROR;
1939: END;
1940: END IF; -- IF pa_fin_plan_utils.get_lookup_value
1941:
1942: END IF; -- IF(px_time_phased_code IS NULL) THEN
1965: ,x_return_status => x_return_status
1966: ,x_msg_count => x_msg_count
1967: ,x_msg_data => x_msg_data);
1968:
1969: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1970:
1971: IF l_debug_mode = 'Y' THEN
1972: pa_debug.g_err_stage:= 'pa_fin_plan_utils.Get_Project_Curr_Attributes errored out for project' ||px_pa_project_id;
1973: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2025: p_value1 => l_amg_project_rec.segment1,
2026: p_token2 => 'PLAN_TYPE',
2027: p_value2 => l_fin_plan_type_name);
2028:
2029: x_return_status := FND_API.G_RET_STS_ERROR;
2030: l_any_error_occurred_flag := 'Y';
2031: l_validate_mc_attributes := 'N';
2032:
2033: END IF;
2045:
2046: PA_UTILS.ADD_MESSAGE
2047: (p_app_short_name => 'PA',
2048: p_msg_name => 'PA_FP_INVALID_AR_AT_PROJ_TEMP');
2049: x_return_status := FND_API.G_RET_STS_ERROR;
2050: l_any_error_occurred_flag := 'Y';
2051:
2052: l_validate_mc_attributes := 'N';
2053:
2074: p_token2 => 'PLAN_TYPE',
2075: p_value2 => l_fin_plan_type_name);
2076:
2077:
2078: x_return_status := FND_API.G_RET_STS_ERROR;
2079: l_any_error_occurred_flag := 'Y';
2080: */
2081: l_validate_mc_attributes := 'Y';
2082: px_plan_in_multi_curr_flag := 'Y';
2114: p_value1 => l_amg_project_rec.segment1,
2115: p_token2 => 'PLAN_TYPE',
2116: p_value2 => l_fin_plan_type_name);
2117:
2118: x_return_status := FND_API.G_RET_STS_ERROR;
2119: l_any_error_occurred_flag := 'Y';
2120: l_validate_mc_attributes := 'N';
2121:
2122:
2198: x_return_status => x_return_status,
2199: x_msg_count => x_msg_count,
2200: x_msg_data => x_msg_data);
2201:
2202: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2203:
2204: IF l_debug_mode = 'Y' THEN
2205: pa_debug.g_err_stage:= 'valid_rate_type returned error';
2206: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2224: p_value1 => l_amg_project_rec.segment1,
2225: p_token2 => 'PLAN_TYPE',
2226: p_value2 => l_fin_plan_type_name);
2227:
2228: x_return_status := FND_API.G_RET_STS_ERROR;
2229: l_any_error_occurred_flag := 'Y';
2230:
2231: ELSE
2232: --dbms_output.put_line('The value of l_conv_attrs_to_be_validated is ' ||l_conv_attrs_to_be_validated);
2255: ,x_return_status =>x_return_status
2256: ,x_msg_count =>x_msg_count
2257: ,x_msg_data =>x_msg_data);
2258:
2259: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2260: x_return_status:=FND_API.G_RET_STS_ERROR;
2261:
2262: IF l_debug_mode = 'Y' THEN
2263: pa_debug.g_err_stage:= 'Validate currency attributes returned error';
2256: ,x_msg_count =>x_msg_count
2257: ,x_msg_data =>x_msg_data);
2258:
2259: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2260: x_return_status:=FND_API.G_RET_STS_ERROR;
2261:
2262: IF l_debug_mode = 'Y' THEN
2263: pa_debug.g_err_stage:= 'Validate currency attributes returned error';
2264: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2300: p_token1 => 'PROJECT',
2301: p_value1 => l_amg_project_rec.segment1,
2302: p_token2 => 'PLAN_TYPE',
2303: p_value2 => l_fin_plan_type_name);
2304: x_return_status := FND_API.G_RET_STS_ERROR;
2305: l_any_error_occurred_flag := 'Y';
2306: IF l_debug_mode = 'Y' THEN
2307: pa_debug.g_err_stage:= 'Invalid values for amount flags ';
2308: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2316:
2317: PA_UTILS.ADD_MESSAGE
2318: (p_app_short_name => 'PA',
2319: p_msg_name => 'PA_FP_NO_PLAN_AMT_CHECKED');
2320: x_return_status := FND_API.G_RET_STS_ERROR;
2321: l_any_error_occurred_flag := 'Y';
2322: IF l_debug_mode = 'Y' THEN
2323: pa_debug.g_err_stage:= 'None of the amount flags are Y ';
2324: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2339: p_token1 => 'PROJECT',
2340: p_value1 => l_amg_project_rec.segment1,
2341: p_token2 => 'PLAN_TYPE',
2342: p_value2 => l_fin_plan_type_name);
2343: x_return_status := FND_API.G_RET_STS_ERROR;
2344: l_any_error_occurred_flag := 'Y';
2345: IF l_debug_mode = 'Y' THEN
2346: pa_debug.g_err_stage:= 'Invalid value for the amount flags ';
2347: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2355:
2356: PA_UTILS.ADD_MESSAGE
2357: (p_app_short_name => 'PA',
2358: p_msg_name => 'PA_FP_NO_PLAN_AMT_CHECKED');
2359: x_return_status := FND_API.G_RET_STS_ERROR;
2360: l_any_error_occurred_flag := 'Y';
2361: IF l_debug_mode = 'Y' THEN
2362: pa_debug.g_err_stage:= 'None of the amount flags are Y ';
2363: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2383: p_token1 => 'PROJECT',
2384: p_value1 => l_amg_project_rec.segment1,
2385: p_token2 => 'PLAN_TYPE',
2386: p_value2 => l_fin_plan_type_name);
2387: x_return_status := FND_API.G_RET_STS_ERROR;
2388: l_any_error_occurred_flag := 'Y';
2389: IF l_debug_mode = 'Y' THEN
2390: pa_debug.g_err_stage:= 'Invalid value for the amount flags ';
2391: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2402:
2403: PA_UTILS.ADD_MESSAGE
2404: (p_app_short_name => 'PA',
2405: p_msg_name => 'PA_FP_NO_PLAN_AMT_CHECKED');
2406: x_return_status := FND_API.G_RET_STS_ERROR;
2407: l_any_error_occurred_flag := 'Y';
2408: IF l_debug_mode = 'Y' THEN
2409: pa_debug.g_err_stage:= 'None of the amount flags are Y ';
2410: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2427: p_value1 => l_amg_project_rec.segment1,
2428: p_token2 => 'PLAN_TYPE',
2429: p_value2 => l_fin_plan_type_name);
2430:
2431: x_return_status := FND_API.G_RET_STS_ERROR;
2432: l_any_error_occurred_flag := 'Y';
2433: IF l_debug_mode = 'Y' THEN
2434: pa_debug.g_err_stage:= 'Create replace CW version flags are invalid ';
2435: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2480: ,p_attribute2 => ''
2481: ,p_attribute3 => l_fin_plan_type_name
2482: ,p_attribute4 => ''
2483: ,p_attribute5 => '');
2484: x_return_status := FND_API.G_RET_STS_ERROR;
2485: l_any_error_occurred_flag := 'Y';
2486:
2487: IF l_finplan_CW_ver_rec.plan_processing_code IN ('XLUE','XLUP') THEN
2488:
2493: ,x_return_status => x_return_status
2494: ,x_msg_count => x_msg_count
2495: ,x_msg_data => x_msg_data);
2496:
2497: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2498: x_return_status:=FND_API.G_RET_STS_ERROR;
2499:
2500: IF l_debug_mode = 'Y' THEN
2501: pa_debug.g_err_stage:= 'pa_fin_plan_utils.return_and_vldt_plan_prc_code returned error';
2494: ,x_msg_count => x_msg_count
2495: ,x_msg_data => x_msg_data);
2496:
2497: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2498: x_return_status:=FND_API.G_RET_STS_ERROR;
2499:
2500: IF l_debug_mode = 'Y' THEN
2501: pa_debug.g_err_stage:= 'pa_fin_plan_utils.return_and_vldt_plan_prc_code returned error';
2502: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2553: pa_debug.g_err_stage:= 'Invalid Change Reason code ';
2554: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
2555: END IF;
2556: END IF;
2557: x_return_status := FND_API.G_RET_STS_ERROR;
2558: l_any_error_occurred_flag := 'Y';
2559:
2560: --RAISE FND_API.G_EXC_ERROR;
2561:
2556: END IF;
2557: x_return_status := FND_API.G_RET_STS_ERROR;
2558: l_any_error_occurred_flag := 'Y';
2559:
2560: --RAISE FND_API.G_EXC_ERROR;
2561:
2562: ELSE
2563:
2564: CLOSE l_budget_change_reason_csr;
2579: IF(l_debug_mode='Y') THEN
2580: pa_debug.g_err_stage := 'About to display all the messages';
2581: pa_debug.write( l_module_name,pa_debug.g_err_stage,l_debug_level5);
2582: END IF;
2583: x_return_status := FND_API.G_RET_STS_ERROR;
2584: l_any_error_occurred_flag := 'Y';
2585: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2586: END IF;
2587:
2591: EXCEPTION
2592:
2593: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
2594: IF x_return_status IS NULL OR
2595: x_return_status = FND_API.G_RET_STS_SUCCESS THEN
2596: x_return_status := FND_API.G_RET_STS_ERROR;
2597: END IF;
2598:
2599: l_msg_count := FND_MSG_PUB.count_msg;
2592:
2593: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
2594: IF x_return_status IS NULL OR
2595: x_return_status = FND_API.G_RET_STS_SUCCESS THEN
2596: x_return_status := FND_API.G_RET_STS_ERROR;
2597: END IF;
2598:
2599: l_msg_count := FND_MSG_PUB.count_msg;
2600: --dbms_output.put_line('MSG count in the stack ' || l_msg_count);
2600: --dbms_output.put_line('MSG count in the stack ' || l_msg_count);
2601:
2602: IF l_msg_count = 1 AND x_msg_data IS NULL THEN
2603: PA_INTERFACE_UTILS_PUB.get_messages
2604: (p_encoded => FND_API.G_TRUE,
2605: p_msg_index => 1,
2606: p_msg_count => l_msg_count,
2607: p_msg_data => l_msg_data,
2608: p_data => l_data,
2620: END IF;
2621: RETURN;
2622:
2623: WHEN OTHERS THEN
2624: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2625: x_msg_count := 1;
2626: x_msg_data := SQLERRM;
2627:
2628: FND_MSG_PUB.add_exc_msg
2863: BEGIN
2864:
2865:
2866: x_msg_count :=0;
2867: x_return_status := FND_API.G_RET_STS_SUCCESS;
2868: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
2869: l_module_name := g_module_name || 'validate_header_info: ';
2870:
2871: IF l_debug_mode = 'Y' THEN
2873: p_debug_mode => l_debug_mode );
2874: END IF;
2875:
2876: -- Initialize the message table if requested.
2877: IF FND_API.TO_BOOLEAN( p_init_msg_list )
2878: THEN
2879: FND_MSG_PUB.initialize;
2880: END IF;
2881:
2888: --Standard call to check for call compatibility.
2889: --We do not perform the call compatibility check if p_api_name
2890: --is null. Internal APIs should pass this parameter as null.
2891: IF p_api_name IS NOT NULL THEN
2892: IF NOT FND_API.compatible_api_call ( PA_BUDGET_PUB.g_api_version_number,
2893: p_api_version_number ,
2894: p_api_name ,
2895: PA_BUDGET_PUB.G_PKG_NAME )
2896: THEN
2893: p_api_version_number ,
2894: p_api_name ,
2895: PA_BUDGET_PUB.G_PKG_NAME )
2896: THEN
2897: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2898: END IF;
2899: END IF;
2900:
2901: --Convert following IN parameters from G_PA_MISS_XXX to null
2980: pa_debug.g_err_stage:= 'PM Product code is missing';
2981: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
2982: END IF;
2983:
2984: x_return_status := FND_API.G_RET_STS_ERROR;
2985: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2986:
2987: ELSE --p_pm_product_code is not null
2988:
3008: pa_debug.g_err_stage:= 'PM Product code is invalid';
3009: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3010: END IF;
3011:
3012: x_return_status := FND_API.G_RET_STS_ERROR;
3013: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3014: END IF;
3015: END IF;-- p_pm_product_code IS NULL
3016:
3025: IF px_pa_project_id_tmp IS NOT NULL then /* Bug 7498493 */
3026: px_pa_project_id := px_pa_project_id_tmp;
3027: END IF;
3028:
3029: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
3030: THEN
3031: IF l_debug_mode = 'Y' THEN
3032: pa_debug.g_err_stage:= 'Unexpected error while deriving project id';
3033: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3031: IF l_debug_mode = 'Y' THEN
3032: pa_debug.g_err_stage:= 'Unexpected error while deriving project id';
3033: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3034: END IF;
3035: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3036:
3037: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
3038: THEN
3039: IF l_debug_mode = 'Y' THEN
3033: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3034: END IF;
3035: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3036:
3037: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
3038: THEN
3039: IF l_debug_mode = 'Y' THEN
3040: pa_debug.g_err_stage:= 'Error while deriving project id';
3041: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3084:
3085: -- the above API adds the error message to stack. Hence the message is not added here.
3086: -- Also, as security check is important further validations are not done in case this
3087: -- validation fails.
3088: IF (x_return_status<>FND_API.G_RET_STS_SUCCESS OR
3089: l_security_ret_code = 'N') THEN
3090:
3091: IF l_debug_mode = 'Y' THEN
3092: pa_debug.g_err_stage:= 'Security API Failed';
3116: ,p_attribute3 => px_budget_type_code
3117: ,p_attribute4 => ''
3118: ,p_attribute5 => '');
3119: END IF;
3120: x_return_status := FND_API.G_RET_STS_ERROR;
3121:
3122: IF l_debug_mode = 'Y' THEN
3123: pa_debug.g_err_stage:= 'Budget type is invalid';
3124: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3170: , x_msg_count => x_msg_count
3171: );
3172:
3173: -- calling api above adds the error message to stack hence not adding the error message here.
3174: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
3175: THEN
3176: IF l_debug_mode = 'Y' THEN
3177: pa_debug.g_err_stage:= 'get_budget_ctrl_options returned unexp error';
3178: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3176: IF l_debug_mode = 'Y' THEN
3177: pa_debug.g_err_stage:= 'get_budget_ctrl_options returned unexp error';
3178: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3179: END IF;
3180: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3181:
3182: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
3183: THEN
3184: IF l_debug_mode = 'Y' THEN
3178: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3179: END IF;
3180: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3181:
3182: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
3183: THEN
3184: IF l_debug_mode = 'Y' THEN
3185: pa_debug.g_err_stage:= 'get_budget_ctrl_options returned error';
3186: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3209: );
3210:
3211:
3212: -- calling api above adds the error message to stack hence not adding the error message here.
3213: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
3214: THEN
3215: IF l_debug_mode = 'Y' THEN
3216: pa_debug.g_err_stage:= 'Get_Latest_BC_Year returned unexp error';
3217: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3215: IF l_debug_mode = 'Y' THEN
3216: pa_debug.g_err_stage:= 'Get_Latest_BC_Year returned unexp error';
3217: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3218: END IF;
3219: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3220: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
3221: THEN
3222: IF l_debug_mode = 'Y' THEN
3223: pa_debug.g_err_stage:= 'Get_Latest_BC_Year returned error';
3216: pa_debug.g_err_stage:= 'Get_Latest_BC_Year returned unexp error';
3217: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3218: END IF;
3219: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3220: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
3221: THEN
3222: IF l_debug_mode = 'Y' THEN
3223: pa_debug.g_err_stage:= 'Get_Latest_BC_Year returned error';
3224: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3240: ,p_attribute3 => px_budget_type_code
3241: ,p_attribute4 => ''
3242: ,p_attribute5 => '');
3243:
3244: x_return_status := FND_API.G_RET_STS_ERROR;
3245: l_any_error_occurred_flag := 'Y';
3246: END IF;
3247: */
3248:
3302: ,p_attribute4 => ''
3303: ,p_attribute5 => '');
3304: END IF;
3305:
3306: x_return_status := FND_API.G_RET_STS_ERROR;
3307: l_any_error_occurred_flag := 'Y';
3308: IF l_debug_mode = 'Y' THEN
3309: pa_debug.g_err_stage:= 'Budget entry method is missing';
3310: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3333: ,p_attribute3 => px_budget_type_code
3334: ,p_attribute4 => ''
3335: ,p_attribute5 => '');
3336: END IF;
3337: x_return_status := FND_API.G_RET_STS_ERROR;
3338: l_any_error_occurred_flag := 'Y';
3339: IF l_debug_mode = 'Y' THEN
3340: pa_debug.g_err_stage:= 'Budget entry method is invalid';
3341: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3357: ,x_msg_count => x_msg_count
3358: ,x_msg_data => x_msg_data);
3359:
3360: -- Throw the error if the above API is not successfully executed
3361: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3362: IF l_debug_mode = 'Y' THEN
3363: pa_debug.g_err_stage := 'Cannot get the value of Fin Plan Type Id' ;
3364: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3365: END IF;
3402: ,x_return_status => x_return_status
3403: ,x_msg_count => x_msg_count
3404: ,x_msg_data => x_msg_data);
3405:
3406: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3407: IF l_debug_mode = 'Y' THEN
3408: pa_debug.g_err_stage := 'Failed in get_Version_type' ;
3409: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3410: END IF;
3423: pa_debug.g_err_stage := 'Org_Forecast plan type has been passed' ;
3424: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3425: END IF;
3426:
3427: x_return_status := FND_API.G_RET_STS_ERROR;
3428: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3429: END IF; --org_forecast
3430:
3431: --Check function security
3438: ,p_version_type => px_version_type
3439: ,x_return_status => x_return_status
3440: ,x_ret_code => l_security_ret_code );
3441:
3442: IF (x_return_status <>FND_API.G_RET_STS_SUCCESS OR
3443: l_security_ret_code='N') THEN
3444: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3445: END IF;
3446:
3469: ,x_return_status => x_return_status
3470: ,x_msg_count => x_msg_count
3471: ,x_msg_data => x_msg_data );
3472:
3473: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3474: IF l_debug_mode = 'Y' THEN
3475: pa_debug.g_err_stage := 'Get_Curr_Working_Version_Info api Failed ' ;
3476: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3477: END IF;
3474: IF l_debug_mode = 'Y' THEN
3475: pa_debug.g_err_stage := 'Get_Curr_Working_Version_Info api Failed ' ;
3476: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3477: END IF;
3478: RAISE FND_API.G_EXC_ERROR;
3479: END IF;
3480:
3481: END IF; --p_budget_version_number IS NOT NULL
3482:
3518: x_return_status => x_return_status,
3519: x_msg_count => x_msg_count,
3520: x_msg_data => x_msg_data);
3521:
3522: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3523: IF l_debug_mode = 'Y' THEN
3524: pa_debug.g_err_stage := 'This budget version can not be edited';
3525: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3526: END IF;
3593: ,p_attribute3 => l_context_info
3594: ,p_attribute4 => ''
3595: ,p_attribute5 => '');
3596: END IF;
3597: x_return_status := FND_API.G_RET_STS_ERROR;
3598: l_any_error_occurred_flag := 'Y';
3599: IF l_debug_mode = 'Y' THEN
3600: pa_debug.g_err_stage:= 'Invalid Change Reason code ';
3601: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3614: ,x_return_status => x_return_status
3615: ,x_msg_count => x_msg_count
3616: ,x_msg_data => x_msg_data );
3617:
3618: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3619: IF(l_debug_mode='Y') THEN
3620: pa_debug.g_err_stage := 'Auto baseline API falied';
3621: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3622: END IF;
3619: IF(l_debug_mode='Y') THEN
3620: pa_debug.g_err_stage := 'Auto baseline API falied';
3621: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3622: END IF;
3623: RAISE FND_API.G_EXC_ERROR;
3624: END IF;
3625:
3626: IF l_result = 'F' THEN
3627: IF(l_debug_mode='Y') THEN
3650: ,x_return_status => x_return_status
3651: ,x_msg_count => x_msg_count
3652: ,x_msg_data => x_msg_data);
3653:
3654: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3655: IF(l_debug_mode='Y') THEN
3656: pa_debug.g_err_stage := 'return_and_vldt_plan_prc_code API falied';
3657: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3658: END IF;
3655: IF(l_debug_mode='Y') THEN
3656: pa_debug.g_err_stage := 'return_and_vldt_plan_prc_code API falied';
3657: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3658: END IF;
3659: RAISE FND_API.G_EXC_ERROR;
3660: END IF;
3661:
3662: /* Plan Amount Entry flags validations start : bug 6408139 */
3663: IF px_budget_type_code IS NULL THEN -- for plan versions only, we are checking the flags
3700: ,x_message_count => x_msg_count
3701: ,x_return_status => x_return_status
3702: ,x_message_data => x_msg_data) ;
3703:
3704: IF x_return_status <> FND_API.G_RET_STS_SUCCESS
3705: THEN
3706: -- RAISE FND_API.G_EXC_ERROR;
3707: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3708: END IF;
3702: ,x_message_data => x_msg_data) ;
3703:
3704: IF x_return_status <> FND_API.G_RET_STS_SUCCESS
3705: THEN
3706: -- RAISE FND_API.G_EXC_ERROR;
3707: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3708: END IF;
3709:
3710: IF ( px_raw_cost_flag = PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR) THEN
3759: p_token1 => 'PROJECT',
3760: p_value1 => x_project_number,
3761: p_token2 => 'PLAN_TYPE',
3762: p_value2 => px_fin_plan_type_name);
3763: x_return_status := FND_API.G_RET_STS_ERROR;
3764: l_any_error_occurred_flag := 'Y';
3765:
3766: IF l_debug_mode = 'Y' THEN
3767: pa_debug.g_err_stage:= 'Invalid values for amount flags ';
3776:
3777: PA_UTILS.ADD_MESSAGE
3778: (p_app_short_name => 'PA',
3779: p_msg_name => 'PA_FP_NO_PLAN_AMT_CHECKED');
3780: x_return_status := FND_API.G_RET_STS_ERROR;
3781: l_any_error_occurred_flag := 'Y';
3782: IF l_debug_mode = 'Y' THEN
3783: pa_debug.g_err_stage:= 'None of the amount flags are Y ';
3784: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level5);
3799: p_token1 => 'PROJECT',
3800: p_value1 => x_project_number,
3801: p_token2 => 'PLAN_TYPE',
3802: p_value2 => px_fin_plan_type_name);
3803: x_return_status := FND_API.G_RET_STS_ERROR;
3804: l_any_error_occurred_flag := 'Y';
3805: IF l_debug_mode = 'Y' THEN
3806: pa_debug.g_err_stage:= 'Invalid value for the amount flags ';
3807: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
3815:
3816: PA_UTILS.ADD_MESSAGE
3817: (p_app_short_name => 'PA',
3818: p_msg_name => 'PA_FP_NO_PLAN_AMT_CHECKED');
3819: x_return_status := FND_API.G_RET_STS_ERROR;
3820: l_any_error_occurred_flag := 'Y';
3821: IF l_debug_mode = 'Y' THEN
3822: pa_debug.g_err_stage:= 'None of the amount flags are Y ';
3823: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
3841: p_token1 => 'PROJECT',
3842: p_value1 => x_project_number,
3843: p_token2 => 'PLAN_TYPE',
3844: p_value2 => px_fin_plan_type_name);
3845: x_return_status := FND_API.G_RET_STS_ERROR;
3846: l_any_error_occurred_flag := 'Y';
3847: IF l_debug_mode = 'Y' THEN
3848: pa_debug.g_err_stage:= 'Invalid value for the amount flags ';
3849: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
3860:
3861: PA_UTILS.ADD_MESSAGE
3862: (p_app_short_name => 'PA',
3863: p_msg_name => 'PA_FP_NO_PLAN_AMT_CHECKED');
3864: x_return_status := FND_API.G_RET_STS_ERROR;
3865: l_any_error_occurred_flag := 'Y';
3866: IF l_debug_mode = 'Y' THEN
3867: pa_debug.g_err_stage:= 'None of the amount flags are Y ';
3868: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
3883: IF(l_debug_mode='Y') THEN
3884: pa_debug.g_err_stage := 'About to display all the messages';
3885: pa_debug.write( l_module_name,pa_debug.g_err_stage,l_debug_level5);
3886: END IF;
3887: x_return_status := FND_API.G_RET_STS_ERROR;
3888: l_any_error_occurred_flag := 'Y';
3889: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
3890: END IF;
3891:
3901: EXCEPTION
3902:
3903: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
3904: IF x_return_status IS NULL
3905: OR x_return_status = FND_API.G_RET_STS_SUCCESS THEN
3906: x_return_status := FND_API.G_RET_STS_ERROR;
3907: END IF;
3908:
3909: x_msg_count := FND_MSG_PUB.count_msg;
3902:
3903: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
3904: IF x_return_status IS NULL
3905: OR x_return_status = FND_API.G_RET_STS_SUCCESS THEN
3906: x_return_status := FND_API.G_RET_STS_ERROR;
3907: END IF;
3908:
3909: x_msg_count := FND_MSG_PUB.count_msg;
3910:
3909: x_msg_count := FND_MSG_PUB.count_msg;
3910:
3911: IF x_msg_count = 1 AND x_msg_data IS NULL THEN
3912: PA_INTERFACE_UTILS_PUB.get_messages
3913: (p_encoded => FND_API.G_TRUE,
3914: p_msg_index => 1,
3915: p_msg_count => x_msg_count,
3916: p_msg_data => x_msg_data,
3917: p_data => l_data,
3925: END IF;
3926:
3927: RETURN;
3928:
3929: WHEN FND_API.G_EXC_ERROR
3930: THEN
3931:
3932: x_return_status := FND_API.G_RET_STS_ERROR;
3933:
3928:
3929: WHEN FND_API.G_EXC_ERROR
3930: THEN
3931:
3932: x_return_status := FND_API.G_RET_STS_ERROR;
3933:
3934: FND_MSG_PUB.count_and_get
3935: ( p_count => x_msg_count ,
3936: p_data => x_msg_data );
3938: IF ( l_debug_mode = 'Y' ) THEN
3939: pa_debug.reset_curr_function;
3940: END IF;
3941:
3942: WHEN FND_API.G_EXC_UNEXPECTED_ERROR
3943: THEN
3944:
3945: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3946:
3941:
3942: WHEN FND_API.G_EXC_UNEXPECTED_ERROR
3943: THEN
3944:
3945: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3946:
3947: FND_MSG_PUB.count_and_get
3948: ( p_count => x_msg_count ,
3949: p_data => x_msg_data );
3952: pa_debug.reset_curr_function;
3953: END IF;
3954:
3955: WHEN OTHERS THEN
3956: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3957: x_msg_count := 1;
3958: x_msg_data := SQLERRM;
3959:
3960: FND_MSG_PUB.add_exc_msg
4133: SAVEPOINT insert_budget_line_pvt;
4134:
4135: --Set API return status to success
4136:
4137: p_return_status := FND_API.G_RET_STS_SUCCESS;
4138:
4139: --get unit_of_measure and track_as_labor_flag associated to
4140: --the resource member and check whether this is a valid member for this list
4141: OPEN l_resource_csr( p_member_id
4157: ,p_attribute5 => to_char(p_budget_start_date));
4158: END IF;
4159:
4160: CLOSE l_resource_csr;
4161: p_return_status := FND_API.G_RET_STS_ERROR;
4162: RAISE FND_API.G_EXC_ERROR;
4163:
4164: ELSE
4165: CLOSE l_resource_csr;
4158: END IF;
4159:
4160: CLOSE l_resource_csr;
4161: p_return_status := FND_API.G_RET_STS_ERROR;
4162: RAISE FND_API.G_EXC_ERROR;
4163:
4164: ELSE
4165: CLOSE l_resource_csr;
4166:
4190: dbms_output.put_line('MSG count in the stack ' || FND_MSG_PUB.count_msg);
4191: dbms_output.put_line('added msg to stack');
4192: dbms_output.put_line('MSG count in the stack 2 ' || FND_MSG_PUB.count_msg);
4193: END IF;
4194: p_return_status := FND_API.G_RET_STS_ERROR;
4195: END IF;
4196: -- bug 3062294
4197:
4198: Bug 3218822 - PM_PRODUCT_CODE could be Null. We need valid it if it is NOT NULL
4564: ,x_msg_count => l_msg_count
4565: ,x_msg_data => l_msg_data
4566: ,x_return_status => l_return_status);
4567:
4568: IF(l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
4569: RAISE FND_API.G_EXC_ERROR;
4570: END IF;
4571:
4572: IF l_debug_mode = 'Y' THEN
4565: ,x_msg_data => l_msg_data
4566: ,x_return_status => l_return_status);
4567:
4568: IF(l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
4569: RAISE FND_API.G_EXC_ERROR;
4570: END IF;
4571:
4572: IF l_debug_mode = 'Y' THEN
4573: pa_debug.g_err_stage := 'Validate Budget Lines got executed successfully';
4661: END IF;
4662:
4663: END IF;
4664:
4665: RAISE FND_API.G_EXC_ERROR;
4666:
4667: ELSIF l_err_code < 0
4668: THEN
4669:
4681: ,p_attribute3 => p_budget_type_code
4682: ,p_attribute4 => ''
4683: ,p_attribute5 => to_char(p_budget_start_date));
4684: END IF;
4685: RAISE FND_API.G_EXC_ERROR;
4686: ELSE
4687:
4688: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
4689: THEN
4693: , p_procedure_name => 'CREATE_LINE'
4694: , p_error_text => 'ORA-'||LPAD(substr(l_err_code,2),5,'0') );
4695:
4696: END IF;
4697: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4698: END IF;
4699:
4700: END IF;
4701: END IF; --all zero's
4701: END IF; --all zero's
4702:
4703: EXCEPTION
4704:
4705: WHEN FND_API.G_EXC_ERROR
4706: THEN
4707:
4708: ROLLBACK TO insert_budget_line_pvt;
4709:
4706: THEN
4707:
4708: ROLLBACK TO insert_budget_line_pvt;
4709:
4710: p_return_status := FND_API.G_RET_STS_ERROR;
4711:
4712: WHEN FND_API.G_EXC_UNEXPECTED_ERROR
4713: THEN
4714:
4708: ROLLBACK TO insert_budget_line_pvt;
4709:
4710: p_return_status := FND_API.G_RET_STS_ERROR;
4711:
4712: WHEN FND_API.G_EXC_UNEXPECTED_ERROR
4713: THEN
4714:
4715: ROLLBACK TO insert_budget_line_pvt;
4716:
4713: THEN
4714:
4715: ROLLBACK TO insert_budget_line_pvt;
4716:
4717: p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4718:
4719: WHEN OTHERS THEN
4720:
4721: ROLLBACK TO insert_budget_line_pvt;
4719: WHEN OTHERS THEN
4720:
4721: ROLLBACK TO insert_budget_line_pvt;
4722:
4723: p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4724:
4725: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
4726: THEN
4727: FND_MSG_PUB.add_exc_msg
4754: -- 10-MAY-2005 Ritesh Shukla Bug 4224464- This procedure has been modified extensively
4755: -- during FP.M changes for AMG. If you do not want to update
4756: -- a parameter then either do not pass it or pass its value
4757: -- as NULL, and if you want to null out a parameter then
4758: -- pass it as FND_API.G_MISS_XXX
4759: -- 13-MAY-2005 Ritesh Shukla Bug 4224464-Removed parameter p_budget_amount_code from
4760: -- procedure update_budget_line_sql since it has become redundant.
4761:
4762: PROCEDURE update_budget_line_sql
4841: SAVEPOINT update_budget_line_sql_pvt;
4842:
4843: -- Set API return status to success
4844:
4845: p_return_status := FND_API.G_RET_STS_SUCCESS;
4846:
4847: --get the current values for this budget line
4848:
4849: OPEN l_budget_line_csr( p_resource_assignment_id, p_start_date );
4860: --dbms_output.put_line('p_description : '||p_description);
4861: --dbms_output.put_line('l_budget_line_rec.description: '||l_budget_line_rec.description);
4862:
4863: IF p_description IS NOT NULL
4864: AND p_description <> nvl(l_budget_line_rec.description,FND_API.G_MISS_CHAR)
4865: THEN
4866: l_statement := l_statement ||
4867: ' DESCRIPTION = :xDescription'||',';
4868: l_update_yes_flag := 'Y';
4871: --dbms_output.put_line('New Raw cost: '||nvl(to_char(p_raw_cost),'NULL'));
4872: --dbms_output.put_line('Old Raw cost: '||nvl(to_char(l_budget_line_rec.raw_cost),'NULL'));
4873:
4874: IF p_raw_cost IS NOT NULL
4875: AND p_raw_cost <> nvl(l_budget_line_rec.raw_cost,FND_API.G_MISS_NUM)
4876: THEN
4877: l_statement := l_statement ||
4878: ' RAW_COST = :xRawCost'||',';
4879:
4889: THEN
4890: /* Bug 2864086 - Added this check for p_raw_cost before updating burdened cost with the p_raw_cost */
4891:
4892: IF p_raw_cost IS NOT NULL
4893: AND p_raw_cost <> nvl(l_budget_line_rec.burdened_cost,FND_API.G_MISS_NUM)
4894: THEN
4895: l_statement := l_statement ||
4896: ' BURDENED_COST = :xRawCostForB'||',';
4897:
4899: END If;
4900: ELSE
4901:
4902: IF p_burdened_cost IS NOT NULL
4903: AND p_burdened_cost <> nvl(l_budget_line_rec.burdened_cost,FND_API.G_MISS_NUM)
4904: THEN
4905: l_statement := l_statement ||
4906: ' BURDENED_COST = :xBurdenedCost'||',';
4907:
4909: END IF;
4910: END IF;--l_burdened_cost_flag = 'N'
4911:
4912: IF p_revenue IS NOT NULL
4913: AND p_revenue <> nvl(l_budget_line_rec.revenue,FND_API.G_MISS_NUM)
4914: THEN
4915: l_statement := l_statement ||
4916: ' REVENUE = :xRevenue'||',';
4917:
4918: l_update_yes_flag := 'Y';
4919: END IF;
4920:
4921: IF p_quantity IS NOT NULL
4922: AND p_quantity <> nvl(l_budget_line_rec.quantity,FND_API.G_MISS_NUM)
4923: THEN
4924: l_statement := l_statement ||
4925: ' QUANTITY = :xQuantity'||',';
4926:
4927: l_update_yes_flag := 'Y';
4928: END IF;
4929:
4930: IF p_change_reason_code IS NOT NULL
4931: AND p_change_reason_code <> nvl(l_budget_line_rec.change_reason_code,FND_API.G_MISS_CHAR)
4932: THEN
4933: l_statement := l_statement ||
4934: ' CHANGE_REASON_CODE = :xChangeReasonCode'||',';
4935: l_update_yes_flag := 'Y';
4935: l_update_yes_flag := 'Y';
4936: END IF;
4937:
4938: IF p_attribute_category IS NOT NULL
4939: AND p_attribute_category <> nvl(l_budget_line_rec.attribute_category,FND_API.G_MISS_CHAR)
4940: THEN
4941: l_statement := l_statement ||
4942: ' ATTRIBUTE_CATEGORY = :xAttributeCategory'||',';
4943: l_update_yes_flag := 'Y';
4943: l_update_yes_flag := 'Y';
4944: END IF;
4945:
4946: IF p_attribute1 IS NOT NULL
4947: AND p_attribute1 <> nvl(l_budget_line_rec.attribute1,FND_API.G_MISS_CHAR)
4948: THEN
4949: l_statement := l_statement ||
4950: ' ATTRIBUTE1 = :xAttribute1'||',';
4951: l_update_yes_flag := 'Y';
4951: l_update_yes_flag := 'Y';
4952: END IF;
4953:
4954: IF p_attribute2 IS NOT NULL
4955: AND p_attribute2 <> nvl(l_budget_line_rec.attribute2,FND_API.G_MISS_CHAR)
4956: THEN
4957: l_statement := l_statement ||
4958: ' ATTRIBUTE2 = :xAttribute2'||',';
4959: l_update_yes_flag := 'Y';
4959: l_update_yes_flag := 'Y';
4960: END IF;
4961:
4962: IF p_attribute3 IS NOT NULL
4963: AND p_attribute3 <> nvl(l_budget_line_rec.attribute3,FND_API.G_MISS_CHAR)
4964: THEN
4965: l_statement := l_statement ||
4966: ' ATTRIBUTE3 = :xAttribute3'||',';
4967: l_update_yes_flag := 'Y';
4967: l_update_yes_flag := 'Y';
4968: END IF;
4969:
4970: IF p_attribute4 IS NOT NULL
4971: AND p_attribute4 <> nvl(l_budget_line_rec.attribute4,FND_API.G_MISS_CHAR)
4972: THEN
4973: l_statement := l_statement ||
4974: ' ATTRIBUTE4 = :xAttribute4'||',';
4975: l_update_yes_flag := 'Y';
4975: l_update_yes_flag := 'Y';
4976: END IF;
4977:
4978: IF p_attribute5 IS NOT NULL
4979: AND p_attribute5 <> nvl(l_budget_line_rec.attribute5,FND_API.G_MISS_CHAR)
4980: THEN
4981: l_statement := l_statement ||
4982: ' ATTRIBUTE5 = :xAttribute5'||',';
4983: l_update_yes_flag := 'Y';
4983: l_update_yes_flag := 'Y';
4984: END IF;
4985:
4986: IF p_attribute6 IS NOT NULL
4987: AND p_attribute6 <> nvl(l_budget_line_rec.attribute6,FND_API.G_MISS_CHAR)
4988: THEN
4989: l_statement := l_statement ||
4990: ' ATTRIBUTE6 = :xAttribute6'||',';
4991: l_update_yes_flag := 'Y';
4991: l_update_yes_flag := 'Y';
4992: END IF;
4993:
4994: IF p_attribute7 IS NOT NULL
4995: AND p_attribute7 <> nvl(l_budget_line_rec.attribute7,FND_API.G_MISS_CHAR)
4996: THEN
4997: l_statement := l_statement ||
4998: ' ATTRIBUTE7 = :xAttribute7'||',';
4999: l_update_yes_flag := 'Y';
4999: l_update_yes_flag := 'Y';
5000: END IF;
5001:
5002: IF p_attribute8 IS NOT NULL
5003: AND p_attribute8 <> nvl(l_budget_line_rec.attribute8,FND_API.G_MISS_CHAR)
5004: THEN
5005: l_statement := l_statement ||
5006: ' ATTRIBUTE8 = :xAttribute8'||',';
5007: l_update_yes_flag := 'Y';
5007: l_update_yes_flag := 'Y';
5008: END IF;
5009:
5010: IF p_attribute9 IS NOT NULL
5011: AND p_attribute9 <> nvl(l_budget_line_rec.attribute9,FND_API.G_MISS_CHAR)
5012: THEN
5013: l_statement := l_statement ||
5014: ' ATTRIBUTE9 = :xAttribute9'||',';
5015: l_update_yes_flag := 'Y';
5015: l_update_yes_flag := 'Y';
5016: END IF;
5017:
5018: IF p_attribute10 IS NOT NULL
5019: AND p_attribute10 <> nvl(l_budget_line_rec.attribute10,FND_API.G_MISS_CHAR)
5020: THEN
5021: l_statement := l_statement ||
5022: ' ATTRIBUTE10 = :xAttribute10'||',';
5023: l_update_yes_flag := 'Y';
5023: l_update_yes_flag := 'Y';
5024: END IF;
5025:
5026: IF p_attribute11 IS NOT NULL
5027: AND p_attribute11 <> nvl(l_budget_line_rec.attribute11,FND_API.G_MISS_CHAR)
5028: THEN
5029: l_statement := l_statement ||
5030: ' ATTRIBUTE11 = :xAttribute11'||',';
5031: l_update_yes_flag := 'Y';
5031: l_update_yes_flag := 'Y';
5032: END IF;
5033:
5034: IF p_attribute12 IS NOT NULL
5035: AND p_attribute12 <> nvl(l_budget_line_rec.attribute12,FND_API.G_MISS_CHAR)
5036: THEN
5037: l_statement := l_statement ||
5038: ' ATTRIBUTE12 = :xAttribute12'||',';
5039: l_update_yes_flag := 'Y';
5039: l_update_yes_flag := 'Y';
5040: END IF;
5041:
5042: IF p_attribute13 IS NOT NULL
5043: AND p_attribute13 <> nvl(l_budget_line_rec.attribute13,FND_API.G_MISS_CHAR)
5044: THEN
5045: l_statement := l_statement ||
5046: ' ATTRIBUTE13 = :xAttribute13'||',';
5047: l_update_yes_flag := 'Y';
5047: l_update_yes_flag := 'Y';
5048: END IF;
5049:
5050: IF p_attribute14 IS NOT NULL
5051: AND p_attribute14 <> nvl(l_budget_line_rec.attribute14,FND_API.G_MISS_CHAR)
5052: THEN
5053: l_statement := l_statement ||
5054: ' ATTRIBUTE14 = :xAttribute14'||',';
5055: l_update_yes_flag := 'Y';
5055: l_update_yes_flag := 'Y';
5056: END IF;
5057:
5058: IF p_attribute15 IS NOT NULL
5059: AND p_attribute15 <> nvl(l_budget_line_rec.attribute15,FND_API.G_MISS_CHAR)
5060: THEN
5061: l_statement := l_statement ||
5062: ' ATTRIBUTE15 = :xAttribute15'||',';
5063: l_update_yes_flag := 'Y';
5113: l_cursor_id := DBMS_SQL.open_cursor;
5114: DBMS_SQL.parse(l_cursor_id, l_statement, DBMS_SQL.native);
5115:
5116: IF p_description IS NOT NULL
5117: AND p_description <> nvl(l_budget_line_rec.description,FND_API.G_MISS_CHAR)
5118: THEN
5119: IF p_description = FND_API.G_MISS_CHAR THEN
5120: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xDescription', TO_CHAR(NULL));
5121: ELSE
5115:
5116: IF p_description IS NOT NULL
5117: AND p_description <> nvl(l_budget_line_rec.description,FND_API.G_MISS_CHAR)
5118: THEN
5119: IF p_description = FND_API.G_MISS_CHAR THEN
5120: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xDescription', TO_CHAR(NULL));
5121: ELSE
5122: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xDescription', p_description);
5123: END IF;
5123: END IF;
5124: END IF;
5125:
5126: IF p_raw_cost IS NOT NULL
5127: AND p_raw_cost <> nvl(l_budget_line_rec.raw_cost,FND_API.G_MISS_NUM)
5128: THEN
5129: IF p_raw_cost = FND_API.G_MISS_NUM THEN
5130: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xRawCost', TO_NUMBER(NULL));
5131: ELSE
5125:
5126: IF p_raw_cost IS NOT NULL
5127: AND p_raw_cost <> nvl(l_budget_line_rec.raw_cost,FND_API.G_MISS_NUM)
5128: THEN
5129: IF p_raw_cost = FND_API.G_MISS_NUM THEN
5130: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xRawCost', TO_NUMBER(NULL));
5131: ELSE
5132: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xRawCost', p_raw_cost);
5133: END IF;
5136: IF l_burdened_cost_flag = 'N' -- added for burden_distributed_cost ='N'
5137: THEN
5138:
5139: IF p_raw_cost IS NOT NULL
5140: AND p_raw_cost <> nvl(l_budget_line_rec.burdened_cost,FND_API.G_MISS_NUM)
5141: THEN
5142: IF p_raw_cost = FND_API.G_MISS_NUM THEN
5143: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xRawCostForB', TO_NUMBER(NULL));
5144: ELSE
5138:
5139: IF p_raw_cost IS NOT NULL
5140: AND p_raw_cost <> nvl(l_budget_line_rec.burdened_cost,FND_API.G_MISS_NUM)
5141: THEN
5142: IF p_raw_cost = FND_API.G_MISS_NUM THEN
5143: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xRawCostForB', TO_NUMBER(NULL));
5144: ELSE
5145: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xRawCostForB', p_raw_cost);
5146: END IF;
5148:
5149: ELSE
5150:
5151: IF p_burdened_cost IS NOT NULL
5152: AND p_burdened_cost <> nvl(l_budget_line_rec.burdened_cost,FND_API.G_MISS_NUM)
5153: THEN
5154: IF p_burdened_cost = FND_API.G_MISS_NUM THEN
5155: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xBurdenedCost', TO_NUMBER(NULL));
5156: ELSE
5150:
5151: IF p_burdened_cost IS NOT NULL
5152: AND p_burdened_cost <> nvl(l_budget_line_rec.burdened_cost,FND_API.G_MISS_NUM)
5153: THEN
5154: IF p_burdened_cost = FND_API.G_MISS_NUM THEN
5155: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xBurdenedCost', TO_NUMBER(NULL));
5156: ELSE
5157: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xBurdenedCost', p_burdened_cost);
5158: END IF;
5160:
5161: END IF;--l_burdened_cost_flag = 'N'
5162:
5163: IF p_revenue IS NOT NULL
5164: AND p_revenue <> nvl(l_budget_line_rec.revenue,FND_API.G_MISS_NUM)
5165: THEN
5166: IF p_revenue = FND_API.G_MISS_NUM THEN
5167: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xRevenue',TO_NUMBER(NULL));
5168: ELSE
5162:
5163: IF p_revenue IS NOT NULL
5164: AND p_revenue <> nvl(l_budget_line_rec.revenue,FND_API.G_MISS_NUM)
5165: THEN
5166: IF p_revenue = FND_API.G_MISS_NUM THEN
5167: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xRevenue',TO_NUMBER(NULL));
5168: ELSE
5169: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xRevenue',p_revenue);
5170: END IF;
5170: END IF;
5171: END IF;
5172:
5173: IF p_quantity IS NOT NULL
5174: AND p_quantity <> nvl(l_budget_line_rec.quantity,FND_API.G_MISS_NUM)
5175: THEN
5176: IF p_quantity = FND_API.G_MISS_NUM THEN
5177: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xQuantity',TO_NUMBER(NULL));
5178: ELSE
5172:
5173: IF p_quantity IS NOT NULL
5174: AND p_quantity <> nvl(l_budget_line_rec.quantity,FND_API.G_MISS_NUM)
5175: THEN
5176: IF p_quantity = FND_API.G_MISS_NUM THEN
5177: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xQuantity',TO_NUMBER(NULL));
5178: ELSE
5179: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xQuantity',p_quantity);
5180: END IF;
5180: END IF;
5181: END IF;
5182:
5183: IF p_change_reason_code IS NOT NULL
5184: AND p_change_reason_code <> nvl(l_budget_line_rec.change_reason_code,FND_API.G_MISS_CHAR)
5185: THEN
5186: IF p_change_reason_code = FND_API.G_MISS_CHAR THEN
5187: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xChangeReasonCode', TO_CHAR(NULL));
5188: ELSE
5182:
5183: IF p_change_reason_code IS NOT NULL
5184: AND p_change_reason_code <> nvl(l_budget_line_rec.change_reason_code,FND_API.G_MISS_CHAR)
5185: THEN
5186: IF p_change_reason_code = FND_API.G_MISS_CHAR THEN
5187: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xChangeReasonCode', TO_CHAR(NULL));
5188: ELSE
5189: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xChangeReasonCode', p_change_reason_code);
5190: END IF;
5190: END IF;
5191: END IF;
5192:
5193: IF p_attribute_category IS NOT NULL
5194: AND p_attribute_category <> nvl(l_budget_line_rec.attribute_category,FND_API.G_MISS_CHAR)
5195: THEN
5196: IF p_attribute_category = FND_API.G_MISS_CHAR THEN
5197: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttributeCategory', TO_CHAR(NULL));
5198: ELSE
5192:
5193: IF p_attribute_category IS NOT NULL
5194: AND p_attribute_category <> nvl(l_budget_line_rec.attribute_category,FND_API.G_MISS_CHAR)
5195: THEN
5196: IF p_attribute_category = FND_API.G_MISS_CHAR THEN
5197: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttributeCategory', TO_CHAR(NULL));
5198: ELSE
5199: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttributeCategory', p_attribute_category);
5200: END IF;
5200: END IF;
5201: END IF;
5202:
5203: IF p_attribute1 IS NOT NULL
5204: AND p_attribute1 <> nvl(l_budget_line_rec.attribute1,FND_API.G_MISS_CHAR)
5205: THEN
5206: IF p_attribute1 = FND_API.G_MISS_CHAR THEN
5207: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute1', TO_CHAR(NULL));
5208: ELSE
5202:
5203: IF p_attribute1 IS NOT NULL
5204: AND p_attribute1 <> nvl(l_budget_line_rec.attribute1,FND_API.G_MISS_CHAR)
5205: THEN
5206: IF p_attribute1 = FND_API.G_MISS_CHAR THEN
5207: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute1', TO_CHAR(NULL));
5208: ELSE
5209: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute1', p_attribute1);
5210: END IF;
5210: END IF;
5211: END IF;
5212:
5213: IF p_attribute2 IS NOT NULL
5214: AND p_attribute2 <> nvl(l_budget_line_rec.attribute2,FND_API.G_MISS_CHAR)
5215: THEN
5216: IF p_attribute2 = FND_API.G_MISS_CHAR THEN
5217: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute2', TO_CHAR(NULL));
5218: ELSE
5212:
5213: IF p_attribute2 IS NOT NULL
5214: AND p_attribute2 <> nvl(l_budget_line_rec.attribute2,FND_API.G_MISS_CHAR)
5215: THEN
5216: IF p_attribute2 = FND_API.G_MISS_CHAR THEN
5217: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute2', TO_CHAR(NULL));
5218: ELSE
5219: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute2', p_attribute2);
5220: END IF;
5220: END IF;
5221: END IF;
5222:
5223: IF p_attribute3 IS NOT NULL
5224: AND p_attribute3 <> nvl(l_budget_line_rec.attribute3,FND_API.G_MISS_CHAR)
5225: THEN
5226: IF p_attribute3 = FND_API.G_MISS_CHAR THEN
5227: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute3', TO_CHAR(NULL));
5228: ELSE
5222:
5223: IF p_attribute3 IS NOT NULL
5224: AND p_attribute3 <> nvl(l_budget_line_rec.attribute3,FND_API.G_MISS_CHAR)
5225: THEN
5226: IF p_attribute3 = FND_API.G_MISS_CHAR THEN
5227: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute3', TO_CHAR(NULL));
5228: ELSE
5229: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute3', p_attribute3);
5230: END IF;
5230: END IF;
5231: END IF;
5232:
5233: IF p_attribute4 IS NOT NULL
5234: AND p_attribute4 <> nvl(l_budget_line_rec.attribute4,FND_API.G_MISS_CHAR)
5235: THEN
5236: IF p_attribute4 = FND_API.G_MISS_CHAR THEN
5237: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute4', TO_CHAR(NULL));
5238: ELSE
5232:
5233: IF p_attribute4 IS NOT NULL
5234: AND p_attribute4 <> nvl(l_budget_line_rec.attribute4,FND_API.G_MISS_CHAR)
5235: THEN
5236: IF p_attribute4 = FND_API.G_MISS_CHAR THEN
5237: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute4', TO_CHAR(NULL));
5238: ELSE
5239: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute4', p_attribute4);
5240: END IF;
5240: END IF;
5241: END IF;
5242:
5243: IF p_attribute5 IS NOT NULL
5244: AND p_attribute5 <> nvl(l_budget_line_rec.attribute5,FND_API.G_MISS_CHAR)
5245: THEN
5246: IF p_attribute5 = FND_API.G_MISS_CHAR THEN
5247: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute5', TO_CHAR(NULL));
5248: ELSE
5242:
5243: IF p_attribute5 IS NOT NULL
5244: AND p_attribute5 <> nvl(l_budget_line_rec.attribute5,FND_API.G_MISS_CHAR)
5245: THEN
5246: IF p_attribute5 = FND_API.G_MISS_CHAR THEN
5247: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute5', TO_CHAR(NULL));
5248: ELSE
5249: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute5', p_attribute5);
5250: END IF;
5250: END IF;
5251: END IF;
5252:
5253: IF p_attribute6 IS NOT NULL
5254: AND p_attribute6 <> nvl(l_budget_line_rec.attribute6,FND_API.G_MISS_CHAR)
5255: THEN
5256: IF p_attribute6 = FND_API.G_MISS_CHAR THEN
5257: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute6', TO_CHAR(NULL));
5258: ELSE
5252:
5253: IF p_attribute6 IS NOT NULL
5254: AND p_attribute6 <> nvl(l_budget_line_rec.attribute6,FND_API.G_MISS_CHAR)
5255: THEN
5256: IF p_attribute6 = FND_API.G_MISS_CHAR THEN
5257: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute6', TO_CHAR(NULL));
5258: ELSE
5259: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute6', p_attribute6);
5260: END IF;
5260: END IF;
5261: END IF;
5262:
5263: IF p_attribute7 IS NOT NULL
5264: AND p_attribute7 <> nvl(l_budget_line_rec.attribute7,FND_API.G_MISS_CHAR)
5265: THEN
5266: IF p_attribute7 = FND_API.G_MISS_CHAR THEN
5267: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute7', TO_CHAR(NULL));
5268: ELSE
5262:
5263: IF p_attribute7 IS NOT NULL
5264: AND p_attribute7 <> nvl(l_budget_line_rec.attribute7,FND_API.G_MISS_CHAR)
5265: THEN
5266: IF p_attribute7 = FND_API.G_MISS_CHAR THEN
5267: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute7', TO_CHAR(NULL));
5268: ELSE
5269: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute7', p_attribute7);
5270: END IF;
5270: END IF;
5271: END IF;
5272:
5273: IF p_attribute8 IS NOT NULL
5274: AND p_attribute8 <> nvl(l_budget_line_rec.attribute8,FND_API.G_MISS_CHAR)
5275: THEN
5276: IF p_attribute8 = FND_API.G_MISS_CHAR THEN
5277: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute8', TO_CHAR(NULL));
5278: ELSE
5272:
5273: IF p_attribute8 IS NOT NULL
5274: AND p_attribute8 <> nvl(l_budget_line_rec.attribute8,FND_API.G_MISS_CHAR)
5275: THEN
5276: IF p_attribute8 = FND_API.G_MISS_CHAR THEN
5277: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute8', TO_CHAR(NULL));
5278: ELSE
5279: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute8', p_attribute8);
5280: END IF;
5280: END IF;
5281: END IF;
5282:
5283: IF p_attribute9 IS NOT NULL
5284: AND p_attribute9 <> nvl(l_budget_line_rec.attribute9,FND_API.G_MISS_CHAR)
5285: THEN
5286: IF p_attribute9 = FND_API.G_MISS_CHAR THEN
5287: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute9', TO_CHAR(NULL));
5288: ELSE
5282:
5283: IF p_attribute9 IS NOT NULL
5284: AND p_attribute9 <> nvl(l_budget_line_rec.attribute9,FND_API.G_MISS_CHAR)
5285: THEN
5286: IF p_attribute9 = FND_API.G_MISS_CHAR THEN
5287: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute9', TO_CHAR(NULL));
5288: ELSE
5289: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute9', p_attribute9);
5290: END IF;
5290: END IF;
5291: END IF;
5292:
5293: IF p_attribute10 IS NOT NULL
5294: AND p_attribute10 <> nvl(l_budget_line_rec.attribute10,FND_API.G_MISS_CHAR)
5295: THEN
5296: IF p_attribute10 = FND_API.G_MISS_CHAR THEN
5297: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute10', TO_CHAR(NULL));
5298: ELSE
5292:
5293: IF p_attribute10 IS NOT NULL
5294: AND p_attribute10 <> nvl(l_budget_line_rec.attribute10,FND_API.G_MISS_CHAR)
5295: THEN
5296: IF p_attribute10 = FND_API.G_MISS_CHAR THEN
5297: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute10', TO_CHAR(NULL));
5298: ELSE
5299: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute10', p_attribute10);
5300: END IF;
5300: END IF;
5301: END IF;
5302:
5303: IF p_attribute11 IS NOT NULL
5304: AND p_attribute11 <> nvl(l_budget_line_rec.attribute11,FND_API.G_MISS_CHAR)
5305: THEN
5306: IF p_attribute11 = FND_API.G_MISS_CHAR THEN
5307: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute11', TO_CHAR(NULL));
5308: ELSE
5302:
5303: IF p_attribute11 IS NOT NULL
5304: AND p_attribute11 <> nvl(l_budget_line_rec.attribute11,FND_API.G_MISS_CHAR)
5305: THEN
5306: IF p_attribute11 = FND_API.G_MISS_CHAR THEN
5307: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute11', TO_CHAR(NULL));
5308: ELSE
5309: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute11', p_attribute11);
5310: END IF;
5310: END IF;
5311: END IF;
5312:
5313: IF p_attribute12 IS NOT NULL
5314: AND p_attribute12 <> nvl(l_budget_line_rec.attribute12,FND_API.G_MISS_CHAR)
5315: THEN
5316: IF p_attribute12 = FND_API.G_MISS_CHAR THEN
5317: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute12', TO_CHAR(NULL));
5318: ELSE
5312:
5313: IF p_attribute12 IS NOT NULL
5314: AND p_attribute12 <> nvl(l_budget_line_rec.attribute12,FND_API.G_MISS_CHAR)
5315: THEN
5316: IF p_attribute12 = FND_API.G_MISS_CHAR THEN
5317: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute12', TO_CHAR(NULL));
5318: ELSE
5319: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute12', p_attribute12);
5320: END IF;
5320: END IF;
5321: END IF;
5322:
5323: IF p_attribute13 IS NOT NULL
5324: AND p_attribute13 <> nvl(l_budget_line_rec.attribute13,FND_API.G_MISS_CHAR)
5325: THEN
5326: IF p_attribute13 = FND_API.G_MISS_CHAR THEN
5327: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute13', TO_CHAR(NULL));
5328: ELSE
5322:
5323: IF p_attribute13 IS NOT NULL
5324: AND p_attribute13 <> nvl(l_budget_line_rec.attribute13,FND_API.G_MISS_CHAR)
5325: THEN
5326: IF p_attribute13 = FND_API.G_MISS_CHAR THEN
5327: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute13', TO_CHAR(NULL));
5328: ELSE
5329: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute13', p_attribute13);
5330: END IF;
5330: END IF;
5331: END IF;
5332:
5333: IF p_attribute14 IS NOT NULL
5334: AND p_attribute14 <> nvl(l_budget_line_rec.attribute14,FND_API.G_MISS_CHAR)
5335: THEN
5336: IF p_attribute14 = FND_API.G_MISS_CHAR THEN
5337: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute14', TO_CHAR(NULL));
5338: ELSE
5332:
5333: IF p_attribute14 IS NOT NULL
5334: AND p_attribute14 <> nvl(l_budget_line_rec.attribute14,FND_API.G_MISS_CHAR)
5335: THEN
5336: IF p_attribute14 = FND_API.G_MISS_CHAR THEN
5337: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute14', TO_CHAR(NULL));
5338: ELSE
5339: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute14', p_attribute14);
5340: END IF;
5340: END IF;
5341: END IF;
5342:
5343: IF p_attribute15 IS NOT NULL
5344: AND p_attribute15 <> nvl(l_budget_line_rec.attribute15,FND_API.G_MISS_CHAR)
5345: THEN
5346: IF p_attribute15 = FND_API.G_MISS_CHAR THEN
5347: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute15', TO_CHAR(NULL));
5348: ELSE
5342:
5343: IF p_attribute15 IS NOT NULL
5344: AND p_attribute15 <> nvl(l_budget_line_rec.attribute15,FND_API.G_MISS_CHAR)
5345: THEN
5346: IF p_attribute15 = FND_API.G_MISS_CHAR THEN
5347: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute15', TO_CHAR(NULL));
5348: ELSE
5349: DBMS_SQL.BIND_VARIABLE(l_cursor_id, ':xAttribute15', p_attribute15);
5350: END IF;
5401: x_msg_count => l_msg_count,
5402: x_msg_data => l_msg_data);
5403: END IF;
5404:
5405: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5406: RAISE g_mrc_exception;
5407: END IF;
5408:
5409: END IF;--nvl(l_rows,0) > 0
5465: x_msg_count => l_msg_count,
5466: x_msg_data => l_msg_data);
5467: END IF;
5468:
5469: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5470: RAISE g_mrc_exception;
5471: END IF;
5472: END IF; --nvl(l_rows,0) > 0
5473: */
5482: ( p_pkg_name => 'PA_BUDGET_LINES_V_PKG'
5483: , p_procedure_name => 'DELETE_ROW'
5484: , p_error_text => SQLCODE );
5485: END IF;
5486: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5487: END;
5488:
5489: END IF;
5490: END IF; --time phased by PA or GL period
5491: END IF;--l_update_yes_flag = 'Y'
5492:
5493: EXCEPTION
5494:
5495: WHEN FND_API.G_EXC_ERROR
5496: THEN
5497:
5498: ROLLBACK TO update_budget_line_sql_pvt;
5499:
5496: THEN
5497:
5498: ROLLBACK TO update_budget_line_sql_pvt;
5499:
5500: p_return_status := FND_API.G_RET_STS_ERROR;
5501:
5502: WHEN FND_API.G_EXC_UNEXPECTED_ERROR
5503: THEN
5504:
5498: ROLLBACK TO update_budget_line_sql_pvt;
5499:
5500: p_return_status := FND_API.G_RET_STS_ERROR;
5501:
5502: WHEN FND_API.G_EXC_UNEXPECTED_ERROR
5503: THEN
5504:
5505: ROLLBACK TO update_budget_line_sql_pvt;
5506:
5503: THEN
5504:
5505: ROLLBACK TO update_budget_line_sql_pvt;
5506:
5507: p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5508:
5509: WHEN OTHERS THEN
5510:
5511: ROLLBACK TO update_budget_line_sql_pvt;
5509: WHEN OTHERS THEN
5510:
5511: ROLLBACK TO update_budget_line_sql_pvt;
5512:
5513: p_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5514:
5515: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
5516: THEN
5517: FND_MSG_PUB.add_exc_msg
6018:
6019:
6020: BEGIN
6021: x_msg_count :=0;
6022: x_return_status := FND_API.G_RET_STS_SUCCESS;
6023: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
6024: l_module_name := 'Validate_Budget_Lines: ' || g_module_name;
6025:
6026: IF l_debug_mode = 'Y' THEN
6227:
6228: END IF; -- Bug 5509192
6229:
6230: --Set API return status to success
6231: x_return_status := FND_API.G_RET_STS_SUCCESS;
6232:
6233: -- Get segment1 for AMG messages
6234: OPEN l_amg_project_csr( p_pa_project_id );
6235: FETCH l_amg_project_csr INTO l_amg_project_rec;
6333: ,x_return_status => x_return_status
6334: ,x_msg_count => x_msg_count
6335: ,x_msg_data => x_msg_data);
6336:
6337: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
6338:
6339: IF l_debug_mode = 'Y' THEN
6340: pa_debug.g_err_stage:= 'pa_fin_plan_utils.Get_Project_Curr_Attributes errored out for project' ||p_pa_project_id;
6341: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
6377: IF px_budget_lines_in.exists(px_budget_lines_in.first) THEN
6378: --Loop thru the pl/sql table and validate each budget line
6379: FOR i IN px_budget_lines_in.first..px_budget_lines_in.last LOOP
6380: /* Bug 3133930 */
6381: x_budget_lines_out(i).return_status := FND_API.G_RET_STS_SUCCESS;
6382: --Initialise all the global variables to null
6383: pa_budget_pvt.g_Task_number := NULL;
6384: pa_budget_pvt.g_start_date := NULL;
6385: pa_budget_pvt.g_resource_alias := NULL;
6413: IF l_debug_mode = 'Y' THEN
6414: pa_debug.g_err_stage:= 'PM Product code is invalid';
6415: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
6416: END IF;
6417: x_return_status := FND_API.G_RET_STS_ERROR;
6418: x_budget_lines_out(i).return_status := FND_API.G_RET_STS_ERROR;
6419: l_any_error_occurred_flag:='Y';
6420: END IF;
6421:
6414: pa_debug.g_err_stage:= 'PM Product code is invalid';
6415: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
6416: END IF;
6417: x_return_status := FND_API.G_RET_STS_ERROR;
6418: x_budget_lines_out(i).return_status := FND_API.G_RET_STS_ERROR;
6419: l_any_error_occurred_flag:='Y';
6420: END IF;
6421:
6422: END IF;
6490: pa_debug.g_err_stage:= 'Converted Task Id is ' || px_budget_lines_in(i).pa_task_id;
6491: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
6492: END IF;
6493:
6494: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
6495: /* Bug 3133930- set the return status to the new output variable */
6496: x_budget_lines_out(i).return_status := x_return_status;
6497:
6498: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6494: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
6495: /* Bug 3133930- set the return status to the new output variable */
6496: x_budget_lines_out(i).return_status := x_return_status;
6497:
6498: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6499: ELSIF x_return_status = FND_API.G_RET_STS_ERROR THEN
6500: -- exception is raised here because we cannot go ahead and do further validations
6501: -- as other validations depend upon task id to be correct.
6502: --RAISE FND_API.G_EXC_ERROR; AMG UT2
6495: /* Bug 3133930- set the return status to the new output variable */
6496: x_budget_lines_out(i).return_status := x_return_status;
6497:
6498: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6499: ELSIF x_return_status = FND_API.G_RET_STS_ERROR THEN
6500: -- exception is raised here because we cannot go ahead and do further validations
6501: -- as other validations depend upon task id to be correct.
6502: --RAISE FND_API.G_EXC_ERROR; AMG UT2
6503: x_budget_lines_out(i).return_status := x_return_status;
6498: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6499: ELSIF x_return_status = FND_API.G_RET_STS_ERROR THEN
6500: -- exception is raised here because we cannot go ahead and do further validations
6501: -- as other validations depend upon task id to be correct.
6502: --RAISE FND_API.G_EXC_ERROR; AMG UT2
6503: x_budget_lines_out(i).return_status := x_return_status;
6504: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
6505: --Changed the elsif below for bug#4488926.
6506: ELSIF (px_budget_lines_in(i).pa_task_id IS NOT NULL) THEN /*if the API above executes successfully
6575: ,p_attribute3 => ''
6576: ,p_attribute4 => ''
6577: ,p_attribute5 => '');
6578: END IF;
6579: -- RAISE FND_API.G_EXC_ERROR;
6580: x_return_status := FND_API.G_RET_STS_ERROR;
6581: /* Bug 3133930- set the return status to the new output variable */
6582: x_budget_lines_out(i).return_status := FND_API.G_RET_STS_ERROR;
6583:
6576: ,p_attribute4 => ''
6577: ,p_attribute5 => '');
6578: END IF;
6579: -- RAISE FND_API.G_EXC_ERROR;
6580: x_return_status := FND_API.G_RET_STS_ERROR;
6581: /* Bug 3133930- set the return status to the new output variable */
6582: x_budget_lines_out(i).return_status := FND_API.G_RET_STS_ERROR;
6583:
6584: l_any_error_occurred_flag:='Y';
6578: END IF;
6579: -- RAISE FND_API.G_EXC_ERROR;
6580: x_return_status := FND_API.G_RET_STS_ERROR;
6581: /* Bug 3133930- set the return status to the new output variable */
6582: x_budget_lines_out(i).return_status := FND_API.G_RET_STS_ERROR;
6583:
6584: l_any_error_occurred_flag:='Y';
6585: END IF;
6586: ELSIF p_entry_level_code = 'L' -- then check whether it is lowest task
6600: ,p_attribute3 => ''
6601: ,p_attribute4 => ''
6602: ,p_attribute5 => '');
6603: END IF;
6604: --RAISE FND_API.G_EXC_ERROR;
6605: x_return_status := FND_API.G_RET_STS_ERROR;
6606: /* Bug 3133930- set the return status to the new output variable */
6607: x_budget_lines_out(i).return_status := x_return_status;
6608:
6601: ,p_attribute4 => ''
6602: ,p_attribute5 => '');
6603: END IF;
6604: --RAISE FND_API.G_EXC_ERROR;
6605: x_return_status := FND_API.G_RET_STS_ERROR;
6606: /* Bug 3133930- set the return status to the new output variable */
6607: x_budget_lines_out(i).return_status := x_return_status;
6608:
6609: l_any_error_occurred_flag:='Y';
6638: ,p_attribute3 => ''
6639: ,p_attribute4 => ''
6640: ,p_attribute5 => '');
6641: END IF;
6642: --RAISE FND_API.G_EXC_ERROR;
6643: x_return_status := FND_API.G_RET_STS_ERROR;
6644: /* Bug 3133930- set the return status to the new output variable */
6645: x_budget_lines_out(i).return_status := x_return_status;
6646:
6639: ,p_attribute4 => ''
6640: ,p_attribute5 => '');
6641: END IF;
6642: --RAISE FND_API.G_EXC_ERROR;
6643: x_return_status := FND_API.G_RET_STS_ERROR;
6644: /* Bug 3133930- set the return status to the new output variable */
6645: x_budget_lines_out(i).return_status := x_return_status;
6646:
6647: l_any_error_occurred_flag:='Y';
6684: p_token2 => 'TASK',
6685: p_value2 => l_amg_top_task_number);
6686:
6687:
6688: x_return_status := FND_API.G_RET_STS_ERROR;
6689: /* Bug 3133930- set the return status to the new output variable */
6690: x_budget_lines_out(i).return_status := x_return_status;
6691:
6692: l_any_error_occurred_flag := 'Y';
6732: ,p_attribute3 => ''
6733: ,p_attribute4 => ''
6734: ,p_attribute5 => '');
6735: END IF;
6736: -- RAISE FND_API.G_EXC_ERROR;
6737: x_return_status := FND_API.G_RET_STS_ERROR;
6738: /* Bug 3133930- set the return status to the new output variable */
6739: x_budget_lines_out(i).return_status := FND_API.G_RET_STS_ERROR;
6740: END IF;
6733: ,p_attribute4 => ''
6734: ,p_attribute5 => '');
6735: END IF;
6736: -- RAISE FND_API.G_EXC_ERROR;
6737: x_return_status := FND_API.G_RET_STS_ERROR;
6738: /* Bug 3133930- set the return status to the new output variable */
6739: x_budget_lines_out(i).return_status := FND_API.G_RET_STS_ERROR;
6740: END IF;
6741: l_any_error_occurred_flag:='Y';
6735: END IF;
6736: -- RAISE FND_API.G_EXC_ERROR;
6737: x_return_status := FND_API.G_RET_STS_ERROR;
6738: /* Bug 3133930- set the return status to the new output variable */
6739: x_budget_lines_out(i).return_status := FND_API.G_RET_STS_ERROR;
6740: END IF;
6741: l_any_error_occurred_flag:='Y';
6742: END IF;
6743:
6757: IF ( p_calling_context not in ('RES_ASSGNMT_LEVEL_VALIDATION','UPDATE_PLANNING_ELEMENT_ATTR') )
6758: THEN
6759: IF p_calling_context = 'WEBADI' THEN -- Bug 3986129: FP.M Web ADI Dev changes
6760: -- checking if the planning start date/end date has been explcitely nulled ou
6761: IF p_planning_start_date_tbl(i) = FND_API.G_MISS_DATE OR
6762: p_planning_end_date_tbl(i) = FND_API.G_MISS_DATE THEN
6763: l_webadi_err_code_tbl.extend(1);
6764: l_webadi_err_code_tbl(l_webadi_err_code_tbl.COUNT) := 'PA_FP_WA_PLAN_DATES_NULLED_OUT';
6765: l_webadi_err_task_id_tbl.extend(1);
6758: THEN
6759: IF p_calling_context = 'WEBADI' THEN -- Bug 3986129: FP.M Web ADI Dev changes
6760: -- checking if the planning start date/end date has been explcitely nulled ou
6761: IF p_planning_start_date_tbl(i) = FND_API.G_MISS_DATE OR
6762: p_planning_end_date_tbl(i) = FND_API.G_MISS_DATE THEN
6763: l_webadi_err_code_tbl.extend(1);
6764: l_webadi_err_code_tbl(l_webadi_err_code_tbl.COUNT) := 'PA_FP_WA_PLAN_DATES_NULLED_OUT';
6765: l_webadi_err_task_id_tbl.extend(1);
6766: l_webadi_err_task_id_tbl(l_webadi_err_task_id_tbl.COUNT) := px_budget_lines_in(i).pa_task_id;
6774: END IF;
6775:
6776: -- before calling get_valid_periods_dates validating the followings
6777: IF (px_budget_lines_in(i).budget_start_date IS NOT NULL OR
6778: px_budget_lines_in(i).budget_start_date <> FND_API.G_MISS_DATE) AND
6779: (px_budget_lines_in(i).budget_end_date IS NOT NULL OR
6780: px_budget_lines_in(i).budget_end_date <> FND_API.G_MISS_DATE) THEN
6781:
6782: -- checking if the budget line start date/ end date falls between
6776: -- before calling get_valid_periods_dates validating the followings
6777: IF (px_budget_lines_in(i).budget_start_date IS NOT NULL OR
6778: px_budget_lines_in(i).budget_start_date <> FND_API.G_MISS_DATE) AND
6779: (px_budget_lines_in(i).budget_end_date IS NOT NULL OR
6780: px_budget_lines_in(i).budget_end_date <> FND_API.G_MISS_DATE) THEN
6781:
6782: -- checking if the budget line start date/ end date falls between
6783: -- the planning start date/ end date
6784: -- Added for the bug 4414062
6848: ,p_context => 'WEBADI'
6849: ,p_return_status => x_return_status
6850: ,x_error_code => l_new_error_code);
6851:
6852: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
6853: -- populationg the error tbl variables to call process_errors at the end
6854: l_webadi_err_code_tbl.extend(1);
6855: l_webadi_err_code_tbl(l_webadi_err_code_tbl.COUNT) := l_new_error_code;
6856: l_webadi_err_task_id_tbl.extend(1);
6871: END IF;
6872:
6873: IF (l_calling_model_context = 'BUDGETSMODEL') or (NOT(p_time_phased_code = 'N' AND -- Bug no 5846942
6874: (px_budget_lines_in(i).budget_start_date IS NULL
6875: OR px_budget_lines_in(i).budget_start_date = FND_API.G_MISS_DATE )
6876: AND (px_budget_lines_in(i).budget_end_date IS NULL
6877: OR px_budget_lines_in(i).budget_end_date = FND_API.G_MISS_DATE )) )THEN
6878:
6879: get_valid_period_dates
6873: IF (l_calling_model_context = 'BUDGETSMODEL') or (NOT(p_time_phased_code = 'N' AND -- Bug no 5846942
6874: (px_budget_lines_in(i).budget_start_date IS NULL
6875: OR px_budget_lines_in(i).budget_start_date = FND_API.G_MISS_DATE )
6876: AND (px_budget_lines_in(i).budget_end_date IS NULL
6877: OR px_budget_lines_in(i).budget_end_date = FND_API.G_MISS_DATE )) )THEN
6878:
6879: get_valid_period_dates
6880: ( p_project_id => p_pa_project_id
6881: ,p_task_id => px_budget_lines_in(i).pa_task_id
6893: END IF;
6894: END IF; -- Bug 3986129
6895:
6896: pa_budget_pvt.g_start_date := px_budget_lines_in(i).budget_start_date;
6897: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6898: -- RAISE FND_API.G_EXC_ERROR;
6899: -- as the API get_valid_period_dates adds the error msg to the stack hence we
6900: -- do not need to add the error msg in this API.
6901: /* Bug 3133930- set the return status to the new output variable */
6894: END IF; -- Bug 3986129
6895:
6896: pa_budget_pvt.g_start_date := px_budget_lines_in(i).budget_start_date;
6897: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6898: -- RAISE FND_API.G_EXC_ERROR;
6899: -- as the API get_valid_period_dates adds the error msg to the stack hence we
6900: -- do not need to add the error msg in this API.
6901: /* Bug 3133930- set the return status to the new output variable */
6902: x_budget_lines_out(i).return_status := x_return_status;
6945: ,p_allow_burd_cost_rate_flag => p_allow_burd_cost_rate_flag
6946: ,p_allow_bill_rate_flag => p_allow_bill_rate_flag
6947: ,x_webadi_error_code => l_new_error_code);
6948:
6949: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
6950: l_webadi_err_code_tbl.extend(1);
6951: l_webadi_err_code_tbl(l_webadi_err_code_tbl.COUNT) := l_new_error_code;
6952: l_webadi_err_task_id_tbl.extend(1);
6953: l_webadi_err_task_id_tbl(l_webadi_err_task_id_tbl.COUNT) := px_budget_lines_in(i).pa_task_id;
6974: ,p_allow_revenue_flag => p_allow_revenue_flag
6975: ,x_webadi_error_code => l_new_error_code);
6976: END IF; -- Bug 3986129
6977: END IF;
6978: IF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
6979: THEN
6980: /* Bug 3133930- set the return status to the new output variable */
6981: x_budget_lines_out(i).return_status := x_return_status;
6982:
6979: THEN
6980: /* Bug 3133930- set the return status to the new output variable */
6981: x_budget_lines_out(i).return_status := x_return_status;
6982:
6983: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6984:
6985: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
6986: THEN
6987: --RAISE FND_API.G_EXC_ERROR;
6981: x_budget_lines_out(i).return_status := x_return_status;
6982:
6983: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6984:
6985: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
6986: THEN
6987: --RAISE FND_API.G_EXC_ERROR;
6988: -- as the called api adds msg to stack hence no need to add err msg here.
6989:
6983: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6984:
6985: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
6986: THEN
6987: --RAISE FND_API.G_EXC_ERROR;
6988: -- as the called api adds msg to stack hence no need to add err msg here.
6989:
6990: /* Bug 3133930- set the return status to the new output variable */
6991: x_budget_lines_out(i).return_status := x_return_status;
7058: ,p_out_resource_list_member_id => px_budget_lines_in(i).resource_list_member_id
7059: ,p_return_status => x_return_status );
7060:
7061: --dbms_output.put_line('----- p_out_resource_list_member_id: -----' || p_out_resource_list_member_id);
7062: IF x_return_status = FND_API.G_RET_STS_SUCCESS
7063: THEN
7064: -- Initialise valid rlmid variable to Y
7065: l_valid_rlmid := 'Y';
7066: IF((p_budget_type_code IS NOT NULL) AND
7084: ,p_attribute3 => l_context_info
7085: ,p_attribute4 => ''
7086: ,p_attribute5 => to_char(px_budget_lines_in(i).budget_start_date));
7087: END IF;
7088: x_return_status := FND_API.G_RET_STS_ERROR;
7089: /* Bug 3133930- set the return status to the new output variable */
7090: x_budget_lines_out(i).return_status := x_return_status;
7091: CLOSE l_resource_csr;
7092:
7091: CLOSE l_resource_csr;
7092:
7093: l_any_error_occurred_flag:='Y';
7094: l_valid_rlmid := 'N';
7095: --RAISE FND_API.G_EXC_ERROR;
7096: ELSE
7097: CLOSE l_resource_csr;
7098: END IF;
7099:
7100: /* bug 3954329: included the following check */
7101: IF l_rlm_migration_code = 'N' THEN
7102: l_any_error_occurred_flag:='Y';
7103: l_valid_rlmid := 'N';
7104: x_return_status := FND_API.G_RET_STS_ERROR;
7105: x_budget_lines_out(i).return_status := x_return_status;
7106: PA_UTILS.ADD_MESSAGE
7107: ( p_app_short_name => 'PA',
7108: p_msg_name => 'PA_FP_OLD_MOD_NEW_RLM_PASSED');
7137: ,p_attribute3 => l_context_info
7138: ,p_attribute4 => ''
7139: ,p_attribute5 => to_char(px_budget_lines_in(i).budget_start_date));
7140: END IF;
7141: x_return_status := FND_API.G_RET_STS_ERROR;
7142: x_budget_lines_out(i).return_status := x_return_status;
7143: END IF;
7144: CLOSE l_resource_csr_fp;
7145:
7161: l_webadi_err_txn_curr_tbl(l_webadi_err_txn_curr_tbl.COUNT) := px_budget_lines_in(i).txn_currency_code;
7162: l_webadi_err_amt_type_tbl.extend(1);
7163: l_webadi_err_amt_type_tbl(l_webadi_err_amt_type_tbl.COUNT) := p_amount_type_tbl(i);
7164: ELSE
7165: x_return_status := FND_API.G_RET_STS_ERROR;
7166: x_budget_lines_out(i).return_status := x_return_status;
7167: PA_UTILS.ADD_MESSAGE
7168: ( p_app_short_name => 'PA',
7169: p_msg_name => 'PA_FP_NEW_MOD_OLD_RLM_PASSED');
7193: IF l_resource_type_code = 'UNCLASSIFIED' THEN
7194:
7195: l_any_error_occurred_flag:='Y';
7196: l_valid_rlmid := 'N';
7197: x_return_status := FND_API.G_RET_STS_ERROR;
7198: /* Bug 3133930- set the return status to the new output variable */
7199: x_budget_lines_out(i).return_status := x_return_status;
7200:
7201: PA_UTILS.ADD_MESSAGE
7249: l_rlm_id_tbl('RLMID' || px_budget_lines_in(i).resource_list_member_id) :=
7250: px_budget_lines_in(i).resource_list_member_id;
7251: END IF;
7252: END IF;
7253: END IF; --x_return_status = FND_API.G_RET_STS_SUCCESS THEN
7254:
7255: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
7256: THEN
7257: /* Bug 3133930- set the return status to the new output variable */
7251: END IF;
7252: END IF;
7253: END IF; --x_return_status = FND_API.G_RET_STS_SUCCESS THEN
7254:
7255: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
7256: THEN
7257: /* Bug 3133930- set the return status to the new output variable */
7258: x_budget_lines_out(i).return_status := x_return_status;
7259: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7255: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
7256: THEN
7257: /* Bug 3133930- set the return status to the new output variable */
7258: x_budget_lines_out(i).return_status := x_return_status;
7259: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7260:
7261: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
7262: THEN
7263: /* Bug 3133930- set the return status to the new output variable */
7257: /* Bug 3133930- set the return status to the new output variable */
7258: x_budget_lines_out(i).return_status := x_return_status;
7259: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7260:
7261: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
7262: THEN
7263: /* Bug 3133930- set the return status to the new output variable */
7264: x_budget_lines_out(i).return_status := x_return_status;
7265: --RAISE FND_API.G_EXC_ERROR;
7261: ELSIF x_return_status = FND_API.G_RET_STS_ERROR
7262: THEN
7263: /* Bug 3133930- set the return status to the new output variable */
7264: x_budget_lines_out(i).return_status := x_return_status;
7265: --RAISE FND_API.G_EXC_ERROR;
7266: -- error message is added by the called API. Hence no error msg need to be added here.
7267: l_any_error_occurred_flag:='Y';
7268: END IF;
7269: ELSE --IF( NOT(l_rlm_id_tbl.exists(l_distinct_rlmid_idx) ) )
7290: ,p_attribute2 => l_amg_task_number
7291: ,p_attribute3 => l_context_info
7292: ,p_attribute4 => ''
7293: ,p_attribute5 => to_char(px_budget_lines_in(i).budget_start_date));
7294: --RAISE FND_API.G_EXC_ERROR;
7295: END IF;
7296: x_return_status := FND_API.G_RET_STS_ERROR;
7297: /* Bug 3133930- set the return status to the new output variable */
7298: x_budget_lines_out(i).return_status := x_return_status;
7292: ,p_attribute4 => ''
7293: ,p_attribute5 => to_char(px_budget_lines_in(i).budget_start_date));
7294: --RAISE FND_API.G_EXC_ERROR;
7295: END IF;
7296: x_return_status := FND_API.G_RET_STS_ERROR;
7297: /* Bug 3133930- set the return status to the new output variable */
7298: x_budget_lines_out(i).return_status := x_return_status;
7299: l_any_error_occurred_flag:='Y';
7300: END IF;
7317: (p_calling_context='UPDATE_PLANNING_ELEMENT_ATTR' and l_valid_rlmid ='Y') THEN --Bug 5509192
7318:
7319: -- validating resource level attributes
7320: IF p_uom_tbl(i) IS NOT NULL AND
7321: p_uom_tbl(i) = FND_API.G_MISS_CHAR THEN
7322: -- UOM has been nulled out
7323: l_webadi_err_code_tbl.extend(1);
7324: l_webadi_err_code_tbl(l_webadi_err_code_tbl.COUNT) := 'PA_FP_WA_UOM_NULLED_OUT';
7325: l_webadi_err_task_id_tbl.extend(1);
7331: l_webadi_err_amt_type_tbl.extend(1);
7332: l_webadi_err_amt_type_tbl(l_webadi_err_amt_type_tbl.COUNT) := p_amount_type_tbl(i);
7333: l_any_error_occurred_flag := 'Y';
7334: ELSIF p_uom_tbl(i) IS NOT NULL AND
7335: p_uom_tbl(i) <> FND_API.G_MISS_CHAR THEN
7336: -- value for UOM has been passed
7337: -- calling an api to validate the UOM passed
7338: PA_BUDGET_CHECK_PVT.validate_uom_passed
7339: (p_res_list_mem_id => px_budget_lines_in(i).resource_list_member_id,
7342: x_return_status => x_return_status,
7343: x_msg_data => x_msg_data,
7344: x_msg_count => x_msg_count);
7345:
7346: IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
7347: IF l_new_error_code IS NOT NULL THEN
7348: l_webadi_err_code_tbl.extend(1);
7349: l_webadi_err_code_tbl(l_webadi_err_code_tbl.COUNT) := l_new_error_code;
7350: l_webadi_err_task_id_tbl.extend(1);
7367: l_etc_method_code :=null;
7368:
7369: IF p_etc_method_name_tbl(i) IS NOT NULL AND
7370: (p_calling_context = 'UPDATE_PLANNING_ELEMENT_ATTR' or
7371: p_etc_method_name_tbl(i) <> FND_API.G_MISS_CHAR) THEN
7372: BEGIN
7373: SELECT lookup_code
7374: INTO l_etc_method_code
7375: FROM pa_lookups
7424:
7425:
7426:
7427: IF p_mfc_cost_type_tbl(i) IS NOT NULL AND
7428: p_mfc_cost_type_tbl(i) <> FND_API.G_MISS_CHAR THEN
7429: BEGIN
7430: SELECT cost_type_id
7431: INTO l_mfc_cost_type_id
7432: FROM CST_COST_TYPES_V
7464: l_spread_curve_id :=null;
7465:
7466: -- validating spread curve
7467: IF p_calling_context='WEBADI' and p_spread_curve_id_tbl.EXISTS(i) AND
7468: (p_spread_curve_id_tbl(i) IS NULL OR p_spread_curve_id_tbl(i) <> FND_API.G_MISS_NUM) THEN
7469: x_spread_curve_id_tbl.EXTEND(1);
7470: x_spread_curve_id_tbl(x_spread_curve_id_tbl.COUNT) := p_spread_curve_id_tbl(i);
7471: ELSE
7472: IF p_spread_curve_name_tbl(i) IS NOT NULL AND
7469: x_spread_curve_id_tbl.EXTEND(1);
7470: x_spread_curve_id_tbl(x_spread_curve_id_tbl.COUNT) := p_spread_curve_id_tbl(i);
7471: ELSE
7472: IF p_spread_curve_name_tbl(i) IS NOT NULL AND
7473: p_spread_curve_name_tbl(i) = FND_API.G_MISS_CHAR AND
7474: p_calling_context <> 'UPDATE_PLANNING_ELEMENT_ATTR' THEN
7475:
7476: l_webadi_err_code_tbl.extend(1);
7477: l_webadi_err_code_tbl(l_webadi_err_code_tbl.COUNT) := 'PA_FP_WA_SC_NULLED_OUT';
7485: l_webadi_err_amt_type_tbl(l_webadi_err_amt_type_tbl.COUNT) := p_amount_type_tbl(i);
7486: l_any_error_occurred_flag := 'Y';
7487: ELSIF p_spread_curve_name_tbl(i) IS NOT NULL AND
7488: (p_calling_context = 'UPDATE_PLANNING_ELEMENT_ATTR' or
7489: p_spread_curve_name_tbl(i) <> FND_API.G_MISS_CHAR) THEN
7490:
7491: BEGIN
7492: SELECT spread_curve_id
7493: INTO l_spread_curve_id
7606: end if;
7607:
7608: l_invalid_plandates_flag :='N';
7609:
7610: if p_planning_start_date_tbl(i) = FND_API.G_MISS_DATE or
7611: p_planning_end_date_tbl(i) = FND_API.G_MISS_DATE then
7612: if px_budget_lines_in(i).pa_task_id <> 0 then
7613: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
7614: p_msg_name => 'INVALID_PLANNING_DATES_AMG',
7607:
7608: l_invalid_plandates_flag :='N';
7609:
7610: if p_planning_start_date_tbl(i) = FND_API.G_MISS_DATE or
7611: p_planning_end_date_tbl(i) = FND_API.G_MISS_DATE then
7612: if px_budget_lines_in(i).pa_task_id <> 0 then
7613: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
7614: p_msg_name => 'INVALID_PLANNING_DATES_AMG',
7615: p_token1 => 'PROJECT_OR_TASK_NUMBER',
7633: ((p_planning_start_date_tbl(i) is null and
7634: p_planning_end_date_tbl(i) is not null) or
7635: (p_planning_start_date_tbl(i) is not null and
7636: p_planning_end_date_tbl(i) is null) or
7637: (nvl(p_planning_end_date_tbl(i),FND_API.G_MISS_DATE) <
7638: nvl(p_planning_start_date_tbl(i),FND_API.G_MISS_DATE)))) then
7639:
7640: if px_budget_lines_in(i).pa_task_id <> 0 then
7641: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
7634: p_planning_end_date_tbl(i) is not null) or
7635: (p_planning_start_date_tbl(i) is not null and
7636: p_planning_end_date_tbl(i) is null) or
7637: (nvl(p_planning_end_date_tbl(i),FND_API.G_MISS_DATE) <
7638: nvl(p_planning_start_date_tbl(i),FND_API.G_MISS_DATE)))) then
7639:
7640: if px_budget_lines_in(i).pa_task_id <> 0 then
7641: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
7642: p_msg_name => 'INVALID_PLANNING_DATES_AMG',
7657:
7658: end if;
7659:
7660: IF l_spread_curve_id = l_fixed_date_sp_id THEN
7661: if (l_sp_fixed_date is null and (p_sp_fixed_date_tbl(i) is null or p_sp_fixed_date_tbl(i)= FND_API.G_MISS_DATE )) or
7662: (l_sp_fixed_date is not null and p_sp_fixed_date_tbl(i)= FND_API.G_MISS_DATE)
7663: then
7664: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
7665: p_msg_name => 'PA_FP_SP_FIXED_DATE_NULL');
7658: end if;
7659:
7660: IF l_spread_curve_id = l_fixed_date_sp_id THEN
7661: if (l_sp_fixed_date is null and (p_sp_fixed_date_tbl(i) is null or p_sp_fixed_date_tbl(i)= FND_API.G_MISS_DATE )) or
7662: (l_sp_fixed_date is not null and p_sp_fixed_date_tbl(i)= FND_API.G_MISS_DATE)
7663: then
7664: PA_UTILS.ADD_MESSAGE(p_app_short_name => 'PA',
7665: p_msg_name => 'PA_FP_SP_FIXED_DATE_NULL');
7666: l_any_error_occurred_flag := 'Y';
7706: Nvl(p_delete_flag_tbl(i), 'N') <> 'Y')))
7707: THEN
7708: --Validate the change reason code. This validation is added for Fin plan model in FP L
7709: IF (px_budget_lines_in(i).change_reason_code IS NOT NULL AND
7710: ((p_calling_context = 'WEBADI' AND px_budget_lines_in(i).change_reason_code <> FND_API.G_MISS_CHAR) OR
7711: (p_calling_context <> 'WEBADI' AND px_budget_lines_in(i).change_reason_code <> PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR))) THEN
7712:
7713: OPEN l_budget_change_reason_csr( px_budget_lines_in(i).change_reason_code );
7714: FETCH l_budget_change_reason_csr INTO l_dummy;
7738: p_value3 => l_context_info ,
7739: p_token4 => 'START_DATE',
7740: p_value4 => to_char(px_budget_lines_in(i).budget_start_date));
7741: END IF;
7742: x_return_status := FND_API.G_RET_STS_ERROR;
7743: /* Bug 3133930- set the return status to the new output variable */
7744: x_budget_lines_out(i).return_status := x_return_status;
7745: --RAISE FND_API.G_EXC_ERROR;
7746: ELSE --p_calling_context <> 'WEBADI' THEN
7741: END IF;
7742: x_return_status := FND_API.G_RET_STS_ERROR;
7743: /* Bug 3133930- set the return status to the new output variable */
7744: x_budget_lines_out(i).return_status := x_return_status;
7745: --RAISE FND_API.G_EXC_ERROR;
7746: ELSE --p_calling_context <> 'WEBADI' THEN
7747: -- populate the error code specific to webadi context
7748: l_webadi_err_code_tbl.extend(1);
7749: l_webadi_err_code_tbl(l_webadi_err_code_tbl.COUNT) := 'PA_FP_WA_INV_RESN_CODE_PASSED';
7834: --We should do these validations only when the above query returned a record.
7835: IF (l_plan_start_date is not null)
7836: THEN
7837: IF (px_budget_lines_in(i).budget_start_date IS NOT NULL AND
7838: px_budget_lines_in(i).budget_start_date <> FND_API.G_MISS_DATE) AND
7839: (px_budget_lines_in(i).budget_end_date IS NOT NULL AND
7840: px_budget_lines_in(i).budget_end_date <> FND_API.G_MISS_DATE) THEN
7841:
7842: -- checking if the budget line start date/ end date falls between
7836: THEN
7837: IF (px_budget_lines_in(i).budget_start_date IS NOT NULL AND
7838: px_budget_lines_in(i).budget_start_date <> FND_API.G_MISS_DATE) AND
7839: (px_budget_lines_in(i).budget_end_date IS NOT NULL AND
7840: px_budget_lines_in(i).budget_end_date <> FND_API.G_MISS_DATE) THEN
7841:
7842: -- checking if the budget line start date/ end date falls between
7843: -- the planning start date/ end date
7844:
7868:
7869: IF (px_budget_lines_in(i).budget_start_date < l_period_start_date OR
7870: px_budget_lines_in(i).budget_end_date > l_period_end_date)
7871: THEN
7872: x_return_status := FND_API.G_RET_STS_ERROR;
7873: x_budget_lines_out(i).return_status := x_return_status;
7874: PA_UTILS.add_message
7875: (p_app_short_name => 'PA',
7876: p_msg_name => 'PA_FP_START_END_DATE_NOT_VALID',
7885: l_any_error_occurred_flag:='Y';
7886: END IF;
7887: ELSIF ( p_time_phased_code = 'N' and
7888: (px_budget_lines_in(i).budget_start_date IS NULL
7889: OR px_budget_lines_in(i).budget_start_date = FND_API.G_MISS_DATE )
7890: AND (px_budget_lines_in(i).budget_end_date IS NULL
7891: OR px_budget_lines_in(i).budget_end_date = FND_API.G_MISS_DATE ) )THEN
7892:
7893: px_budget_lines_in(i).budget_start_date := l_plan_start_date;
7887: ELSIF ( p_time_phased_code = 'N' and
7888: (px_budget_lines_in(i).budget_start_date IS NULL
7889: OR px_budget_lines_in(i).budget_start_date = FND_API.G_MISS_DATE )
7890: AND (px_budget_lines_in(i).budget_end_date IS NULL
7891: OR px_budget_lines_in(i).budget_end_date = FND_API.G_MISS_DATE ) )THEN
7892:
7893: px_budget_lines_in(i).budget_start_date := l_plan_start_date;
7894: px_budget_lines_in(i).budget_end_date := l_period_end_date;
7895:
7947: p_token3 => 'CURRENCY',
7948: p_value3 => px_budget_lines_in(i).txn_currency_code);
7949:
7950:
7951: x_return_status := FND_API.G_RET_STS_ERROR;
7952: /* Bug 3133930- set the return status to the new output variable */
7953: x_budget_lines_out(i).return_status := x_return_status;
7954:
7955: ELSE
8048: p_value2 => l_fin_plan_type_name,
8049: p_token3 => 'CURRENCY',
8050: p_value3 => px_budget_lines_in(i).txn_currency_code);
8051:
8052: x_return_status := FND_API.G_RET_STS_ERROR;
8053: /* Bug 3133930- set the return status to the new output variable */
8054: x_budget_lines_out(i).return_status := x_return_status;
8055:
8056: IF l_debug_mode = 'Y' THEN
8165: -- Bug 3986129: FP.M Web ADI Dev changes: included the following check
8166: IF p_calling_context = 'WEBADI' AND
8167: l_wa_val_conv_attr_flag='Y' THEN
8168:
8169: IF px_budget_lines_in(i).project_cost_rate_type = FND_API.G_MISS_CHAR THEN
8170: l_wa_project_cost_rate_typ := NULL;
8171: ELSE
8172: l_wa_project_cost_rate_typ := px_budget_lines_in(i).project_cost_rate_type;
8173: END IF;
8170: l_wa_project_cost_rate_typ := NULL;
8171: ELSE
8172: l_wa_project_cost_rate_typ := px_budget_lines_in(i).project_cost_rate_type;
8173: END IF;
8174: IF px_budget_lines_in(i).project_cost_rate_date_type = FND_API.G_MISS_CHAR THEN
8175: l_wa_project_cost_rate_dt_typ := NULL;
8176: ELSE
8177: l_wa_project_cost_rate_dt_typ := px_budget_lines_in(i).project_cost_rate_date_type;
8178: END IF;
8175: l_wa_project_cost_rate_dt_typ := NULL;
8176: ELSE
8177: l_wa_project_cost_rate_dt_typ := px_budget_lines_in(i).project_cost_rate_date_type;
8178: END IF;
8179: IF px_budget_lines_in(i).project_cost_rate_date = FND_API.G_MISS_DATE THEN
8180: l_wa_project_cost_rate_date := NULL;
8181: ELSE
8182: l_wa_project_cost_rate_date := px_budget_lines_in(i).project_cost_rate_date;
8183: END IF;
8180: l_wa_project_cost_rate_date := NULL;
8181: ELSE
8182: l_wa_project_cost_rate_date := px_budget_lines_in(i).project_cost_rate_date;
8183: END IF;
8184: IF px_budget_lines_in(i).project_cost_exchange_rate = FND_API.G_MISS_NUM THEN
8185: l_wa_project_cost_exc_rate := NULL;
8186: ELSE
8187: l_wa_project_cost_exc_rate := px_budget_lines_in(i).project_cost_exchange_rate;
8188: END IF;
8185: l_wa_project_cost_exc_rate := NULL;
8186: ELSE
8187: l_wa_project_cost_exc_rate := px_budget_lines_in(i).project_cost_exchange_rate;
8188: END IF;
8189: IF px_budget_lines_in(i).projfunc_cost_rate_type = FND_API.G_MISS_CHAR THEN
8190: l_wa_projfunc_cost_rate_typ := NULL;
8191: ELSE
8192: l_wa_projfunc_cost_rate_typ := px_budget_lines_in(i).projfunc_cost_rate_type;
8193: END IF;
8190: l_wa_projfunc_cost_rate_typ := NULL;
8191: ELSE
8192: l_wa_projfunc_cost_rate_typ := px_budget_lines_in(i).projfunc_cost_rate_type;
8193: END IF;
8194: IF px_budget_lines_in(i).projfunc_cost_rate_date_type = FND_API.G_MISS_CHAR THEN
8195: l_wa_projfunc_cost_rate_dt_typ := NULL;
8196: ELSE
8197: l_wa_projfunc_cost_rate_dt_typ := px_budget_lines_in(i).projfunc_cost_rate_date_type;
8198: END IF;
8195: l_wa_projfunc_cost_rate_dt_typ := NULL;
8196: ELSE
8197: l_wa_projfunc_cost_rate_dt_typ := px_budget_lines_in(i).projfunc_cost_rate_date_type;
8198: END IF;
8199: IF px_budget_lines_in(i).projfunc_cost_rate_date = FND_API.G_MISS_DATE THEN
8200: l_wa_projfunc_cost_rate_date := NULL;
8201: ELSE
8202: l_wa_projfunc_cost_rate_date := px_budget_lines_in(i).projfunc_cost_rate_date;
8203: END IF;
8200: l_wa_projfunc_cost_rate_date := NULL;
8201: ELSE
8202: l_wa_projfunc_cost_rate_date := px_budget_lines_in(i).projfunc_cost_rate_date;
8203: END IF;
8204: IF px_budget_lines_in(i).projfunc_cost_exchange_rate = FND_API.G_MISS_NUM THEN
8205: l_wa_projfunc_cost_exc_rate := NULL;
8206: ELSE
8207: l_wa_projfunc_cost_exc_rate := px_budget_lines_in(i).projfunc_cost_exchange_rate;
8208: END IF;
8205: l_wa_projfunc_cost_exc_rate := NULL;
8206: ELSE
8207: l_wa_projfunc_cost_exc_rate := px_budget_lines_in(i).projfunc_cost_exchange_rate;
8208: END IF;
8209: IF px_budget_lines_in(i).project_rev_rate_type = FND_API.G_MISS_CHAR THEN
8210: l_wa_project_rev_rate_typ := NULL;
8211: ELSE
8212: l_wa_project_rev_rate_typ := px_budget_lines_in(i).project_rev_rate_type;
8213: END IF;
8210: l_wa_project_rev_rate_typ := NULL;
8211: ELSE
8212: l_wa_project_rev_rate_typ := px_budget_lines_in(i).project_rev_rate_type;
8213: END IF;
8214: IF px_budget_lines_in(i).project_rev_rate_date_type = FND_API.G_MISS_CHAR THEN
8215: l_wa_project_rev_rate_dt_typ := NULL;
8216: ELSE
8217: l_wa_project_rev_rate_dt_typ := px_budget_lines_in(i).project_rev_rate_date_type;
8218: END IF;
8215: l_wa_project_rev_rate_dt_typ := NULL;
8216: ELSE
8217: l_wa_project_rev_rate_dt_typ := px_budget_lines_in(i).project_rev_rate_date_type;
8218: END IF;
8219: IF px_budget_lines_in(i).project_rev_rate_date = FND_API.G_MISS_DATE THEN
8220: l_wa_project_rev_rate_date := NULL;
8221: ELSE
8222: l_wa_project_rev_rate_date := px_budget_lines_in(i).project_rev_rate_date;
8223: END IF;
8220: l_wa_project_rev_rate_date := NULL;
8221: ELSE
8222: l_wa_project_rev_rate_date := px_budget_lines_in(i).project_rev_rate_date;
8223: END IF;
8224: IF px_budget_lines_in(i).project_rev_exchange_rate = FND_API.G_MISS_NUM THEN
8225: l_wa_project_rev_exc_rate := NULL;
8226: ELSE
8227: l_wa_project_rev_exc_rate := px_budget_lines_in(i).project_rev_exchange_rate;
8228: END IF;
8225: l_wa_project_rev_exc_rate := NULL;
8226: ELSE
8227: l_wa_project_rev_exc_rate := px_budget_lines_in(i).project_rev_exchange_rate;
8228: END IF;
8229: IF px_budget_lines_in(i).projfunc_rev_rate_type = FND_API.G_MISS_CHAR THEN
8230: l_wa_projfunc_rev_rate_typ := NULL;
8231: ELSE
8232: l_wa_projfunc_rev_rate_typ := px_budget_lines_in(i).projfunc_rev_rate_type;
8233: END IF;
8230: l_wa_projfunc_rev_rate_typ := NULL;
8231: ELSE
8232: l_wa_projfunc_rev_rate_typ := px_budget_lines_in(i).projfunc_rev_rate_type;
8233: END IF;
8234: IF px_budget_lines_in(i).projfunc_rev_rate_date_type = FND_API.G_MISS_CHAR THEN
8235: l_wa_projfunc_rev_rate_dt_typ := NULL;
8236: ELSE
8237: l_wa_projfunc_rev_rate_dt_typ := px_budget_lines_in(i).projfunc_rev_rate_date_type;
8238: END IF;
8235: l_wa_projfunc_rev_rate_dt_typ := NULL;
8236: ELSE
8237: l_wa_projfunc_rev_rate_dt_typ := px_budget_lines_in(i).projfunc_rev_rate_date_type;
8238: END IF;
8239: IF px_budget_lines_in(i).projfunc_rev_rate_date = FND_API.G_MISS_DATE THEN
8240: l_wa_projfunc_rev_rate_date := NULL;
8241: ELSE
8242: l_wa_projfunc_rev_rate_date := px_budget_lines_in(i).projfunc_rev_rate_date;
8243: END IF;
8240: l_wa_projfunc_rev_rate_date := NULL;
8241: ELSE
8242: l_wa_projfunc_rev_rate_date := px_budget_lines_in(i).projfunc_rev_rate_date;
8243: END IF;
8244: IF px_budget_lines_in(i).projfunc_rev_exchange_rate = FND_API.G_MISS_NUM THEN
8245: l_wa_projfunc_rev_exc_rate := NULL;
8246: ELSE
8247: l_wa_projfunc_rev_exc_rate := px_budget_lines_in(i).projfunc_rev_exchange_rate;
8248: END IF;
8300: ,x_return_status =>x_return_status
8301: ,x_msg_count =>x_msg_count
8302: ,x_msg_data =>x_msg_data);
8303: END IF;
8304: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
8305: IF p_calling_context <> 'WEBADI' THEN
8306: /* Bug 3133930- set the return status to the new output variable */
8307: x_budget_lines_out(i).return_status := x_return_status;
8308:
8319: l_webadi_err_amt_type_tbl(l_webadi_err_amt_type_tbl.COUNT) := p_amount_type_tbl(i);
8320: END IF;
8321:
8322: l_any_error_occurred_flag:='Y';
8323: ELSIF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
8324: IF p_calling_context = 'WEBADI' THEN --Bug 4382980
8325: -- copying back the validated attribute in the rac type
8326: px_budget_lines_in(i).project_cost_rate_type := l_wa_project_cost_rate_typ;
8327: px_budget_lines_in(i).project_cost_rate_date_type := l_wa_project_cost_rate_dt_typ;
8437: x_return_status => x_return_status,
8438: x_msg_data => x_msg_data,
8439: x_msg_count => x_msg_count);
8440:
8441: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
8442: IF l_debug_mode = 'Y' THEN
8443: pa_debug.g_err_stage := 'Call to process_errors returned with error';
8444: pa_debug.write(l_module_name,pa_debug.g_err_stage,l_debug_level3);
8445: END IF;
8476: EXCEPTION
8477: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
8478:
8479: IF x_return_status IS NULL OR
8480: x_return_status = FND_API.G_RET_STS_SUCCESS THEN
8481: x_return_status := FND_API.G_RET_STS_ERROR;
8482:
8483: END IF;
8484:
8477: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
8478:
8479: IF x_return_status IS NULL OR
8480: x_return_status = FND_API.G_RET_STS_SUCCESS THEN
8481: x_return_status := FND_API.G_RET_STS_ERROR;
8482:
8483: END IF;
8484:
8485: l_msg_count := FND_MSG_PUB.count_msg;
8485: l_msg_count := FND_MSG_PUB.count_msg;
8486:
8487: IF l_msg_count = 1 and x_msg_data IS NULL THEN
8488: PA_INTERFACE_UTILS_PUB.get_messages
8489: (p_encoded => FND_API.G_TRUE
8490: ,p_msg_index => 1
8491: ,p_msg_count => l_msg_count
8492: ,p_msg_data => l_msg_data
8493: ,p_data => l_data
8503: RETURN;
8504:
8505: WHEN OTHERS THEN
8506:
8507: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8508:
8509: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
8510:
8511: THEN
8567:
8568: BEGIN
8569:
8570: x_msg_count := 0;
8571: x_return_status := FND_API.G_RET_STS_SUCCESS;
8572: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
8573: l_module_name := 'PA_BUDGET_PVT.GET_FIN_PLAN_LINES_STATUS ';
8574:
8575: IF l_debug_mode = 'Y' THEN
8598: ,p_procedure_name => 'GET_FIN_PLAN_LINES_STATUS' );
8599:
8600: END IF;
8601:
8602: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8603:
8604: END IF;
8605:
8606: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8717: END IF ; --IF nvl(p_budget_lines_in.LAST,0) > 0
8718:
8719:
8720: IF (l_count = 0) THEN
8721: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8722: END IF;
8723:
8724: END LOOP;
8725:
8729: EXCEPTION
8730:
8731: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
8732:
8733: x_return_status := FND_API.G_RET_STS_ERROR;
8734: IF l_debug_mode = 'Y' THEN
8735: pa_debug.g_err_stage:= 'Invalid Arguments Passed';
8736: pa_debug.write('GET_FIN_PLAN_LINES_STATUS: ' || g_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
8737: pa_debug.reset_err_stack;
8739: RETURN;
8740:
8741: WHEN OTHERS THEN
8742:
8743: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8744: x_msg_count := 1;
8745: x_msg_data := SQLERRM;
8746:
8747: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'pa_budget_pvt'
8822:
8823: BEGIN
8824:
8825: x_msg_count := 0;
8826: x_return_status := FND_API.G_RET_STS_SUCCESS;
8827:
8828: l_debug_mode := NVL(FND_PROFILE.value('PA_DEBUG_MODE'),'N');
8829: l_module_name := 'PA_BUDGET_PVT.GET_FIN_PLAN_LINES_STATUS ';
8830:
8849: EXCEPTION
8850:
8851: WHEN OTHERS THEN
8852:
8853: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8854: x_msg_count := 1;
8855: x_msg_data := SQLERRM;
8856:
8857: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'pa_budget_pvt'