58: -- of error messages on stack at the start of this API.
59: l_initial_msg_count NUMBER;
60:
61: BEGIN
62: --FND_MSG_PUB.initialize;
63: l_initial_msg_count := FND_MSG_PUB.count_msg;
64:
65: IF P_PA_DEBUG_MODE = 'Y' THEN
66: pa_debug.init_err_stack('PA_FIN_PLAN_PUB.lock_unlock_version');
59: l_initial_msg_count NUMBER;
60:
61: BEGIN
62: --FND_MSG_PUB.initialize;
63: l_initial_msg_count := FND_MSG_PUB.count_msg;
64:
65: IF P_PA_DEBUG_MODE = 'Y' THEN
66: pa_debug.init_err_stack('PA_FIN_PLAN_PUB.lock_unlock_version');
67: END IF;
135:
136: end if;
137:
138: /* If There are ANY Busines Rules Violations , Then Do NOT Proceed: RETURN */
139: l_msg_count := FND_MSG_PUB.count_msg;
140: --if l_msg_count > 0 then
141: if l_msg_count > l_initial_msg_count then
142: if l_msg_count = 1 then
143: PA_INTERFACE_UTILS_PUB.get_messages
218: rollback to PA_FP_LOCK_UNLOCK;
219: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
220: x_msg_count := 1;
221: x_msg_data := SQLERRM;
222: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FIN_PLAN_PUB',
223: p_procedure_name => 'lock_unlock_version');
224: IF p_pa_debug_mode = 'Y' THEN
225: pa_debug.reset_err_stack;
226: END IF;
352: OR pbl.pc_cur_conv_rejection_code IS NOT NULL
353: OR pbl.pfc_cur_conv_rejection_code IS NOT NULL));
354:
355: BEGIN
356: FND_MSG_PUB.initialize;
357: IF p_pa_debug_mode = 'Y' THEN
358: pa_debug.init_err_stack('PA_FIN_PLAN_PUB.Baseline_FinPlan');
359: END IF;
360: l_created_by:=FND_GLOBAL.user_id;
384: end if;
385: end if;
386:
387: ----- IF THERE ARE ANY BUSINESS RULES VIOLATIONS, DO NOT PROCEED ----
388: l_msg_count := FND_MSG_PUB.count_msg;
389: if l_msg_count > 0 then
390: if l_msg_count = 1 then
391: PA_INTERFACE_UTILS_PUB.get_messages
392: (p_encoded => FND_API.G_TRUE,
555: p_msg_name => x_err_code);
556: */
557:
558: x_return_status := FND_API.G_RET_STS_ERROR;
559: x_msg_count := FND_MSG_PUB.Count_Msg;
560: if x_msg_count = 1 then
561: PA_INTERFACE_UTILS_PUB.get_messages
562: (p_encoded => FND_API.G_TRUE,
563: p_msg_index => 1,
588: PA_UTILS.Add_Message(p_app_short_name => 'PA',
589: p_msg_name => x_err_code);
590:
591: x_return_status := FND_API.G_RET_STS_ERROR;
592: x_msg_count := FND_MSG_PUB.Count_Msg;
593: if x_msg_count = 1 then
594: PA_INTERFACE_UTILS_PUB.get_messages
595: (p_encoded => FND_API.G_TRUE,
596: p_msg_index => 1,
611: PA_UTILS.Add_Message(p_app_short_name => 'PA',
612: p_msg_name => x_err_code);
613:
614: x_return_status := FND_API.G_RET_STS_ERROR;
615: x_msg_count := FND_MSG_PUB.Count_Msg;
616: if x_msg_count = 1 then
617: PA_INTERFACE_UTILS_PUB.get_messages
618: (p_encoded => FND_API.G_TRUE,
619: p_msg_index => 1,
636: PA_UTILS.Add_Message(p_app_short_name => 'PA',
637: p_msg_name => x_err_code);
638:
639: x_return_status := FND_API.G_RET_STS_ERROR;
640: x_msg_count := FND_MSG_PUB.Count_Msg;
641: if x_msg_count = 1 then
642: PA_INTERFACE_UTILS_PUB.get_messages
643: (p_encoded => FND_API.G_TRUE,
644: p_msg_index => 1,
733: PA_UTILS.Add_Message(p_app_short_name => 'PA',
734: p_msg_name => x_err_code);
735:
736: x_return_status := FND_API.G_RET_STS_ERROR;
737: x_msg_count := FND_MSG_PUB.Count_Msg;
738: if x_msg_count = 1 then
739: PA_INTERFACE_UTILS_PUB.get_messages
740: (p_encoded => FND_API.G_TRUE,
741: p_msg_index => 1,
761: PA_UTILS.Add_Message(p_app_short_name => 'PA',
762: p_msg_name => x_err_code);
763:
764: x_return_status := FND_API.G_RET_STS_ERROR;
765: x_msg_count := FND_MSG_PUB.Count_Msg;
766: if x_msg_count = 1 then
767: PA_INTERFACE_UTILS_PUB.get_messages
768: (p_encoded => FND_API.G_TRUE,
769: p_msg_index => 1,
812: PA_UTILS.Add_Message(p_app_short_name => 'PA',
813: p_msg_name => x_err_code);
814:
815: x_return_status := FND_API.G_RET_STS_ERROR;
816: x_msg_count := FND_MSG_PUB.Count_Msg;
817: if x_msg_count = 1 then
818: PA_INTERFACE_UTILS_PUB.get_messages
819: (p_encoded => FND_API.G_TRUE,
820: p_msg_index => 1,
953:
954: end if;
955:
956:
957: x_msg_count := FND_MSG_PUB.Count_Msg;
958: if x_msg_count = 1 then
959: PA_INTERFACE_UTILS_PUB.get_messages
960: (p_encoded => FND_API.G_TRUE,
961: p_msg_index => 1,
1289: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
1290: rollback to before_fp_baseline;
1291: --Bug 4044009
1292: x_return_status := FND_API.G_RET_STS_ERROR;
1293: l_msg_count := FND_MSG_PUB.count_msg;
1294: IF l_msg_count = 1 THEN
1295: PA_INTERFACE_UTILS_PUB.get_messages
1296: (p_encoded => FND_API.G_TRUE,
1297: p_msg_index => 1,
1313: rollback to before_fp_baseline;
1314: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1315: x_msg_count := 1;
1316: x_msg_data := SQLERRM;
1317: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_FIN_PLAN_PVT',
1318: p_procedure_name => 'Baseline_FinPlan');
1319: IF p_pa_debug_mode = 'Y' THEN
1320: pa_debug.reset_err_stack;
1321: END IF;
1368: l_created_by pa_budget_versions.created_by%TYPE;
1369: v_emp_id NUMBER; -- employee id
1370:
1371: BEGIN
1372: FND_MSG_PUB.initialize;
1373: IF P_PA_DEBUG_MODE = 'Y' THEN
1374: pa_debug.init_err_stack('PA_FIN_PLAN_PUB.Submit_Current_Working_FinPlan');
1375: END IF;
1376: x_msg_count := 0;
1396: p_msg_name => l_error_msg_code);
1397: end if;
1398:
1399: ----- IF THERE ARE ANY BUSINESS RULES VIOLATIONS, DO NOT PROCEED ----
1400: l_msg_count := FND_MSG_PUB.count_msg;
1401: if l_msg_count > 0 then
1402: if l_msg_count = 1 then
1403: PA_INTERFACE_UTILS_PUB.get_messages
1404: (p_encoded => FND_API.G_TRUE,
1516: if (l_err_msg_count > 0 ) then
1517: if (l_warnings_only_flag = 'N') then
1518:
1519: x_return_status := FND_API.G_RET_STS_ERROR;
1520: x_msg_count := FND_MSG_PUB.Count_Msg;
1521: if x_msg_count = 1 then
1522: PA_INTERFACE_UTILS_PUB.get_messages
1523: (p_encoded => FND_API.G_TRUE,
1524: p_msg_index => 1,
1600: when others then
1601: rollback to before_fp_sbmt_cur_working;
1602: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1603: x_msg_count := 1;
1604: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_FIN_PLAN_PVT',
1605: p_procedure_name => 'Submit_Current_Working_FinPlan');
1606: IF p_pa_debug_mode = 'Y' THEN
1607: pa_debug.reset_err_stack;
1608: END IF;
1767:
1768: End if;
1769:
1770: x_return_status := FND_API.G_RET_STS_SUCCESS;
1771: x_msg_count := FND_MSG_PUB.Count_Msg;
1772:
1773: EXCEPTION WHEN OTHERS THEN
1774: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1775: x_msg_count := 1;
1774: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1775: x_msg_count := 1;
1776: x_msg_data := substr(SQLERRM,1,240);
1777:
1778: fnd_msg_pub.add_exc_msg
1779: ( p_pkg_name => 'pa_fin_plan_pvt'
1780: ,p_procedure_name => 'Get_Included_Ci'
1781: ,p_error_text => substr(SQLERRM,1,240));
1782:
1851: ,x_msg_count => l_msg_count
1852: ,x_msg_data => l_msg_data);
1853:
1854: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1855: fnd_msg_pub.add_exc_msg
1856: ( p_pkg_name => 'pa_fin_plan_pvt'
1857: ,p_procedure_name => 'handle_ci_links'
1858: ,p_error_text => to_char(l_stage)||': '||substr(SQLERRM,1,240));
1859: ELSE
1876: , x_msg_data => l_msg_data);
1877:
1878:
1879: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1880: fnd_msg_pub.add_exc_msg
1881: ( p_pkg_name => 'pa_fin_plan_pvt'
1882: ,p_procedure_name => 'handle_ci_links'
1883: ,p_error_text => to_char(l_stage)||': '||substr(SQLERRM,1,240));
1884: ELSE
1912: ,x_msg_data => l_msg_data
1913: ) ;
1914:
1915: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1916: fnd_msg_pub.add_exc_msg
1917: ( p_pkg_name => 'pa_fin_plan_pvt'
1918: ,p_procedure_name => 'handle_ci_links'
1919: ,p_error_text => to_char(l_stage)||': '||substr(SQLERRM,1,240));
1920: END IF; -- l_return_status <> FND_API.G_RET_STS_SUCCESS
1940: , x_msg_data => l_msg_data);
1941:
1942:
1943: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1944: fnd_msg_pub.add_exc_msg
1945: ( p_pkg_name => 'pa_fin_plan_pvt'
1946: ,p_procedure_name => 'handle_ci_links'
1947: ,p_error_text => to_char(l_stage)||': '||substr(SQLERRM,1,240));
1948: ELSE
1981: ,x_msg_count => l_msg_count
1982: ,x_msg_data => l_msg_data);
1983:
1984: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1985: fnd_msg_pub.add_exc_msg
1986: ( p_pkg_name => 'pa_fin_plan_pvt'
1987: ,p_procedure_name => 'handle_ci_links'
1988: ,p_error_text => to_char(l_stage)||': '||substr(SQLERRM,1,240));
1989: END IF; -- l_return_status <> FND_API.G_RET_STS_SUCCESS
2007: , x_msg_data => l_msg_data);
2008:
2009:
2010: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2011: fnd_msg_pub.add_exc_msg
2012: ( p_pkg_name => 'pa_fin_plan_pvt'
2013: ,p_procedure_name => 'handle_ci_links'
2014: ,p_error_text => to_char(l_stage)||': '||substr(SQLERRM,1,240));
2015: ELSE
2034: ,x_msg_count => l_msg_count
2035: ,x_msg_data => l_msg_data);
2036:
2037: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2038: fnd_msg_pub.add_exc_msg
2039: ( p_pkg_name => 'pa_fin_plan_pvt'
2040: ,p_procedure_name => 'handle_ci_links'
2041: ,p_error_text => to_char(l_stage)||': '||substr(SQLERRM,1,240));
2042: END IF; -- l_return_status <> FND_API.G_RET_STS_SUCCESS
2045: END IF; -- l_return_status <> FND_API.G_RET_STS_SUCCESS
2046:
2047: END IF; -- l_approved_budget_plan_type = 'Y'
2048: x_return_status := FND_API.G_RET_STS_SUCCESS;
2049: x_msg_count := FND_MSG_PUB.Count_Msg;
2050:
2051: EXCEPTION WHEN NO_DATA_FOUND THEN
2052: l_approved_budget_plan_type := 'N';
2053: WHEN OTHERS THEN
2051: EXCEPTION WHEN NO_DATA_FOUND THEN
2052: l_approved_budget_plan_type := 'N';
2053: WHEN OTHERS THEN
2054: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2055: x_msg_count := FND_MSG_PUB.Count_Msg;
2056: IF x_msg_count = 1 THEN
2057: pa_interface_utils_pub.get_messages ( p_encoded => FND_API.G_TRUE
2058: ,p_msg_index => 1
2059: ,p_data => x_msg_data
2058: ,p_msg_index => 1
2059: ,p_data => x_msg_data
2060: ,p_msg_index_out => l_msg_index_out);
2061: END IF;
2062: fnd_msg_pub.add_exc_msg
2063: ( p_pkg_name => 'pa_fin_plan_pvt'
2064: ,p_procedure_name => 'handle_ci_links'
2065: ,p_error_text => to_char(l_stage)||': '||substr(SQLERRM,1,240));
2066:
2063: ( p_pkg_name => 'pa_fin_plan_pvt'
2064: ,p_procedure_name => 'handle_ci_links'
2065: ,p_error_text => to_char(l_stage)||': '||substr(SQLERRM,1,240));
2066:
2067: fnd_msg_pub.count_and_get (p_count => x_msg_count,
2068: p_data => x_msg_data);
2069: END handle_ci_links;
2070:
2071: /*
2865:
2866: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
2867:
2868: x_return_status := FND_API.G_RET_STS_ERROR;
2869: l_msg_count := FND_MSG_PUB.count_msg;
2870: IF l_msg_count = 1 THEN
2871: PA_INTERFACE_UTILS_PUB.get_messages
2872: (p_encoded => FND_API.G_TRUE
2873: ,p_msg_index => 1
2892:
2893: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2894: x_msg_count := 1;
2895: x_msg_data := SQLERRM;
2896: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'pa_fin_plan_pvt'
2897: ,p_procedure_name => 'CREATE_DRAFT');
2898: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
2899: IF P_PA_DEBUG_MODE = 'Y' THEN
2900: pa_debug.write('CREATE_DRAFT: ' || g_module_name,pa_debug.g_err_stage,PA_FP_CONSTANTS_PKG.G_DEBUG_LEVEL5);
3719: EXCEPTION
3720: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
3721:
3722: x_return_status := FND_API.G_RET_STS_ERROR;
3723: l_msg_count := FND_MSG_PUB.count_msg;
3724: IF l_msg_count = 1 THEN
3725: PA_INTERFACE_UTILS_PUB.get_messages
3726: (p_encoded => FND_API.G_TRUE
3727: ,p_msg_index => 1
3746:
3747: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3748: x_msg_count := 1;
3749: x_msg_data := SQLERRM;
3750: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'pa_fin_plan_pvt'
3751: ,p_procedure_name => 'CREATE_FINPLAN_LINES');
3752: IF P_PA_DEBUG_MODE = 'Y' THEN
3753: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
3754: pa_debug.write('CREATE_FINPLAN_LINES: ' || g_module_name,pa_debug.g_err_stage,5);
3918: IF x_return_status IS NULL OR
3919: x_return_status = FND_API.G_RET_STS_SUCCESS THEN
3920: x_return_status := FND_API.G_RET_STS_ERROR;
3921: END IF;
3922: l_msg_count := FND_MSG_PUB.count_msg;
3923:
3924: IF l_msg_count = 1 and x_msg_data IS NULL THEN
3925: PA_INTERFACE_UTILS_PUB.get_messages
3926: (p_encoded => FND_API.G_TRUE
3945: x_msg_count := 1;
3946: x_msg_data := SQLERRM;
3947:
3948:
3949: FND_MSG_PUB.add_exc_msg
3950: ( p_pkg_name => 'pa_fin_plan_pvt'
3951: ,p_procedure_name => 'convert_plan_type_name_to_id'
3952: ,p_error_text => x_msg_data);
3953:
4138: pa_debug.reset_curr_function;
4139: END IF;
4140: WHEN Delete_Ver_Exc_PVT THEN
4141: ROLLBACK TO SAVEPOINT PA_FP_PUB_DELETE_VER;
4142: l_msg_count := FND_MSG_PUB.count_msg;
4143: IF l_msg_count = 1 THEN
4144: PA_INTERFACE_UTILS_PUB.get_messages
4145: (p_encoded => FND_API.G_TRUE
4146: ,p_msg_index => 1
4162: pa_debug.reset_curr_function;
4163: END IF;
4164:
4165: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
4166: l_msg_count := FND_MSG_PUB.count_msg;
4167: IF l_msg_count = 1 THEN
4168: PA_INTERFACE_UTILS_PUB.get_messages
4169: (p_encoded => FND_API.G_TRUE
4170: ,p_msg_index => 1
4190: ROLLBACK TO SAVEPOINT DELETE_WP_OPTION_SAVE;
4191: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4192: x_msg_count := 1;
4193: x_msg_data := SQLERRM;
4194: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FIN_PLAN_PVT'
4195: ,p_procedure_name => 'Delete_wp_option');
4196:
4197: IF l_debug_mode = 'Y' THEN
4198: pa_debug.g_err_stage:='Unexpected Error'||SQLERRM;
4319: END IF;
4320: EXCEPTION
4321:
4322: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
4323: l_msg_count := FND_MSG_PUB.count_msg;
4324: IF l_msg_count = 1 THEN
4325: PA_INTERFACE_UTILS_PUB.get_messages
4326: (p_encoded => FND_API.G_TRUE
4327: ,p_msg_index => 1
4344: END IF;
4345:
4346: WHEN Delete_Ver_Exc_PVT THEN
4347: ROLLBACK TO SAVEPOINT PA_FP_PUB_DELETE_VER;
4348: l_msg_count := FND_MSG_PUB.count_msg;
4349: IF l_msg_count = 1 THEN
4350: PA_INTERFACE_UTILS_PUB.get_messages
4351: (p_encoded => FND_API.G_TRUE
4352: ,p_msg_index => 1
4371: ROLLBACK TO SAVEPOINT DELETE_WP_OPTION_SAVE;
4372: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4373: x_msg_count := 1;
4374: x_msg_data := SQLERRM;
4375: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_FIN_PLAN_PVT'
4376: ,p_procedure_name => 'Delete_wp_budget_versions');
4377:
4378: IF l_debug_mode = 'Y' THEN
4379: pa_debug.g_err_stage:='Unexpected Error'||SQLERRM;
4748:
4749: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
4750:
4751: x_return_status := FND_API.G_RET_STS_ERROR;
4752: l_msg_count := FND_MSG_PUB.count_msg;
4753:
4754: IF l_msg_count = 1 THEN
4755: PA_INTERFACE_UTILS_PUB.get_messages
4756: (p_encoded => FND_API.G_TRUE
4778: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4779: x_msg_count := 1;
4780: x_msg_data := SQLERRM;
4781:
4782: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'pa_fin_plan_pvt'
4783: ,p_procedure_name => 'ADD_FIN_PLAN_LINES');
4784: pa_debug.g_err_stage:= 'Unexpected Error'||SQLERRM;
4785:
4786: IF P_PA_DEBUG_MODE = 'Y' THEN