1: PACKAGE BODY Pa_Prj_Period_Profile_Utils as
2: /* $Header: PAPJPDPB.pls 120.1.12010000.8 2009/05/21 12:15:37 vgovvala ship $ */
3:
4: P_PA_DEBUG_MODE varchar2(1) := NVL(FND_PROFILE.value('PA_DEBUG_MODE'), 'N');
5: g_module_name VARCHAR2(100) := 'pa.plsql.pa_prj_period_profile_utils';
6:
7: Procedure Maintain_Prj_Period_Profile(
8: p_project_id IN NUMBER,
64: the p_end_date should be passed with the actual date. */
65:
66: x_return_status := FND_API.G_RET_STS_SUCCESS;
67:
68: PA_DEBUG.Set_Curr_Function( p_function => 'Maintain_Prj_Period_Profile',
69: p_debug_mode => p_debug_mode );
70:
71: IF px_end_date IS NULL THEN
72: IF P_PA_DEBUG_MODE = 'Y' THEN
68: PA_DEBUG.Set_Curr_Function( p_function => 'Maintain_Prj_Period_Profile',
69: p_debug_mode => p_debug_mode );
70:
71: IF px_end_date IS NULL THEN
72: IF P_PA_DEBUG_MODE = 'Y' THEN
73: PA_DEBUG.g_err_stage := 'end date is null, setting the end dt';
74: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
75: END IF;
76: px_end_date := ADD_MONTHS(p_start_date,120);
69: p_debug_mode => p_debug_mode );
70:
71: IF px_end_date IS NULL THEN
72: IF P_PA_DEBUG_MODE = 'Y' THEN
73: PA_DEBUG.g_err_stage := 'end date is null, setting the end dt';
74: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
75: END IF;
76: px_end_date := ADD_MONTHS(p_start_date,120);
77: END IF;
70:
71: IF px_end_date IS NULL THEN
72: IF P_PA_DEBUG_MODE = 'Y' THEN
73: PA_DEBUG.g_err_stage := 'end date is null, setting the end dt';
74: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
75: END IF;
76: px_end_date := ADD_MONTHS(p_start_date,120);
77: END IF;
78: IF p_plan_period_type = 'PA' THEN
93: null;
94: END IF;
95: CLOSE c1;
96:
97: IF P_PA_DEBUG_MODE = 'Y' THEN
98: PA_DEBUG.g_err_stage := 'after fetching pds';
99: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
100: END IF;
101: l_plan_end_period := NULL;
94: END IF;
95: CLOSE c1;
96:
97: IF P_PA_DEBUG_MODE = 'Y' THEN
98: PA_DEBUG.g_err_stage := 'after fetching pds';
99: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
100: END IF;
101: l_plan_end_period := NULL;
102: l_tab_count := l_period_name_tab.count;
95: CLOSE c1;
96:
97: IF P_PA_DEBUG_MODE = 'Y' THEN
98: PA_DEBUG.g_err_stage := 'after fetching pds';
99: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
100: END IF;
101: l_plan_end_period := NULL;
102: l_tab_count := l_period_name_tab.count;
103: px_number_of_periods := l_tab_count;
101: l_plan_end_period := NULL;
102: l_tab_count := l_period_name_tab.count;
103: px_number_of_periods := l_tab_count;
104: IF l_tab_count = 0 THEN
105: IF P_PA_DEBUG_MODE = 'Y' THEN
106: PA_DEBUG.g_err_stage := 'table count is zero for the given dt range, returning ';
107: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
108: END IF;
109: x_return_status := FND_API.G_RET_STS_ERROR;
102: l_tab_count := l_period_name_tab.count;
103: px_number_of_periods := l_tab_count;
104: IF l_tab_count = 0 THEN
105: IF P_PA_DEBUG_MODE = 'Y' THEN
106: PA_DEBUG.g_err_stage := 'table count is zero for the given dt range, returning ';
107: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
108: END IF;
109: x_return_status := FND_API.G_RET_STS_ERROR;
110: IF p_add_msg_in_stack = 'Y' THEN
103: px_number_of_periods := l_tab_count;
104: IF l_tab_count = 0 THEN
105: IF P_PA_DEBUG_MODE = 'Y' THEN
106: PA_DEBUG.g_err_stage := 'table count is zero for the given dt range, returning ';
107: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
108: END IF;
109: x_return_status := FND_API.G_RET_STS_ERROR;
110: IF p_add_msg_in_stack = 'Y' THEN
111: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
112: p_msg_name => 'PA_FP_INVALID_DATE_RANGE');
113: ELSE
114: x_msg_data := 'PA_FP_INVALID_DATE_RANGE';
115: END IF;
116: PA_DEBUG.Reset_Curr_Function;
117: RETURN;
118: END IF;
119:
120: l_plan_end_period := l_period_name_tab(l_tab_count);
296: PROFILE_END_PERIOD_NAME = l_plan_end_period
297: WHERE period_profile_id = px_period_profile_id;
298:
299: IF SQL%ROWCOUNT = 0 THEN
300: IF P_PA_DEBUG_MODE = 'Y' THEN
301: PA_DEBUG.g_err_stage := 'no record updated for the gievn id';
302: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
303: END IF;
304: x_return_status := FND_API.G_RET_STS_ERROR;
297: WHERE period_profile_id = px_period_profile_id;
298:
299: IF SQL%ROWCOUNT = 0 THEN
300: IF P_PA_DEBUG_MODE = 'Y' THEN
301: PA_DEBUG.g_err_stage := 'no record updated for the gievn id';
302: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
303: END IF;
304: x_return_status := FND_API.G_RET_STS_ERROR;
305: IF p_add_msg_in_stack = 'Y' THEN
298:
299: IF SQL%ROWCOUNT = 0 THEN
300: IF P_PA_DEBUG_MODE = 'Y' THEN
301: PA_DEBUG.g_err_stage := 'no record updated for the gievn id';
302: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
303: END IF;
304: x_return_status := FND_API.G_RET_STS_ERROR;
305: IF p_add_msg_in_stack = 'Y' THEN
306: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
307: p_msg_name => 'PA_FP_INVALID_PRJ_PROFILE');
308: ELSE
309: x_msg_data := 'PA_FP_INVALID_PRJ_PROFILE';
310: END IF;
311: PA_DEBUG.Reset_Curr_Function;
312: RETURN;
313: END IF;
314: ELSE
315: INSERT INTO pa_proj_period_profiles (
653: l_tab_count ,
654: l_plan_end_period ) returning period_profile_id into
655: px_period_profile_id;
656:
657: IF P_PA_DEBUG_MODE = 'Y' THEN
658: PA_DEBUG.g_err_stage := 'after inserting pd profile';
659: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
660: END IF;
661:
654: l_plan_end_period ) returning period_profile_id into
655: px_period_profile_id;
656:
657: IF P_PA_DEBUG_MODE = 'Y' THEN
658: PA_DEBUG.g_err_stage := 'after inserting pd profile';
659: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
660: END IF;
661:
662: UPDATE PA_PROJ_PERIOD_PROFILES SET CURRENT_FLAG = 'N' WHERE
655: px_period_profile_id;
656:
657: IF P_PA_DEBUG_MODE = 'Y' THEN
658: PA_DEBUG.g_err_stage := 'after inserting pd profile';
659: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
660: END IF;
661:
662: UPDATE PA_PROJ_PERIOD_PROFILES SET CURRENT_FLAG = 'N' WHERE
663: Period_Profile_Type = p_period_profile_type AND
671: END IF;
672: IF NVL(p_commit_flag,'N') = 'Y' THEN
673: COMMIT;
674: END IF;
675: PA_DEBUG.Reset_Curr_Function;
676: RETURN;
677: EXCEPTION
678: WHEN OTHERS THEN
679: RAISE;
698: l_column_name varchar2(100);
699: l_dummy integer;
700: BEGIN
701: x_return_status := FND_API.G_RET_STS_SUCCESS;
702: PA_DEBUG.Set_Curr_Function( p_function => 'Get_Prj_Period_Profile_Dtls',
703: p_debug_mode => p_debug_mode );
704: BEGIN
705: SELECT Period_Profile_Type,
706: Plan_Period_Type,
733: x_plan_end_date := l_plan_end_date;
734:
735: EXCEPTION
736: WHEN NO_DATA_FOUND THEN
737: IF P_PA_DEBUG_MODE = 'Y' THEN
738: PA_DEBUG.g_err_stage := 'no data found for the given pd profile id';
739: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
740: END IF;
741: x_return_status := FND_API.G_RET_STS_ERROR;
734:
735: EXCEPTION
736: WHEN NO_DATA_FOUND THEN
737: IF P_PA_DEBUG_MODE = 'Y' THEN
738: PA_DEBUG.g_err_stage := 'no data found for the given pd profile id';
739: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
740: END IF;
741: x_return_status := FND_API.G_RET_STS_ERROR;
742: IF p_add_msg_in_stack = 'Y' THEN
735: EXCEPTION
736: WHEN NO_DATA_FOUND THEN
737: IF P_PA_DEBUG_MODE = 'Y' THEN
738: PA_DEBUG.g_err_stage := 'no data found for the given pd profile id';
739: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
740: END IF;
741: x_return_status := FND_API.G_RET_STS_ERROR;
742: IF p_add_msg_in_stack = 'Y' THEN
743: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
745: ELSE
746: x_msg_data := 'PA_FP_INVALID_PRJ_PROFILE';
747: END IF;
748: END;
749: PA_DEBUG.Reset_Curr_Function;
750: RETURN;
751:
752: END Get_Prj_Period_Profile_Dtls;
753:
946: Either both should be null or both should be not null */
947:
948: IF (p_pa_start_period IS NULL and p_pa_end_period IS NOT NULL) or
949: (p_pa_start_period IS NOT NULL and p_pa_end_period IS NULL) THEN
950: IF P_PA_DEBUG_MODE = 'Y' THEN
951: PA_DEBUG.g_err_stage := 'Only one of the pa start or end periods are not null..';
952: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
953: END IF;
954: x_return_status := FND_API.G_RET_STS_ERROR;
947:
948: IF (p_pa_start_period IS NULL and p_pa_end_period IS NOT NULL) or
949: (p_pa_start_period IS NOT NULL and p_pa_end_period IS NULL) THEN
950: IF P_PA_DEBUG_MODE = 'Y' THEN
951: PA_DEBUG.g_err_stage := 'Only one of the pa start or end periods are not null..';
952: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
953: END IF;
954: x_return_status := FND_API.G_RET_STS_ERROR;
955: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
948: IF (p_pa_start_period IS NULL and p_pa_end_period IS NOT NULL) or
949: (p_pa_start_period IS NOT NULL and p_pa_end_period IS NULL) THEN
950: IF P_PA_DEBUG_MODE = 'Y' THEN
951: PA_DEBUG.g_err_stage := 'Only one of the pa start or end periods are not null..';
952: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
953: END IF;
954: x_return_status := FND_API.G_RET_STS_ERROR;
955: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
956: p_msg_name => 'PA_FP_ENTER_PA_PP_ST_END_DT');
957: END IF;
958:
959: IF (p_gl_start_period IS NULL and p_gl_end_period IS NOT NULL) or
960: (p_gl_start_period IS NOT NULL and p_gl_end_period IS NULL) THEN
961: IF P_PA_DEBUG_MODE = 'Y' THEN
962: PA_DEBUG.g_err_stage := 'Only one of the gl start or end periods are not null..';
963: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
964: END IF;
965: x_return_status := FND_API.G_RET_STS_ERROR;
958:
959: IF (p_gl_start_period IS NULL and p_gl_end_period IS NOT NULL) or
960: (p_gl_start_period IS NOT NULL and p_gl_end_period IS NULL) THEN
961: IF P_PA_DEBUG_MODE = 'Y' THEN
962: PA_DEBUG.g_err_stage := 'Only one of the gl start or end periods are not null..';
963: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
964: END IF;
965: x_return_status := FND_API.G_RET_STS_ERROR;
966: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
959: IF (p_gl_start_period IS NULL and p_gl_end_period IS NOT NULL) or
960: (p_gl_start_period IS NOT NULL and p_gl_end_period IS NULL) THEN
961: IF P_PA_DEBUG_MODE = 'Y' THEN
962: PA_DEBUG.g_err_stage := 'Only one of the gl start or end periods are not null..';
963: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
964: END IF;
965: x_return_status := FND_API.G_RET_STS_ERROR;
966: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
967: p_msg_name => 'PA_FP_ENTER_GL_PP_ST_END_DT');
969:
970: /* If start and end periods are null then there should not have been an existing period profile */
971:
972: IF (p_pa_start_period IS NULL and p_pa_end_period IS NULL) THEN
973: IF P_PA_DEBUG_MODE = 'Y' THEN
974: PA_DEBUG.g_err_stage := 'Both pa start and end periods are null...';
975: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
976: END IF;
977: l_valid_pa_period_flag := 'N';
970: /* If start and end periods are null then there should not have been an existing period profile */
971:
972: IF (p_pa_start_period IS NULL and p_pa_end_period IS NULL) THEN
973: IF P_PA_DEBUG_MODE = 'Y' THEN
974: PA_DEBUG.g_err_stage := 'Both pa start and end periods are null...';
975: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
976: END IF;
977: l_valid_pa_period_flag := 'N';
978: IF p_old_pa_profile_id IS NOT NULL THEN
971:
972: IF (p_pa_start_period IS NULL and p_pa_end_period IS NULL) THEN
973: IF P_PA_DEBUG_MODE = 'Y' THEN
974: PA_DEBUG.g_err_stage := 'Both pa start and end periods are null...';
975: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
976: END IF;
977: l_valid_pa_period_flag := 'N';
978: IF p_old_pa_profile_id IS NOT NULL THEN
979: x_return_status := FND_API.G_RET_STS_ERROR;
984: END IF;
985: END IF;
986:
987: IF (p_gl_start_period IS NULL and p_gl_end_period IS NULL) THEN
988: IF P_PA_DEBUG_MODE = 'Y' THEN
989: PA_DEBUG.g_err_stage := 'Both gl start and end periods are null...';
990: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
991: END IF;
992: l_valid_gl_period_flag := 'N';
985: END IF;
986:
987: IF (p_gl_start_period IS NULL and p_gl_end_period IS NULL) THEN
988: IF P_PA_DEBUG_MODE = 'Y' THEN
989: PA_DEBUG.g_err_stage := 'Both gl start and end periods are null...';
990: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
991: END IF;
992: l_valid_gl_period_flag := 'N';
993: IF p_old_gl_profile_id IS NOT NULL THEN
986:
987: IF (p_gl_start_period IS NULL and p_gl_end_period IS NULL) THEN
988: IF P_PA_DEBUG_MODE = 'Y' THEN
989: PA_DEBUG.g_err_stage := 'Both gl start and end periods are null...';
990: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
991: END IF;
992: l_valid_gl_period_flag := 'N';
993: IF p_old_gl_profile_id IS NOT NULL THEN
994: x_return_status := FND_API.G_RET_STS_ERROR;
1508: END IF;
1509:
1510: IF p_refresh_option_code <> 'NONE' THEN
1511: /* calling the concurrent program */
1512: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
1513:
1514: IF l_call_profile_gl_flag = 'Y' THEN
1515: l_conc_gl_profile_id := px_gl_period_profile_id;
1516: ELSE
1536: argument6 => l_conc_pa_profile_id,
1537: argument7 => l_debug_mode );
1538:
1539: IF l_rpt_request_id = 0 then
1540: IF P_PA_DEBUG_MODE = 'Y' THEN
1541: PA_DEBUG.g_err_stage := 'Error while submitting Report [PAFPEXRP]';
1542: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
1543: END IF;
1544: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
1537: argument7 => l_debug_mode );
1538:
1539: IF l_rpt_request_id = 0 then
1540: IF P_PA_DEBUG_MODE = 'Y' THEN
1541: PA_DEBUG.g_err_stage := 'Error while submitting Report [PAFPEXRP]';
1542: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
1543: END IF;
1544: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
1545: p_msg_name => 'PA_FP_PP_CONC_PGM_ERR');
1538:
1539: IF l_rpt_request_id = 0 then
1540: IF P_PA_DEBUG_MODE = 'Y' THEN
1541: PA_DEBUG.g_err_stage := 'Error while submitting Report [PAFPEXRP]';
1542: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
1543: END IF;
1544: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
1545: p_msg_name => 'PA_FP_PP_CONC_PGM_ERR');
1546: x_return_status := FND_API.G_RET_STS_ERROR;
1603: WHERE
1604: budget_version_id = l_bv_id_tab(ii) AND
1605: locked_by_person_id IS NULL; */
1606:
1607: IF P_PA_DEBUG_MODE = 'Y' THEN
1608: PA_DEBUG.g_err_stage := 'Exception Report Request Id : ' ||
1609: LTRIM(TO_CHAR(l_rpt_request_id )) ;
1610: PA_DEBUG.log_Message( p_message => PA_DEBUG.g_err_stage,
1611: p_write_file => 'OUT',
1604: budget_version_id = l_bv_id_tab(ii) AND
1605: locked_by_person_id IS NULL; */
1606:
1607: IF P_PA_DEBUG_MODE = 'Y' THEN
1608: PA_DEBUG.g_err_stage := 'Exception Report Request Id : ' ||
1609: LTRIM(TO_CHAR(l_rpt_request_id )) ;
1610: PA_DEBUG.log_Message( p_message => PA_DEBUG.g_err_stage,
1611: p_write_file => 'OUT',
1612: p_write_mode => 1);
1606:
1607: IF P_PA_DEBUG_MODE = 'Y' THEN
1608: PA_DEBUG.g_err_stage := 'Exception Report Request Id : ' ||
1609: LTRIM(TO_CHAR(l_rpt_request_id )) ;
1610: PA_DEBUG.log_Message( p_message => PA_DEBUG.g_err_stage,
1611: p_write_file => 'OUT',
1612: p_write_mode => 1);
1613: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
1614: END IF;
1609: LTRIM(TO_CHAR(l_rpt_request_id )) ;
1610: PA_DEBUG.log_Message( p_message => PA_DEBUG.g_err_stage,
1611: p_write_file => 'OUT',
1612: p_write_mode => 1);
1613: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
1614: END IF;
1615: END IF;
1616: x_conc_req_id := LTRIM(RTRIM(TO_CHAR(l_rpt_request_id)));
1617: END IF;
1969:
1970: IF x_pa_start_date IS NOT NULL AND
1971: l_create_pa_profile = 'Y' THEN
1972:
1973: IF p_pa_debug_mode = 'Y' THEN
1974: pa_debug.g_err_stage := 'Calling Maintain_Prj_Period_Profile to create the PA period profile ....';
1975: pa_debug.write(g_module_name,pa_debug.g_err_stage,3);
1976: END IF;
1977:
1970: IF x_pa_start_date IS NOT NULL AND
1971: l_create_pa_profile = 'Y' THEN
1972:
1973: IF p_pa_debug_mode = 'Y' THEN
1974: pa_debug.g_err_stage := 'Calling Maintain_Prj_Period_Profile to create the PA period profile ....';
1975: pa_debug.write(g_module_name,pa_debug.g_err_stage,3);
1976: END IF;
1977:
1978: Pa_Prj_Period_Profile_Utils.Maintain_Prj_Period_Profile(
1971: l_create_pa_profile = 'Y' THEN
1972:
1973: IF p_pa_debug_mode = 'Y' THEN
1974: pa_debug.g_err_stage := 'Calling Maintain_Prj_Period_Profile to create the PA period profile ....';
1975: pa_debug.write(g_module_name,pa_debug.g_err_stage,3);
1976: END IF;
1977:
1978: Pa_Prj_Period_Profile_Utils.Maintain_Prj_Period_Profile(
1979: p_project_id => p_project_id,
1995: x_msg_count => l_msg_count,
1996: x_msg_data => l_msg_data );
1997:
1998: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1999: IF p_pa_debug_mode = 'Y' THEN
2000: pa_debug.g_err_stage := ' Maintain_Prj_Period_Profile Errored for PA';
2001: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2002: END IF;
2003: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
1996: x_msg_data => l_msg_data );
1997:
1998: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1999: IF p_pa_debug_mode = 'Y' THEN
2000: pa_debug.g_err_stage := ' Maintain_Prj_Period_Profile Errored for PA';
2001: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2002: END IF;
2003: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2004: END IF;
1997:
1998: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1999: IF p_pa_debug_mode = 'Y' THEN
2000: pa_debug.g_err_stage := ' Maintain_Prj_Period_Profile Errored for PA';
2001: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2002: END IF;
2003: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2004: END IF;
2005:
2010: The period profile page would then fetch the queried record to be displayed on screen */
2011:
2012: IF x_gl_start_date IS NOT NULL AND
2013: l_create_gl_profile = 'Y' THEN
2014: IF p_pa_debug_mode = 'Y' THEN
2015: pa_debug.g_err_stage := 'Calling Maintain_Prj_Period_Profile to create the GL period profile ....';
2016: pa_debug.write(g_module_name,pa_debug.g_err_stage,3);
2017: END IF;
2018:
2011:
2012: IF x_gl_start_date IS NOT NULL AND
2013: l_create_gl_profile = 'Y' THEN
2014: IF p_pa_debug_mode = 'Y' THEN
2015: pa_debug.g_err_stage := 'Calling Maintain_Prj_Period_Profile to create the GL period profile ....';
2016: pa_debug.write(g_module_name,pa_debug.g_err_stage,3);
2017: END IF;
2018:
2019: Pa_Prj_Period_Profile_Utils.Maintain_Prj_Period_Profile(
2012: IF x_gl_start_date IS NOT NULL AND
2013: l_create_gl_profile = 'Y' THEN
2014: IF p_pa_debug_mode = 'Y' THEN
2015: pa_debug.g_err_stage := 'Calling Maintain_Prj_Period_Profile to create the GL period profile ....';
2016: pa_debug.write(g_module_name,pa_debug.g_err_stage,3);
2017: END IF;
2018:
2019: Pa_Prj_Period_Profile_Utils.Maintain_Prj_Period_Profile(
2020: p_project_id => p_project_id,
2036: x_msg_count => l_msg_count,
2037: x_msg_data => l_msg_data );
2038:
2039: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2040: IF p_pa_debug_mode = 'Y' THEN
2041: pa_debug.g_err_stage := ' Maintain_Prj_Period_Profile Errored for PA';
2042: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2043: END IF;
2044: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2037: x_msg_data => l_msg_data );
2038:
2039: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2040: IF p_pa_debug_mode = 'Y' THEN
2041: pa_debug.g_err_stage := ' Maintain_Prj_Period_Profile Errored for PA';
2042: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2043: END IF;
2044: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2045: END IF;
2038:
2039: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2040: IF p_pa_debug_mode = 'Y' THEN
2041: pa_debug.g_err_stage := ' Maintain_Prj_Period_Profile Errored for PA';
2042: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2043: END IF;
2044: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2045: END IF;
2046: END IF;
2049: EXCEPTION
2050:
2051: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
2052:
2053: IF P_PA_DEBUG_MODE = 'Y' THEN
2054: pa_debug.g_err_stage:= l_msg_data;
2055: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2056: pa_debug.g_err_stage := sqlerrm;
2057: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2050:
2051: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
2052:
2053: IF P_PA_DEBUG_MODE = 'Y' THEN
2054: pa_debug.g_err_stage:= l_msg_data;
2055: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2056: pa_debug.g_err_stage := sqlerrm;
2057: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2058: END IF;
2051: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
2052:
2053: IF P_PA_DEBUG_MODE = 'Y' THEN
2054: pa_debug.g_err_stage:= l_msg_data;
2055: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2056: pa_debug.g_err_stage := sqlerrm;
2057: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2058: END IF;
2059: RAISE;
2052:
2053: IF P_PA_DEBUG_MODE = 'Y' THEN
2054: pa_debug.g_err_stage:= l_msg_data;
2055: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2056: pa_debug.g_err_stage := sqlerrm;
2057: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2058: END IF;
2059: RAISE;
2060: END Get_Prj_Defaults;
2053: IF P_PA_DEBUG_MODE = 'Y' THEN
2054: pa_debug.g_err_stage:= l_msg_data;
2055: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2056: pa_debug.g_err_stage := sqlerrm;
2057: pa_debug.write(g_module_name,pa_debug.g_err_stage,5);
2058: END IF;
2059: RAISE;
2060: END Get_Prj_Defaults;
2061:
2092:
2093: x_msg_count := 0;
2094: x_return_status := FND_API.G_RET_STS_SUCCESS;
2095:
2096: pa_debug.set_err_stack('Get_Curr_Period_Profile_Info');
2097: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2098: l_debug_mode := NVL(l_debug_mode, 'Y');
2099: IF P_PA_DEBUG_MODE = 'Y' THEN
2100: pa_debug.set_process('Get_Curr_Period_Profile_Info: ' || 'PLSQL','LOG',l_debug_mode);
2093: x_msg_count := 0;
2094: x_return_status := FND_API.G_RET_STS_SUCCESS;
2095:
2096: pa_debug.set_err_stack('Get_Curr_Period_Profile_Info');
2097: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2098: l_debug_mode := NVL(l_debug_mode, 'Y');
2099: IF P_PA_DEBUG_MODE = 'Y' THEN
2100: pa_debug.set_process('Get_Curr_Period_Profile_Info: ' || 'PLSQL','LOG',l_debug_mode);
2101: END IF;
2095:
2096: pa_debug.set_err_stack('Get_Curr_Period_Profile_Info');
2097: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2098: l_debug_mode := NVL(l_debug_mode, 'Y');
2099: IF P_PA_DEBUG_MODE = 'Y' THEN
2100: pa_debug.set_process('Get_Curr_Period_Profile_Info: ' || 'PLSQL','LOG',l_debug_mode);
2101: END IF;
2102:
2103: -- Check for not null parameters
2096: pa_debug.set_err_stack('Get_Curr_Period_Profile_Info');
2097: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2098: l_debug_mode := NVL(l_debug_mode, 'Y');
2099: IF P_PA_DEBUG_MODE = 'Y' THEN
2100: pa_debug.set_process('Get_Curr_Period_Profile_Info: ' || 'PLSQL','LOG',l_debug_mode);
2101: END IF;
2102:
2103: -- Check for not null parameters
2104:
2101: END IF;
2102:
2103: -- Check for not null parameters
2104:
2105: pa_debug.g_err_stage := 'Checking for valid parameters:';
2106: IF P_PA_DEBUG_MODE = 'Y' THEN
2107: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2108: END IF;
2109:
2102:
2103: -- Check for not null parameters
2104:
2105: pa_debug.g_err_stage := 'Checking for valid parameters:';
2106: IF P_PA_DEBUG_MODE = 'Y' THEN
2107: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2108: END IF;
2109:
2110: IF (p_project_id IS NULL) OR
2103: -- Check for not null parameters
2104:
2105: pa_debug.g_err_stage := 'Checking for valid parameters:';
2106: IF P_PA_DEBUG_MODE = 'Y' THEN
2107: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2108: END IF;
2109:
2110: IF (p_project_id IS NULL) OR
2111: (p_period_type NOT IN (PA_FP_CONSTANTS_PKG.G_PERIOD_TYPE_GL,PA_FP_CONSTANTS_PKG.G_PERIOD_TYPE_PA)) OR
2111: (p_period_type NOT IN (PA_FP_CONSTANTS_PKG.G_PERIOD_TYPE_GL,PA_FP_CONSTANTS_PKG.G_PERIOD_TYPE_PA)) OR
2112: (p_period_profile_type IS NULL)
2113: THEN
2114:
2115: pa_debug.g_err_stage := 'Project='||p_project_id;
2116: IF P_PA_DEBUG_MODE = 'Y' THEN
2117: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2118: END IF;
2119: pa_debug.g_err_stage := 'Period_type='||p_period_type;
2112: (p_period_profile_type IS NULL)
2113: THEN
2114:
2115: pa_debug.g_err_stage := 'Project='||p_project_id;
2116: IF P_PA_DEBUG_MODE = 'Y' THEN
2117: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2118: END IF;
2119: pa_debug.g_err_stage := 'Period_type='||p_period_type;
2120: IF P_PA_DEBUG_MODE = 'Y' THEN
2113: THEN
2114:
2115: pa_debug.g_err_stage := 'Project='||p_project_id;
2116: IF P_PA_DEBUG_MODE = 'Y' THEN
2117: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2118: END IF;
2119: pa_debug.g_err_stage := 'Period_type='||p_period_type;
2120: IF P_PA_DEBUG_MODE = 'Y' THEN
2121: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2115: pa_debug.g_err_stage := 'Project='||p_project_id;
2116: IF P_PA_DEBUG_MODE = 'Y' THEN
2117: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2118: END IF;
2119: pa_debug.g_err_stage := 'Period_type='||p_period_type;
2120: IF P_PA_DEBUG_MODE = 'Y' THEN
2121: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2122: END IF;
2123: pa_debug.g_err_stage := 'P_period_profile_type='||p_period_profile_type;
2116: IF P_PA_DEBUG_MODE = 'Y' THEN
2117: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2118: END IF;
2119: pa_debug.g_err_stage := 'Period_type='||p_period_type;
2120: IF P_PA_DEBUG_MODE = 'Y' THEN
2121: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2122: END IF;
2123: pa_debug.g_err_stage := 'P_period_profile_type='||p_period_profile_type;
2124: IF P_PA_DEBUG_MODE = 'Y' THEN
2117: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2118: END IF;
2119: pa_debug.g_err_stage := 'Period_type='||p_period_type;
2120: IF P_PA_DEBUG_MODE = 'Y' THEN
2121: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2122: END IF;
2123: pa_debug.g_err_stage := 'P_period_profile_type='||p_period_profile_type;
2124: IF P_PA_DEBUG_MODE = 'Y' THEN
2125: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2119: pa_debug.g_err_stage := 'Period_type='||p_period_type;
2120: IF P_PA_DEBUG_MODE = 'Y' THEN
2121: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2122: END IF;
2123: pa_debug.g_err_stage := 'P_period_profile_type='||p_period_profile_type;
2124: IF P_PA_DEBUG_MODE = 'Y' THEN
2125: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2126: END IF;
2127:
2120: IF P_PA_DEBUG_MODE = 'Y' THEN
2121: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2122: END IF;
2123: pa_debug.g_err_stage := 'P_period_profile_type='||p_period_profile_type;
2124: IF P_PA_DEBUG_MODE = 'Y' THEN
2125: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2126: END IF;
2127:
2128: PA_UTILS.ADD_MESSAGE(p_app_short_name=> 'PA',
2121: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2122: END IF;
2123: pa_debug.g_err_stage := 'P_period_profile_type='||p_period_profile_type;
2124: IF P_PA_DEBUG_MODE = 'Y' THEN
2125: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2126: END IF;
2127:
2128: PA_UTILS.ADD_MESSAGE(p_app_short_name=> 'PA',
2129: p_msg_name => 'PA_FP_INV_PARAM_PASSED');
2131: RAISE PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc;
2132:
2133: END IF;
2134:
2135: pa_debug.g_err_stage := 'Parameter validation complete';
2136: IF P_PA_DEBUG_MODE = 'Y' THEN
2137: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2138: END IF;
2139:
2132:
2133: END IF;
2134:
2135: pa_debug.g_err_stage := 'Parameter validation complete';
2136: IF P_PA_DEBUG_MODE = 'Y' THEN
2137: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2138: END IF;
2139:
2140: --Fetch Profile Info
2133: END IF;
2134:
2135: pa_debug.g_err_stage := 'Parameter validation complete';
2136: IF P_PA_DEBUG_MODE = 'Y' THEN
2137: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2138: END IF;
2139:
2140: --Fetch Profile Info
2141:
2140: --Fetch Profile Info
2141:
2142: BEGIN
2143:
2144: pa_debug.g_err_stage := 'Fetching Profile Info';
2145: IF P_PA_DEBUG_MODE = 'Y' THEN
2146: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2147: END IF;
2148:
2141:
2142: BEGIN
2143:
2144: pa_debug.g_err_stage := 'Fetching Profile Info';
2145: IF P_PA_DEBUG_MODE = 'Y' THEN
2146: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2147: END IF;
2148:
2149: SELECT period_profile_id
2142: BEGIN
2143:
2144: pa_debug.g_err_stage := 'Fetching Profile Info';
2145: IF P_PA_DEBUG_MODE = 'Y' THEN
2146: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2147: END IF;
2148:
2149: SELECT period_profile_id
2150: ,period_name1
2163: WHEN NO_DATA_FOUND THEN
2164:
2165: --There is no current profile for project.return null
2166:
2167: pa_debug.g_err_stage := 'Current period profile doesnt exist for project';
2168: IF P_PA_DEBUG_MODE = 'Y' THEN
2169: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2170: END IF;
2171:
2164:
2165: --There is no current profile for project.return null
2166:
2167: pa_debug.g_err_stage := 'Current period profile doesnt exist for project';
2168: IF P_PA_DEBUG_MODE = 'Y' THEN
2169: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2170: END IF;
2171:
2172: l_period_profile_id := NULL;
2165: --There is no current profile for project.return null
2166:
2167: pa_debug.g_err_stage := 'Current period profile doesnt exist for project';
2168: IF P_PA_DEBUG_MODE = 'Y' THEN
2169: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2170: END IF;
2171:
2172: l_period_profile_id := NULL;
2173: l_start_period := NULL;
2181: x_start_period := l_start_period;
2182: x_end_period := l_end_period;
2183:
2184:
2185: pa_debug.g_err_stage := ' Exiting Get_Curr_Period_Profile_Info';
2186: IF P_PA_DEBUG_MODE = 'Y' THEN
2187: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2188: END IF;
2189: pa_debug.reset_err_stack;
2182: x_end_period := l_end_period;
2183:
2184:
2185: pa_debug.g_err_stage := ' Exiting Get_Curr_Period_Profile_Info';
2186: IF P_PA_DEBUG_MODE = 'Y' THEN
2187: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2188: END IF;
2189: pa_debug.reset_err_stack;
2190: EXCEPTION
2183:
2184:
2185: pa_debug.g_err_stage := ' Exiting Get_Curr_Period_Profile_Info';
2186: IF P_PA_DEBUG_MODE = 'Y' THEN
2187: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2188: END IF;
2189: pa_debug.reset_err_stack;
2190: EXCEPTION
2191:
2185: pa_debug.g_err_stage := ' Exiting Get_Curr_Period_Profile_Info';
2186: IF P_PA_DEBUG_MODE = 'Y' THEN
2187: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,3);
2188: END IF;
2189: pa_debug.reset_err_stack;
2190: EXCEPTION
2191:
2192: WHEN PA_FP_CONSTANTS_PKG.Invalid_Arg_Exc THEN
2193:
2211: x_msg_count := l_msg_count;
2212:
2213: END IF;
2214:
2215: pa_debug.g_err_stage:='Invalid Arguments Passed';
2216: IF P_PA_DEBUG_MODE = 'Y' THEN
2217: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2218: END IF;
2219:
2212:
2213: END IF;
2214:
2215: pa_debug.g_err_stage:='Invalid Arguments Passed';
2216: IF P_PA_DEBUG_MODE = 'Y' THEN
2217: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2218: END IF;
2219:
2220: x_return_status:= FND_API.G_RET_STS_ERROR;
2213: END IF;
2214:
2215: pa_debug.g_err_stage:='Invalid Arguments Passed';
2216: IF P_PA_DEBUG_MODE = 'Y' THEN
2217: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2218: END IF;
2219:
2220: x_return_status:= FND_API.G_RET_STS_ERROR;
2221:
2218: END IF;
2219:
2220: x_return_status:= FND_API.G_RET_STS_ERROR;
2221:
2222: pa_debug.reset_err_stack;
2223:
2224: RAISE;
2225:
2226: WHEN Others THEN
2231:
2232: FND_MSG_PUB.add_exc_msg( p_pkg_name=> 'PA_PRJ_PERIOD_PROFILE_UTILS'
2233: ,p_procedure_name => 'Get_Curr_Period_Profile_Info');
2234:
2235: pa_debug.g_err_stage:='Unexpected Error' || SQLERRM;
2236: IF P_PA_DEBUG_MODE = 'Y' THEN
2237: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2238: END IF;
2239:
2232: FND_MSG_PUB.add_exc_msg( p_pkg_name=> 'PA_PRJ_PERIOD_PROFILE_UTILS'
2233: ,p_procedure_name => 'Get_Curr_Period_Profile_Info');
2234:
2235: pa_debug.g_err_stage:='Unexpected Error' || SQLERRM;
2236: IF P_PA_DEBUG_MODE = 'Y' THEN
2237: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2238: END IF;
2239:
2240: pa_debug.reset_err_stack;
2233: ,p_procedure_name => 'Get_Curr_Period_Profile_Info');
2234:
2235: pa_debug.g_err_stage:='Unexpected Error' || SQLERRM;
2236: IF P_PA_DEBUG_MODE = 'Y' THEN
2237: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2238: END IF;
2239:
2240: pa_debug.reset_err_stack;
2241:
2236: IF P_PA_DEBUG_MODE = 'Y' THEN
2237: pa_debug.write('Get_Curr_Period_Profile_Info: ' || g_module_name,pa_debug.g_err_stage,5);
2238: END IF;
2239:
2240: pa_debug.reset_err_stack;
2241:
2242: RAISE;
2243:
2244: END Get_Curr_Period_Profile_Info;
2268:
2269: l_stage number := 0;
2270:
2271: BEGIN
2272: IF P_PA_DEBUG_MODE = 'Y' THEN
2273: pa_debug.init_err_stack('PA_PLAN_MATRIX.GET_AMTTYPE_ID');
2274: END IF;
2275:
2276: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2269: l_stage number := 0;
2270:
2271: BEGIN
2272: IF P_PA_DEBUG_MODE = 'Y' THEN
2273: pa_debug.init_err_stack('PA_PLAN_MATRIX.GET_AMTTYPE_ID');
2274: END IF;
2275:
2276: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2277: l_debug_mode := NVL(l_debug_mode, 'Y');
2272: IF P_PA_DEBUG_MODE = 'Y' THEN
2273: pa_debug.init_err_stack('PA_PLAN_MATRIX.GET_AMTTYPE_ID');
2274: END IF;
2275:
2276: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2277: l_debug_mode := NVL(l_debug_mode, 'Y');
2278:
2279: IF P_PA_DEBUG_MODE = 'Y' THEN
2280: pa_debug.set_process('GET_AMTTYPE_ID: ' || 'PLSQL','LOG',l_debug_mode);
2275:
2276: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2277: l_debug_mode := NVL(l_debug_mode, 'Y');
2278:
2279: IF P_PA_DEBUG_MODE = 'Y' THEN
2280: pa_debug.set_process('GET_AMTTYPE_ID: ' || 'PLSQL','LOG',l_debug_mode);
2281: END IF;
2282:
2283: l_amount_type_id := -99;
2276: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2277: l_debug_mode := NVL(l_debug_mode, 'Y');
2278:
2279: IF P_PA_DEBUG_MODE = 'Y' THEN
2280: pa_debug.set_process('GET_AMTTYPE_ID: ' || 'PLSQL','LOG',l_debug_mode);
2281: END IF;
2282:
2283: l_amount_type_id := -99;
2284:
2298: END IF;
2299: END LOOP;
2300: END IF;
2301: IF l_amount_type_id = -99 THEN
2302: pa_debug.g_err_stage := 'p_amt_typ_code ['||p_amt_typ_code ||']';
2303: IF P_PA_DEBUG_MODE = 'Y' THEN
2304: pa_debug.write_file('GET_AMTTYPE_ID: ' || pa_debug.g_err_stage);
2305: END IF;
2306: END IF;
2299: END LOOP;
2300: END IF;
2301: IF l_amount_type_id = -99 THEN
2302: pa_debug.g_err_stage := 'p_amt_typ_code ['||p_amt_typ_code ||']';
2303: IF P_PA_DEBUG_MODE = 'Y' THEN
2304: pa_debug.write_file('GET_AMTTYPE_ID: ' || pa_debug.g_err_stage);
2305: END IF;
2306: END IF;
2307: pa_debug.reset_err_stack;
2300: END IF;
2301: IF l_amount_type_id = -99 THEN
2302: pa_debug.g_err_stage := 'p_amt_typ_code ['||p_amt_typ_code ||']';
2303: IF P_PA_DEBUG_MODE = 'Y' THEN
2304: pa_debug.write_file('GET_AMTTYPE_ID: ' || pa_debug.g_err_stage);
2305: END IF;
2306: END IF;
2307: pa_debug.reset_err_stack;
2308: RETURN(l_amount_type_id);
2303: IF P_PA_DEBUG_MODE = 'Y' THEN
2304: pa_debug.write_file('GET_AMTTYPE_ID: ' || pa_debug.g_err_stage);
2305: END IF;
2306: END IF;
2307: pa_debug.reset_err_stack;
2308: RETURN(l_amount_type_id);
2309:
2310: EXCEPTION
2311: WHEN OTHERS THEN
2310: EXCEPTION
2311: WHEN OTHERS THEN
2312: FND_MSG_PUB.add_exc_msg(
2313: p_pkg_name => 'PA_FP_ORG_FCST_GEN_PUB.get_amttype_id'
2314: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
2315:
2316: IF P_PA_DEBUG_MODE = 'Y' THEN
2317: pa_debug.write_file('GET_AMTTYPE_ID: ' || SQLERRM);
2318: END IF;
2312: FND_MSG_PUB.add_exc_msg(
2313: p_pkg_name => 'PA_FP_ORG_FCST_GEN_PUB.get_amttype_id'
2314: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
2315:
2316: IF P_PA_DEBUG_MODE = 'Y' THEN
2317: pa_debug.write_file('GET_AMTTYPE_ID: ' || SQLERRM);
2318: END IF;
2319: pa_debug.reset_err_stack;
2320: RAISE;
2313: p_pkg_name => 'PA_FP_ORG_FCST_GEN_PUB.get_amttype_id'
2314: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
2315:
2316: IF P_PA_DEBUG_MODE = 'Y' THEN
2317: pa_debug.write_file('GET_AMTTYPE_ID: ' || SQLERRM);
2318: END IF;
2319: pa_debug.reset_err_stack;
2320: RAISE;
2321: END GET_AMTTYPE_ID;
2315:
2316: IF P_PA_DEBUG_MODE = 'Y' THEN
2317: pa_debug.write_file('GET_AMTTYPE_ID: ' || SQLERRM);
2318: END IF;
2319: pa_debug.reset_err_stack;
2320: RAISE;
2321: END GET_AMTTYPE_ID;
2322:
2323: --This API is called on refresh of period profiles.
2349: l_request_id NUMBER;
2350: BEGIN
2351: l_request_id := FND_GLOBAL.CONC_REQUEST_ID;
2352: -- Setting the Debug Statements
2353: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2354: l_debug_mode := NVL(l_debug_mode, 'N');
2355: IF P_PA_DEBUG_MODE = 'Y' THEN
2356: PA_DEBUG.Set_Curr_Function( p_function => 'Refresh_Period_Profile',
2357: p_debug_mode => l_debug_mode );
2351: l_request_id := FND_GLOBAL.CONC_REQUEST_ID;
2352: -- Setting the Debug Statements
2353: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2354: l_debug_mode := NVL(l_debug_mode, 'N');
2355: IF P_PA_DEBUG_MODE = 'Y' THEN
2356: PA_DEBUG.Set_Curr_Function( p_function => 'Refresh_Period_Profile',
2357: p_debug_mode => l_debug_mode );
2358: END IF;
2359: x_return_status := FND_API.G_RET_STS_SUCCESS;
2352: -- Setting the Debug Statements
2353: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
2354: l_debug_mode := NVL(l_debug_mode, 'N');
2355: IF P_PA_DEBUG_MODE = 'Y' THEN
2356: PA_DEBUG.Set_Curr_Function( p_function => 'Refresh_Period_Profile',
2357: p_debug_mode => l_debug_mode );
2358: END IF;
2359: x_return_status := FND_API.G_RET_STS_SUCCESS;
2360:
2357: p_debug_mode => l_debug_mode );
2358: END IF;
2359: x_return_status := FND_API.G_RET_STS_SUCCESS;
2360:
2361: IF P_PA_DEBUG_MODE = 'Y' THEN
2362: PA_DEBUG.g_err_stage := 'Entering Refresh Period Profile ' ||
2363: 'for Refreshing the Period Profile';
2364: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2365: PA_DEBUG.g_err_stage := 'Concurrent request id :' ||
2358: END IF;
2359: x_return_status := FND_API.G_RET_STS_SUCCESS;
2360:
2361: IF P_PA_DEBUG_MODE = 'Y' THEN
2362: PA_DEBUG.g_err_stage := 'Entering Refresh Period Profile ' ||
2363: 'for Refreshing the Period Profile';
2364: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2365: PA_DEBUG.g_err_stage := 'Concurrent request id :' ||
2366: to_char(nvl(l_request_id,0));
2360:
2361: IF P_PA_DEBUG_MODE = 'Y' THEN
2362: PA_DEBUG.g_err_stage := 'Entering Refresh Period Profile ' ||
2363: 'for Refreshing the Period Profile';
2364: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2365: PA_DEBUG.g_err_stage := 'Concurrent request id :' ||
2366: to_char(nvl(l_request_id,0));
2367: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2368: END IF;
2361: IF P_PA_DEBUG_MODE = 'Y' THEN
2362: PA_DEBUG.g_err_stage := 'Entering Refresh Period Profile ' ||
2363: 'for Refreshing the Period Profile';
2364: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2365: PA_DEBUG.g_err_stage := 'Concurrent request id :' ||
2366: to_char(nvl(l_request_id,0));
2367: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2368: END IF;
2369:
2363: 'for Refreshing the Period Profile';
2364: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2365: PA_DEBUG.g_err_stage := 'Concurrent request id :' ||
2366: to_char(nvl(l_request_id,0));
2367: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2368: END IF;
2369:
2370: -- Set the savepoint to return if any of the merges fail
2371: -- for control items
2376: --If budget version id is null then no processing will take place as there is no
2377: --record in denorm for that budget version id. If no record then it is the case
2378: --of creating a new profile rather than refreshing an existing profile.
2379: IF p_budget_version_id IS NULL THEN
2380: IF P_PA_DEBUG_MODE = 'Y' THEN
2381: PA_DEBUG.g_err_stage := 'No Budget Version ID is specified ' ||
2382: 'or budget version id is null';
2383: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2384: END IF;
2377: --record in denorm for that budget version id. If no record then it is the case
2378: --of creating a new profile rather than refreshing an existing profile.
2379: IF p_budget_version_id IS NULL THEN
2380: IF P_PA_DEBUG_MODE = 'Y' THEN
2381: PA_DEBUG.g_err_stage := 'No Budget Version ID is specified ' ||
2382: 'or budget version id is null';
2383: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2384: END IF;
2385: /* PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
2379: IF p_budget_version_id IS NULL THEN
2380: IF P_PA_DEBUG_MODE = 'Y' THEN
2381: PA_DEBUG.g_err_stage := 'No Budget Version ID is specified ' ||
2382: 'or budget version id is null';
2383: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2384: END IF;
2385: /* PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
2386: p_msg_name => 'NULL_BDGT_VSN_ID');
2387: invalid message code, so commented */
2386: p_msg_name => 'NULL_BDGT_VSN_ID');
2387: invalid message code, so commented */
2388: x_return_status := FND_API.G_RET_STS_ERROR;
2389: /* x_msg_data := 'NULL_BDGT_VSN_ID'; */
2390: IF P_PA_DEBUG_MODE = 'Y' THEN
2391: PA_DEBUG.Reset_Curr_Function;
2392: END IF;
2393: RETURN;
2394: END IF;
2387: invalid message code, so commented */
2388: x_return_status := FND_API.G_RET_STS_ERROR;
2389: /* x_msg_data := 'NULL_BDGT_VSN_ID'; */
2390: IF P_PA_DEBUG_MODE = 'Y' THEN
2391: PA_DEBUG.Reset_Curr_Function;
2392: END IF;
2393: RETURN;
2394: END IF;
2395: -- Setting local variable values
2427: UPDATE_BUDGET_VERSION(p_budget_version_id => l_budget_version_id,
2428: p_return_status => x_return_status,
2429: p_project_id => p_project_id,
2430: p_request_id => l_request_id );
2431: IF P_PA_DEBUG_MODE = 'Y' THEN
2432: PA_DEBUG.Reset_Curr_Function;
2433: END IF;
2434: RETURN;
2435: END IF;
2428: p_return_status => x_return_status,
2429: p_project_id => p_project_id,
2430: p_request_id => l_request_id );
2431: IF P_PA_DEBUG_MODE = 'Y' THEN
2432: PA_DEBUG.Reset_Curr_Function;
2433: END IF;
2434: RETURN;
2435: END IF;
2436:
2462: UPDATE_BUDGET_VERSION(p_budget_version_id => l_budget_version_id,
2463: p_return_status => x_return_status,
2464: p_project_id => p_project_id,
2465: p_request_id => l_request_id );
2466: IF P_PA_DEBUG_MODE = 'Y' THEN
2467: PA_DEBUG.Reset_Curr_Function;
2468: END IF;
2469: RETURN;
2470: END IF;
2463: p_return_status => x_return_status,
2464: p_project_id => p_project_id,
2465: p_request_id => l_request_id );
2466: IF P_PA_DEBUG_MODE = 'Y' THEN
2467: PA_DEBUG.Reset_Curr_Function;
2468: END IF;
2469: RETURN;
2470: END IF;
2471:
2479: EXCEPTION
2480: WHEN OTHERS THEN
2481: FND_MSG_PUB.add_exc_msg
2482: ( p_pkg_name => 'PA_PRJ_PERIOD_PROFILE_UTILS.refresh_period_profile'
2483: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
2484: IF P_PA_DEBUG_MODE = 'Y' THEN
2485: PA_DEBUG.g_err_stage := 'Unexpected error in refresh_period_profile ';
2486: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2487: END IF;
2480: WHEN OTHERS THEN
2481: FND_MSG_PUB.add_exc_msg
2482: ( p_pkg_name => 'PA_PRJ_PERIOD_PROFILE_UTILS.refresh_period_profile'
2483: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
2484: IF P_PA_DEBUG_MODE = 'Y' THEN
2485: PA_DEBUG.g_err_stage := 'Unexpected error in refresh_period_profile ';
2486: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2487: END IF;
2488: ROLLBACK TO before_refresh_pd_profile;
2481: FND_MSG_PUB.add_exc_msg
2482: ( p_pkg_name => 'PA_PRJ_PERIOD_PROFILE_UTILS.refresh_period_profile'
2483: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
2484: IF P_PA_DEBUG_MODE = 'Y' THEN
2485: PA_DEBUG.g_err_stage := 'Unexpected error in refresh_period_profile ';
2486: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2487: END IF;
2488: ROLLBACK TO before_refresh_pd_profile;
2489: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2482: ( p_pkg_name => 'PA_PRJ_PERIOD_PROFILE_UTILS.refresh_period_profile'
2483: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
2484: IF P_PA_DEBUG_MODE = 'Y' THEN
2485: PA_DEBUG.g_err_stage := 'Unexpected error in refresh_period_profile ';
2486: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2487: END IF;
2488: ROLLBACK TO before_refresh_pd_profile;
2489: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2490: UPDATE_BUDGET_VERSION(p_budget_version_id => l_budget_version_id,
2490: UPDATE_BUDGET_VERSION(p_budget_version_id => l_budget_version_id,
2491: p_return_status => x_return_status,
2492: p_project_id => p_project_id,
2493: p_request_id => l_request_id );
2494: IF P_PA_DEBUG_MODE = 'Y' THEN
2495: PA_DEBUG.Reset_Curr_Function;
2496: END IF;
2497: RAISE;
2498: END Refresh_Period_Profile;
2491: p_return_status => x_return_status,
2492: p_project_id => p_project_id,
2493: p_request_id => l_request_id );
2494: IF P_PA_DEBUG_MODE = 'Y' THEN
2495: PA_DEBUG.Reset_Curr_Function;
2496: END IF;
2497: RAISE;
2498: END Refresh_Period_Profile;
2499:
2537: WHERE project_id = l_project_id
2538: FOR UPDATE;
2539: BEGIN
2540: -- Setting the Debug Statements
2541: IF P_PA_DEBUG_MODE = 'Y' THEN
2542: PA_DEBUG.Set_Curr_Function( p_function => 'Wrapper_Refresh_Pd_Profile',
2543: p_debug_mode => p_debug_mode );
2544: END IF;
2545: l_request_id := FND_GLOBAL.CONC_REQUEST_ID;
2538: FOR UPDATE;
2539: BEGIN
2540: -- Setting the Debug Statements
2541: IF P_PA_DEBUG_MODE = 'Y' THEN
2542: PA_DEBUG.Set_Curr_Function( p_function => 'Wrapper_Refresh_Pd_Profile',
2543: p_debug_mode => p_debug_mode );
2544: END IF;
2545: l_request_id := FND_GLOBAL.CONC_REQUEST_ID;
2546:
2543: p_debug_mode => p_debug_mode );
2544: END IF;
2545: l_request_id := FND_GLOBAL.CONC_REQUEST_ID;
2546:
2547: IF P_PA_DEBUG_MODE = 'Y' THEN
2548: PA_DEBUG.g_err_stage := 'Entering Refresh Period Profile WRAPPER ' ||
2549: 'for Conc Request Id :'||to_char(nvl(l_Request_id,0));
2550: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2551: PA_DEBUG.g_err_stage := 'Parameters : ';
2544: END IF;
2545: l_request_id := FND_GLOBAL.CONC_REQUEST_ID;
2546:
2547: IF P_PA_DEBUG_MODE = 'Y' THEN
2548: PA_DEBUG.g_err_stage := 'Entering Refresh Period Profile WRAPPER ' ||
2549: 'for Conc Request Id :'||to_char(nvl(l_Request_id,0));
2550: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2551: PA_DEBUG.g_err_stage := 'Parameters : ';
2552: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2546:
2547: IF P_PA_DEBUG_MODE = 'Y' THEN
2548: PA_DEBUG.g_err_stage := 'Entering Refresh Period Profile WRAPPER ' ||
2549: 'for Conc Request Id :'||to_char(nvl(l_Request_id,0));
2550: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2551: PA_DEBUG.g_err_stage := 'Parameters : ';
2552: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2553: PA_DEBUG.g_err_stage := 'Budget version id1 : '||
2554: to_char(nvl(p_budget_Version_id1,0));
2547: IF P_PA_DEBUG_MODE = 'Y' THEN
2548: PA_DEBUG.g_err_stage := 'Entering Refresh Period Profile WRAPPER ' ||
2549: 'for Conc Request Id :'||to_char(nvl(l_Request_id,0));
2550: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2551: PA_DEBUG.g_err_stage := 'Parameters : ';
2552: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2553: PA_DEBUG.g_err_stage := 'Budget version id1 : '||
2554: to_char(nvl(p_budget_Version_id1,0));
2555: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2548: PA_DEBUG.g_err_stage := 'Entering Refresh Period Profile WRAPPER ' ||
2549: 'for Conc Request Id :'||to_char(nvl(l_Request_id,0));
2550: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2551: PA_DEBUG.g_err_stage := 'Parameters : ';
2552: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2553: PA_DEBUG.g_err_stage := 'Budget version id1 : '||
2554: to_char(nvl(p_budget_Version_id1,0));
2555: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2556: PA_DEBUG.g_err_stage := 'Budget version id2 : '||
2549: 'for Conc Request Id :'||to_char(nvl(l_Request_id,0));
2550: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2551: PA_DEBUG.g_err_stage := 'Parameters : ';
2552: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2553: PA_DEBUG.g_err_stage := 'Budget version id1 : '||
2554: to_char(nvl(p_budget_Version_id1,0));
2555: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2556: PA_DEBUG.g_err_stage := 'Budget version id2 : '||
2557: to_char(nvl(p_budget_Version_id2,0));
2551: PA_DEBUG.g_err_stage := 'Parameters : ';
2552: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2553: PA_DEBUG.g_err_stage := 'Budget version id1 : '||
2554: to_char(nvl(p_budget_Version_id1,0));
2555: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2556: PA_DEBUG.g_err_stage := 'Budget version id2 : '||
2557: to_char(nvl(p_budget_Version_id2,0));
2558: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2559: PA_DEBUG.g_err_stage := 'Project Id : '||
2552: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2553: PA_DEBUG.g_err_stage := 'Budget version id1 : '||
2554: to_char(nvl(p_budget_Version_id1,0));
2555: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2556: PA_DEBUG.g_err_stage := 'Budget version id2 : '||
2557: to_char(nvl(p_budget_Version_id2,0));
2558: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2559: PA_DEBUG.g_err_stage := 'Project Id : '||
2560: to_char(nvl(p_project_id,0));
2554: to_char(nvl(p_budget_Version_id1,0));
2555: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2556: PA_DEBUG.g_err_stage := 'Budget version id2 : '||
2557: to_char(nvl(p_budget_Version_id2,0));
2558: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2559: PA_DEBUG.g_err_stage := 'Project Id : '||
2560: to_char(nvl(p_project_id,0));
2561: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2562: PA_DEBUG.g_err_stage := 'Refresh option code : '||
2555: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2556: PA_DEBUG.g_err_stage := 'Budget version id2 : '||
2557: to_char(nvl(p_budget_Version_id2,0));
2558: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2559: PA_DEBUG.g_err_stage := 'Project Id : '||
2560: to_char(nvl(p_project_id,0));
2561: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2562: PA_DEBUG.g_err_stage := 'Refresh option code : '||
2563: nvl(p_refresh_option_code,'NULL');
2557: to_char(nvl(p_budget_Version_id2,0));
2558: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2559: PA_DEBUG.g_err_stage := 'Project Id : '||
2560: to_char(nvl(p_project_id,0));
2561: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2562: PA_DEBUG.g_err_stage := 'Refresh option code : '||
2563: nvl(p_refresh_option_code,'NULL');
2564: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2565: PA_DEBUG.g_err_stage := 'Pa Profile Id : '||
2558: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2559: PA_DEBUG.g_err_stage := 'Project Id : '||
2560: to_char(nvl(p_project_id,0));
2561: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2562: PA_DEBUG.g_err_stage := 'Refresh option code : '||
2563: nvl(p_refresh_option_code,'NULL');
2564: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2565: PA_DEBUG.g_err_stage := 'Pa Profile Id : '||
2566: to_char(nvl(p_pa_period_profile_id,0));
2560: to_char(nvl(p_project_id,0));
2561: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2562: PA_DEBUG.g_err_stage := 'Refresh option code : '||
2563: nvl(p_refresh_option_code,'NULL');
2564: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2565: PA_DEBUG.g_err_stage := 'Pa Profile Id : '||
2566: to_char(nvl(p_pa_period_profile_id,0));
2567: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2568: PA_DEBUG.g_err_stage := 'Gl Profile Id : '||
2561: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2562: PA_DEBUG.g_err_stage := 'Refresh option code : '||
2563: nvl(p_refresh_option_code,'NULL');
2564: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2565: PA_DEBUG.g_err_stage := 'Pa Profile Id : '||
2566: to_char(nvl(p_pa_period_profile_id,0));
2567: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2568: PA_DEBUG.g_err_stage := 'Gl Profile Id : '||
2569: to_char(nvl(p_gl_period_profile_id,0));
2563: nvl(p_refresh_option_code,'NULL');
2564: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2565: PA_DEBUG.g_err_stage := 'Pa Profile Id : '||
2566: to_char(nvl(p_pa_period_profile_id,0));
2567: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2568: PA_DEBUG.g_err_stage := 'Gl Profile Id : '||
2569: to_char(nvl(p_gl_period_profile_id,0));
2570: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2571: END IF;
2564: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2565: PA_DEBUG.g_err_stage := 'Pa Profile Id : '||
2566: to_char(nvl(p_pa_period_profile_id,0));
2567: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2568: PA_DEBUG.g_err_stage := 'Gl Profile Id : '||
2569: to_char(nvl(p_gl_period_profile_id,0));
2570: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2571: END IF;
2572: retcode := '0';
2566: to_char(nvl(p_pa_period_profile_id,0));
2567: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2568: PA_DEBUG.g_err_stage := 'Gl Profile Id : '||
2569: to_char(nvl(p_gl_period_profile_id,0));
2570: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2571: END IF;
2572: retcode := '0';
2573:
2574: /* Setting local variable values */
2723: AND bv.project_id = p_project_id
2724: AND po.project_id = bv.project_id;
2725: EXCEPTION
2726: WHEN NO_DATA_FOUND THEN
2727: IF P_PA_DEBUG_MODE = 'Y' THEN
2728: PA_DEBUG.g_err_stage := 'No data found while trying ' ||
2729: 'to retrive data for time phased code FOR ' ||
2730: 'l_refresh_option_code ALL';
2731: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2724: AND po.project_id = bv.project_id;
2725: EXCEPTION
2726: WHEN NO_DATA_FOUND THEN
2727: IF P_PA_DEBUG_MODE = 'Y' THEN
2728: PA_DEBUG.g_err_stage := 'No data found while trying ' ||
2729: 'to retrive data for time phased code FOR ' ||
2730: 'l_refresh_option_code ALL';
2731: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2732: END IF;
2727: IF P_PA_DEBUG_MODE = 'Y' THEN
2728: PA_DEBUG.g_err_stage := 'No data found while trying ' ||
2729: 'to retrive data for time phased code FOR ' ||
2730: 'l_refresh_option_code ALL';
2731: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2732: END IF;
2733: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
2734: p_msg_name => 'PA_FP_TM_PHSD_CODE_NOT_FOUND');
2735: retcode := '2';
2733: PA_UTILS.ADD_MESSAGE( p_app_short_name => 'PA',
2734: p_msg_name => 'PA_FP_TM_PHSD_CODE_NOT_FOUND');
2735: retcode := '2';
2736: errbuff := 'PA_FP_TM_PHSD_CODE_NOT_FOUND';
2737: IF P_PA_DEBUG_MODE = 'Y' THEN
2738: PA_DEBUG.Reset_Curr_Function;
2739: END IF;
2740: END;
2741: IF (l_time_phased_code = 'P' and
2734: p_msg_name => 'PA_FP_TM_PHSD_CODE_NOT_FOUND');
2735: retcode := '2';
2736: errbuff := 'PA_FP_TM_PHSD_CODE_NOT_FOUND';
2737: IF P_PA_DEBUG_MODE = 'Y' THEN
2738: PA_DEBUG.Reset_Curr_Function;
2739: END IF;
2740: END;
2741: IF (l_time_phased_code = 'P' and
2742: l_req_id_tab(l_cnt)= l_request_id and
2742: l_req_id_tab(l_cnt)= l_request_id and
2743: l_plan_proc_code_tab(l_cnt) = 'PPP' ) THEN
2744: --Knows that time phased code is PA
2745: --So, check for PA period profile passed to the API
2746: IF P_PA_DEBUG_MODE = 'Y' THEN
2747: PA_DEBUG.g_err_stage := 'calling PP refresh for ' ||
2748: 'PA period : ';
2749: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2750: PA_DEBUG.g_err_stage := 'budget version id ' ||
2743: l_plan_proc_code_tab(l_cnt) = 'PPP' ) THEN
2744: --Knows that time phased code is PA
2745: --So, check for PA period profile passed to the API
2746: IF P_PA_DEBUG_MODE = 'Y' THEN
2747: PA_DEBUG.g_err_stage := 'calling PP refresh for ' ||
2748: 'PA period : ';
2749: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2750: PA_DEBUG.g_err_stage := 'budget version id ' ||
2751: to_char(l_budget_version_id) ||
2745: --So, check for PA period profile passed to the API
2746: IF P_PA_DEBUG_MODE = 'Y' THEN
2747: PA_DEBUG.g_err_stage := 'calling PP refresh for ' ||
2748: 'PA period : ';
2749: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2750: PA_DEBUG.g_err_stage := 'budget version id ' ||
2751: to_char(l_budget_version_id) ||
2752: ' period profile id :'||to_char(l_pa_period_profile_id);
2753: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2746: IF P_PA_DEBUG_MODE = 'Y' THEN
2747: PA_DEBUG.g_err_stage := 'calling PP refresh for ' ||
2748: 'PA period : ';
2749: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2750: PA_DEBUG.g_err_stage := 'budget version id ' ||
2751: to_char(l_budget_version_id) ||
2752: ' period profile id :'||to_char(l_pa_period_profile_id);
2753: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2754: END IF;
2749: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2750: PA_DEBUG.g_err_stage := 'budget version id ' ||
2751: to_char(l_budget_version_id) ||
2752: ' period profile id :'||to_char(l_pa_period_profile_id);
2753: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2754: END IF;
2755: IF l_pa_period_profile_id IS NOT NULL THEN
2756: --Call the refresh period profile with PA profile ID
2757: REFRESH_PERIOD_PROFILE
2775: --Knows that time phased code is GL
2776: --So, check for GL period profile passed to the API
2777: IF l_gl_period_profile_id IS NOT NULL THEN
2778: --Call the refresh period profile with GL profile ID
2779: IF P_PA_DEBUG_MODE = 'Y' THEN
2780: PA_DEBUG.g_err_stage := 'calling PP refresh for ' ||
2781: 'GL period : ';
2782: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2783: PA_DEBUG.g_err_stage := 'budget version id ' ||
2776: --So, check for GL period profile passed to the API
2777: IF l_gl_period_profile_id IS NOT NULL THEN
2778: --Call the refresh period profile with GL profile ID
2779: IF P_PA_DEBUG_MODE = 'Y' THEN
2780: PA_DEBUG.g_err_stage := 'calling PP refresh for ' ||
2781: 'GL period : ';
2782: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2783: PA_DEBUG.g_err_stage := 'budget version id ' ||
2784: to_char(l_budget_version_id) ||
2778: --Call the refresh period profile with GL profile ID
2779: IF P_PA_DEBUG_MODE = 'Y' THEN
2780: PA_DEBUG.g_err_stage := 'calling PP refresh for ' ||
2781: 'GL period : ';
2782: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2783: PA_DEBUG.g_err_stage := 'budget version id ' ||
2784: to_char(l_budget_version_id) ||
2785: ' period profile id :'||to_char(l_gl_period_profile_id);
2786: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2779: IF P_PA_DEBUG_MODE = 'Y' THEN
2780: PA_DEBUG.g_err_stage := 'calling PP refresh for ' ||
2781: 'GL period : ';
2782: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2783: PA_DEBUG.g_err_stage := 'budget version id ' ||
2784: to_char(l_budget_version_id) ||
2785: ' period profile id :'||to_char(l_gl_period_profile_id);
2786: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2787: END IF;
2782: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2783: PA_DEBUG.g_err_stage := 'budget version id ' ||
2784: to_char(l_budget_version_id) ||
2785: ' period profile id :'||to_char(l_gl_period_profile_id);
2786: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2787: END IF;
2788: REFRESH_PERIOD_PROFILE
2789: (
2790: p_budget_version_id => l_budget_version_id,
2836: EXCEPTION
2837: WHEN OTHERS THEN
2838: FND_MSG_PUB.add_exc_msg
2839: ( p_pkg_name => 'PA_PRJ_PERIOD_PROFILE_UTILS.wrapper_refresh_pd_profile'
2840: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
2841: IF P_PA_DEBUG_MODE = 'Y' THEN
2842: PA_DEBUG.g_err_stage := 'Unexpected error in wrapper_refresh_pd_profile ';
2843: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2844: END IF;
2837: WHEN OTHERS THEN
2838: FND_MSG_PUB.add_exc_msg
2839: ( p_pkg_name => 'PA_PRJ_PERIOD_PROFILE_UTILS.wrapper_refresh_pd_profile'
2840: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
2841: IF P_PA_DEBUG_MODE = 'Y' THEN
2842: PA_DEBUG.g_err_stage := 'Unexpected error in wrapper_refresh_pd_profile ';
2843: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2844: END IF;
2845: retcode := '2';
2838: FND_MSG_PUB.add_exc_msg
2839: ( p_pkg_name => 'PA_PRJ_PERIOD_PROFILE_UTILS.wrapper_refresh_pd_profile'
2840: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
2841: IF P_PA_DEBUG_MODE = 'Y' THEN
2842: PA_DEBUG.g_err_stage := 'Unexpected error in wrapper_refresh_pd_profile ';
2843: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2844: END IF;
2845: retcode := '2';
2846: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2839: ( p_pkg_name => 'PA_PRJ_PERIOD_PROFILE_UTILS.wrapper_refresh_pd_profile'
2840: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
2841: IF P_PA_DEBUG_MODE = 'Y' THEN
2842: PA_DEBUG.g_err_stage := 'Unexpected error in wrapper_refresh_pd_profile ';
2843: PA_DEBUG.Log_Message(p_message => PA_DEBUG.g_err_stage);
2844: END IF;
2845: retcode := '2';
2846: l_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2847: UPDATE_BUDGET_VERSION(p_budget_version_id => l_budget_version_id,
2847: UPDATE_BUDGET_VERSION(p_budget_version_id => l_budget_version_id,
2848: p_return_status => l_return_status,
2849: p_project_id => p_project_id,
2850: p_request_id => l_request_id );
2851: IF P_PA_DEBUG_MODE = 'Y' THEN
2852: PA_DEBUG.Reset_Curr_Function;
2853: END IF;
2854: RAISE;
2855: END Wrapper_Refresh_Pd_Profile;
2848: p_return_status => l_return_status,
2849: p_project_id => p_project_id,
2850: p_request_id => l_request_id );
2851: IF P_PA_DEBUG_MODE = 'Y' THEN
2852: PA_DEBUG.Reset_Curr_Function;
2853: END IF;
2854: RAISE;
2855: END Wrapper_Refresh_Pd_Profile;
2856:
3231: EXCEPTION
3232: WHEN OTHERS THEN
3233: FND_MSG_PUB.add_exc_msg
3234: ( p_pkg_name => 'PA_PRJ_PERIOD_PROFILE_UTILS.get_current_period_info'
3235: ,p_procedure_name => PA_DEBUG.G_Err_Stack);
3236: RAISE;
3237: END get_current_period_info;
3238:
3239: