24:
25: g_resource_class_flag VARCHAR2(1); -- cbs change
26: g_res_prec_id NUMBER; -- cbs change
27:
28: P_PA_DEBUG_MODE varchar2(1) := NVL(FND_PROFILE.value('PA_DEBUG_MODE'), 'N');
29: g_module_name VARCHAR2(100) := 'pa.plsql.PA_RESOURCE_MAPPING';
30:
31: ---------------------------------
32: --Gets the Projects Schema name
776:
777:
778: BEGIN
779:
780: PA_DEBUG.init_err_stack('identify_new_plan_res');
781:
782: --Generate SQL statement to populate TMP3
783: --This step differentiates the mapped and
784: --unmapped headers
791: l_SELECT_clause || ' ' ||
792: l_FROM_clause || ' ' ||
793: l_WHERE_clause || ';' ;
794:
795: IF P_PA_DEBUG_MODE = 'Y' THEN
796: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_INSERT_clause '|| l_INSERT_clause ,1);
797: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_SELECT_clause '|| l_SELECT_clause ,1);
798: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_FROM_clause '|| l_FROM_clause ,1);
799: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_WHERE_clause '|| l_WHERE_clause ,1);
792: l_FROM_clause || ' ' ||
793: l_WHERE_clause || ';' ;
794:
795: IF P_PA_DEBUG_MODE = 'Y' THEN
796: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_INSERT_clause '|| l_INSERT_clause ,1);
797: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_SELECT_clause '|| l_SELECT_clause ,1);
798: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_FROM_clause '|| l_FROM_clause ,1);
799: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_WHERE_clause '|| l_WHERE_clause ,1);
800: END IF;
793: l_WHERE_clause || ';' ;
794:
795: IF P_PA_DEBUG_MODE = 'Y' THEN
796: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_INSERT_clause '|| l_INSERT_clause ,1);
797: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_SELECT_clause '|| l_SELECT_clause ,1);
798: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_FROM_clause '|| l_FROM_clause ,1);
799: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_WHERE_clause '|| l_WHERE_clause ,1);
800: END IF;
801:
794:
795: IF P_PA_DEBUG_MODE = 'Y' THEN
796: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_INSERT_clause '|| l_INSERT_clause ,1);
797: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_SELECT_clause '|| l_SELECT_clause ,1);
798: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_FROM_clause '|| l_FROM_clause ,1);
799: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_WHERE_clause '|| l_WHERE_clause ,1);
800: END IF;
801:
802: EXECUTE IMMEDIATE 'BEGIN ' ||l_SQL_statement || ' END;';
795: IF P_PA_DEBUG_MODE = 'Y' THEN
796: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_INSERT_clause '|| l_INSERT_clause ,1);
797: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_SELECT_clause '|| l_SELECT_clause ,1);
798: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_FROM_clause '|| l_FROM_clause ,1);
799: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'identify_new_plan_res l_WHERE_clause '|| l_WHERE_clause ,1);
800: END IF;
801:
802: EXECUTE IMMEDIATE 'BEGIN ' ||l_SQL_statement || ' END;';
803: l_SQL_statement := NULL; --reset SQL statement
802: EXECUTE IMMEDIATE 'BEGIN ' ||l_SQL_statement || ' END;';
803: l_SQL_statement := NULL; --reset SQL statement
804:
805:
806: pa_debug.reset_err_stack;
807:
808: RETURN 0;
809:
810: END;--end function identify_new_plan_res
893:
894: -- Initialize the return status to success
895: x_return_status := FND_API.G_RET_STS_SUCCESS;
896:
897: PA_DEBUG.init_err_stack('create_planning_resource');
898:
899: IF P_PA_DEBUG_MODE = 'Y' THEN
900: pa_debug.write('create_planning_resources: ' || g_module_name,'Before new_planning_resources cursor p_resource_class_id '||p_resource_class_id,1);
901: END IF;
895: x_return_status := FND_API.G_RET_STS_SUCCESS;
896:
897: PA_DEBUG.init_err_stack('create_planning_resource');
898:
899: IF P_PA_DEBUG_MODE = 'Y' THEN
900: pa_debug.write('create_planning_resources: ' || g_module_name,'Before new_planning_resources cursor p_resource_class_id '||p_resource_class_id,1);
901: END IF;
902: --Create missing planning resources in
903: --PA_RESOURCE_LIST_MEMBERS
896:
897: PA_DEBUG.init_err_stack('create_planning_resource');
898:
899: IF P_PA_DEBUG_MODE = 'Y' THEN
900: pa_debug.write('create_planning_resources: ' || g_module_name,'Before new_planning_resources cursor p_resource_class_id '||p_resource_class_id,1);
901: END IF;
902: --Create missing planning resources in
903: --PA_RESOURCE_LIST_MEMBERS
904: FOR planning_res_rec IN new_planning_resources(p_resource_class_id) LOOP
901: END IF;
902: --Create missing planning resources in
903: --PA_RESOURCE_LIST_MEMBERS
904: FOR planning_res_rec IN new_planning_resources(p_resource_class_id) LOOP
905: IF P_PA_DEBUG_MODE = 'Y' THEN
906: pa_debug.write('create_planning_resources: ' || g_module_name,'In new_planning_resources cursor '||planning_res_rec.RES_FORMAT_ID,1);
907: END IF;
908: -- process data record
909: --Call API to create planning resources
902: --Create missing planning resources in
903: --PA_RESOURCE_LIST_MEMBERS
904: FOR planning_res_rec IN new_planning_resources(p_resource_class_id) LOOP
905: IF P_PA_DEBUG_MODE = 'Y' THEN
906: pa_debug.write('create_planning_resources: ' || g_module_name,'In new_planning_resources cursor '||planning_res_rec.RES_FORMAT_ID,1);
907: END IF;
908: -- process data record
909: --Call API to create planning resources
910: --API provided by resource foundation team
947: l_incur_by_res_code := NULL;
948: l_incur_by_res_type := NULL;
949: END IF; */
950:
951: IF P_PA_DEBUG_MODE = 'Y' THEN
952: pa_debug.write('create_planning_resources: ' || g_module_name,'Before calling pa_planning_resource_pvt.create_planning_resource',1);
953: END IF;
954: pa_planning_resource_pvt.create_planning_resource(
955: p_resource_list_id => g_resource_list_id,
948: l_incur_by_res_type := NULL;
949: END IF; */
950:
951: IF P_PA_DEBUG_MODE = 'Y' THEN
952: pa_debug.write('create_planning_resources: ' || g_module_name,'Before calling pa_planning_resource_pvt.create_planning_resource',1);
953: END IF;
954: pa_planning_resource_pvt.create_planning_resource(
955: p_resource_list_id => g_resource_list_id,
956: p_person_id => planning_res_rec.person_id,
980: x_return_status => x_return_status, /* bug#3691060 changed l_return_status to x_return_status */
981: x_msg_count => l_msg_count,
982: x_error_msg_data => l_msg_data );
983:
984: IF P_PA_DEBUG_MODE = 'Y' THEN
985: pa_debug.write('create_planning_resources: ' || g_module_name,'After calling pa_planning_resource_pvt.create_planning_resource l_rlm_id '||l_rlm_id || 'x_return_status '||x_return_status,1);
986: END IF;
987:
988: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
981: x_msg_count => l_msg_count,
982: x_error_msg_data => l_msg_data );
983:
984: IF P_PA_DEBUG_MODE = 'Y' THEN
985: pa_debug.write('create_planning_resources: ' || g_module_name,'After calling pa_planning_resource_pvt.create_planning_resource l_rlm_id '||l_rlm_id || 'x_return_status '||x_return_status,1);
986: END IF;
987:
988: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
989: EXIT;
990: END IF;
991:
992: END LOOP;
993:
994: pa_debug.reset_err_stack;
995:
996: END; --end procedure create_planning_resources
997:
998: -----------------------------------------------
1014:
1015:
1016: BEGIN
1017:
1018: PA_DEBUG.init_err_stack('process_mapped_txns');
1019:
1020: --Move mapped txns to TMP4
1021: --Truncate TMP3 (It will be used to
1022: --map remaining txns)
1029: l_SELECT_clause || ' ' ||
1030: l_FROM_clause || ' ' ||
1031: l_WHERE_clause || ';' ;
1032:
1033: IF P_PA_DEBUG_MODE = 'Y' THEN
1034: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_INSERT_clause '|| l_INSERT_clause ,1);
1035: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_SELECT_clause '|| l_SELECT_clause ,1);
1036: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_FROM_clause '|| l_FROM_clause ,1);
1037: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_WHERE_clause '|| l_WHERE_clause ,1);
1030: l_FROM_clause || ' ' ||
1031: l_WHERE_clause || ';' ;
1032:
1033: IF P_PA_DEBUG_MODE = 'Y' THEN
1034: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_INSERT_clause '|| l_INSERT_clause ,1);
1035: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_SELECT_clause '|| l_SELECT_clause ,1);
1036: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_FROM_clause '|| l_FROM_clause ,1);
1037: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_WHERE_clause '|| l_WHERE_clause ,1);
1038: END IF;
1031: l_WHERE_clause || ';' ;
1032:
1033: IF P_PA_DEBUG_MODE = 'Y' THEN
1034: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_INSERT_clause '|| l_INSERT_clause ,1);
1035: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_SELECT_clause '|| l_SELECT_clause ,1);
1036: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_FROM_clause '|| l_FROM_clause ,1);
1037: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_WHERE_clause '|| l_WHERE_clause ,1);
1038: END IF;
1039:
1032:
1033: IF P_PA_DEBUG_MODE = 'Y' THEN
1034: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_INSERT_clause '|| l_INSERT_clause ,1);
1035: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_SELECT_clause '|| l_SELECT_clause ,1);
1036: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_FROM_clause '|| l_FROM_clause ,1);
1037: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_WHERE_clause '|| l_WHERE_clause ,1);
1038: END IF;
1039:
1040: EXECUTE IMMEDIATE 'BEGIN ' || l_SQL_statement || ' END;';
1033: IF P_PA_DEBUG_MODE = 'Y' THEN
1034: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_INSERT_clause '|| l_INSERT_clause ,1);
1035: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_SELECT_clause '|| l_SELECT_clause ,1);
1036: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_FROM_clause '|| l_FROM_clause ,1);
1037: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'process_mapped_txns l_WHERE_clause '|| l_WHERE_clause ,1);
1038: END IF;
1039:
1040: EXECUTE IMMEDIATE 'BEGIN ' || l_SQL_statement || ' END;';
1041: l_SQL_statement := NULL; --reset SQL statement
1044: --
1045: -- Replaced truncate statement with delete for resolving the auto commit issue.
1046: --EXECUTE IMMEDIATE ('TRUNCATE TABLE ' || get_pa_schema_name || '.PA_RES_LIST_MAP_TMP3');
1047: EXECUTE IMMEDIATE ('DELETE FROM PA_RES_LIST_MAP_TMP3'); --bug#16865233
1048: pa_debug.reset_err_stack;
1049:
1050: RETURN 0;
1051:
1052: END;--end function process_mapped_txns
1056: -----------------------------------------
1057: FUNCTION process_txns_for_next_format RETURN NUMBER IS
1058: BEGIN
1059:
1060: PA_DEBUG.init_err_stack('process_txns_for_next_format');
1061:
1062: --Move txns that did not satisfy format
1063: --to TMP2/TMP1 based on the run sequence
1064: --Truncate processed txns in TMP1/TMP2
1068: -- Pji_Pjp_Fp_Curr_Wrap.print_time(' Before RBS Mapping deletion. ' );
1069: EXECUTE IMMEDIATE ('DELETE FROM PA_RES_LIST_MAP_TMP1 TMP1' || ' WHERE ROWID IN ( SELECT tmp_rowid FROM pa_res_list_map_tmp4 tmp4 ) '); --bug#16865233
1070: -- Pji_Pjp_Fp_Curr_Wrap.print_time(' After RBS Mapping # records deleted = ' || SQL%ROWCOUNT );
1071:
1072: pa_debug.reset_err_stack;
1073:
1074: RETURN 0;
1075:
1076: END;--end function process_txns_for_next_format
1100:
1101: -- Initialize the return status to success
1102: x_return_status := FND_API.G_RET_STS_SUCCESS;
1103:
1104: PA_DEBUG.init_err_stack('map_for_format');
1105:
1106: --Identify new planning resources that need to be created
1107: --Generate SQL for TMP3
1108: l_status := identify_new_plan_res (p_resource_class_id, p_format_id);
1105:
1106: --Identify new planning resources that need to be created
1107: --Generate SQL for TMP3
1108: l_status := identify_new_plan_res (p_resource_class_id, p_format_id);
1109: IF P_PA_DEBUG_MODE = 'Y' THEN
1110: pa_debug.write('map_for_format: ' || g_module_name,'After calling identify_new_plan_res l_status '|| l_status,1);
1111: END IF;
1112:
1113: IF l_status <> 0 THEN
1106: --Identify new planning resources that need to be created
1107: --Generate SQL for TMP3
1108: l_status := identify_new_plan_res (p_resource_class_id, p_format_id);
1109: IF P_PA_DEBUG_MODE = 'Y' THEN
1110: pa_debug.write('map_for_format: ' || g_module_name,'After calling identify_new_plan_res l_status '|| l_status,1);
1111: END IF;
1112:
1113: IF l_status <> 0 THEN
1114: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1120: --This step involves creating new resource list members using
1121: --API provided by resource foundation team
1122: --New planning resources will be created only if the
1123: --resource list is not centrally controlled
1124: IF P_PA_DEBUG_MODE = 'Y' THEN
1125: pa_debug.write('map_for_format: ' || g_module_name,'Before fetching l_res_class_id g_control_flag '||g_control_flag||'g_resource_class_flag '||g_resource_class_flag,1);
1126: END IF;
1127:
1128: IF g_control_flag = 'N' THEN
1121: --API provided by resource foundation team
1122: --New planning resources will be created only if the
1123: --resource list is not centrally controlled
1124: IF P_PA_DEBUG_MODE = 'Y' THEN
1125: pa_debug.write('map_for_format: ' || g_module_name,'Before fetching l_res_class_id g_control_flag '||g_control_flag||'g_resource_class_flag '||g_resource_class_flag,1);
1126: END IF;
1127:
1128: IF g_control_flag = 'N' THEN
1129: if g_resource_class_flag = 'N' then -- cbs change
1127:
1128: IF g_control_flag = 'N' THEN
1129: if g_resource_class_flag = 'N' then -- cbs change
1130:
1131: IF P_PA_DEBUG_MODE = 'Y' THEN
1132: pa_debug.write('map_for_format: ' || g_module_name,'Fetching l_res_class_id',1);
1133: END IF;
1134: begin
1135: select b.resource_class_id
1128: IF g_control_flag = 'N' THEN
1129: if g_resource_class_flag = 'N' then -- cbs change
1130:
1131: IF P_PA_DEBUG_MODE = 'Y' THEN
1132: pa_debug.write('map_for_format: ' || g_module_name,'Fetching l_res_class_id',1);
1133: END IF;
1134: begin
1135: select b.resource_class_id
1136: into l_res_class_id
1138: where a.res_prec_id = g_res_prec_id
1139: and a.eff_res_format_id = p_format_id
1140: and b.res_format_id = a.res_format_id;
1141:
1142: IF P_PA_DEBUG_MODE = 'Y' THEN
1143: pa_debug.write('map_for_format: ' || g_module_name,'Fetched l_res_class_id in map_for_format g_res_prec_id '
1144: ||g_res_prec_id||' p_format_id '||p_format_id||' l_res_class_id '||l_res_class_id,1);
1145: END IF;
1146:
1139: and a.eff_res_format_id = p_format_id
1140: and b.res_format_id = a.res_format_id;
1141:
1142: IF P_PA_DEBUG_MODE = 'Y' THEN
1143: pa_debug.write('map_for_format: ' || g_module_name,'Fetched l_res_class_id in map_for_format g_res_prec_id '
1144: ||g_res_prec_id||' p_format_id '||p_format_id||' l_res_class_id '||l_res_class_id,1);
1145: END IF;
1146:
1147: exception when others then
1144: ||g_res_prec_id||' p_format_id '||p_format_id||' l_res_class_id '||l_res_class_id,1);
1145: END IF;
1146:
1147: exception when others then
1148: IF P_PA_DEBUG_MODE = 'Y' THEN
1149: pa_debug.write('map_for_format: ' || g_module_name,'Error when fetching l_resource_class_id in map_for_format g_res_prec_id '
1150: ||g_res_prec_id||' p_format_id '||p_format_id||' l_res_class_id '||l_res_class_id,1);
1151: pa_debug.write('map_for_format: ' || g_module_name,SQLERRM,1);
1152: END IF;
1145: END IF;
1146:
1147: exception when others then
1148: IF P_PA_DEBUG_MODE = 'Y' THEN
1149: pa_debug.write('map_for_format: ' || g_module_name,'Error when fetching l_resource_class_id in map_for_format g_res_prec_id '
1150: ||g_res_prec_id||' p_format_id '||p_format_id||' l_res_class_id '||l_res_class_id,1);
1151: pa_debug.write('map_for_format: ' || g_module_name,SQLERRM,1);
1152: END IF;
1153: raise;
1147: exception when others then
1148: IF P_PA_DEBUG_MODE = 'Y' THEN
1149: pa_debug.write('map_for_format: ' || g_module_name,'Error when fetching l_resource_class_id in map_for_format g_res_prec_id '
1150: ||g_res_prec_id||' p_format_id '||p_format_id||' l_res_class_id '||l_res_class_id,1);
1151: pa_debug.write('map_for_format: ' || g_module_name,SQLERRM,1);
1152: END IF;
1153: raise;
1154: end;
1155:
1163: x_return_status => x_return_status,
1164: x_msg_count => x_msg_count,
1165: x_msg_data => x_msg_data);
1166: END IF;
1167: IF P_PA_DEBUG_MODE = 'Y' THEN
1168: pa_debug.write('map_for_format: ' || g_module_name,'After calling create_planning_resources x_return_status '|| x_return_status,1);
1169: END IF;
1170:
1171: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1164: x_msg_count => x_msg_count,
1165: x_msg_data => x_msg_data);
1166: END IF;
1167: IF P_PA_DEBUG_MODE = 'Y' THEN
1168: pa_debug.write('map_for_format: ' || g_module_name,'After calling create_planning_resources x_return_status '|| x_return_status,1);
1169: END IF;
1170:
1171: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1172: RETURN;
1175: -- start-00 sridhar_progress
1176:
1177: if g_resource_class_flag = 'N' then
1178:
1179: IF P_PA_DEBUG_MODE = 'Y' THEN
1180: pa_debug.write('map_for_format: ' || g_module_name,'Before updating pa_res_list_map_tmp3 p_format_id '||p_format_id,1);
1181: END IF;
1182: begin
1183:
1176:
1177: if g_resource_class_flag = 'N' then
1178:
1179: IF P_PA_DEBUG_MODE = 'Y' THEN
1180: pa_debug.write('map_for_format: ' || g_module_name,'Before updating pa_res_list_map_tmp3 p_format_id '||p_format_id,1);
1181: END IF;
1182: begin
1183:
1184: UPDATE pa_res_list_map_tmp3 a
1199: AND a.res_format_id = b1.res_format_id
1200: AND d1.res_prec_id = g_res_prec_id
1201: and d1.eff_res_format_id = p_format_id
1202: );
1203: IF P_PA_DEBUG_MODE = 'Y' THEN
1204: pa_debug.write('map_for_format: ' || g_module_name,'After updating pa_res_list_map_tmp3 count '||SQL%ROWCOUNT,1);
1205: END IF;
1206:
1207: EXCEPTION
1200: AND d1.res_prec_id = g_res_prec_id
1201: and d1.eff_res_format_id = p_format_id
1202: );
1203: IF P_PA_DEBUG_MODE = 'Y' THEN
1204: pa_debug.write('map_for_format: ' || g_module_name,'After updating pa_res_list_map_tmp3 count '||SQL%ROWCOUNT,1);
1205: END IF;
1206:
1207: EXCEPTION
1208: WHEN NO_DATA_FOUND THEN
1207: EXCEPTION
1208: WHEN NO_DATA_FOUND THEN
1209: null;
1210: WHEN OTHERS THEN
1211: IF P_PA_DEBUG_MODE = 'Y' THEN
1212: pa_debug.write('map_for_format: ' || g_module_name,'Error when fetching l_resource_class_id in map_for_format g_res_prec_id '
1213: ||g_res_prec_id||' p_format_id '||p_format_id||' l_res_class_id '||l_res_class_id,1);
1214: pa_debug.write('map_for_format: ' || g_module_name,SQLERRM,1);
1215: END IF;
1208: WHEN NO_DATA_FOUND THEN
1209: null;
1210: WHEN OTHERS THEN
1211: IF P_PA_DEBUG_MODE = 'Y' THEN
1212: pa_debug.write('map_for_format: ' || g_module_name,'Error when fetching l_resource_class_id in map_for_format g_res_prec_id '
1213: ||g_res_prec_id||' p_format_id '||p_format_id||' l_res_class_id '||l_res_class_id,1);
1214: pa_debug.write('map_for_format: ' || g_module_name,SQLERRM,1);
1215: END IF;
1216: raise; --SQLERRM
1210: WHEN OTHERS THEN
1211: IF P_PA_DEBUG_MODE = 'Y' THEN
1212: pa_debug.write('map_for_format: ' || g_module_name,'Error when fetching l_resource_class_id in map_for_format g_res_prec_id '
1213: ||g_res_prec_id||' p_format_id '||p_format_id||' l_res_class_id '||l_res_class_id,1);
1214: pa_debug.write('map_for_format: ' || g_module_name,SQLERRM,1);
1215: END IF;
1216: raise; --SQLERRM
1217: END ;
1218: end if;
1219: -- end-00 sridhar_progress
1220: --Move mapped data into TMP4
1221: l_status := -1;
1222: l_status := process_mapped_txns (p_resource_class_id, p_format_id ) ;
1223: IF P_PA_DEBUG_MODE = 'Y' THEN
1224: pa_debug.write('map_for_format: ' || g_module_name,'After calling process_mapped_txns l_status '|| l_status,1);
1225: END IF;
1226:
1227: IF l_status <> 0 THEN
1220: --Move mapped data into TMP4
1221: l_status := -1;
1222: l_status := process_mapped_txns (p_resource_class_id, p_format_id ) ;
1223: IF P_PA_DEBUG_MODE = 'Y' THEN
1224: pa_debug.write('map_for_format: ' || g_module_name,'After calling process_mapped_txns l_status '|| l_status,1);
1225: END IF;
1226:
1227: IF l_status <> 0 THEN
1228: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1233: --between TMP1 and TMP2
1234: l_status := -1;
1235: l_status := process_txns_for_next_format ;
1236:
1237: IF P_PA_DEBUG_MODE = 'Y' THEN
1238: pa_debug.write('map_for_format: ' || g_module_name,'After calling process_txns_for_next_format l_status '|| l_status,1);
1239: END IF;
1240: IF l_status <> 0 THEN
1241: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1234: l_status := -1;
1235: l_status := process_txns_for_next_format ;
1236:
1237: IF P_PA_DEBUG_MODE = 'Y' THEN
1238: pa_debug.write('map_for_format: ' || g_module_name,'After calling process_txns_for_next_format l_status '|| l_status,1);
1239: END IF;
1240: IF l_status <> 0 THEN
1241: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1242: RETURN;
1241: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1242: RETURN;
1243: END IF;
1244:
1245: pa_debug.reset_err_stack;
1246:
1247: END; --end procedure map_for_format
1248:
1249:
1324: WHEN NO_DATA_FOUND THEN
1325: NULL;
1326: END;
1327:
1328: IF P_PA_DEBUG_MODE = 'Y' THEN
1329: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'enable_resource_classes '||g_resource_class_flag,1);
1330: END IF;
1331:
1332: --For every resource class the transactions have to be mapped
1325: NULL;
1326: END;
1327:
1328: IF P_PA_DEBUG_MODE = 'Y' THEN
1329: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'enable_resource_classes '||g_resource_class_flag,1);
1330: END IF;
1331:
1332: --For every resource class the transactions have to be mapped
1333: --to the resource formats for the given resource list
1448:
1449: FOR i IN 1..l_eff_formats.COUNT LOOP
1450:
1451:
1452: IF P_PA_DEBUG_MODE = 'Y' THEN
1453: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'Calling map_for_format with l_eff_format_id '|| l_eff_formats(i),1);
1454: END IF;
1455:
1456: IF g_resource_class_flag ='N' THEN
1449: FOR i IN 1..l_eff_formats.COUNT LOOP
1450:
1451:
1452: IF P_PA_DEBUG_MODE = 'Y' THEN
1453: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'Calling map_for_format with l_eff_format_id '|| l_eff_formats(i),1);
1454: END IF;
1455:
1456: IF g_resource_class_flag ='N' THEN
1457: g_res_prec_id := l_res_prec_id(i); -- cbs change
1454: END IF;
1455:
1456: IF g_resource_class_flag ='N' THEN
1457: g_res_prec_id := l_res_prec_id(i); -- cbs change
1458: IF P_PA_DEBUG_MODE = 'Y' THEN
1459: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'Calling map_for_format with g_res_prec_id '|| g_res_prec_id,1);
1460: END IF;
1461: END IF;
1462: map_for_format(p_resource_class_id => res_class_rec.resource_class_id,
1455:
1456: IF g_resource_class_flag ='N' THEN
1457: g_res_prec_id := l_res_prec_id(i); -- cbs change
1458: IF P_PA_DEBUG_MODE = 'Y' THEN
1459: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'Calling map_for_format with g_res_prec_id '|| g_res_prec_id,1);
1460: END IF;
1461: END IF;
1462: map_for_format(p_resource_class_id => res_class_rec.resource_class_id,
1463: p_format_id => l_eff_formats(i),
1465: x_return_status => x_return_status,
1466: x_msg_count => x_msg_count,
1467: x_msg_data => x_msg_data);
1468:
1469: IF P_PA_DEBUG_MODE = 'Y' THEN
1470: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'map_for_format x_return_status '|| x_return_status,1);
1471: END IF;
1472:
1473: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1466: x_msg_count => x_msg_count,
1467: x_msg_data => x_msg_data);
1468:
1469: IF P_PA_DEBUG_MODE = 'Y' THEN
1470: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'map_for_format x_return_status '|| x_return_status,1);
1471: END IF;
1472:
1473: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1474: EXIT OUTER;
1475: END IF;
1476:
1477:
1478: IF NOT (txns_to_map_exists) THEN
1479: IF P_PA_DEBUG_MODE = 'Y' THEN
1480: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'map_for_format all transactions mapped',1);
1481: END IF;
1482: EXIT OUTER;
1483: END IF;
1476:
1477:
1478: IF NOT (txns_to_map_exists) THEN
1479: IF P_PA_DEBUG_MODE = 'Y' THEN
1480: pa_debug.write('MAP_RESOURCE_LIST: ' || g_module_name,'map_for_format all transactions mapped',1);
1481: END IF;
1482: EXIT OUTER;
1483: END IF;
1484: