1052: --
1053: -- Update trailer data element with the correct value
1054: --
1055: ben_ext_thread.g_ext_rslt_id := l_master_ext_rslt_id;
1056: l_val_02 := pqp_gb_tp_pension_extracts.get_total_number_data_records(' ');
1057: l_val_03 := pqp_gb_tp_pension_extracts.get_total_number_data_records('1');
1058:
1059: IF g_debug
1060: THEN
1053: -- Update trailer data element with the correct value
1054: --
1055: ben_ext_thread.g_ext_rslt_id := l_master_ext_rslt_id;
1056: l_val_02 := pqp_gb_tp_pension_extracts.get_total_number_data_records(' ');
1057: l_val_03 := pqp_gb_tp_pension_extracts.get_total_number_data_records('1');
1058:
1059: IF g_debug
1060: THEN
1061: DEBUG ('Total Number of Data Records: '
1679: l_dev_status VARCHAR2(80);
1680: l_message VARCHAR2(80);
1681: l_err_msg fnd_new_messages.message_text%TYPE;
1682:
1683: l_lea_details pqp_gb_tp_pension_extracts.csr_lea_details%ROWTYPE;
1684: l_lea_dets_frm_bg pqp_gb_tp_pension_extracts.csr_lea_details%ROWTYPE;
1685: l_multiproc_data pqp_gb_t1_pension_extracts.csr_multiproc_data%ROWTYPE;
1686: l_lea_dets_by_loc pqp_gb_tp_pension_extracts.csr_lea_details_by_loc%ROWTYPE;
1687:
1680: l_message VARCHAR2(80);
1681: l_err_msg fnd_new_messages.message_text%TYPE;
1682:
1683: l_lea_details pqp_gb_tp_pension_extracts.csr_lea_details%ROWTYPE;
1684: l_lea_dets_frm_bg pqp_gb_tp_pension_extracts.csr_lea_details%ROWTYPE;
1685: l_multiproc_data pqp_gb_t1_pension_extracts.csr_multiproc_data%ROWTYPE;
1686: l_lea_dets_by_loc pqp_gb_tp_pension_extracts.csr_lea_details_by_loc%ROWTYPE;
1687:
1688: l_ext_udt_id pay_user_tables.user_table_id%TYPE;
1682:
1683: l_lea_details pqp_gb_tp_pension_extracts.csr_lea_details%ROWTYPE;
1684: l_lea_dets_frm_bg pqp_gb_tp_pension_extracts.csr_lea_details%ROWTYPE;
1685: l_multiproc_data pqp_gb_t1_pension_extracts.csr_multiproc_data%ROWTYPE;
1686: l_lea_dets_by_loc pqp_gb_tp_pension_extracts.csr_lea_details_by_loc%ROWTYPE;
1687:
1688: l_ext_udt_id pay_user_tables.user_table_id%TYPE;
1689: l_bg_name per_business_groups_perf.name%TYPE := NULL;
1690:
1757: debug(l_proc_name, 40);
1758: END IF;
1759:
1760: -- Step 1) Getting LEA Number from Org linked to the location
1761: OPEN pqp_gb_tp_pension_extracts.csr_lea_details_by_loc(l_location_id);
1762: FETCH pqp_gb_tp_pension_extracts.csr_lea_details_by_loc INTO l_lea_dets_by_loc;
1763:
1764: IF (pqp_gb_tp_pension_extracts.csr_lea_details_by_loc%FOUND
1765: AND
1758: END IF;
1759:
1760: -- Step 1) Getting LEA Number from Org linked to the location
1761: OPEN pqp_gb_tp_pension_extracts.csr_lea_details_by_loc(l_location_id);
1762: FETCH pqp_gb_tp_pension_extracts.csr_lea_details_by_loc INTO l_lea_dets_by_loc;
1763:
1764: IF (pqp_gb_tp_pension_extracts.csr_lea_details_by_loc%FOUND
1765: AND
1766: l_lea_dets_by_loc.lea_number IS NOT NULL
1760: -- Step 1) Getting LEA Number from Org linked to the location
1761: OPEN pqp_gb_tp_pension_extracts.csr_lea_details_by_loc(l_location_id);
1762: FETCH pqp_gb_tp_pension_extracts.csr_lea_details_by_loc INTO l_lea_dets_by_loc;
1763:
1764: IF (pqp_gb_tp_pension_extracts.csr_lea_details_by_loc%FOUND
1765: AND
1766: l_lea_dets_by_loc.lea_number IS NOT NULL
1767: ) THEN
1768:
1774: debug(l_proc_name, 45);
1775: END IF;
1776:
1777: -- Step 2) Look for LEA Number at BG level
1778: OPEN pqp_gb_tp_pension_extracts.csr_lea_details
1779: (p_organization_id => p_business_group_id
1780: ,p_lea_number => NULL
1781: );
1782: FETCH pqp_gb_tp_pension_extracts.csr_lea_details INTO l_lea_dets_frm_bg;
1778: OPEN pqp_gb_tp_pension_extracts.csr_lea_details
1779: (p_organization_id => p_business_group_id
1780: ,p_lea_number => NULL
1781: );
1782: FETCH pqp_gb_tp_pension_extracts.csr_lea_details INTO l_lea_dets_frm_bg;
1783:
1784: IF (pqp_gb_tp_pension_extracts.csr_lea_details%FOUND
1785: AND
1786: l_lea_dets_frm_bg.lea_number IS NOT NULL
1780: ,p_lea_number => NULL
1781: );
1782: FETCH pqp_gb_tp_pension_extracts.csr_lea_details INTO l_lea_dets_frm_bg;
1783:
1784: IF (pqp_gb_tp_pension_extracts.csr_lea_details%FOUND
1785: AND
1786: l_lea_dets_frm_bg.lea_number IS NOT NULL
1787: ) THEN
1788:
1790:
1791: ELSE -- NOT FOUND or LEA Number is NULL
1792:
1793: -- Close both cursors
1794: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details_by_loc;
1795: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details;
1796:
1797: -- Error out as the current BG is not set up as an LEA
1798: fail_current_extract_run(p_ext_dfn_id => p_ext_dfn_id);
1791: ELSE -- NOT FOUND or LEA Number is NULL
1792:
1793: -- Close both cursors
1794: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details_by_loc;
1795: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details;
1796:
1797: -- Error out as the current BG is not set up as an LEA
1798: fail_current_extract_run(p_ext_dfn_id => p_ext_dfn_id);
1799:
1808: RETURN;
1809:
1810: END IF; -- Chk Lea number from BG Level
1811:
1812: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details;
1813:
1814: END IF; -- Step 1) Getting LEA Number from Org linked to the location
1815:
1816: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details_by_loc;
1812: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details;
1813:
1814: END IF; -- Step 1) Getting LEA Number from Org linked to the location
1815:
1816: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details_by_loc;
1817:
1818: END IF; -- g_lea_number IS NULL
1819: --
1820: END IF; -- Check report type
1825: debug('l_location_code :'||nvl(l_location_code,'NULL'), 70);
1826: END IF;
1827:
1828: -- Step 2.3) Get the UDT name using p_ext_dfn_id
1829: OPEN pqp_gb_tp_pension_extracts.csr_pqp_extract_attributes(p_ext_dfn_id);
1830: FETCH pqp_gb_tp_pension_extracts.csr_pqp_extract_attributes
1831: INTO g_extract_type, g_extract_udt_name, l_ext_udt_id;
1832: CLOSE pqp_gb_tp_pension_extracts.csr_pqp_extract_attributes;
1833:
1826: END IF;
1827:
1828: -- Step 2.3) Get the UDT name using p_ext_dfn_id
1829: OPEN pqp_gb_tp_pension_extracts.csr_pqp_extract_attributes(p_ext_dfn_id);
1830: FETCH pqp_gb_tp_pension_extracts.csr_pqp_extract_attributes
1831: INTO g_extract_type, g_extract_udt_name, l_ext_udt_id;
1832: CLOSE pqp_gb_tp_pension_extracts.csr_pqp_extract_attributes;
1833:
1834: -- Step 2.4) Update the UDT in the current Master BG
1828: -- Step 2.3) Get the UDT name using p_ext_dfn_id
1829: OPEN pqp_gb_tp_pension_extracts.csr_pqp_extract_attributes(p_ext_dfn_id);
1830: FETCH pqp_gb_tp_pension_extracts.csr_pqp_extract_attributes
1831: INTO g_extract_type, g_extract_udt_name, l_ext_udt_id;
1832: CLOSE pqp_gb_tp_pension_extracts.csr_pqp_extract_attributes;
1833:
1834: -- Step 2.4) Update the UDT in the current Master BG
1835: set_location_code
1836: (p_udt_id => l_ext_udt_id
1855:
1856: -- Step 4.1) Get the LEA details of the chosen LEA in the current BG
1857: g_lea_business_groups.DELETE;
1858:
1859: OPEN pqp_gb_tp_pension_extracts.csr_lea_details
1860: (p_organization_id => p_business_group_id
1861: -- Bugfix 3671727:ENH1 Now fetching for chosen LEA
1862: ,p_lea_number => g_lea_number
1863: );
1860: (p_organization_id => p_business_group_id
1861: -- Bugfix 3671727:ENH1 Now fetching for chosen LEA
1862: ,p_lea_number => g_lea_number
1863: );
1864: FETCH pqp_gb_tp_pension_extracts.csr_lea_details INTO l_lea_details;
1865:
1866: IF pqp_gb_tp_pension_extracts.csr_lea_details%NOTFOUND THEN
1867:
1868: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details;
1862: ,p_lea_number => g_lea_number
1863: );
1864: FETCH pqp_gb_tp_pension_extracts.csr_lea_details INTO l_lea_details;
1865:
1866: IF pqp_gb_tp_pension_extracts.csr_lea_details%NOTFOUND THEN
1867:
1868: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details;
1869:
1870: -- Error out as the current BG does not hv this LEA
1864: FETCH pqp_gb_tp_pension_extracts.csr_lea_details INTO l_lea_details;
1865:
1866: IF pqp_gb_tp_pension_extracts.csr_lea_details%NOTFOUND THEN
1867:
1868: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details;
1869:
1870: -- Error out as the current BG does not hv this LEA
1871: -- Bugfix 3671727:ENH1:ENH2 :Moved code from here into new proc
1872: -- as we need to call it from more than one places
1883: RETURN;
1884:
1885: END IF;
1886:
1887: CLOSE pqp_gb_tp_pension_extracts.csr_lea_details;
1888:
1889: -- Step 4.2) Store the current master BG in the list of BGs to process
1890: g_lea_business_groups(p_business_group_id).business_group_id := p_business_group_id;
1891: -- Bugfix 3671727:ENH1 Commented out as these cols are not available in the collection