1: PACKAGE BODY pqp_budget_maintenance AS
2: /* $Header: pqabvmaintain.pkb 120.14 2012/01/19 07:26:29 rpahune ship $ */
3: g_package_name VARCHAR2(31) := 'pqp_budget_maintenance.';
4: g_debug BOOLEAN := hr_utility.debug_enabled;
5: hr_application_error EXCEPTION;
6: PRAGMA EXCEPTION_INIT (hr_application_error, -20001);
7: -- output record structure
8: TYPE g_output_file_rec_type IS RECORD(
195: WHEN OTHERS
196: THEN
197: clear_cache;
198:
199: IF SQLCODE <> hr_utility.hr_error_number
200: THEN
201: debug_others(l_proc_name, l_proc_step);
202:
203: IF g_debug
204: THEN
205: debug('Leaving: ' || l_proc_name, -999);
206: END IF;
207:
208: hr_utility.raise_error;
209: ELSE
210: RAISE;
211: END IF;
212: END load_cache;
318: WHEN OTHERS
319: THEN
320: clear_cache;
321:
322: IF SQLCODE <> hr_utility.hr_error_number
323: THEN
324: debug_others(l_proc_name, l_proc_step);
325:
326: IF g_debug
327: THEN
328: debug('Leaving: ' || l_proc_name, -999);
329: END IF;
330:
331: hr_utility.raise_error;
332: ELSE
333: RAISE;
334: END IF;
335: END convert_record_to_outputstring;
413: WHEN OTHERS
414: THEN
415: clear_cache;
416:
417: IF SQLCODE <> hr_utility.hr_error_number
418: THEN
419: debug_others(l_proc_name, l_proc_step);
420:
421: IF g_debug
422: THEN
423: debug('Leaving: ' || l_proc_name, -999);
424: END IF;
425:
426: hr_utility.raise_error;
427: ELSE
428: RAISE;
429: END IF;
430: END write_output_file_records;
476: WHEN OTHERS
477: THEN
478: clear_cache;
479:
480: IF SQLCODE <> hr_utility.hr_error_number
481: THEN
482: debug_others(l_proc_name, l_proc_step);
483:
484: IF g_debug
485: THEN
486: debug('Leaving: ' || l_proc_name, -999);
487: END IF;
488:
489: hr_utility.raise_error;
490: ELSE
491: RAISE;
492: END IF;
493: --
582: WHEN OTHERS
583: THEN
584: clear_cache;
585:
586: IF SQLCODE <> hr_utility.hr_error_number
587: THEN
588: debug_others(l_proc_name, l_proc_step);
589:
590: IF g_debug
591: THEN
592: debug('Leaving: ' || l_proc_name, -999);
593: END IF;
594:
595: hr_utility.raise_error;
596: ELSE
597: RAISE;
598: END IF;
599: --
663: -- Criteria exists check for formula id
664: IF l_formula_id IS NULL
665: THEN
666: -- Raise error as the criteria is not generated
667: hr_utility.set_message(8303, 'PQP_230458_ABV_ASGSET_NO_FMLA');
668: fnd_file.put_line(fnd_file.LOG
669: , RPAD('Error', 30) || ': ' || hr_utility.get_message
670: );
671: fnd_file.put_line(fnd_file.LOG, ' ');
665: THEN
666: -- Raise error as the criteria is not generated
667: hr_utility.set_message(8303, 'PQP_230458_ABV_ASGSET_NO_FMLA');
668: fnd_file.put_line(fnd_file.LOG
669: , RPAD('Error', 30) || ': ' || hr_utility.get_message
670: );
671: fnd_file.put_line(fnd_file.LOG, ' ');
672: l_proc_step := 20;
673:
673:
674: IF g_debug
675: THEN
676: debug(l_proc_name, l_proc_step);
677: debug('Error: ' || hr_utility.get_message);
678: END IF;
679:
680: CLOSE csr_get_asg_set_info;
681: hr_utility.raise_error;
677: debug('Error: ' || hr_utility.get_message);
678: END IF;
679:
680: CLOSE csr_get_asg_set_info;
681: hr_utility.raise_error;
682: END IF; -- End if of formula id is null check ...
683: END IF; -- End if of asg criteria row found check ...
684:
685: CLOSE csr_get_asg_set_info;
715: WHEN OTHERS
716: THEN
717: clear_cache;
718:
719: IF SQLCODE <> hr_utility.hr_error_number
720: THEN
721: debug_others(l_proc_name, l_proc_step);
722:
723: IF g_debug
724: THEN
725: debug('Leaving: ' || l_proc_name, -999);
726: END IF;
727:
728: hr_utility.raise_error;
729: ELSE
730: RAISE;
731: END IF;
732: --
996: WHEN OTHERS
997: THEN
998: clear_cache;
999:
1000: IF SQLCODE <> hr_utility.hr_error_number
1001: THEN
1002: debug_others(l_proc_name, l_proc_step);
1003:
1004: IF g_debug
1005: THEN
1006: debug('Leaving: ' || l_proc_name, -999);
1007: END IF;
1008:
1009: hr_utility.raise_error;
1010: ELSE
1011: RAISE;
1012: END IF;
1013: --
1174: WHEN OTHERS
1175: THEN
1176: clear_cache;
1177:
1178: IF SQLCODE <> hr_utility.hr_error_number
1179: THEN
1180: debug_others(l_proc_name, l_proc_step);
1181:
1182: IF g_debug
1183: THEN
1184: debug('Leaving: ' || l_proc_name, -999);
1185: END IF;
1186:
1187: hr_utility.raise_error;
1188: ELSE
1189: RAISE;
1190: END IF;
1191: --
1560: WHEN OTHERS
1561: THEN
1562: clear_cache;
1563:
1564: IF SQLCODE <> hr_utility.hr_error_number
1565: THEN
1566: debug_others(l_proc_name, l_proc_step);
1567:
1568: IF g_debug
1569: THEN
1570: debug('Leaving: ' || l_proc_name, -999);
1571: END IF;
1572:
1573: hr_utility.raise_error;
1574: ELSE
1575: RAISE;
1576: END IF;
1577: END action_creation;
1594: l_proc_step NUMBER(38, 10) := 0;
1595: l_proc_name VARCHAR2(61) := g_package_name || 'archive_data';
1596: BEGIN
1597: g_is_concurrent_program_run := TRUE;
1598: g_debug := hr_utility.debug_enabled;
1599: g_output_file_records.DELETE;
1600:
1601: IF g_debug
1602: THEN
1641: WHEN OTHERS
1642: THEN
1643: clear_cache;
1644:
1645: IF SQLCODE <> hr_utility.hr_error_number
1646: THEN
1647: debug_others(l_proc_name, l_proc_step);
1648:
1649: IF g_debug
1650: THEN
1651: debug('Leaving: ' || l_proc_name, -999);
1652: END IF;
1653:
1654: hr_utility.raise_error;
1655: ELSE
1656: RAISE;
1657: END IF;
1658: END archive_data;
1716: WHEN OTHERS
1717: THEN
1718: clear_cache;
1719:
1720: IF SQLCODE <> hr_utility.hr_error_number
1721: THEN
1722: debug_others(l_proc_name, l_proc_step);
1723:
1724: IF g_debug
1725: THEN
1726: debug('Leaving: ' || l_proc_name, -999);
1727: END IF;
1728:
1729: hr_utility.raise_error;
1730: ELSE
1731: RAISE;
1732: END IF;
1733: END sort_event_dates;
1780: THEN
1781: debug(l_proc_name, l_proc_step);
1782: END IF;
1783: CLOSE csr_min_aat_start_date;
1784: hr_utility.set_message(8303, 'PQP_230113_AAT_MISSING_CONTRCT');
1785: hr_utility.set_message_token('EFFECTIVEDATE',
1786: fnd_date.date_to_displaydate(p_effective_date)
1787: );
1788: hr_utility.raise_error;
1781: debug(l_proc_name, l_proc_step);
1782: END IF;
1783: CLOSE csr_min_aat_start_date;
1784: hr_utility.set_message(8303, 'PQP_230113_AAT_MISSING_CONTRCT');
1785: hr_utility.set_message_token('EFFECTIVEDATE',
1786: fnd_date.date_to_displaydate(p_effective_date)
1787: );
1788: hr_utility.raise_error;
1789: END IF;
1784: hr_utility.set_message(8303, 'PQP_230113_AAT_MISSING_CONTRCT');
1785: hr_utility.set_message_token('EFFECTIVEDATE',
1786: fnd_date.date_to_displaydate(p_effective_date)
1787: );
1788: hr_utility.raise_error;
1789: END IF;
1790: CLOSE csr_min_aat_start_date;
1791:
1792: OPEN csr_min_asg_start_date(p_assignment_id);
1800: THEN
1801: debug(l_proc_name, l_proc_step);
1802: END IF;
1803: CLOSE csr_min_asg_start_date;
1804: hr_utility.set_message(8303, 'PQP_230456_FTE_NO_ASG_DETAILS');
1805: hr_utility.set_message_token('EFFECTIVEDATE',
1806: fnd_date.date_to_displaydate(p_effective_date)
1807: );
1808: hr_utility.raise_error;
1801: debug(l_proc_name, l_proc_step);
1802: END IF;
1803: CLOSE csr_min_asg_start_date;
1804: hr_utility.set_message(8303, 'PQP_230456_FTE_NO_ASG_DETAILS');
1805: hr_utility.set_message_token('EFFECTIVEDATE',
1806: fnd_date.date_to_displaydate(p_effective_date)
1807: );
1808: hr_utility.raise_error;
1809: END IF;
1804: hr_utility.set_message(8303, 'PQP_230456_FTE_NO_ASG_DETAILS');
1805: hr_utility.set_message_token('EFFECTIVEDATE',
1806: fnd_date.date_to_displaydate(p_effective_date)
1807: );
1808: hr_utility.raise_error;
1809: END IF;
1810: CLOSE csr_min_asg_start_date;
1811:
1812: IF g_debug
1833: WHEN OTHERS
1834: THEN
1835: clear_cache;
1836:
1837: IF SQLCODE <> hr_utility.hr_error_number
1838: THEN
1839: debug_others(l_proc_name, l_proc_step);
1840:
1841: IF g_debug
1842: THEN
1843: debug('Leaving: ' || l_proc_name, -999);
1844: END IF;
1845:
1846: hr_utility.raise_error;
1847: ELSE
1848: RAISE;
1849: END IF;
1850: END get_earliest_possible_fte_date;
1892: SAVEPOINT maintain_abv_savepoint;
1893:
1894: IF NOT g_is_concurrent_program_run
1895: THEN
1896: g_debug := hr_utility.debug_enabled;
1897: END IF;
1898:
1899: IF g_debug
1900: THEN
1991: IF g_debug
1992: THEN
1993: debug(l_proc_name, l_proc_step);
1994: END IF;
1995: hr_utility.raise_error;
1996: END IF;
1997:
1998: l_log_string := NULL;
1999:
2320: EXCEPTION
2321: WHEN OTHERS
2322: THEN
2323: clear_cache;
2324: IF SQLCODE <> hr_utility.hr_error_number
2325: THEN
2326: debug_others(l_proc_name, l_proc_step);
2327: IF g_debug THEN
2328: debug('Leaving: ' || l_proc_name, -999);
2354: );
2355: write_output_file_records;
2356: g_output_file_records.DELETE;
2357: END IF;
2358: hr_utility.raise_error;
2359:
2360: ELSE
2361: IF g_is_concurrent_program_run THEN
2362: g_output_file_records(g_output_file_records.LAST).status :=
2361: IF g_is_concurrent_program_run THEN
2362: g_output_file_records(g_output_file_records.LAST).status :=
2363: 'Errored';
2364: g_output_file_records(g_output_file_records.LAST).MESSAGE :=
2365: hr_utility.get_message;
2366:
2367: fnd_file.put_line(fnd_file.LOG
2368: , RPAD(NVL(g_output_file_records(g_output_file_records.LAST
2369: ).employee_number
2532: WHEN OTHERS
2533: THEN
2534: clear_cache;
2535:
2536: IF SQLCODE <> hr_utility.hr_error_number
2537: THEN
2538: debug_others(l_proc_name, l_proc_step);
2539:
2540: IF g_debug
2541: THEN
2542: debug('Leaving: ' || l_proc_name, -999);
2543: END IF;
2544:
2545: hr_utility.raise_error;
2546: ELSE
2547: RAISE;
2548: END IF;
2549: END get_event_dates;
2668: WHEN OTHERS
2669: THEN
2670: clear_cache;
2671:
2672: IF SQLCODE <> hr_utility.hr_error_number
2673: THEN
2674: debug_others(l_proc_name, l_proc_step);
2675:
2676: IF g_debug
2677: THEN
2678: debug('Leaving: ' || l_proc_name, -999);
2679: END IF;
2680:
2681: hr_utility.raise_error;
2682: ELSE
2683: RAISE;
2684: END IF;
2685: END get_change_dates_from_dti;
2766: WHEN OTHERS
2767: THEN
2768: clear_cache;
2769:
2770: IF SQLCODE <> hr_utility.hr_error_number
2771: THEN
2772: debug_others(l_proc_name, l_proc_step);
2773:
2774: IF g_debug
2775: THEN
2776: debug('Leaving: ' || l_proc_name, -999);
2777: END IF;
2778:
2779: hr_utility.raise_error;
2780: ELSE
2781: RAISE;
2782: END IF;
2783: END execute_custom_function;
3037: IF g_debug
3038: THEN
3039: debug(l_proc_name, l_proc_step);
3040: END IF;
3041: hr_utility.set_message(8303, 'PQP_230113_AAT_MISSING_CONTRCT');
3042: hr_utility.set_message_token('EFFECTIVEDATE'
3043: ,fnd_date.date_to_displaydate(p_effective_date
3044: )
3045: );
3038: THEN
3039: debug(l_proc_name, l_proc_step);
3040: END IF;
3041: hr_utility.set_message(8303, 'PQP_230113_AAT_MISSING_CONTRCT');
3042: hr_utility.set_message_token('EFFECTIVEDATE'
3043: ,fnd_date.date_to_displaydate(p_effective_date
3044: )
3045: );
3046: hr_utility.raise_error;
3042: hr_utility.set_message_token('EFFECTIVEDATE'
3043: ,fnd_date.date_to_displaydate(p_effective_date
3044: )
3045: );
3046: hr_utility.raise_error;
3047: END IF;
3048:
3049: END IF;
3050: CLOSE csr_assignment_contract;
3136: EXCEPTION
3137: WHEN OTHERS
3138: THEN
3139: clear_cache;
3140: IF SQLCODE <> hr_utility.hr_error_number
3141: THEN
3142: debug_others(l_proc_name, l_proc_step);
3143:
3144: IF g_debug
3145: THEN
3146: debug('Leaving: ' || l_proc_name, -999);
3147: END IF;
3148:
3149: hr_utility.raise_error;
3150: ELSE
3151: RAISE;
3152: END IF;
3153: END get_fte_event_dates;
3265: OPEN csr_formula_name(p_formula_id);
3266: FETCH csr_formula_name INTO l_formula_name;
3267: CLOSE csr_formula_name;
3268:
3269: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3270: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3271: hr_utility.set_message_token('MESSAGE',l_outputs(l_out_cnt).VALUE);
3272: hr_utility.raise_error;
3273: END IF; -- IF l_outputs(l_out_cnt).value IS NOT NULL THEN
3266: FETCH csr_formula_name INTO l_formula_name;
3267: CLOSE csr_formula_name;
3268:
3269: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3270: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3271: hr_utility.set_message_token('MESSAGE',l_outputs(l_out_cnt).VALUE);
3272: hr_utility.raise_error;
3273: END IF; -- IF l_outputs(l_out_cnt).value IS NOT NULL THEN
3274:
3267: CLOSE csr_formula_name;
3268:
3269: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3270: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3271: hr_utility.set_message_token('MESSAGE',l_outputs(l_out_cnt).VALUE);
3272: hr_utility.raise_error;
3273: END IF; -- IF l_outputs(l_out_cnt).value IS NOT NULL THEN
3274:
3275: ELSIF( UPPER(l_outputs(l_out_cnt).NAME) =
3268:
3269: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3270: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3271: hr_utility.set_message_token('MESSAGE',l_outputs(l_out_cnt).VALUE);
3272: hr_utility.raise_error;
3273: END IF; -- IF l_outputs(l_out_cnt).value IS NOT NULL THEN
3274:
3275: ELSIF( UPPER(l_outputs(l_out_cnt).NAME) =
3276: TRANSLATE(UPPER(hr_general.decode_lookup('BUDGET_MEASUREMENT_TYPE'
3331: OPEN csr_formula_name(p_formula_id);
3332: FETCH csr_formula_name INTO l_formula_name;
3333: CLOSE csr_formula_name;
3334:
3335: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3336: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3337: l_message := 'The UOM being processed "'||p_uom||'" does not match the UOM "'
3338: ||l_outputs(l_out_cnt).NAME||'" returned';
3339: hr_utility.set_message_token('MESSAGE',l_message);
3332: FETCH csr_formula_name INTO l_formula_name;
3333: CLOSE csr_formula_name;
3334:
3335: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3336: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3337: l_message := 'The UOM being processed "'||p_uom||'" does not match the UOM "'
3338: ||l_outputs(l_out_cnt).NAME||'" returned';
3339: hr_utility.set_message_token('MESSAGE',l_message);
3340: hr_utility.raise_error;
3335: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3336: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3337: l_message := 'The UOM being processed "'||p_uom||'" does not match the UOM "'
3338: ||l_outputs(l_out_cnt).NAME||'" returned';
3339: hr_utility.set_message_token('MESSAGE',l_message);
3340: hr_utility.raise_error;
3341:
3342: END IF; --IF l_outputs(l_out_cnt).name = 'ERROR_MESSAGE'
3343: END LOOP;-- FOR l_out_cnt IN l_outputs.FIRST .. l_outputs.LAST
3336: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3337: l_message := 'The UOM being processed "'||p_uom||'" does not match the UOM "'
3338: ||l_outputs(l_out_cnt).NAME||'" returned';
3339: hr_utility.set_message_token('MESSAGE',l_message);
3340: hr_utility.raise_error;
3341:
3342: END IF; --IF l_outputs(l_out_cnt).name = 'ERROR_MESSAGE'
3343: END LOOP;-- FOR l_out_cnt IN l_outputs.FIRST .. l_outputs.LAST
3344:
3350: WHEN OTHERS
3351: THEN
3352: clear_cache;
3353:
3354: IF SQLCODE <> hr_utility.hr_error_number
3355: THEN
3356: debug_others(l_proc_name, l_proc_step);
3357:
3358: IF g_debug
3359: THEN
3360: debug('Leaving: ' || l_proc_name, -999);
3361: END IF;
3362:
3363: hr_utility.raise_error;
3364: ELSE
3365: RAISE;
3366: END IF;
3367: END update_value_for_event_dates;
3500: THEN
3501: debug(l_proc_name, l_proc_step);
3502: END IF;
3503: CLOSE csr_effective_abv;
3504: hr_utility.set_message(8303, 'PQP_230460_ABV_FUTURE_ROWS');
3505: hr_utility.set_message_token('ABVUOM', p_uom);
3506: hr_utility.raise_error;
3507: END IF; -- IF csr_effective_abv%NOTFOUND
3508:
3501: debug(l_proc_name, l_proc_step);
3502: END IF;
3503: CLOSE csr_effective_abv;
3504: hr_utility.set_message(8303, 'PQP_230460_ABV_FUTURE_ROWS');
3505: hr_utility.set_message_token('ABVUOM', p_uom);
3506: hr_utility.raise_error;
3507: END IF; -- IF csr_effective_abv%NOTFOUND
3508:
3509: CLOSE csr_effective_abv;
3502: END IF;
3503: CLOSE csr_effective_abv;
3504: hr_utility.set_message(8303, 'PQP_230460_ABV_FUTURE_ROWS');
3505: hr_utility.set_message_token('ABVUOM', p_uom);
3506: hr_utility.raise_error;
3507: END IF; -- IF csr_effective_abv%NOTFOUND
3508:
3509: CLOSE csr_effective_abv;
3510: IF p_action <> c_verify THEN
3764: WHEN OTHERS
3765: THEN
3766: clear_cache;
3767:
3768: IF SQLCODE <> hr_utility.hr_error_number
3769: THEN
3770: debug_others(l_proc_name, l_proc_step);
3771:
3772: IF g_debug
3773: THEN
3774: debug('Leaving: ' || l_proc_name, -999);
3775: END IF;
3776:
3777: hr_utility.raise_error;
3778: ELSE
3779: RAISE;
3780: END IF;
3781: END update_and_store_abv;
3919: THEN
3920: debug_exit(l_proc_name);
3921: END IF;
3922:
3923: hr_utility.trace_off;
3924: EXCEPTION
3925: WHEN OTHERS
3926: THEN
3927: clear_cache;
3925: WHEN OTHERS
3926: THEN
3927: clear_cache;
3928:
3929: IF SQLCODE <> hr_utility.hr_error_number
3930: THEN
3931: debug_others(l_proc_name, l_proc_step);
3932:
3933: IF g_debug
3934: THEN
3935: debug('Leaving: ' || l_proc_name, -999);
3936: END IF;
3937:
3938: hr_utility.raise_error;
3939: ELSE
3940: RAISE;
3941: END IF;
3942: END deinitialization_code;