1: package body psp_matrix_driver_pkg as
2: /* $Header: PSPLSMTB.pls 120.5.12010000.4 2009/01/27 07:54:38 sabvenug ship $ */
3:
4: start_period BINARY_INTEGER:=1;
5: global_run_id NUMBER(9);
654: fnd_msg_pub.initialize;
655:
656: -- set the run id for this run
657: -- errbuf := 'Run ID Initialization failed';
658: psp_matrix_driver_pkg.set_runid;
659:
660: -- Introduced the if condition for bug 2863953
661: If p_organization_id is null then
662:
750: -- call the matrix driver procedure to load the respective schedule lines
751: -- errbuf := 'Loading Matrix Driver for Schedule Hierarchy: ' ||
752: -- sch_hier_rec.schedule_hierarchy_id || ' had Failed';
753:
754: -- psp_matrix_driver_pkg.load_table(sch_hier_rec.schedule_hierarchy_id); Commented for bug fix 3697471
755: -- psp_matrix_driver_pkg.purge_table; Commented for bug fix 3697471
756:
757:
758: -- Introduced the following for bug fix 3697471
751: -- errbuf := 'Loading Matrix Driver for Schedule Hierarchy: ' ||
752: -- sch_hier_rec.schedule_hierarchy_id || ' had Failed';
753:
754: -- psp_matrix_driver_pkg.load_table(sch_hier_rec.schedule_hierarchy_id); Commented for bug fix 3697471
755: -- psp_matrix_driver_pkg.purge_table; Commented for bug fix 3697471
756:
757:
758: -- Introduced the following for bug fix 3697471
759: k := 1;
1089: --set the Run Id for the current request
1090: --dbms_output.put_line('Organization List '||p_list_organization_id);
1091:
1092: --X=10
1093: psp_matrix_driver_pkg.set_runid;
1094: l_run_id := psp_matrix_driver_pkg.get_run_id;
1095: --dbms_output.put_line(l_run_id);
1096: --errbuf := 'Run id '||global_run_id;
1097: psp_matrix_driver_pkg.purge_table;
1090: --dbms_output.put_line('Organization List '||p_list_organization_id);
1091:
1092: --X=10
1093: psp_matrix_driver_pkg.set_runid;
1094: l_run_id := psp_matrix_driver_pkg.get_run_id;
1095: --dbms_output.put_line(l_run_id);
1096: --errbuf := 'Run id '||global_run_id;
1097: psp_matrix_driver_pkg.purge_table;
1098:
1093: psp_matrix_driver_pkg.set_runid;
1094: l_run_id := psp_matrix_driver_pkg.get_run_id;
1095: --dbms_output.put_line(l_run_id);
1096: --errbuf := 'Run id '||global_run_id;
1097: psp_matrix_driver_pkg.purge_table;
1098:
1099: --X=20
1100:
1101: If p_list_organization_id is null then
1101: If p_list_organization_id is null then
1102:
1103: For l_org_rec in c_all_org
1104: loop
1105: psp_matrix_driver_pkg.load_table_schedule(to_number(l_org_rec.organization_id)
1106: ,p_business_group_id,p_set_of_books_id);
1107: psp_matrix_driver_pkg.purge_table;
1108: end loop;
1109:
1103: For l_org_rec in c_all_org
1104: loop
1105: psp_matrix_driver_pkg.load_table_schedule(to_number(l_org_rec.organization_id)
1106: ,p_business_group_id,p_set_of_books_id);
1107: psp_matrix_driver_pkg.purge_table;
1108: end loop;
1109:
1110:
1111: else
1116: IF (l_end_position = 0) THEN
1117: l_end_position := l_org_length + 1;
1118: END IF;
1119: l_org_id := TO_NUMBER(SUBSTR(p_list_organization_id, l_begin_position,(l_end_position - l_begin_position)));
1120: psp_matrix_driver_pkg.load_table_schedule(to_number(l_org_id),p_business_group_id,p_set_of_books_id);
1121: psp_matrix_driver_pkg.purge_table;
1122: IF (l_end_position > l_org_length) THEN
1123: EXIT;
1124: END IF;
1117: l_end_position := l_org_length + 1;
1118: END IF;
1119: l_org_id := TO_NUMBER(SUBSTR(p_list_organization_id, l_begin_position,(l_end_position - l_begin_position)));
1120: psp_matrix_driver_pkg.load_table_schedule(to_number(l_org_id),p_business_group_id,p_set_of_books_id);
1121: psp_matrix_driver_pkg.purge_table;
1122: IF (l_end_position > l_org_length) THEN
1123: EXIT;
1124: END IF;
1125: l_begin_position := l_end_position + 1;
1386: OPEN sch_hier_cur;
1387: LOOP
1388: FETCH sch_hier_cur INTO l_schedule_hierarchy_id;
1389: EXIT WHEN sch_hier_cur%NOTFOUND;
1390: psp_matrix_driver_pkg.clear_table('REFRESH');
1391: psp_matrix_driver_pkg.purge_table;
1392: psp_matrix_driver_pkg.load_table(l_schedule_hierarchy_id);
1393: IF (NOT psp_matrix_driver_pkg.check_exceedence(p_assignment_id)) THEN
1394: l_invalid_count := l_invalid_count + 1;
1387: LOOP
1388: FETCH sch_hier_cur INTO l_schedule_hierarchy_id;
1389: EXIT WHEN sch_hier_cur%NOTFOUND;
1390: psp_matrix_driver_pkg.clear_table('REFRESH');
1391: psp_matrix_driver_pkg.purge_table;
1392: psp_matrix_driver_pkg.load_table(l_schedule_hierarchy_id);
1393: IF (NOT psp_matrix_driver_pkg.check_exceedence(p_assignment_id)) THEN
1394: l_invalid_count := l_invalid_count + 1;
1395: p_hierarchy_id :=l_schedule_hierarchy_id;
1388: FETCH sch_hier_cur INTO l_schedule_hierarchy_id;
1389: EXIT WHEN sch_hier_cur%NOTFOUND;
1390: psp_matrix_driver_pkg.clear_table('REFRESH');
1391: psp_matrix_driver_pkg.purge_table;
1392: psp_matrix_driver_pkg.load_table(l_schedule_hierarchy_id);
1393: IF (NOT psp_matrix_driver_pkg.check_exceedence(p_assignment_id)) THEN
1394: l_invalid_count := l_invalid_count + 1;
1395: p_hierarchy_id :=l_schedule_hierarchy_id;
1396: END IF;
1389: EXIT WHEN sch_hier_cur%NOTFOUND;
1390: psp_matrix_driver_pkg.clear_table('REFRESH');
1391: psp_matrix_driver_pkg.purge_table;
1392: psp_matrix_driver_pkg.load_table(l_schedule_hierarchy_id);
1393: IF (NOT psp_matrix_driver_pkg.check_exceedence(p_assignment_id)) THEN
1394: l_invalid_count := l_invalid_count + 1;
1395: p_hierarchy_id :=l_schedule_hierarchy_id;
1396: END IF;
1397: END LOOP;
1395: p_hierarchy_id :=l_schedule_hierarchy_id;
1396: END IF;
1397: END LOOP;
1398: CLOSE sch_hier_cur;
1399: psp_matrix_driver_pkg.clear_table('REFRESH');
1400: psp_matrix_driver_pkg.purge_table;
1401: p_invalid_count := l_invalid_count;
1402: END check_sch_hierarchy;
1403:
1396: END IF;
1397: END LOOP;
1398: CLOSE sch_hier_cur;
1399: psp_matrix_driver_pkg.clear_table('REFRESH');
1400: psp_matrix_driver_pkg.purge_table;
1401: p_invalid_count := l_invalid_count;
1402: END check_sch_hierarchy;
1403:
1404: /* End of code for Bug no 2836176 By tbalacha*/
1403:
1404: /* End of code for Bug no 2836176 By tbalacha*/
1405:
1406:
1407: end psp_matrix_driver_pkg;