1: PACKAGE BODY pqp_budget_maintenance AS
2: /* $Header: pqabvmaintain.pkb 120.8.12010000.2 2008/08/25 15:14:13 skpatil 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: --
571: WHEN OTHERS
572: THEN
573: clear_cache;
574:
575: IF SQLCODE <> hr_utility.hr_error_number
576: THEN
577: debug_others(l_proc_name, l_proc_step);
578:
579: IF g_debug
580: THEN
581: debug('Leaving: ' || l_proc_name, -999);
582: END IF;
583:
584: hr_utility.raise_error;
585: ELSE
586: RAISE;
587: END IF;
588: --
652: -- Criteria exists check for formula id
653: IF l_formula_id IS NULL
654: THEN
655: -- Raise error as the criteria is not generated
656: hr_utility.set_message(8303, 'PQP_230458_ABV_ASGSET_NO_FMLA');
657: fnd_file.put_line(fnd_file.LOG
658: , RPAD('Error', 30) || ': ' || hr_utility.get_message
659: );
660: fnd_file.put_line(fnd_file.LOG, ' ');
654: THEN
655: -- Raise error as the criteria is not generated
656: hr_utility.set_message(8303, 'PQP_230458_ABV_ASGSET_NO_FMLA');
657: fnd_file.put_line(fnd_file.LOG
658: , RPAD('Error', 30) || ': ' || hr_utility.get_message
659: );
660: fnd_file.put_line(fnd_file.LOG, ' ');
661: l_proc_step := 20;
662:
662:
663: IF g_debug
664: THEN
665: debug(l_proc_name, l_proc_step);
666: debug('Error: ' || hr_utility.get_message);
667: END IF;
668:
669: CLOSE csr_get_asg_set_info;
670: hr_utility.raise_error;
666: debug('Error: ' || hr_utility.get_message);
667: END IF;
668:
669: CLOSE csr_get_asg_set_info;
670: hr_utility.raise_error;
671: END IF; -- End if of formula id is null check ...
672: END IF; -- End if of asg criteria row found check ...
673:
674: CLOSE csr_get_asg_set_info;
704: WHEN OTHERS
705: THEN
706: clear_cache;
707:
708: IF SQLCODE <> hr_utility.hr_error_number
709: THEN
710: debug_others(l_proc_name, l_proc_step);
711:
712: IF g_debug
713: THEN
714: debug('Leaving: ' || l_proc_name, -999);
715: END IF;
716:
717: hr_utility.raise_error;
718: ELSE
719: RAISE;
720: END IF;
721: --
985: WHEN OTHERS
986: THEN
987: clear_cache;
988:
989: IF SQLCODE <> hr_utility.hr_error_number
990: THEN
991: debug_others(l_proc_name, l_proc_step);
992:
993: IF g_debug
994: THEN
995: debug('Leaving: ' || l_proc_name, -999);
996: END IF;
997:
998: hr_utility.raise_error;
999: ELSE
1000: RAISE;
1001: END IF;
1002: --
1163: WHEN OTHERS
1164: THEN
1165: clear_cache;
1166:
1167: IF SQLCODE <> hr_utility.hr_error_number
1168: THEN
1169: debug_others(l_proc_name, l_proc_step);
1170:
1171: IF g_debug
1172: THEN
1173: debug('Leaving: ' || l_proc_name, -999);
1174: END IF;
1175:
1176: hr_utility.raise_error;
1177: ELSE
1178: RAISE;
1179: END IF;
1180: --
1548: WHEN OTHERS
1549: THEN
1550: clear_cache;
1551:
1552: IF SQLCODE <> hr_utility.hr_error_number
1553: THEN
1554: debug_others(l_proc_name, l_proc_step);
1555:
1556: IF g_debug
1557: THEN
1558: debug('Leaving: ' || l_proc_name, -999);
1559: END IF;
1560:
1561: hr_utility.raise_error;
1562: ELSE
1563: RAISE;
1564: END IF;
1565: END action_creation;
1582: l_proc_step NUMBER(38, 10) := 0;
1583: l_proc_name VARCHAR2(61) := g_package_name || 'archive_data';
1584: BEGIN
1585: g_is_concurrent_program_run := TRUE;
1586: g_debug := hr_utility.debug_enabled;
1587: g_output_file_records.DELETE;
1588:
1589: IF g_debug
1590: THEN
1629: WHEN OTHERS
1630: THEN
1631: clear_cache;
1632:
1633: IF SQLCODE <> hr_utility.hr_error_number
1634: THEN
1635: debug_others(l_proc_name, l_proc_step);
1636:
1637: IF g_debug
1638: THEN
1639: debug('Leaving: ' || l_proc_name, -999);
1640: END IF;
1641:
1642: hr_utility.raise_error;
1643: ELSE
1644: RAISE;
1645: END IF;
1646: END archive_data;
1704: WHEN OTHERS
1705: THEN
1706: clear_cache;
1707:
1708: IF SQLCODE <> hr_utility.hr_error_number
1709: THEN
1710: debug_others(l_proc_name, l_proc_step);
1711:
1712: IF g_debug
1713: THEN
1714: debug('Leaving: ' || l_proc_name, -999);
1715: END IF;
1716:
1717: hr_utility.raise_error;
1718: ELSE
1719: RAISE;
1720: END IF;
1721: END sort_event_dates;
1768: THEN
1769: debug(l_proc_name, l_proc_step);
1770: END IF;
1771: CLOSE csr_min_aat_start_date;
1772: hr_utility.set_message(8303, 'PQP_230113_AAT_MISSING_CONTRCT');
1773: hr_utility.set_message_token('EFFECTIVEDATE',
1774: fnd_date.date_to_displaydate(p_effective_date)
1775: );
1776: hr_utility.raise_error;
1769: debug(l_proc_name, l_proc_step);
1770: END IF;
1771: CLOSE csr_min_aat_start_date;
1772: hr_utility.set_message(8303, 'PQP_230113_AAT_MISSING_CONTRCT');
1773: hr_utility.set_message_token('EFFECTIVEDATE',
1774: fnd_date.date_to_displaydate(p_effective_date)
1775: );
1776: hr_utility.raise_error;
1777: END IF;
1772: hr_utility.set_message(8303, 'PQP_230113_AAT_MISSING_CONTRCT');
1773: hr_utility.set_message_token('EFFECTIVEDATE',
1774: fnd_date.date_to_displaydate(p_effective_date)
1775: );
1776: hr_utility.raise_error;
1777: END IF;
1778: CLOSE csr_min_aat_start_date;
1779:
1780: OPEN csr_min_asg_start_date(p_assignment_id);
1788: THEN
1789: debug(l_proc_name, l_proc_step);
1790: END IF;
1791: CLOSE csr_min_asg_start_date;
1792: hr_utility.set_message(8303, 'PQP_230456_FTE_NO_ASG_DETAILS');
1793: hr_utility.set_message_token('EFFECTIVEDATE',
1794: fnd_date.date_to_displaydate(p_effective_date)
1795: );
1796: hr_utility.raise_error;
1789: debug(l_proc_name, l_proc_step);
1790: END IF;
1791: CLOSE csr_min_asg_start_date;
1792: hr_utility.set_message(8303, 'PQP_230456_FTE_NO_ASG_DETAILS');
1793: hr_utility.set_message_token('EFFECTIVEDATE',
1794: fnd_date.date_to_displaydate(p_effective_date)
1795: );
1796: hr_utility.raise_error;
1797: END IF;
1792: hr_utility.set_message(8303, 'PQP_230456_FTE_NO_ASG_DETAILS');
1793: hr_utility.set_message_token('EFFECTIVEDATE',
1794: fnd_date.date_to_displaydate(p_effective_date)
1795: );
1796: hr_utility.raise_error;
1797: END IF;
1798: CLOSE csr_min_asg_start_date;
1799:
1800: IF g_debug
1821: WHEN OTHERS
1822: THEN
1823: clear_cache;
1824:
1825: IF SQLCODE <> hr_utility.hr_error_number
1826: THEN
1827: debug_others(l_proc_name, l_proc_step);
1828:
1829: IF g_debug
1830: THEN
1831: debug('Leaving: ' || l_proc_name, -999);
1832: END IF;
1833:
1834: hr_utility.raise_error;
1835: ELSE
1836: RAISE;
1837: END IF;
1838: END get_earliest_possible_fte_date;
1869: SAVEPOINT maintain_abv_savepoint;
1870:
1871: IF NOT g_is_concurrent_program_run
1872: THEN
1873: g_debug := hr_utility.debug_enabled;
1874: END IF;
1875:
1876: IF g_debug
1877: THEN
1968: IF g_debug
1969: THEN
1970: debug(l_proc_name, l_proc_step);
1971: END IF;
1972: hr_utility.raise_error;
1973: END IF;
1974:
1975: l_log_string := NULL;
1976:
2278: EXCEPTION
2279: WHEN OTHERS
2280: THEN
2281: clear_cache;
2282: IF SQLCODE <> hr_utility.hr_error_number
2283: THEN
2284: debug_others(l_proc_name, l_proc_step);
2285: IF g_debug THEN
2286: debug('Leaving: ' || l_proc_name, -999);
2312: );
2313: write_output_file_records;
2314: g_output_file_records.DELETE;
2315: END IF;
2316: hr_utility.raise_error;
2317:
2318: ELSE
2319: IF g_is_concurrent_program_run THEN
2320: g_output_file_records(g_output_file_records.LAST).status :=
2319: IF g_is_concurrent_program_run THEN
2320: g_output_file_records(g_output_file_records.LAST).status :=
2321: 'Errored';
2322: g_output_file_records(g_output_file_records.LAST).MESSAGE :=
2323: hr_utility.get_message;
2324:
2325: fnd_file.put_line(fnd_file.LOG
2326: , RPAD(NVL(g_output_file_records(g_output_file_records.LAST
2327: ).employee_number
2490: WHEN OTHERS
2491: THEN
2492: clear_cache;
2493:
2494: IF SQLCODE <> hr_utility.hr_error_number
2495: THEN
2496: debug_others(l_proc_name, l_proc_step);
2497:
2498: IF g_debug
2499: THEN
2500: debug('Leaving: ' || l_proc_name, -999);
2501: END IF;
2502:
2503: hr_utility.raise_error;
2504: ELSE
2505: RAISE;
2506: END IF;
2507: END get_event_dates;
2626: WHEN OTHERS
2627: THEN
2628: clear_cache;
2629:
2630: IF SQLCODE <> hr_utility.hr_error_number
2631: THEN
2632: debug_others(l_proc_name, l_proc_step);
2633:
2634: IF g_debug
2635: THEN
2636: debug('Leaving: ' || l_proc_name, -999);
2637: END IF;
2638:
2639: hr_utility.raise_error;
2640: ELSE
2641: RAISE;
2642: END IF;
2643: END get_change_dates_from_dti;
2724: WHEN OTHERS
2725: THEN
2726: clear_cache;
2727:
2728: IF SQLCODE <> hr_utility.hr_error_number
2729: THEN
2730: debug_others(l_proc_name, l_proc_step);
2731:
2732: IF g_debug
2733: THEN
2734: debug('Leaving: ' || l_proc_name, -999);
2735: END IF;
2736:
2737: hr_utility.raise_error;
2738: ELSE
2739: RAISE;
2740: END IF;
2741: END execute_custom_function;
2995: IF g_debug
2996: THEN
2997: debug(l_proc_name, l_proc_step);
2998: END IF;
2999: hr_utility.set_message(8303, 'PQP_230113_AAT_MISSING_CONTRCT');
3000: hr_utility.set_message_token('EFFECTIVEDATE'
3001: ,fnd_date.date_to_displaydate(p_effective_date
3002: )
3003: );
2996: THEN
2997: debug(l_proc_name, l_proc_step);
2998: END IF;
2999: hr_utility.set_message(8303, 'PQP_230113_AAT_MISSING_CONTRCT');
3000: hr_utility.set_message_token('EFFECTIVEDATE'
3001: ,fnd_date.date_to_displaydate(p_effective_date
3002: )
3003: );
3004: hr_utility.raise_error;
3000: hr_utility.set_message_token('EFFECTIVEDATE'
3001: ,fnd_date.date_to_displaydate(p_effective_date
3002: )
3003: );
3004: hr_utility.raise_error;
3005: END IF;
3006:
3007: END IF;
3008: CLOSE csr_assignment_contract;
3094: EXCEPTION
3095: WHEN OTHERS
3096: THEN
3097: clear_cache;
3098: IF SQLCODE <> hr_utility.hr_error_number
3099: THEN
3100: debug_others(l_proc_name, l_proc_step);
3101:
3102: IF g_debug
3103: THEN
3104: debug('Leaving: ' || l_proc_name, -999);
3105: END IF;
3106:
3107: hr_utility.raise_error;
3108: ELSE
3109: RAISE;
3110: END IF;
3111: END get_fte_event_dates;
3223: OPEN csr_formula_name(p_formula_id);
3224: FETCH csr_formula_name INTO l_formula_name;
3225: CLOSE csr_formula_name;
3226:
3227: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3228: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3229: hr_utility.set_message_token('MESSAGE',l_outputs(l_out_cnt).VALUE);
3230: hr_utility.raise_error;
3231: END IF; -- IF l_outputs(l_out_cnt).value IS NOT NULL THEN
3224: FETCH csr_formula_name INTO l_formula_name;
3225: CLOSE csr_formula_name;
3226:
3227: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3228: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3229: hr_utility.set_message_token('MESSAGE',l_outputs(l_out_cnt).VALUE);
3230: hr_utility.raise_error;
3231: END IF; -- IF l_outputs(l_out_cnt).value IS NOT NULL THEN
3232:
3225: CLOSE csr_formula_name;
3226:
3227: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3228: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3229: hr_utility.set_message_token('MESSAGE',l_outputs(l_out_cnt).VALUE);
3230: hr_utility.raise_error;
3231: END IF; -- IF l_outputs(l_out_cnt).value IS NOT NULL THEN
3232:
3233: ELSIF( UPPER(l_outputs(l_out_cnt).NAME) =
3226:
3227: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3228: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3229: hr_utility.set_message_token('MESSAGE',l_outputs(l_out_cnt).VALUE);
3230: hr_utility.raise_error;
3231: END IF; -- IF l_outputs(l_out_cnt).value IS NOT NULL THEN
3232:
3233: ELSIF( UPPER(l_outputs(l_out_cnt).NAME) =
3234: TRANSLATE(UPPER(hr_general.decode_lookup('BUDGET_MEASUREMENT_TYPE'
3289: OPEN csr_formula_name(p_formula_id);
3290: FETCH csr_formula_name INTO l_formula_name;
3291: CLOSE csr_formula_name;
3292:
3293: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3294: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3295: l_message := 'The UOM being processed "'||p_uom||'" does not match the UOM "'
3296: ||l_outputs(l_out_cnt).NAME||'" returned';
3297: hr_utility.set_message_token('MESSAGE',l_message);
3290: FETCH csr_formula_name INTO l_formula_name;
3291: CLOSE csr_formula_name;
3292:
3293: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3294: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3295: l_message := 'The UOM being processed "'||p_uom||'" does not match the UOM "'
3296: ||l_outputs(l_out_cnt).NAME||'" returned';
3297: hr_utility.set_message_token('MESSAGE',l_message);
3298: hr_utility.raise_error;
3293: hr_utility.set_message(8303, 'PQP_230459_ABV_FORMULA_ERROR');
3294: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3295: l_message := 'The UOM being processed "'||p_uom||'" does not match the UOM "'
3296: ||l_outputs(l_out_cnt).NAME||'" returned';
3297: hr_utility.set_message_token('MESSAGE',l_message);
3298: hr_utility.raise_error;
3299:
3300: END IF; --IF l_outputs(l_out_cnt).name = 'ERROR_MESSAGE'
3301: END LOOP;-- FOR l_out_cnt IN l_outputs.FIRST .. l_outputs.LAST
3294: hr_utility.set_message_token('FORMULANAME',l_formula_name);
3295: l_message := 'The UOM being processed "'||p_uom||'" does not match the UOM "'
3296: ||l_outputs(l_out_cnt).NAME||'" returned';
3297: hr_utility.set_message_token('MESSAGE',l_message);
3298: hr_utility.raise_error;
3299:
3300: END IF; --IF l_outputs(l_out_cnt).name = 'ERROR_MESSAGE'
3301: END LOOP;-- FOR l_out_cnt IN l_outputs.FIRST .. l_outputs.LAST
3302:
3308: WHEN OTHERS
3309: THEN
3310: clear_cache;
3311:
3312: IF SQLCODE <> hr_utility.hr_error_number
3313: THEN
3314: debug_others(l_proc_name, l_proc_step);
3315:
3316: IF g_debug
3317: THEN
3318: debug('Leaving: ' || l_proc_name, -999);
3319: END IF;
3320:
3321: hr_utility.raise_error;
3322: ELSE
3323: RAISE;
3324: END IF;
3325: END update_value_for_event_dates;
3458: THEN
3459: debug(l_proc_name, l_proc_step);
3460: END IF;
3461: CLOSE csr_effective_abv;
3462: hr_utility.set_message(8303, 'PQP_230460_ABV_FUTURE_ROWS');
3463: hr_utility.set_message_token('ABVUOM', p_uom);
3464: hr_utility.raise_error;
3465: END IF; -- IF csr_effective_abv%NOTFOUND
3466:
3459: debug(l_proc_name, l_proc_step);
3460: END IF;
3461: CLOSE csr_effective_abv;
3462: hr_utility.set_message(8303, 'PQP_230460_ABV_FUTURE_ROWS');
3463: hr_utility.set_message_token('ABVUOM', p_uom);
3464: hr_utility.raise_error;
3465: END IF; -- IF csr_effective_abv%NOTFOUND
3466:
3467: CLOSE csr_effective_abv;
3460: END IF;
3461: CLOSE csr_effective_abv;
3462: hr_utility.set_message(8303, 'PQP_230460_ABV_FUTURE_ROWS');
3463: hr_utility.set_message_token('ABVUOM', p_uom);
3464: hr_utility.raise_error;
3465: END IF; -- IF csr_effective_abv%NOTFOUND
3466:
3467: CLOSE csr_effective_abv;
3468: IF p_action <> c_verify THEN
3722: WHEN OTHERS
3723: THEN
3724: clear_cache;
3725:
3726: IF SQLCODE <> hr_utility.hr_error_number
3727: THEN
3728: debug_others(l_proc_name, l_proc_step);
3729:
3730: IF g_debug
3731: THEN
3732: debug('Leaving: ' || l_proc_name, -999);
3733: END IF;
3734:
3735: hr_utility.raise_error;
3736: ELSE
3737: RAISE;
3738: END IF;
3739: END update_and_store_abv;
3877: THEN
3878: debug_exit(l_proc_name);
3879: END IF;
3880:
3881: hr_utility.trace_off;
3882: EXCEPTION
3883: WHEN OTHERS
3884: THEN
3885: clear_cache;
3883: WHEN OTHERS
3884: THEN
3885: clear_cache;
3886:
3887: IF SQLCODE <> hr_utility.hr_error_number
3888: THEN
3889: debug_others(l_proc_name, l_proc_step);
3890:
3891: IF g_debug
3892: THEN
3893: debug('Leaving: ' || l_proc_name, -999);
3894: END IF;
3895:
3896: hr_utility.raise_error;
3897: ELSE
3898: RAISE;
3899: END IF;
3900: END deinitialization_code;