25: -- -->OPI_DBI_INV_VALUE_INIT_PKG.SEED_INV_TYPE_CODE
26: --
27: -- -->RUN_DISCRETE_FIRST_ETL
28: -- --->clean_staging_tables
29: -- --->OPI_DBI_BOUNDS_PKG.MAINTAIN_OPI_DBI_LOGS
30: -- --->EXTRACT_INVENTORY_TXN_QTY
31: -- --->EXTRACT_INVENTORY_TXN_VALUE
32: -- --->GET_INTRANSIT_INITIAL_LOAD
33: -- ---->> INTRANSIT_SETUP
51: -- -->GET_CONVERSION_RATE
52: -- -->MERGE_INITIAL_LOAD
53: -- -->clean_staging_tablesS
54: -- -->OPI_DBI_INV_CPCS_PKG.Run_Period_Close_Adjustment
55: -- -->OPI_DBI_BOUNDS_PKG.bounds_uncosted
56: -- -->OPI_DBI_BOUNDS_PKG.print_opi_org_bounds
57: -- -->OPI_DBI_BOUNDS_PKG.SET_LOAD_SUCCESSFUL
58:
59:
52: -- -->MERGE_INITIAL_LOAD
53: -- -->clean_staging_tablesS
54: -- -->OPI_DBI_INV_CPCS_PKG.Run_Period_Close_Adjustment
55: -- -->OPI_DBI_BOUNDS_PKG.bounds_uncosted
56: -- -->OPI_DBI_BOUNDS_PKG.print_opi_org_bounds
57: -- -->OPI_DBI_BOUNDS_PKG.SET_LOAD_SUCCESSFUL
58:
59:
60: -- Design Highlights
53: -- -->clean_staging_tablesS
54: -- -->OPI_DBI_INV_CPCS_PKG.Run_Period_Close_Adjustment
55: -- -->OPI_DBI_BOUNDS_PKG.bounds_uncosted
56: -- -->OPI_DBI_BOUNDS_PKG.print_opi_org_bounds
57: -- -->OPI_DBI_BOUNDS_PKG.SET_LOAD_SUCCESSFUL
58:
59:
60: -- Design Highlights
61: -- 1. Data Flow is different in Initial and Incremental Loads. One of the
172: RAISE INITIALIZATION_ERROR;
173: END IF;
174: EXCEPTION
175: WHEN INITIALIZATION_ERROR THEN
176: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
177: RAISE;
178:
179: WHEN OTHERS THEN
180: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
177: RAISE;
178:
179: WHEN OTHERS THEN
180: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
181: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
182: RAISE;
183:
184: END CHECK_INITIAL_LOAD_SETUP;
185:
222:
223: l_stmt_num := 0;
224: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
225: l_debug_msg := 'Start of cleaning staging table';
226: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
227: END IF;
228:
229: l_stmt_num := 10;
230: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_OPM_INV_LED_CURRENT';
230: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_OPM_INV_LED_CURRENT';
231:
232: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
233: l_debug_msg := 'OPI_DBI_OPM_INV_LED_CURRENT table truncated';
234: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
235: END IF;
236:
237: l_stmt_num := 20;
238: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_OPM_INV_STG';
238: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_OPM_INV_STG';
239:
240: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
241: l_debug_msg := 'OPI_DBI_OPM_INV_STG table truncated';
242: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
243: END IF;
244:
245: l_stmt_num := 30;
246: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_CONVERSION_RATES';
246: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_CONVERSION_RATES';
247:
248: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
249: l_debug_msg := 'OPI_DBI_CONVERSION_RATES table truncated';
250: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
251: END IF;
252:
253: -- Added opi_dbi_inv_value_log truncate for CPCS. This table should not be truncated in incremental load.
254: -- This log table is only used in CPCS code line.
256: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_INV_VALUE_LOG';
257:
258: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
259: l_debug_msg := 'OPI_DBI_INV_VALUE_LOG table truncated';
260: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
261: END IF;
262:
263: -- l_stmt_num := 40;
264: -- as we are not using OPM costing API we need not truncate this table
272: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_INTR_SUP_TMP';
273:
274: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
275: l_debug_msg := 'OPI_DBI_INTR_SUP_TMP table truncated.';
276: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
277: END IF;
278:
279: l_stmt_num := 70;
280: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_INTR_MMT_TMP';
280: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_INTR_MMT_TMP';
281:
282: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
283: l_debug_msg := 'OPI_DBI_INTR_MMT_TMP table truncated.';
284: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg);
285: END IF;
286:
287: l_stmt_num := 80;
288: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_INTR_MIP_TMP';
288: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_INTR_MIP_TMP';
289:
290: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
291: l_debug_msg := 'OPI_DBI_INTR_MIP_TMP table truncated.';
292: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
293: END IF;
294:
295: l_stmt_num := 90;
296: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_INTRANSIT_STG';
296: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_INTRANSIT_STG';
297:
298: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
299: l_debug_msg := 'OPI_DBI_INTRANSIT_STG table truncated.';
300: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
301: END IF;
302:
303: l_stmt_num := 100;
304: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_WIP_STG';
304: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_WIP_STG';
305:
306: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
307: l_debug_msg := 'OPI_DBI_WIP_STG table truncated.';
308: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
309: END IF;
310:
311: l_stmt_num := 110;
312: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_ONH_QTY_STG';
312: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_ONH_QTY_STG';
313:
314: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
315: l_debug_msg := 'OPI_DBI_ONH_QTY_STG table truncated.';
316: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
317: END IF;
318:
319: l_stmt_num := 120;
320: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_INV_BEG_STG';
320: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_INV_BEG_STG';
321:
322: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
323: l_debug_msg := 'OPI_DBI_INV_BEG_STG table truncated.';
324: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
325: END IF;
326:
327: l_stmt_num := 130;
328: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_ONHAND_STG';
328: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_ONHAND_STG';
329:
330: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
331: l_debug_msg := 'OPI_DBI_ONHAND_STG table truncated.';
332: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
333: END IF;
334:
335: IF p_stage = 'PRE_INIT' THEN
336:
338: execute immediate 'truncate table ' || g_opi_schema || '.OPI_DBI_INV_VALUE_F';
339:
340: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
341: l_debug_msg := 'OPI_DBI_INV_VALUE_F table truncated.';
342: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
343: END IF;
344:
345: END IF;
346: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
344:
345: END IF;
346: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
347: l_debug_msg := 'End of cleaning staging table';
348: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
349: END IF;
350: EXCEPTION
351: WHEN OTHERS THEN
352: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
349: END IF;
350: EXCEPTION
351: WHEN OTHERS THEN
352: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
353: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
354: RAISE;
355: END clean_staging_tables;
356:
357:
371: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
372:
373: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
374: l_debug_msg := 'Entered Into COST_DISCRETE_INCEPTION_QTY ';
375: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
376: END IF;
377:
378:
379: -- Get costs as of the inception date.
395:
396: l_stmt_num :=10;
397: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
398: l_debug_msg := 'Inserting data into OPI_DBI_INV_BEG_STG from inception date less than gsd';
399: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
400: l_debug_msg := 'for standard costing organization';
401: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
402: END IF;
403:
397: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
398: l_debug_msg := 'Inserting data into OPI_DBI_INV_BEG_STG from inception date less than gsd';
399: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
400: l_debug_msg := 'for standard costing organization';
401: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
402: END IF;
403:
404:
405: UPDATE OPI_DBI_INV_BEG_STG fact
447: csc2.cost_group_id)
448: where ( nvl(fact.onhand_qty,0) <> 0 or nvl(fact.intransit_qty,0) <> 0 );
449:
450: l_debug_msg := 'Updated into staging table OPI_DBI_INV_BEG_STG for ODM - ' || SQL%ROWCOUNT || ' rows. ';
451: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
452:
453: l_stmt_num := 20;
454: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
455: l_debug_msg := 'Updated staging table OPI_DBI_INV_BEG_STG from inception date greater than gsd';
452:
453: l_stmt_num := 20;
454: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
455: l_debug_msg := 'Updated staging table OPI_DBI_INV_BEG_STG from inception date greater than gsd';
456: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
457: l_debug_msg := 'for standard costing organization';
458: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
459: END IF;
460:
454: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
455: l_debug_msg := 'Updated staging table OPI_DBI_INV_BEG_STG from inception date greater than gsd';
456: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
457: l_debug_msg := 'for standard costing organization';
458: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
459: END IF;
460:
461:
462: -- if cost is not found after earlier step (which means there
523: where ((fact.onhand_value_b is null and nvl(fact.onhand_qty,0) <> 0)
524: or (fact.intransit_value_b is null and nvl(fact.intransit_qty,0) <> 0 ));
525:
526: l_debug_msg := 'Updating staging table table OPI_DBI_INV_BEG_STG for ODM - ' || SQL%ROWCOUNT || ' rows. ';
527: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
528:
529: l_stmt_num := 30;
530: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
531: l_debug_msg := 'updated data into OPI_DBI_INV_BEG_STG for standard costing organization';
528:
529: l_stmt_num := 30;
530: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
531: l_debug_msg := 'updated data into OPI_DBI_INV_BEG_STG for standard costing organization';
532: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
533: l_debug_msg := 'form cst_item_costs for which cost is not found till now';
534: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
535: END IF;
536:
530: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
531: l_debug_msg := 'updated data into OPI_DBI_INV_BEG_STG for standard costing organization';
532: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
533: l_debug_msg := 'form cst_item_costs for which cost is not found till now';
534: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
535: END IF;
536:
537:
538: -- step 3 for standard costing org items.
552: WHERE ((fact.onhand_value_b is null and nvl(fact.onhand_qty,0) <> 0)
553: or (fact.intransit_value_b is null and nvl(fact.intransit_qty,0) <> 0 ));
554:
555: l_debug_msg := 'updated into staging table OPI_DBI_INV_BEG_STG for ODM - ' || SQL%ROWCOUNT || ' rows. ';
556: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
557:
558: l_stmt_num := 40;
559: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
560: l_debug_msg := 'updating data into OPI_DBI_INV_BEG_STG for Non standard costing organization';
557:
558: l_stmt_num := 40;
559: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
560: l_debug_msg := 'updating data into OPI_DBI_INV_BEG_STG for Non standard costing organization';
561: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
562: END IF;
563:
564:
565: -- Cost update for average costing orgs.
607: WHERE ((fact.onhand_value_b is null and nvl(fact.onhand_qty,0) <> 0)
608: or (fact.intransit_value_b is null and nvl(fact.intransit_qty,0) <> 0 ));
609:
610: l_debug_msg := 'updated into staging table OPI_DBI_INV_BEG_STG for ODM - ' || SQL%ROWCOUNT || ' rows. ';
611: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
612:
613: l_stmt_num := 50;
614: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
615: l_debug_msg := 'updating data into OPI_DBI_INV_BEG_STG for Non standard costing organization';
612:
613: l_stmt_num := 50;
614: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
615: l_debug_msg := 'updating data into OPI_DBI_INV_BEG_STG for Non standard costing organization';
616: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
617: END IF;
618:
619:
620:
641: OR (fact.intransit_value_b is null and nvl(fact.intransit_qty,0) <> 0 ));
642:
643:
644: l_debug_msg := 'updated into staging table OPI_DBI_INV_BEG_STG for ODM - ' || SQL%ROWCOUNT || ' rows. ';
645: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
646:
647: commit;
648:
649:
648:
649:
650: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
651: l_debug_msg := 'Exit from COST_DISCRETE_INCEPTION_QTY ';
652: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
653: END IF;
654:
655: -- 11.5.10 change to match costing team's method for obtaining
656: -- standard costs for an item. Added items with no standard cost
659:
660: EXCEPTION
661: WHEN OTHERS THEN
662: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
663: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
664: RAISE;
665:
666: END COST_DISCRETE_INCEPTION_QTY;
667: -------------------------------------------------------------------------------
718: END IF;
719: EXCEPTION
720: WHEN OTHERS THEN
721: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
722: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
723: RAISE;
724:
725: END GET_OPM_ITEM_COST;
726:
757: l_row_count := 0;
758:
759: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
760: l_debug_msg := 'Entered Into COST_OPM_INCEPTION_QTY ';
761: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
762: END IF;
763:
764: l_stmt_num :=10;
765: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
763:
764: l_stmt_num :=10;
765: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
766: l_debug_msg := 'Inserting data into OPI_DBI_INV_BEG_STG for Process costing organization';
767: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
768: END IF;
769:
770: /*UPDATE OPI_DBI_INV_BEG_STG fact
771: SET (onhand_value_b ,intransit_value_b, COST_FOUND_FLAG) =
792:
793: END LOOP;
794:
795: l_debug_msg := 'Updated staging table OPI_DBI_INV_BEG_STG for OPM - ' || l_row_count || ' rows. ';
796: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
797:
798: commit;
799:
800:
799:
800:
801: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
802: l_debug_msg := 'Exit from COST_OPM_INCEPTION_QTY ';
803: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
804: END IF;
805:
806: EXCEPTION
807: WHEN OTHERS THEN
805:
806: EXCEPTION
807: WHEN OTHERS THEN
808: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
809: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
810: RAISE;
811:
812: END COST_OPM_INCEPTION_QTY;
813:
831: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
832:
833: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
834: l_debug_msg := 'Entered Into GET_ONHAND_BALANCE ';
835: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
836: END IF;
837:
838: l_stmt_num :=10;
839: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
837:
838: l_stmt_num :=10;
839: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
840: l_debug_msg := 'Inserting data into OPI_DBI_INV_BEG_STG ';
841: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
842: END IF;
843:
844: INSERT INTO OPI_DBI_INV_BEG_STG
845: (organization_id
878: ,balance.cost_group_id
879: ,balance.inventory_item_id;
880:
881: l_debug_msg := 'Inserted into staging table OPI_DBI_INV_BEG_STG - ' || SQL%ROWCOUNT || ' rows. ';
882: OPI_DBI_BOUNDS_PKG.write(g_pkg_name, l_proc_name,l_stmt_num, l_debug_msg);
883:
884: commit;
885:
886: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
884: commit;
885:
886: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
887: l_debug_msg := 'Exit from GET_ONHAND_BALANCE ';
888: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
889: END IF;
890:
891: --execute immediate 'alter session disable parallel query';
892:
892:
893: EXCEPTION
894: WHEN OTHERS THEN
895: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
896: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
897: RAISE;
898: END GET_ONHAND_BALANCE;
899:
900: -------------------------------------------------------------------------------
931: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
932:
933: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
934: l_debug_msg := 'Entered into INTRANSIT_SETUP ';
935: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
936: END IF;
937: -- Setup the intransit shipping network parameters.
938: -- FOB = 1 = Shipment i.e. the to_org is the owning_org.
939: -- FOB = 2 = Receipt i.e. the from_org is the owning_org.
943: IF p_mode = 'INIT' or p_mode = 'INCR' THEN
944: l_stmt_num :=10;
945: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
946: l_debug_msg := 'Insert Data into opi_dbi_intr_mip_tmp ';
947: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
948: END IF;
949:
950: INSERT /*+append parallel(opi_dbi_intr_mip_tmp) */
951: INTO opi_dbi_intr_mip_tmp (
986: WHERE mip_outer.owning_organization_id =mp.organization_id
987: ;
988:
989: l_debug_msg := 'Inserted into staging table opi_dbi_intr_mip_tmp - ' || SQL%ROWCOUNT || ' rows. ';
990: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
991:
992: commit;
993: END IF;
994:
995: IF p_mode = 'INIT' THEN
996: l_stmt_num :=20;
997: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
998: l_debug_msg := 'Insert Data into opi_dbi_intr_mmt_tmp. ';
999: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1000: END IF;
1001: -- Select all intransit data from MMT into a temp table.
1002: --
1003: --
1051: --AND mmt.transaction_type_id IN (12,21,61,62,24,80,26,28) -- Removed in r12
1052: ;
1053:
1054: l_debug_msg := 'Inserted into staging table opi_dbi_intr_mmt_tmp - ' || SQL%ROWCOUNT || ' rows. ';
1055: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1056: commit;
1057:
1058: l_stmt_num :=30;
1059: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1057:
1058: l_stmt_num :=30;
1059: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1060: l_debug_msg := 'Insert into opi_dbi_intr_sup_tmp. ';
1061: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1062: END IF;
1063: -- Extract all data from mtl_supply into a temp table.
1064: -- Make sure that the primary quantity used is that
1065: -- of the intransit_owning_org.
1121: item_id,
1122: cost_group_id;
1123: */
1124: l_debug_msg :='Inserted into staging table opi_dbi_intr_sup_tmp - ' || SQL%ROWCOUNT || ' rows. ';
1125: opi_dbi_bounds_pkg.write(g_pkg_name, l_proc_name,l_stmt_num,l_debug_msg);
1126:
1127: commit;
1128: END IF;
1129:
1128: END IF;
1129:
1130: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1131: l_debug_msg := 'Exit from INTRANSIT_SETUP ';
1132: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1133: END IF;
1134:
1135: EXCEPTION
1136: WHEN OTHERS THEN
1134:
1135: EXCEPTION
1136: WHEN OTHERS THEN
1137: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
1138: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1139: RAISE;
1140: END INTRANSIT_SETUP;
1141:
1142: -------------------------------------------------------------------------------
1177: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
1178:
1179: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1180: l_debug_msg := 'Entered Into GET_INTRANSIT_BALANCE';
1181: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1182: END IF;
1183:
1184: l_stmt_num := 10;
1185: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1183:
1184: l_stmt_num := 10;
1185: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1186: l_debug_msg := 'Inserting data into OPI_DBI_INV_BEG_STG for Intransit Inception load ';
1187: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1188: END IF;
1189:
1190: OPI_DBI_RPT_UTIL_PKG.g_pk_uom_conversion := 1;
1191:
1306: if OPI_DBI_RPT_UTIL_PKG.g_pk_uom_conversion <>1 then
1307: Raise UOM_CONV_ERROR;
1308: end if;
1309: l_debug_msg := 'Inserted into staging table OPI_DBI_INV_BEG_STG - ' || SQL%ROWCOUNT || ' rows. ';
1310: OPI_DBI_BOUNDS_PKG.write(g_pkg_name, l_proc_name,l_stmt_num, l_debug_msg);
1311:
1312: commit;
1313:
1314: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1312: commit;
1313:
1314: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1315: l_debug_msg := 'Exit from GET_INTRANSIT_BALANCE';
1316: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1317: END IF;
1318:
1319:
1320: EXCEPTION
1319:
1320: EXCEPTION
1321: WHEN UOM_CONV_ERROR then
1322: l_debug_msg := 'UOM conversion not found ' || SQLcode || ' - ' ||SQLERRM;
1323: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1324: RAISE;
1325:
1326: WHEN OTHERS THEN
1327: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
1324: RAISE;
1325:
1326: WHEN OTHERS THEN
1327: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
1328: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1329: RAISE;
1330:
1331: END GET_INTRANSIT_BALANCE;
1332:
1345: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
1346:
1347: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1348: l_debug_msg := 'Entered Into GET_WIP_BALANCE ';
1349: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1350: END IF;
1351:
1352: l_stmt_num :=10;
1353: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1351:
1352: l_stmt_num :=10;
1353: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1354: l_debug_msg := 'Inserting data into OPI_DBI_INV_BEG_STG ';
1355: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1356: END IF;
1357:
1358: INSERT INTO OPI_DBI_INV_BEG_STG
1359: (organization_id
1399: ,balance.cost_group_id
1400: ,balance.inventory_item_id;
1401:
1402: l_debug_msg := 'Inserted into staging table OPI_DBI_INV_BEG_STG - ' || SQL%ROWCOUNT || ' rows. ';
1403: OPI_DBI_BOUNDS_PKG.write(g_pkg_name, l_proc_name,l_stmt_num, l_debug_msg);
1404:
1405: commit;
1406:
1407: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1405: commit;
1406:
1407: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1408: l_debug_msg := 'Exit from GET_WIP_BALANCE ';
1409: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1410: END IF;
1411:
1412:
1413: EXCEPTION
1412:
1413: EXCEPTION
1414: WHEN OTHERS THEN
1415: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
1416: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1417: RAISE;
1418:
1419: END GET_WIP_BALANCE;
1420:
1437: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
1438:
1439: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1440: l_debug_msg := 'Entered Into GET_INCEPTION_INV_BALANCE';
1441: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1442: END IF;
1443:
1444: g_inception_date := g_global_start_date ;
1445:
1445:
1446: l_stmt_num := 10;
1447: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1448: l_debug_msg := 'Extracting On Hand Inception Balances into its staging table ...';
1449: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1450: END IF;
1451: -- collect on hand inception balance
1452: OPI_DBI_INV_VALUE_INIT_PKG.get_onhand_balance;
1453:
1453:
1454: l_stmt_num := 20;
1455: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1456: l_debug_msg := 'Extracting InTransit Inception Balances into its staging table ...';
1457: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1458: END IF;
1459: -- collect intransit inception balance
1460: OPI_DBI_INV_VALUE_INIT_PKG.get_intransit_balance;
1461:
1461:
1462: l_stmt_num := 30;
1463: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1464: l_debug_msg := 'Extracting Work In Process Inception Balances into its staging table ...';
1465: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1466: END IF;
1467: -- collect WIP inception balance
1468: OPI_DBI_INV_VALUE_INIT_PKG.get_wip_balance;
1469:
1469:
1470: l_stmt_num := 40;
1471: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1472: l_debug_msg := 'Costing Inception balances ODM ...';
1473: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1474: END IF;
1475: -- cost discrete inception onhand and intransit quantities
1476: OPI_DBI_INV_VALUE_INIT_PKG.cost_discrete_inception_qty;
1477:
1477:
1478: l_stmt_num := 50;
1479: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1480: l_debug_msg := 'Costing Inception balances OPM ...';
1481: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1482: END IF;
1483: -- cost OPM inception onhand and intransit quantities
1484: OPI_DBI_INV_VALUE_INIT_PKG.cost_opm_inception_qty;
1485:
1487:
1488: --execute immediate 'alter session disable parallel query';
1489: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1490: l_debug_msg := 'Exit from GET_INCEPTION_INV_BALANCE';
1491: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1492: END IF;
1493:
1494: EXCEPTION
1495: WHEN OTHERS THEN
1493:
1494: EXCEPTION
1495: WHEN OTHERS THEN
1496: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
1497: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1498: RAISE;
1499:
1500: END GET_INCEPTION_INV_BALANCE;
1501:
1517: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
1518:
1519: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1520: l_debug_msg := 'Entered Into GET_INTRANSIT_INITIAL_LOAD ';
1521: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1522: END IF;
1523:
1524: l_stmt_num :=10;
1525: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1523:
1524: l_stmt_num :=10;
1525: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1526: l_debug_msg := 'Calling Intransit setup from get_intransit_initial_load. ';
1527: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1528: END IF;
1529:
1530: -- INTRANSIT_SETUP collect data into following temp tables.
1531: -- OPI_DBI_INTR_MIP_TMP
1535:
1536: l_stmt_num :=20;
1537: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1538: l_debug_msg := 'Inserting data Into opi_dbi_intransit_stg for ODM ';
1539: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1540: END IF;
1541:
1542: -- The extract below gets data from mmt staging table populated in INTRANSIT_SETUP.
1543: -- joining with MIP and MTA tables to get the intransit data for
1719: Raise UOM_CONV_ERROR;
1720: end if ;
1721:
1722: l_debug_msg := 'Inserted into staging table opi_dbi_intransit_stg - ' || SQL%ROWCOUNT || ' rows. ';
1723: OPI_DBI_BOUNDS_PKG.write(g_pkg_name, l_proc_name,l_stmt_num, l_debug_msg);
1724:
1725: commit;
1726:
1727: l_stmt_num :=30;
1726:
1727: l_stmt_num :=30;
1728: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1729: l_debug_msg := 'Inserting data Into opi_dbi_intransit_stg for OPM Post R12 ';
1730: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1731: END IF;
1732:
1733: -- extract to collect process orgs intransit data
1734: -- process does not support cost updates for intransit data hence
1875: end if;
1876: commit;
1877:
1878: l_debug_msg := 'Inserted into staging table opi_dbi_intransit_stg for OPM Post R12 - ' || SQL%ROWCOUNT || ' rows. ';
1879: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1880:
1881: l_debug_msg := 'End of collecting intransit ODM initial load. ';
1882: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1883:
1878: l_debug_msg := 'Inserted into staging table opi_dbi_intransit_stg for OPM Post R12 - ' || SQL%ROWCOUNT || ' rows. ';
1879: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1880:
1881: l_debug_msg := 'End of collecting intransit ODM initial load. ';
1882: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1883:
1884: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1885: l_debug_msg := 'Exit from GET_INTRANSIT_INITIAL_LOAD ';
1886: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1882: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1883:
1884: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1885: l_debug_msg := 'Exit from GET_INTRANSIT_INITIAL_LOAD ';
1886: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1887: END IF;
1888:
1889: EXCEPTION
1890: WHEN UOM_CONV_ERROR then
1888:
1889: EXCEPTION
1890: WHEN UOM_CONV_ERROR then
1891: l_debug_msg := 'UOM conversion not found ' || SQLcode || ' - ' ||SQLERRM;
1892: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1893: RAISE;
1894:
1895: WHEN OTHERS THEN
1896: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
1893: RAISE;
1894:
1895: WHEN OTHERS THEN
1896: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
1897: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
1898: RAISE;
1899:
1900: END GET_INTRANSIT_INITIAL_LOAD ;
1901:
1916: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
1917:
1918: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1919: l_debug_msg := 'Entered Into EXTRACT_INVENTORY_TXN_QTY ';
1920: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1921: END IF;
1922:
1923: /* Extract all records from MMT in quantity staging table (OPI_DBI_INV_ONH_QTY_stg) ,
1924: such that transaction_date >= GSD and TRANSACTION_ID >= FROM_BOUND_ID in LOG table for this ETL.
1944:
1945: l_stmt_num :=10;
1946: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
1947: l_debug_msg := 'Inserting data into OPI_DBI_ONH_QTY_STG ';
1948: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
1949: END IF;
1950: --execute immediate 'alter session force parallel query parallel ' || g_degree;
1951:
1952: INSERT /*+ append parallel(OPI_DBI_ONH_QTY_STG) */
2042: NVL(moq.cost_group_id, mp.default_cost_group_id),
2043: moq.inventory_item_id);
2044:
2045: l_debug_msg := 'Inserted into staging table OPI_DBI_ONH_QTY_STG - ' || SQL%ROWCOUNT || ' rows. ';
2046: OPI_DBI_BOUNDS_PKG.write(g_pkg_name, l_proc_name,l_stmt_num, l_debug_msg);
2047:
2048: commit;
2049:
2050: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2048: commit;
2049:
2050: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2051: l_debug_msg := 'Exit from GET_INTRANSIT_INITIAL_LOAD ';
2052: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2053: END IF;
2054:
2055: EXCEPTION
2056: WHEN OTHERS THEN
2054:
2055: EXCEPTION
2056: WHEN OTHERS THEN
2057: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
2058: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
2059: RAISE;
2060: END EXTRACT_INVENTORY_TXN_QTY;
2061:
2062:
2098: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
2099:
2100: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2101: l_debug_msg := 'Enter Into EXTRACT_INVENTORY_TXN_VALUE ';
2102: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2103: END IF;
2104: l_stmt_num :=10;
2105: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2106: l_debug_msg := 'Inserting data into OPI_DBI_ONHAND_STG ';
2103: END IF;
2104: l_stmt_num :=10;
2105: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2106: l_debug_msg := 'Inserting data into OPI_DBI_ONHAND_STG ';
2107: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2108: END IF;
2109:
2110: INSERT /*+ append parallel(OPI_DBI_ONH_QTY_STG) */
2111: INTO OPI_DBI_ONHAND_STG
2406: decode(gtv.journal_line_type,'WIP',gmdtl.inventory_item_id,gtv.inventory_item_id),
2407: trunc(gtv.transaction_date));
2408:
2409: l_debug_msg := 'Inserted into staging table OPI_DBI_ONHAND_STG - ' || SQL%ROWCOUNT || ' rows. ';
2410: OPI_DBI_BOUNDS_PKG.write(g_pkg_name, l_proc_name,l_stmt_num, l_debug_msg);
2411:
2412: commit;
2413:
2414: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2412: commit;
2413:
2414: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2415: l_debug_msg := 'Exit from EXTRACT_INVENTORY_TXN_VALUE ';
2416: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2417: END IF;
2418:
2419: EXCEPTION
2420: WHEN OTHERS THEN
2418:
2419: EXCEPTION
2420: WHEN OTHERS THEN
2421: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
2422: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
2423: RAISE;
2424: END EXTRACT_INVENTORY_TXN_VALUE;
2425:
2426: -------------------------------------------------------------------------------
2447: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
2448:
2449: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2450: l_debug_msg := 'Entered Into MERGE_INITIAL_LOAD';
2451: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2452: END IF;
2453:
2454: l_stmt_num := 10;
2455: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2453:
2454: l_stmt_num := 10;
2455: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2456: l_debug_msg := 'Calling Clean staging table PRE INIT';
2457: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2458: END IF;
2459:
2460: insert /*+ append parallel(opi_dbi_inv_value_f) */ into OPI_DBI_INV_VALUE_F
2461: ( operating_unit_id,
2657: where s.organization_id = rate.organization_id
2658: and s.transaction_date = rate.transaction_date;
2659:
2660: l_debug_msg := 'Inserted into staging table OPI_DBI_INV_VALUE_F - ' || SQL%ROWCOUNT || ' rows. ';
2661: OPI_DBI_BOUNDS_PKG.write(g_pkg_name, l_proc_name,l_stmt_num, l_debug_msg);
2662:
2663: commit;
2664:
2665: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2663: commit;
2664:
2665: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2666: l_debug_msg := 'Exit from MERGE INITIAL LOAD';
2667: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2668: END IF;
2669:
2670: --execute immediate 'alter session disable parallel query';
2671:
2671:
2672: EXCEPTION
2673: WHEN OTHERS THEN
2674: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
2675: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
2676: RAISE;
2677:
2678: END MERGE_INITIAL_LOAD;
2679:
2694: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
2695:
2696: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2697: l_debug_msg := 'Entered Into RUN_DISCRETE_FIRST_ETL';
2698: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2699: END IF;
2700:
2701: l_stmt_num := 10;
2702: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2700:
2701: l_stmt_num := 10;
2702: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2703: l_debug_msg := 'Calling Clean staging table PRE INIT';
2704: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2705: END IF;
2706:
2707: OPI_DBI_INV_VALUE_INIT_PKG.clean_staging_tables('PRE_INIT');
2708:
2708:
2709: l_stmt_num := 20;
2710: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2711: l_debug_msg := 'Setting up bound for Inventory Initial Load ';
2712: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2713: END IF;
2714:
2715: -- cleans staging table. sets bounds for MMT, GTV and WTA Tables accordingly.
2716: OPI_DBI_BOUNDS_PKG.maintain_opi_dbi_logs('INVENTORY','INIT');
2712: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2713: END IF;
2714:
2715: -- cleans staging table. sets bounds for MMT, GTV and WTA Tables accordingly.
2716: OPI_DBI_BOUNDS_PKG.maintain_opi_dbi_logs('INVENTORY','INIT');
2717:
2718: l_stmt_num := 25;
2719: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2720: l_debug_msg := 'Calling OPI_DBI_BOUNDS_PKG.load_opm_org_ledger_data ';
2716: OPI_DBI_BOUNDS_PKG.maintain_opi_dbi_logs('INVENTORY','INIT');
2717:
2718: l_stmt_num := 25;
2719: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2720: l_debug_msg := 'Calling OPI_DBI_BOUNDS_PKG.load_opm_org_ledger_data ';
2721: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2722: END IF;
2723:
2724: OPI_DBI_BOUNDS_PKG.load_opm_org_ledger_data;
2717:
2718: l_stmt_num := 25;
2719: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2720: l_debug_msg := 'Calling OPI_DBI_BOUNDS_PKG.load_opm_org_ledger_data ';
2721: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2722: END IF;
2723:
2724: OPI_DBI_BOUNDS_PKG.load_opm_org_ledger_data;
2725:
2720: l_debug_msg := 'Calling OPI_DBI_BOUNDS_PKG.load_opm_org_ledger_data ';
2721: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2722: END IF;
2723:
2724: OPI_DBI_BOUNDS_PKG.load_opm_org_ledger_data;
2725:
2726: l_stmt_num := 30;
2727: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2728: l_debug_msg := 'Collecting OPI , OPM Initial Load Inventory Quantities ';
2725:
2726: l_stmt_num := 30;
2727: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2728: l_debug_msg := 'Collecting OPI , OPM Initial Load Inventory Quantities ';
2729: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2730: END IF;
2731:
2732: OPI_DBI_INV_VALUE_INIT_PKG.extract_inventory_txn_qty;
2733: -- even this procedure has a commit as it has two extracts and each one run in parallel append mode.
2735:
2736: l_stmt_num := 40;
2737: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2738: l_debug_msg := 'Collecting OPI, OPM Initial Load Inventory Values ';
2739: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2740: END IF;
2741:
2742: OPI_DBI_INV_VALUE_INIT_PKG.extract_inventory_txn_value;
2743: commit;
2744:
2745: l_stmt_num := 50;
2746: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2747: l_debug_msg := 'Collecting OPI , OPM Intransit Intial Load ';
2748: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2749: END IF;
2750:
2751: OPI_DBI_INV_VALUE_INIT_PKG.get_intransit_initial_load;
2752: commit;
2752: commit;
2753:
2754: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2755: l_debug_msg := 'Exit from RUN_DISCRETE_FIRST_ETL';
2756: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2757: END IF;
2758: -- ACTION: call API that Julia is writing for printing the stop reason code.
2759:
2760: EXCEPTION
2759:
2760: EXCEPTION
2761: WHEN OTHERS THEN
2762: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
2763: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
2764: RAISE;
2765:
2766: END RUN_DISCRETE_FIRST_ETL;
2767:
2793: l_module_name := FND_PROFILE.value('AFLOG_MODULE');
2794:
2795: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2796: l_debug_msg := 'Entered Into SEED_INV_TYPE_CODES';
2797: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2798: END IF;
2799:
2800: l_stmt_num := 10;
2801: OPEN type_code_exists_check_csr;
2804:
2805: l_stmt_num :=20;
2806: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2807: l_debug_msg := 'Inserting type codes. ';
2808: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2809: END IF;
2810:
2811: IF (type_code_exists_check_csr%NOTFOUND) THEN
2812:
2820: CLOSE type_code_exists_check_csr;
2821:
2822: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2823: l_debug_msg := 'exit from SEED_INV_TYPE_CODES';
2824: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2825: END IF;
2826:
2827: EXCEPTION
2828: WHEN OTHERS THEN
2826:
2827: EXCEPTION
2828: WHEN OTHERS THEN
2829: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
2830: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
2831: RAISE;
2832:
2833: END SEED_INV_TYPE_CODES;
2834:
2866:
2867: l_stmt_num :=20;
2868: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2869: l_debug_msg := 'Checking For Global Parameters';
2870: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2871: END IF;
2872:
2873: -- checks for GSD, primary and sec currency rate types, schema name for OPI
2874: -- raises exception in case there is an error
2876:
2877: l_stmt_num :=30;
2878: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2879: l_debug_msg := 'Calling Procedure seed inv codeType ';
2880: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2881: END IF;
2882: -- This will populate data for INV type report
2883: OPI_DBI_INV_VALUE_INIT_PKG.seed_inv_type_codes; -- No changes for R12
2884: commit;
2890:
2891: l_stmt_num :=40;
2892: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2893: l_debug_msg := 'Starting ODM and OPM Post R12 Initial Collection. ';
2894: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2895: END IF;
2896:
2897: -- collects data from post r12 model for process as well as discrete organizations
2898: -- collects onhand quantity, onhand value, intransit qty and value, wip value
2900:
2901: l_stmt_num :=50;
2902: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2903: l_debug_msg := 'Getting Convergence date. ';
2904: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2905: END IF;
2906: -- Procedure will provide R12 migration date
2907: OPI_DBI_RPT_UTIL_PKG.get_inv_convergence_date(l_inv_migration_date);
2908: g_R12_date:=l_inv_migration_date;
2909: -- ACTION: confirm that it returns a truncated date
2910:
2911: IF (g_R12_date IS NULL ) THEN
2912: l_debug_msg := 'CONVERGENGE Date is not available. Can not proceed';
2913: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2914: RAISE OPI_DBI_EXCEPTION;
2915: END IF;
2916:
2917: l_stmt_num :=60;
2917: l_stmt_num :=60;
2918: IF g_global_start_date < g_R12_date then
2919: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2920: l_debug_msg := 'Strating Pre R12 OPM Collection . ';
2921: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2922: END IF;
2923: -- This procedure will collect Pre R12 data for OPM
2924: OPI_DBI_INV_VALUE_OPM_INIT_PKG.Run_OPM_First_ETL(errbuf, retcode); -- For Pre R12 data
2925: IF (retcode <> 0) THEN
2923: -- This procedure will collect Pre R12 data for OPM
2924: OPI_DBI_INV_VALUE_OPM_INIT_PKG.Run_OPM_First_ETL(errbuf, retcode); -- For Pre R12 data
2925: IF (retcode <> 0) THEN
2926: IF (retcode = 1) THEN
2927: OPI_DBI_BOUNDS_PKG.write(g_pkg_name, l_proc_name,l_stmt_num,'Process Org Initial Collection completed with warnings.');
2928: ELSE
2929: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num, 'Process Org Initial Collection Failed.');
2930: RAISE OPI_DBI_EXCEPTION;
2931: END IF;
2925: IF (retcode <> 0) THEN
2926: IF (retcode = 1) THEN
2927: OPI_DBI_BOUNDS_PKG.write(g_pkg_name, l_proc_name,l_stmt_num,'Process Org Initial Collection completed with warnings.');
2928: ELSE
2929: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num, 'Process Org Initial Collection Failed.');
2930: RAISE OPI_DBI_EXCEPTION;
2931: END IF;
2932: END IF;
2933: ELSE
2931: END IF;
2932: END IF;
2933: ELSE
2934: l_debug_msg := 'GSD is greater then R12. No preR12 data is collected.';
2935: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2936: END IF;
2937:
2938: l_stmt_num :=70;
2939: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2937:
2938: l_stmt_num :=70;
2939: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2940: l_debug_msg := 'Start Collection of Inception quantities. ';
2941: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2942: END IF;
2943:
2944: -- collects inception balance from staging tables above and also costs the onhand and
2945: -- intransit quantities
2947:
2948: l_stmt_num :=80;
2949: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2950: l_debug_msg := 'Checking for Conversion Rate. ';
2951: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2952: END IF;
2953:
2954: -- this api prints the report in case there are conversion rates missing.
2955: -- it returns -1 in case there are missing conversion rates as well.
2953:
2954: -- this api prints the report in case there are conversion rates missing.
2955: -- it returns -1 in case there are missing conversion rates as well.
2956: IF (OPI_DBI_INV_VALUE_UTL_PKG.Get_Conversion_Rate(errbuf, retcode) = -1) THEN
2957: OPI_DBI_BOUNDS_PKG.write (g_pkg_name, l_proc_name,l_stmt_num,'Missing currency rate.');
2958: OPI_DBI_BOUNDS_PKG.write (g_pkg_name, l_proc_name,l_stmt_num,'Please run the concurrent program: Initial Load - Update Inventory Value and Turns Base Summary, after fixing missing currency rates.');
2959: retcode := -1; /* 11.5.10. Changed from warning to error */
2960: RAISE OPI_DBI_EXCEPTION;
2961: END IF;
2954: -- this api prints the report in case there are conversion rates missing.
2955: -- it returns -1 in case there are missing conversion rates as well.
2956: IF (OPI_DBI_INV_VALUE_UTL_PKG.Get_Conversion_Rate(errbuf, retcode) = -1) THEN
2957: OPI_DBI_BOUNDS_PKG.write (g_pkg_name, l_proc_name,l_stmt_num,'Missing currency rate.');
2958: OPI_DBI_BOUNDS_PKG.write (g_pkg_name, l_proc_name,l_stmt_num,'Please run the concurrent program: Initial Load - Update Inventory Value and Turns Base Summary, after fixing missing currency rates.');
2959: retcode := -1; /* 11.5.10. Changed from warning to error */
2960: RAISE OPI_DBI_EXCEPTION;
2961: END IF;
2962: COMMIT;
2963:
2964: l_stmt_num :=90;
2965: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2966: l_debug_msg := 'Starting Merge Initial Load . ';
2967: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2968: END IF;
2969: -- This procedure merges data from various
2970: -- staging tables populated in initial load.
2971: -- 1. OPI_DBI_ONH_QTY_STG -- onhand quantity
2978:
2979: l_stmt_num :=100;
2980: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2981: l_debug_msg := 'Starting Clean staging table post initial Load. ';
2982: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2983: END IF;
2984: -- truncate the data in staging table
2985: OPI_DBI_INV_VALUE_INIT_PKG.clean_staging_tables ('POST_INIT');
2986:
2986:
2987: l_stmt_num :=110;
2988: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2989: l_debug_msg := 'Starting Period close adjustment. ';
2990: OPI_DBI_BOUNDS_PKG.write (g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2991: END IF;
2992: -- It will populate period close adjustment data
2993: OPI_DBI_INV_CPCS_PKG.Run_Period_Close_Adjustment(errbuf, retcode);
2994:
2994:
2995: l_stmt_num :=120;
2996: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
2997: l_debug_msg := 'Checking for uncosted transactions. ';
2998: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2999: END IF;
3000:
3001: l_uncost_trx := OPI_DBI_BOUNDS_PKG.bounds_uncosted('INVENTORY', 'INIT');
3002:
2997: l_debug_msg := 'Checking for uncosted transactions. ';
2998: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
2999: END IF;
3000:
3001: l_uncost_trx := OPI_DBI_BOUNDS_PKG.bounds_uncosted('INVENTORY', 'INIT');
3002:
3003: IF l_uncost_trx =TRUE then
3004: retcode := 1;
3005: l_debug_msg := 'Warning: There are some uncosted transactions. ';
3002:
3003: IF l_uncost_trx =TRUE then
3004: retcode := 1;
3005: l_debug_msg := 'Warning: There are some uncosted transactions. ';
3006: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
3007: END IF;
3008:
3009: l_stmt_num :=130;
3010: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
3008:
3009: l_stmt_num :=130;
3010: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
3011: l_debug_msg := 'Priting the log bounds. ';
3012: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
3013: END IF;
3014:
3015: OPI_DBI_BOUNDS_PKG.print_opi_org_bounds('INVENTORY', 'INIT');
3016:
3011: l_debug_msg := 'Priting the log bounds. ';
3012: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
3013: END IF;
3014:
3015: OPI_DBI_BOUNDS_PKG.print_opi_org_bounds('INVENTORY', 'INIT');
3016:
3017: l_stmt_num :=140;
3018: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
3019: l_debug_msg := 'Updating Log with success. ';
3016:
3017: l_stmt_num :=140;
3018: IF l_debug_mode = 'Y' and upper(l_module_name) like 'BIS%' then
3019: l_debug_msg := 'Updating Log with success. ';
3020: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num, l_debug_msg );
3021: END IF;
3022:
3023: -- This will update log table for successful completion of
3024: -- Inventory Initial Load
3021: END IF;
3022:
3023: -- This will update log table for successful completion of
3024: -- Inventory Initial Load
3025: OPI_DBI_BOUNDS_PKG.set_load_successful('INVENTORY', 'INIT');
3026:
3027: BIS_COLLECTION_UTILITIES.wrapup( -- updates the log
3028: p_status => TRUE,
3029: p_count => 0, -- for 5.0 only. will put meaningful number in 6.0
3033: EXCEPTION
3034: WHEN OPI_DBI_EXCEPTION THEN
3035: retcode := -1;
3036: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
3037: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
3038: RAISE;
3039:
3040: WHEN OTHERS THEN
3041: retcode := -1;
3039:
3040: WHEN OTHERS THEN
3041: retcode := -1;
3042: l_debug_msg := 'Failed with errror ' || SQLcode || ' - ' ||SQLERRM;
3043: OPI_DBI_BOUNDS_PKG.write(g_pkg_name,l_proc_name,l_stmt_num,l_debug_msg);
3044:
3045: BIS_COLLECTION_UTILITIES.WRAPUP(
3046: p_status => FALSE,
3047: p_message => 'Failed in Initial Load of inventory value base table.'