1: package body psp_matrix_driver_pkg as
2: /* $Header: PSPLSMTB.pls 120.5.12010000.2 2008/08/05 10:13:30 ubhat ship $ */
3:
4: start_period BINARY_INTEGER:=1;
5: global_run_id NUMBER(9);
620: fnd_msg_pub.initialize;
621:
622: -- set the run id for this run
623: -- errbuf := 'Run ID Initialization failed';
624: psp_matrix_driver_pkg.set_runid;
625:
626: -- Introduced the if condition for bug 2863953
627: If p_organization_id is null then
628:
716: -- call the matrix driver procedure to load the respective schedule lines
717: -- errbuf := 'Loading Matrix Driver for Schedule Hierarchy: ' ||
718: -- sch_hier_rec.schedule_hierarchy_id || ' had Failed';
719:
720: -- psp_matrix_driver_pkg.load_table(sch_hier_rec.schedule_hierarchy_id); Commented for bug fix 3697471
721: -- psp_matrix_driver_pkg.purge_table; Commented for bug fix 3697471
722:
723:
724: -- Introduced the following for bug fix 3697471
717: -- errbuf := 'Loading Matrix Driver for Schedule Hierarchy: ' ||
718: -- sch_hier_rec.schedule_hierarchy_id || ' had Failed';
719:
720: -- psp_matrix_driver_pkg.load_table(sch_hier_rec.schedule_hierarchy_id); Commented for bug fix 3697471
721: -- psp_matrix_driver_pkg.purge_table; Commented for bug fix 3697471
722:
723:
724: -- Introduced the following for bug fix 3697471
725: k := 1;
1055: --set the Run Id for the current request
1056: --dbms_output.put_line('Organization List '||p_list_organization_id);
1057:
1058: --X=10
1059: psp_matrix_driver_pkg.set_runid;
1060: l_run_id := psp_matrix_driver_pkg.get_run_id;
1061: --dbms_output.put_line(l_run_id);
1062: --errbuf := 'Run id '||global_run_id;
1063: psp_matrix_driver_pkg.purge_table;
1056: --dbms_output.put_line('Organization List '||p_list_organization_id);
1057:
1058: --X=10
1059: psp_matrix_driver_pkg.set_runid;
1060: l_run_id := psp_matrix_driver_pkg.get_run_id;
1061: --dbms_output.put_line(l_run_id);
1062: --errbuf := 'Run id '||global_run_id;
1063: psp_matrix_driver_pkg.purge_table;
1064:
1059: psp_matrix_driver_pkg.set_runid;
1060: l_run_id := psp_matrix_driver_pkg.get_run_id;
1061: --dbms_output.put_line(l_run_id);
1062: --errbuf := 'Run id '||global_run_id;
1063: psp_matrix_driver_pkg.purge_table;
1064:
1065: --X=20
1066:
1067: If p_list_organization_id is null then
1067: If p_list_organization_id is null then
1068:
1069: For l_org_rec in c_all_org
1070: loop
1071: psp_matrix_driver_pkg.load_table_schedule(to_number(l_org_rec.organization_id)
1072: ,p_business_group_id,p_set_of_books_id);
1073: psp_matrix_driver_pkg.purge_table;
1074: end loop;
1075:
1069: For l_org_rec in c_all_org
1070: loop
1071: psp_matrix_driver_pkg.load_table_schedule(to_number(l_org_rec.organization_id)
1072: ,p_business_group_id,p_set_of_books_id);
1073: psp_matrix_driver_pkg.purge_table;
1074: end loop;
1075:
1076:
1077: else
1082: IF (l_end_position = 0) THEN
1083: l_end_position := l_org_length + 1;
1084: END IF;
1085: l_org_id := TO_NUMBER(SUBSTR(p_list_organization_id, l_begin_position,(l_end_position - l_begin_position)));
1086: psp_matrix_driver_pkg.load_table_schedule(to_number(l_org_id),p_business_group_id,p_set_of_books_id);
1087: psp_matrix_driver_pkg.purge_table;
1088: IF (l_end_position > l_org_length) THEN
1089: EXIT;
1090: END IF;
1083: l_end_position := l_org_length + 1;
1084: END IF;
1085: l_org_id := TO_NUMBER(SUBSTR(p_list_organization_id, l_begin_position,(l_end_position - l_begin_position)));
1086: psp_matrix_driver_pkg.load_table_schedule(to_number(l_org_id),p_business_group_id,p_set_of_books_id);
1087: psp_matrix_driver_pkg.purge_table;
1088: IF (l_end_position > l_org_length) THEN
1089: EXIT;
1090: END IF;
1091: l_begin_position := l_end_position + 1;
1352: OPEN sch_hier_cur;
1353: LOOP
1354: FETCH sch_hier_cur INTO l_schedule_hierarchy_id;
1355: EXIT WHEN sch_hier_cur%NOTFOUND;
1356: psp_matrix_driver_pkg.clear_table('REFRESH');
1357: psp_matrix_driver_pkg.purge_table;
1358: psp_matrix_driver_pkg.load_table(l_schedule_hierarchy_id);
1359: IF (NOT psp_matrix_driver_pkg.check_exceedence(p_assignment_id)) THEN
1360: l_invalid_count := l_invalid_count + 1;
1353: LOOP
1354: FETCH sch_hier_cur INTO l_schedule_hierarchy_id;
1355: EXIT WHEN sch_hier_cur%NOTFOUND;
1356: psp_matrix_driver_pkg.clear_table('REFRESH');
1357: psp_matrix_driver_pkg.purge_table;
1358: psp_matrix_driver_pkg.load_table(l_schedule_hierarchy_id);
1359: IF (NOT psp_matrix_driver_pkg.check_exceedence(p_assignment_id)) THEN
1360: l_invalid_count := l_invalid_count + 1;
1361: p_hierarchy_id :=l_schedule_hierarchy_id;
1354: FETCH sch_hier_cur INTO l_schedule_hierarchy_id;
1355: EXIT WHEN sch_hier_cur%NOTFOUND;
1356: psp_matrix_driver_pkg.clear_table('REFRESH');
1357: psp_matrix_driver_pkg.purge_table;
1358: psp_matrix_driver_pkg.load_table(l_schedule_hierarchy_id);
1359: IF (NOT psp_matrix_driver_pkg.check_exceedence(p_assignment_id)) THEN
1360: l_invalid_count := l_invalid_count + 1;
1361: p_hierarchy_id :=l_schedule_hierarchy_id;
1362: END IF;
1355: EXIT WHEN sch_hier_cur%NOTFOUND;
1356: psp_matrix_driver_pkg.clear_table('REFRESH');
1357: psp_matrix_driver_pkg.purge_table;
1358: psp_matrix_driver_pkg.load_table(l_schedule_hierarchy_id);
1359: IF (NOT psp_matrix_driver_pkg.check_exceedence(p_assignment_id)) THEN
1360: l_invalid_count := l_invalid_count + 1;
1361: p_hierarchy_id :=l_schedule_hierarchy_id;
1362: END IF;
1363: END LOOP;
1361: p_hierarchy_id :=l_schedule_hierarchy_id;
1362: END IF;
1363: END LOOP;
1364: CLOSE sch_hier_cur;
1365: psp_matrix_driver_pkg.clear_table('REFRESH');
1366: psp_matrix_driver_pkg.purge_table;
1367: p_invalid_count := l_invalid_count;
1368: END check_sch_hierarchy;
1369:
1362: END IF;
1363: END LOOP;
1364: CLOSE sch_hier_cur;
1365: psp_matrix_driver_pkg.clear_table('REFRESH');
1366: psp_matrix_driver_pkg.purge_table;
1367: p_invalid_count := l_invalid_count;
1368: END check_sch_hierarchy;
1369:
1370: /* End of code for Bug no 2836176 By tbalacha*/
1369:
1370: /* End of code for Bug no 2836176 By tbalacha*/
1371:
1372:
1373: end psp_matrix_driver_pkg;