40: -- Note
41: ------------------------------------------------------------
42:
43: g_pkg_name CONSTANT VARCHAR2 (30) := 'ozf_fund_reconcile_pvt';
44: G_DEBUG BOOLEAN := FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_debug_high);
45: g_bulk_limit CONSTANT NUMBER := 5000;
46:
47: /* =========================================================
48: --tbl_type to hold the object
512: -- x_retcode := 1;
513: --x_errbuf := l_msg_data;
514: ozf_utility_pvt.write_conc_log('ERROR: Could not perform reconcile for Object: '||l_object_type||' : '||l_object_tbl (k).object_id);
515:
516: /* fnd_msg_pub.count_and_get (
517: p_encoded=> fnd_api.g_false
518: ,p_count=> x_msg_count
519: ,p_data=> x_msg_data
520: );*/
574:
575: END LOOP;
576:
577: ozf_utility_pvt.write_conc_log (l_msg_data);
578: /* fnd_msg_pub.count_and_get (
579: p_encoded=> fnd_api.g_false
580: ,p_count=> x_msg_count
581: ,p_data=> x_msg_data
582: );
585: WHEN OTHERS THEN
586: -ROLLBACK TO release_fund_conc;
587: x_return_status := fnd_api.g_ret_sts_unexp_error;
588:
589: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
590: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
591: END IF;
592:
593: fnd_msg_pub.count_and_get (
586: -ROLLBACK TO release_fund_conc;
587: x_return_status := fnd_api.g_ret_sts_unexp_error;
588:
589: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
590: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
591: END IF;
592:
593: fnd_msg_pub.count_and_get (
594: p_count=> x_msg_count
589: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
590: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
591: END IF;
592:
593: fnd_msg_pub.count_and_get (
594: p_count=> x_msg_count
595: ,p_data=> x_msg_data
596: ,p_encoded=> fnd_api.g_false
597: );
727: ozf_utility_pvt.debug_message (': before parent source cursor ');
728: END IF;
729:
730: IF fnd_api.to_boolean (p_init_msg_list) THEN
731: fnd_msg_pub.initialize;
732: END IF;
733:
734: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
735: RAISE fnd_api.g_exc_unexpected_error;
959: IF G_DEBUG THEN
960: ozf_utility_pvt.debug_message ( l_api_name || ': end');
961: END IF;
962:
963: fnd_msg_pub.count_and_get (
964: p_count=> x_msg_count
965: ,p_data=> x_msg_data
966: ,p_encoded=> fnd_api.g_false
967: );
971: EXCEPTION
972: WHEN fnd_api.g_exc_error THEN
973: ROLLBACK TO reconcile_budget_line;
974: x_return_status := fnd_api.g_ret_sts_error;
975: fnd_msg_pub.count_and_get (
976: p_count=> x_msg_count
977: ,p_data=> x_msg_data
978: ,p_encoded=> fnd_api.g_false
979: );
979: );
980: WHEN fnd_api.g_exc_unexpected_error THEN
981: ROLLBACK TO reconcile_budget_line;
982: x_return_status := fnd_api.g_ret_sts_unexp_error;
983: fnd_msg_pub.count_and_get (
984: p_count=> x_msg_count
985: ,p_data=> x_msg_data
986: ,p_encoded=> fnd_api.g_false
987: );
988: WHEN OTHERS THEN
989: ROLLBACK TO reconcile_budget_line;
990: x_return_status := fnd_api.g_ret_sts_unexp_error;
991:
992: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
993: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
994: END IF;
995:
996: fnd_msg_pub.count_and_get (
989: ROLLBACK TO reconcile_budget_line;
990: x_return_status := fnd_api.g_ret_sts_unexp_error;
991:
992: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
993: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
994: END IF;
995:
996: fnd_msg_pub.count_and_get (
997: p_count=> x_msg_count
992: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
993: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
994: END IF;
995:
996: fnd_msg_pub.count_and_get (
997: p_count=> x_msg_count
998: ,p_data=> x_msg_data
999: ,p_encoded=> fnd_api.g_false
1000: );
1567: END IF;
1568: -- x_return_status := fnd_api.g_ret_sts_success;
1569:
1570: /* IF fnd_api.to_boolean (p_init_msg_list) THEN
1571: fnd_msg_pub.initialize;
1572: END IF;
1573:
1574: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
1575: RAISE fnd_api.g_exc_unexpected_error;
1602: ROLLBACK TO offer_budget;
1603: END IF;
1604: END LOOP;
1605:
1606: /* fnd_msg_pub.count_and_get (
1607: p_encoded=> fnd_api.g_false
1608: ,p_count=> x_msg_count
1609: ,p_data=> x_msg_data
1610: );
1614: EXCEPTION
1615: WHEN fnd_api.g_exc_error THEN
1616: ROLLBACK TO Post_utilized_budget_conc;
1617: x_return_status := fnd_api.g_ret_sts_error;
1618: fnd_msg_pub.count_and_get (
1619: p_count=> x_msg_count
1620: ,p_data=> x_msg_data
1621: ,p_encoded=> fnd_api.g_false
1622: );
1622: );
1623: WHEN fnd_api.g_exc_unexpected_error THEN
1624: ROLLBACK TO Post_utilized_budget_conc;
1625: x_return_status := fnd_api.g_ret_sts_unexp_error;
1626: fnd_msg_pub.count_and_get (
1627: p_count=> x_msg_count
1628: ,p_data=> x_msg_data
1629: ,p_encoded=> fnd_api.g_false
1630: );
1631: WHEN OTHERS THEN
1632: ROLLBACK TO Post_utilized_budget_conc;
1633: x_return_status := fnd_api.g_ret_sts_unexp_error;
1634:
1635: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1636: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1637: END IF;
1638:
1639: fnd_msg_pub.count_and_get (
1632: ROLLBACK TO Post_utilized_budget_conc;
1633: x_return_status := fnd_api.g_ret_sts_unexp_error;
1634:
1635: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1636: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1637: END IF;
1638:
1639: fnd_msg_pub.count_and_get (
1640: p_count=> x_msg_count
1635: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1636: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1637: END IF;
1638:
1639: fnd_msg_pub.count_and_get (
1640: p_count=> x_msg_count
1641: ,p_data=> x_msg_data
1642: ,p_encoded=> fnd_api.g_false
1643: ); */
1726: ozf_utility_pvt.debug_message (': before parent source cursor ');
1727: END IF;
1728:
1729: IF fnd_api.to_boolean (p_init_msg_list) THEN
1730: fnd_msg_pub.initialize;
1731: END IF;
1732:
1733: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
1734: RAISE fnd_api.g_exc_unexpected_error;
1821: END LOOP;
1822:
1823: CLOSE c_parent_source_fund;
1824:
1825: fnd_msg_pub.count_and_get (
1826: p_encoded=> fnd_api.g_false
1827: ,p_count=> x_msg_count
1828: ,p_data=> x_msg_data
1829: );
1834: EXCEPTION
1835: WHEN fnd_api.g_exc_error THEN
1836: ROLLBACK TO reconcile_budget_utilized;
1837: x_return_status := fnd_api.g_ret_sts_error;
1838: fnd_msg_pub.count_and_get (
1839: p_count=> x_msg_count
1840: ,p_data=> x_msg_data
1841: ,p_encoded=> fnd_api.g_false
1842: );
1842: );
1843: WHEN fnd_api.g_exc_unexpected_error THEN
1844: ROLLBACK TO reconcile_budget_utilized;
1845: x_return_status := fnd_api.g_ret_sts_unexp_error;
1846: fnd_msg_pub.count_and_get (
1847: p_count=> x_msg_count
1848: ,p_data=> x_msg_data
1849: ,p_encoded=> fnd_api.g_false
1850: );
1851: WHEN OTHERS THEN
1852: ROLLBACK TO reconcile_budget_utilized;
1853: x_return_status := fnd_api.g_ret_sts_unexp_error;
1854:
1855: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1856: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1857: END IF;
1858:
1859: fnd_msg_pub.count_and_get (
1852: ROLLBACK TO reconcile_budget_utilized;
1853: x_return_status := fnd_api.g_ret_sts_unexp_error;
1854:
1855: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1856: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1857: END IF;
1858:
1859: fnd_msg_pub.count_and_get (
1860: p_count=> x_msg_count
1855: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1856: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1857: END IF;
1858:
1859: fnd_msg_pub.count_and_get (
1860: p_count=> x_msg_count
1861: ,p_data=> x_msg_data
1862: ,p_encoded=> fnd_api.g_false
1863: );
1905: END IF;
1906: x_return_status := fnd_api.g_ret_sts_success;
1907:
1908: IF fnd_api.to_boolean (p_init_msg_list) THEN
1909: fnd_msg_pub.initialize;
1910: END IF;
1911:
1912: IF NOT fnd_api.compatible_api_call (l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
1913: RAISE fnd_api.g_exc_unexpected_error;
1948: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
1949: RAISE fnd_api.g_exc_unexpected_error;
1950: END IF;
1951:
1952: fnd_msg_pub.count_and_get (
1953: p_encoded=> fnd_api.g_false
1954: ,p_count=> x_msg_count
1955: ,p_data=> x_msg_data
1956: );
1961: EXCEPTION
1962: WHEN fnd_api.g_exc_error THEN
1963: ROLLBACK TO reconcile_line;
1964: x_return_status := fnd_api.g_ret_sts_error;
1965: fnd_msg_pub.count_and_get (
1966: p_count=> x_msg_count
1967: ,p_data=> x_msg_data
1968: ,p_encoded=> fnd_api.g_false
1969: );
1969: );
1970: WHEN fnd_api.g_exc_unexpected_error THEN
1971: ROLLBACK TO reconcile_line;
1972: x_return_status := fnd_api.g_ret_sts_unexp_error;
1973: fnd_msg_pub.count_and_get (
1974: p_count=> x_msg_count
1975: ,p_data=> x_msg_data
1976: ,p_encoded=> fnd_api.g_false
1977: );
1978: WHEN OTHERS THEN
1979: ROLLBACK TO reconcile_line;
1980: x_return_status := fnd_api.g_ret_sts_unexp_error;
1981:
1982: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1983: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1984: END IF;
1985:
1986: fnd_msg_pub.count_and_get (
1979: ROLLBACK TO reconcile_line;
1980: x_return_status := fnd_api.g_ret_sts_unexp_error;
1981:
1982: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1983: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1984: END IF;
1985:
1986: fnd_msg_pub.count_and_get (
1987: p_count=> x_msg_count
1982: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error) THEN
1983: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1984: END IF;
1985:
1986: fnd_msg_pub.count_and_get (
1987: p_count=> x_msg_count
1988: ,p_data=> x_msg_data
1989: ,p_encoded=> fnd_api.g_false
1990: );
2376: END IF; -- The main IF loop
2377:
2378: x_return_status := fnd_api.g_ret_sts_success;
2379:
2380: fnd_msg_pub.count_and_get(
2381: p_encoded => fnd_api.g_false
2382: ,p_count => x_msg_count
2383: ,p_data => x_msg_data);
2384: EXCEPTION
2383: ,p_data => x_msg_data);
2384: EXCEPTION
2385: WHEN fnd_api.g_exc_error THEN
2386: x_return_status := fnd_api.g_ret_sts_error;
2387: fnd_msg_pub.count_and_get(
2388: p_encoded => fnd_api.g_false
2389: ,p_count => x_msg_count
2390: ,p_data => x_msg_data);
2391: WHEN fnd_api.g_exc_unexpected_error THEN
2389: ,p_count => x_msg_count
2390: ,p_data => x_msg_data);
2391: WHEN fnd_api.g_exc_unexpected_error THEN
2392: x_return_status := fnd_api.g_ret_sts_unexp_error;
2393: fnd_msg_pub.count_and_get(
2394: p_encoded => fnd_api.g_false
2395: ,p_count => x_msg_count
2396: ,p_data => x_msg_data);
2397: WHEN OTHERS THEN
2395: ,p_count => x_msg_count
2396: ,p_data => x_msg_data);
2397: WHEN OTHERS THEN
2398: x_return_status := fnd_api.g_ret_sts_unexp_error;
2399: fnd_msg_pub.count_and_get(
2400: p_encoded => fnd_api.g_false
2401: ,p_count => x_msg_count
2402: ,p_data => x_msg_data);
2403: END transferring_unutilized_amount;
2457: ozf_utility_pvt.write_conc_log(l_full_name || ': start');
2458: END IF;
2459:
2460: IF fnd_api.to_boolean(p_init_msg_list) THEN
2461: fnd_msg_pub.initialize;
2462: END IF;
2463:
2464: IF NOT fnd_api.compatible_api_call(l_api_version, p_api_version, l_api_name, g_pkg_name) THEN
2465: RAISE fnd_api.g_exc_unexpected_error;
2765: END LOOP;
2766:
2767: CLOSE c_get_new_funds;
2768:
2769: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false
2770: ,p_count => x_msg_count
2771: ,p_data => x_msg_data);
2772:
2773: IF G_DEBUG THEN
2777: EXCEPTION
2778: WHEN fnd_api.g_exc_error THEN
2779: ROLLBACK;
2780: x_return_status := fnd_api.g_ret_sts_error;
2781: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false
2782: ,p_count => x_msg_count
2783: ,p_data => x_msg_data);
2784: WHEN fnd_api.g_exc_unexpected_error THEN
2785: ROLLBACK;
2783: ,p_data => x_msg_data);
2784: WHEN fnd_api.g_exc_unexpected_error THEN
2785: ROLLBACK;
2786: x_return_status := fnd_api.g_ret_sts_unexp_error;
2787: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false
2788: ,p_count => x_msg_count
2789: ,p_data => x_msg_data);
2790: WHEN OTHERS THEN
2791: ROLLBACK;
2790: WHEN OTHERS THEN
2791: ROLLBACK;
2792: x_return_status := fnd_api.g_ret_sts_unexp_error;
2793:
2794: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2795: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2796: END IF;
2797:
2798: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false
2791: ROLLBACK;
2792: x_return_status := fnd_api.g_ret_sts_unexp_error;
2793:
2794: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2795: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2796: END IF;
2797:
2798: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false
2799: ,p_count => x_msg_count
2794: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
2795: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
2796: END IF;
2797:
2798: fnd_msg_pub.count_and_get(p_encoded => fnd_api.g_false
2799: ,p_count => x_msg_count
2800: ,p_data => x_msg_data);
2801:
2802: END get_new_funds;
2937: LOOP
2938: SAVEPOINT open_next_years_budget;
2939: FETCH c_get_fund_id INTO l_root_fund_id;
2940:
2941: fnd_msg_pub.initialize;
2942:
2943: l_return_status := fnd_api.g_ret_sts_success;
2944:
2945: IF c_get_fund_id%NOTFOUND THEN
3085: COMMIT;
3086: x_retcode := 0;
3087: ELSE
3088: ROLLBACK TO open_next_years_budget;
3089: fnd_msg_pub.count_and_get(p_count => x_msg_count
3090: ,p_data => x_msg_data
3091: ,p_encoded => fnd_api.g_false
3092: );
3093: ozf_utility_pvt.write_conc_log (x_msg_data);
3122: WHEN fnd_api.g_exc_error THEN
3123: ROLLBACK;
3124: x_retcode := 1;
3125: x_errbuf := x_msg_data;
3126: fnd_msg_pub.count_and_get(p_count => x_msg_count
3127: ,p_data => x_msg_data
3128: ,p_encoded => fnd_api.g_false
3129: );
3130: ozf_utility_pvt.write_conc_log (x_errbuf);
3131: WHEN fnd_api.g_exc_unexpected_error THEN
3132: ROLLBACK;
3133: x_retcode := 1;
3134: x_errbuf := x_msg_data;
3135: fnd_msg_pub.count_and_get(p_count => x_msg_count
3136: ,p_data => x_msg_data
3137: ,p_encoded => fnd_api.g_false
3138: );
3139: ozf_utility_pvt.write_conc_log (x_errbuf);
3140: WHEN OTHERS THEN
3141: ROLLBACK;
3142: x_retcode := 1;
3143: x_errbuf := x_msg_data;
3144: fnd_msg_pub.count_and_get(p_count => x_msg_count
3145: ,p_data => x_msg_data
3146: ,p_encoded => fnd_api.g_false
3147: );
3148: ozf_utility_pvt.write_conc_log (x_errbuf);