DBA Data[Home] [Help]

APPS.FII_AP_INV_DISTRIBUTIONS_B_C dependencies on FII_AP_INV_DIST_T

Line 143: FII_UTIL.put_line('Truncate table FII_AP_INV_DIST_T');

139: END IF;
140:
141: IF (g_truncate_staging = 'Y') THEN
142: if g_debug_flag = 'Y' then
143: FII_UTIL.put_line('Truncate table FII_AP_INV_DIST_T');
144: end if;
145: truncate_table('FII_AP_INV_DIST_T');
146: END IF;
147:

Line 145: truncate_table('FII_AP_INV_DIST_T');

141: IF (g_truncate_staging = 'Y') THEN
142: if g_debug_flag = 'Y' then
143: FII_UTIL.put_line('Truncate table FII_AP_INV_DIST_T');
144: end if;
145: truncate_table('FII_AP_INV_DIST_T');
146: END IF;
147:
148: -- haritha
149: IF (g_truncate_rates = 'Y') THEN

Line 204: FROM fii_ap_inv_dist_t

200:
201: BEGIN
202: SELECT 1
203: INTO l_count2
204: FROM fii_ap_inv_dist_t
205: WHERE ROWNUM = 1;
206: EXCEPTION
207: WHEN NO_DATA_FOUND THEN l_count2 := 0;
208: END;

Line 301: g_state := 'Populating FII_AP_INV_DIST_T from FII_AP_INV_ID table';

297: PROCEDURE POPULATE_AP_SUM_STG (p_start_range IN number,
298: p_end_range IN number) is
299: l_stmt VARCHAR2(1000);
300: BEGIN
301: g_state := 'Populating FII_AP_INV_DIST_T from FII_AP_INV_ID table';
302: if g_debug_flag = 'Y' then
303: FII_UTIL.put_line(g_state);
304: FII_UTIL.start_timer;
305: end if;

Line 307: INSERT INTO FII_AP_INV_DIST_T

303: FII_UTIL.put_line(g_state);
304: FII_UTIL.start_timer;
305: end if;
306:
307: INSERT INTO FII_AP_INV_DIST_T
308: (ACCOUNT_DATE,
309: INV_CURRENCY_CODE,
310: INVOICE_ID,
311: INVOICE_DISTRIBUTION_ID,

Line 389: FII_UTIL.put_line('Inserted '||sql%rowcount||' rows INTO FII_AP_INV_DIST_T table');

385: AND temp.sequence_id <= p_end_range
386: AND aid.accounting_date >= g_start_date;
387:
388: if g_debug_flag = 'Y' then
389: FII_UTIL.put_line('Inserted '||sql%rowcount||' rows INTO FII_AP_INV_DIST_T table');
390: FII_UTIL.stop_timer;
391: FII_UTIL.print_timer('Duration');
392: end if;
393:

Line 543: FROM FII_AP_INV_DIST_T stg

539: --------------------------------------------------------
540: CURSOR prim_MissingRate IS
541: SELECT DISTINCT INV_CURRENCY_CODE from_currency, decode(prim_conversion_rate,-3,
542: to_date('01/01/1999','MM/DD/RRRR'), LEAST(ACCOUNT_DATE, sysdate)) actg_dt
543: FROM FII_AP_INV_DIST_T stg
544: WHERE stg.prim_conversion_rate < 0 ;
545:
546: CURSOR sec_MissingRate IS
547: SELECT DISTINCT INV_CURRENCY_CODE from_currency, decode(sec_conversion_rate,-3,

Line 549: FROM FII_AP_INV_DIST_T stg

545:
546: CURSOR sec_MissingRate IS
547: SELECT DISTINCT INV_CURRENCY_CODE from_currency, decode(sec_conversion_rate,-3,
548: to_date('01/01/1999','MM/DD/RRRR'),LEAST(ACCOUNT_DATE, sysdate)) actg_dt
549: FROM FII_AP_INV_DIST_T stg
550: WHERE stg.sec_conversion_rate < 0 ;
551:
552: CURSOR prim_MissingRate_L IS
553: SELECT DISTINCT FUNCTIONAL_CURRENCY from_currency, decode(prim_conversion_rate,-3,

Line 585: SELECT 1 INTO l_miss_rates_prim FROM FII_AP_INV_DIST_T stg WHERE stg.prim_conversion_rate < 0;

581:
582: ELSE
583:
584: BEGIN
585: SELECT 1 INTO l_miss_rates_prim FROM FII_AP_INV_DIST_T stg WHERE stg.prim_conversion_rate < 0;
586: EXCEPTION
587: WHEN NO_DATA_FOUND THEN l_miss_rates_prim := 0;
588: END;
589:

Line 591: SELECT 1 INTO l_miss_rates_sec FROM FII_AP_INV_DIST_T stg WHERE stg.sec_conversion_rate < 0;

587: WHEN NO_DATA_FOUND THEN l_miss_rates_prim := 0;
588: END;
589:
590: BEGIN
591: SELECT 1 INTO l_miss_rates_sec FROM FII_AP_INV_DIST_T stg WHERE stg.sec_conversion_rate < 0;
592: EXCEPTION
593: WHEN NO_DATA_FOUND THEN l_miss_rates_sec := 0;
594: END;
595:

Line 689: g_state := 'Populating FII_AP_INV_DIST_F FROM FII_AP_INV_DIST_T table';

685: seq_id NUMBER :=0;
686: BEGIN
687: SELECT FII_AP_INV_DIST_F_S.nextval INTO seq_id FROM dual;
688:
689: g_state := 'Populating FII_AP_INV_DIST_F FROM FII_AP_INV_DIST_T table';
690:
691: if g_debug_flag = 'Y' then
692: FII_UTIL.put_line('');
693: FII_UTIL.put_line('-------------------------------------------------');

Line 705: FROM FII_AP_INV_DIST_T

701: -- Also added the additional columns for insertion.
702:
703: MERGE /*+ use_nl(bsum) */ INTO FII_AP_INV_DIST_F bsum
704: USING (SELECT *
705: FROM FII_AP_INV_DIST_T
706: WHERE (prim_conversion_rate > 0 OR sec_conversion_rate > 0)
707: ) stg
708: ON (bsum.INVOICE_DISTRIBUTION_ID = stg.INVOICE_DISTRIBUTION_ID)
709: WHEN MATCHED THEN UPDATE SET bsum.account_date = stg.account_date,

Line 1154: INSERT /*+ APPEND PARALLEL(F) */ INTO FII_AP_INV_DIST_T F

1150: fii_util.put_line('');
1151: end if;
1152:
1153:
1154: INSERT /*+ APPEND PARALLEL(F) */ INTO FII_AP_INV_DIST_T F
1155: (ACCOUNT_DATE,
1156: INV_CURRENCY_CODE,
1157: INVOICE_ID,
1158: AMOUNT_B,

Line 1275: from FII_AP_INV_DIST_T

1271: from (
1272: select /*+ no_merge */ distinct
1273: inv_currency_code cc,
1274: account_date dt
1275: from FII_AP_INV_DIST_T
1276: );
1277:
1278: if g_debug_flag = 'Y' then
1279: fii_util.put_line('Processed '||SQL%ROWCOUNT||' rows');

Line 1371: FROM FII_AP_INV_DIST_T stg, fii_ap_inv_rates_temp rates

1367: stg.LINE_TYPE_LOOKUP_CODE,
1368: stg.Inventory_Item_ID,
1369: stg.Purchasing_Category_ID,
1370: stg.Item_Description
1371: FROM FII_AP_INV_DIST_T stg, fii_ap_inv_rates_temp rates
1372: where stg.account_date = rates.trx_date
1373: and stg.inv_currency_code = rates.functional_currency;
1374:
1375: if g_debug_flag = 'Y' then

Line 1557: TRUNCATE_TABLE('FII_AP_INV_DIST_T');

1553: g_state := 'Running Initial Load, truncate staging and base summary table.';
1554: IF g_debug_flag = 'Y' then
1555: FII_UTIL.put_line('Running Initial Load, truncate staging and base summary table.');
1556: END IF;
1557: TRUNCATE_TABLE('FII_AP_INV_DIST_T');
1558: TRUNCATE_TABLE('FII_AP_INV_DIST_F');
1559: COMMIT;
1560: END IF;
1561:

Line 1650: SELECT 1 INTO g_num FROM fii_ap_inv_dist_t where rownum = 1;

1646: -- exchange rates. In this case, we run in resume mode.
1647: -- If no, then program will insert records into staging table
1648: --------------------------------------------------------------------
1649: BEGIN
1650: SELECT 1 INTO g_num FROM fii_ap_inv_dist_t where rownum = 1;
1651: EXCEPTION
1652: WHEN NO_DATA_FOUND THEN g_num := 0;
1653: END;
1654:

Line 1850: FND_STATS.GATHER_TABLE_STATS(OWNNAME => 'FII', TABNAME => 'FII_AP_INV_DIST_T', PERCENT=> 5);

1846: NVL(p_sort_area_size, 200000000),
1847: NVL(p_hash_area_size, 200000000));
1848: INSERT_RATES;
1849:
1850: FND_STATS.GATHER_TABLE_STATS(OWNNAME => 'FII', TABNAME => 'FII_AP_INV_DIST_T', PERCENT=> 5);
1851:
1852: ELSE
1853:
1854: --------------------------------------------

Line 1994: g_state := 'Updating records with missing primary rates in FII_AP_INV_DIST_T table';

1990: -- staging table
1991: ----------------------------------------------------------
1992: g_truncate_staging := 'N';
1993:
1994: g_state := 'Updating records with missing primary rates in FII_AP_INV_DIST_T table';
1995: if g_debug_flag = 'Y' then
1996: FII_UTIL.put_line('');
1997: FII_UTIL.put_line('---------------------------------------------------------------------');
1998: FII_UTIL.put_line(g_state);

Line 2003: UPDATE FII_AP_INV_DIST_T stg

1999: FII_UTIL.start_timer;
2000: end if;
2001:
2002: --modified by ilavenil to handle future dated transaction. The change is usage of least(...,sysdate)
2003: UPDATE FII_AP_INV_DIST_T stg
2004: SET stg.PRIM_CONVERSION_RATE = DECODE(stg.inv_currency_code, g_prim_currency, 1,
2005: fii_currency.get_global_rate_primary(stg.inv_currency_code,
2006: least(stg.account_date,sysdate)))
2007: WHERE stg.PRIM_CONVERSION_RATE < 0;

Line 2016: g_state := 'Updating records with missing secondary rates in FII_AP_INV_DIST_T table';

2012: FII_UTIL.put_line('Updated ' || l_rowcount || ' records for primary conversion rate');
2013: FII_UTIL.stop_timer;
2014: FII_UTIL.print_timer('Duration');
2015:
2016: g_state := 'Updating records with missing secondary rates in FII_AP_INV_DIST_T table';
2017: FII_UTIL.put_line('');
2018: FII_UTIL.put_line('---------------------------------------------------------------------');
2019: FII_UTIL.put_line(g_state);
2020: FII_UTIL.start_timer;

Line 2024: UPDATE FII_AP_INV_DIST_T stg

2020: FII_UTIL.start_timer;
2021: end if;
2022:
2023: --modified by ilavenil to handle future dated transaction. The change is usage of least(...,sysdate)
2024: UPDATE FII_AP_INV_DIST_T stg
2025: SET stg.SEC_CONVERSION_RATE = decode(stg.inv_currency_code, g_sec_currency, 1,
2026: fii_currency.get_global_rate_secondary(stg.inv_currency_code,
2027: least( stg.account_date,sysdate)))
2028: WHERE stg.SEC_CONVERSION_RATE < 0;

Line 2154: Truncate_table('FII_AP_INV_DIST_T');

2150: -- because we can use it for debugging purpose if the program
2151: -- error out. FII_AP_INV_ID always gets truncated at the start
2152: -- of the program.
2153: ---------------------------------------------------------------
2154: Truncate_table('FII_AP_INV_DIST_T');
2155:
2156: Truncate_table('FII_AP_SUM_WORK_JOBS');
2157:
2158: RAISE;