84:
85: BEGIN
86:
87: if g_debug_flag = 'Y' then
88: FII_UTIL.put_line('Calling procedure: CHECK_XLA_CONVERSION_STATUS');
89: FII_UTIL.put_line('');
90: end if;
91:
92: FOR ledger_record in c_non_upgraded_ledgers LOOP
85: BEGIN
86:
87: if g_debug_flag = 'Y' then
88: FII_UTIL.put_line('Calling procedure: CHECK_XLA_CONVERSION_STATUS');
89: FII_UTIL.put_line('');
90: end if;
91:
92: FOR ledger_record in c_non_upgraded_ledgers LOOP
93: g_non_upgraded_ledgers := TRUE;
106:
107: EXCEPTION
108: WHEN OTHERS THEN
109: g_retcode := -1;
110: FII_UTIL.put_line('
111: ---------------------------------
112: Error in Procedure: CHECK_XLA_CONVERSION_STATUS
113: Phase: '||g_phase||'
114: Message: '||sqlerrm);
156:
157: /*
158:
159: if g_debug_flag = 'Y' then
160: FII_UTIL.put_line('Calling procedure: REPORT_MISSING_RATES');
161: FII_UTIL.put_line('');
162: end if;
163:
164: g_phase := 'Calling BIS_COLLECTION_UTILITIES.WriteMissingRateHeader to write out report header';
157: /*
158:
159: if g_debug_flag = 'Y' then
160: FII_UTIL.put_line('Calling procedure: REPORT_MISSING_RATES');
161: FII_UTIL.put_line('');
162: end if;
163:
164: g_phase := 'Calling BIS_COLLECTION_UTILITIES.WriteMissingRateHeader to write out report header';
165: if g_debug_flag = 'Y' then
162: end if;
163:
164: g_phase := 'Calling BIS_COLLECTION_UTILITIES.WriteMissingRateHeader to write out report header';
165: if g_debug_flag = 'Y' then
166: FII_UTIL.put_line(g_phase);
167: FII_UTIL.put_line('');
168: end if;
169:
170: BIS_COLLECTION_UTILITIES.WriteMissingRateHeader;
163:
164: g_phase := 'Calling BIS_COLLECTION_UTILITIES.WriteMissingRateHeader to write out report header';
165: if g_debug_flag = 'Y' then
166: FII_UTIL.put_line(g_phase);
167: FII_UTIL.put_line('');
168: end if;
169:
170: BIS_COLLECTION_UTILITIES.WriteMissingRateHeader;
171:
170: BIS_COLLECTION_UTILITIES.WriteMissingRateHeader;
171:
172: g_phase := 'Calling BIS_COLLECTION_UTILITIES.WriteMissingRate to write out report contents';
173: if g_debug_flag = 'Y' then
174: FII_UTIL.put_line(g_phase);
175: FII_UTIL.put_line('');
176: end if;
177:
178: FOR rate_record in PrimMissingRate LOOP
171:
172: g_phase := 'Calling BIS_COLLECTION_UTILITIES.WriteMissingRate to write out report contents';
173: if g_debug_flag = 'Y' then
174: FII_UTIL.put_line(g_phase);
175: FII_UTIL.put_line('');
176: end if;
177:
178: FOR rate_record in PrimMissingRate LOOP
179: BIS_COLLECTION_UTILITIES.writemissingrate(
196:
197: EXCEPTION
198: WHEN NO_DATA_FOUND THEN
199: g_retcode:=-1;
200: FII_UTIL.put_line('
201: ---------------------------------------------------
202: Error in Procedure: REPORT_MISSING_RATES
203: Phase: '||g_phase||'
204: Message: Should have missing rates but found none');
206: raise;
207:
208: WHEN OTHERS THEN
209: g_retcode := -1;
210: FII_UTIL.put_line('
211: ---------------------------------
212: Error in Procedure: REPORT_MISSING_RATES
213: Phase: '||g_phase||'
214: Message: '||sqlerrm);
228:
229: BEGIN
230:
231: if g_debug_flag = 'Y' then
232: FII_UTIL.put_line('Calling procedure: GET_ACCT_CLASSES');
233: FII_UTIL.put_line('');
234: end if;
235:
236: insert into FII_FA_ACCT_CLASS_CODE_GT
229: BEGIN
230:
231: if g_debug_flag = 'Y' then
232: FII_UTIL.put_line('Calling procedure: GET_ACCT_CLASSES');
233: FII_UTIL.put_line('');
234: end if;
235:
236: insert into FII_FA_ACCT_CLASS_CODE_GT
237: (accounting_class_code, ledger_id)
277: from xla_assignment_defns_b XAD2
278: where xad2.ledger_id = fset.ledger_id);
279:
280: if g_debug_flag = 'Y' then
281: FII_UTIL.put_line('Updated ' || SQL%ROWCOUNT || ' rows into FII_FA_ACCT_CLASS_CODE_GT');
282: FII_UTIL.stop_timer;
283: FII_UTIL.print_timer('Duration');
284: end if;
285:
278: where xad2.ledger_id = fset.ledger_id);
279:
280: if g_debug_flag = 'Y' then
281: FII_UTIL.put_line('Updated ' || SQL%ROWCOUNT || ' rows into FII_FA_ACCT_CLASS_CODE_GT');
282: FII_UTIL.stop_timer;
283: FII_UTIL.print_timer('Duration');
284: end if;
285:
286: EXCEPTION
279:
280: if g_debug_flag = 'Y' then
281: FII_UTIL.put_line('Updated ' || SQL%ROWCOUNT || ' rows into FII_FA_ACCT_CLASS_CODE_GT');
282: FII_UTIL.stop_timer;
283: FII_UTIL.print_timer('Duration');
284: end if;
285:
286: EXCEPTION
287: WHEN OTHERS THEN
285:
286: EXCEPTION
287: WHEN OTHERS THEN
288: g_retcode := -1;
289: FII_UTIL.put_line('
290: ---------------------------------
291: Error in Procedure: GET_ACCT_CLASSES
292: Phase: '||g_phase||'
293: Message: '||sqlerrm);
306:
307: BEGIN
308:
309: if g_debug_flag = 'Y' then
310: FII_UTIL.put_line('Calling procedure: INIT');
311: FII_UTIL.put_line('');
312: end if;
313:
314: -- -------------------------------------------
307: BEGIN
308:
309: if g_debug_flag = 'Y' then
310: FII_UTIL.put_line('Calling procedure: INIT');
311: FII_UTIL.put_line('');
312: end if;
313:
314: -- -------------------------------------------
315: -- Turn on parallel insert/dml for the session
332: ----------------------------------------------------------
333: -- Find the schema owner of FII
334: ----------------------------------------------------------
335: g_phase := 'Find FII schema';
336: g_fii_schema := FII_UTIL.get_schema_name ('FII');
337:
338: /*
339: --------------------------------------------------------------
340: -- Find all currency related information
364: end if;
365:
366: exception
367: when others then
368: fii_util.write_log('Failed to convert rate_type to rate_type_name' );
369: raise;
370: end;
371: */
372:
372:
373: EXCEPTION
374: WHEN OTHERS THEN
375: g_retcode := -1;
376: FII_UTIL.put_line('
377: ---------------------------------
378: Error in Procedure: INIT
379: Phase: '||g_phase||'
380: Message: '||sqlerrm);
398: BEGIN
399:
400: g_phase := 'Check if Source Legder Assignments setup has changed';
401: if g_debug_flag = 'Y' then
402: FII_UTIL.put_line(g_phase);
403: end if;
404:
405: SELECT DECODE(item_value, 'Y', 'TRUE', 'FALSE')
406: INTO l_slg_chg
456: WHEN NO_DATA_FOUND THEN
457: RETURN 'FALSE';
458: WHEN OTHERS THEN
459: g_retcode := -1;
460: FII_UTIL.put_line('
461: -----------------------------
462: Error occured in Funcation: CHECK_IF_SLG_SET_UP_CHANGE
463: Phase: '||g_phase||'
464: Message: ' || sqlerrm);
484:
485: BEGIN
486:
487: if g_debug_flag = 'Y' then
488: FII_UTIL.put_line('Calling procedure: REGISTER_JOBS');
489: FII_UTIL.put_line('');
490: end if;
491:
492: g_phase := 'Register jobs for workers';
485: BEGIN
486:
487: if g_debug_flag = 'Y' then
488: FII_UTIL.put_line('Calling procedure: REGISTER_JOBS');
489: FII_UTIL.put_line('');
490: end if;
491:
492: g_phase := 'Register jobs for workers';
493: if g_debug_flag = 'Y' then
490: end if;
491:
492: g_phase := 'Register jobs for workers';
493: if g_debug_flag = 'Y' then
494: FII_UTIL.put_line('Register jobs for workers');
495: end if;
496:
497: ------------------------------------------------------------
498: -- select min and max sequence IDs from your ID Temp table
513: l_start_number := least(l_end_number, l_max_number) + 1;
514: END LOOP;
515:
516: if g_debug_flag = 'Y' then
517: FII_UTIL.put_line('Inserted ' || l_count || ' jobs into FII_FA_WORKER_JOBS table');
518: end if;
519:
520: COMMIT;
521:
521:
522: EXCEPTION
523: WHEN OTHERS THEN
524: g_retcode := -1;
525: FII_UTIL.put_line('
526: ---------------------------------
527: Error in Procedure: REGISTER_JOBS
528: Phase: '||g_phase||'
529: Message: '||sqlerrm);
559: 20000000,
560: 20000000);
561:
562: if g_debug_flag = 'Y' then
563: FII_util.put_line(' Worker '||i||' request id: '||l_request_id);
564: end if;
565:
566: IF (l_request_id = 0) THEN
567: rollback;
565:
566: IF (l_request_id = 0) THEN
567: rollback;
568: g_retcode := -1;
569: FII_UTIL.put_line('
570: ---------------------------------
571: Error in Procedure: LAUNCH_WORKERS
572: Message: '||fnd_message.get);
573: raise G_NO_CHILD_PROCESS;
580:
581: EXCEPTION
582: WHEN G_NO_CHILD_PROCESS THEN
583: g_retcode := -1;
584: FII_UTIL.put_line('No child process launched');
585: raise;
586:
587: WHEN OTHERS THEN
588: rollback;
586:
587: WHEN OTHERS THEN
588: rollback;
589: g_retcode := -1;
590: FII_UTIL.put_line('
591: ---------------------------------
592: Error in Procedure: LAUNCH_WORKERS
593: Message: '||sqlerrm);
594:
618: EXCEPTION
619: WHEN OTHERS THEN
620: rollback;
621: g_retcode := -1;
622: FII_UTIL.put_line('
623: ---------------------------------
624: Error in Procedure: CHILD_SETUP
625: Phase: '||g_phase||'
626: Message: '||sqlerrm);
647: BEGIN
648:
649: g_phase := 'Checking for missing rates';
650: if g_debug_flag = 'Y' then
651: FII_UTIL.put_line(g_phase);
652: end if;
653:
654:
655: --------------------------------------------------------
682: END IF;
683:
684: IF l_row_cnt = 0 THEN
685: IF g_debug_flag = 'Y' THEN
686: FII_UTIL.put_line('Summary Error Check completed successfully, no data found!');
687: END IF;
688: RETURN;
689: END IF;
690:
696: FII_MESSAGE.write_output (msg_name => 'FII_MISS_EXCH_RATE_FOUND', token_num => 0);
697: FII_MESSAGE.write_log (msg_name => 'FII_MISS_EXCH_RATE_FOUND', token_num => 0);
698: FII_MESSAGE.write_log (msg_name => 'FII_REFER_TO_OUTPUT', token_num => 0);
699:
700: --FII_UTIL.put_line('Missing currency conversion rates found, program will exit with error status. Please fix the missing conversion rates');
701:
702: g_retcode := -1;
703: g_missing_rates := 1;
704: IF g_program_type = 'L' THEN
710: END IF;
711:
712: g_phase := 'Checking for Time dimension';
713: if g_debug_flag = 'Y' then
714: FII_UTIL.put_line(g_phase);
715: end if;
716:
717: */
718:
735: FII_MESSAGE.write_output (msg_name => 'FII_TIME_DIM_STALE', token_num => 0);
736: FII_MESSAGE.write_log (msg_name => 'FII_TIME_DIM_STALE', token_num => 0);
737: FII_MESSAGE.write_log (msg_name => 'FII_REFER_TO_OUTPUT', token_num => 0);
738:
739: --FII_UTIL.put_line('Time Dimension is not fully populated. Please populate Time dimension to cover the date range you are collecting');
740:
741: g_retcode := -1; --we set it error out for missing time
742: g_missing_time := 1;
743: RETURN;
743: RETURN;
744: END IF;
745:
746: if g_debug_flag = 'Y' then
747: FII_UTIL.put_line('Summary Error Check completed successfully, no error found!');
748: end if;
749: RETURN;
750:
751: EXCEPTION
750:
751: EXCEPTION
752: WHEN OTHERS THEN
753: g_retcode := -1;
754: FII_UTIL.put_line('
755: ---------------------------------
756: Error occured in Summary_err_check function
757: Phase: '||g_phase||'
758: Message: '||sqlerrm);
770:
771: BEGIN
772:
773: if g_debug_flag = 'Y' then
774: FII_UTIL.put_line('Calling procedure: CLEAN_UP');
775: end if;
776:
777: ------------------------------------------------------
778: -- Current plan is to not use a worker table
776:
777: ------------------------------------------------------
778: -- Current plan is to not use a worker table
779: ------------------------------------------------------
780: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_WORKER_JOBS',
781: P_RETCODE => l_ret_code);
782:
783: IF (g_truncate_id) THEN
784: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_NEW_EXP_HDR_IDS',
780: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_WORKER_JOBS',
781: P_RETCODE => l_ret_code);
782:
783: IF (g_truncate_id) THEN
784: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_NEW_EXP_HDR_IDS',
785: P_RETCODE => l_ret_code);
786: END IF;
787:
788: IF (g_truncate_stg) THEN
785: P_RETCODE => l_ret_code);
786: END IF;
787:
788: IF (g_truncate_stg) THEN
789: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_EXP_T',
790: P_RETCODE => l_ret_code);
791:
792: END IF;
793:
795:
796: EXCEPTION
797: WHEN OTHERS Then
798: g_retcode:=-1;
799: FII_UTIL.put_line('
800: ---------------------------------
801: Error in Procedure: Clean_Up
802: Message: ' || sqlerrm);
803:
815:
816: BEGIN
817:
818: if g_debug_flag = 'Y' then
819: FII_UTIL.put_line ('Calling Journals_Processed Procedure');
820: FII_UTIL.start_timer;
821: end if;
822:
823: ---------------------------------------------------------------------
816: BEGIN
817:
818: if g_debug_flag = 'Y' then
819: FII_UTIL.put_line ('Calling Journals_Processed Procedure');
820: FII_UTIL.start_timer;
821: end if;
822:
823: ---------------------------------------------------------------------
824: -- Inserting processed JE Header IDs into FII_FA_EXP_HDR_IDS
845: g_fii_user_id
846: FROM fii_fa_new_exp_hdr_ids;
847:
848: if g_debug_flag = 'Y' then
849: FII_UTIL.put_line('Updated ' || SQL%ROWCOUNT || ' rows into FII_FA_EXP_HDR_IDS');
850: FII_UTIL.stop_timer;
851: FII_UTIL.print_timer('Duration');
852: end if;
853:
846: FROM fii_fa_new_exp_hdr_ids;
847:
848: if g_debug_flag = 'Y' then
849: FII_UTIL.put_line('Updated ' || SQL%ROWCOUNT || ' rows into FII_FA_EXP_HDR_IDS');
850: FII_UTIL.stop_timer;
851: FII_UTIL.print_timer('Duration');
852: end if;
853:
854: Exception
847:
848: if g_debug_flag = 'Y' then
849: FII_UTIL.put_line('Updated ' || SQL%ROWCOUNT || ' rows into FII_FA_EXP_HDR_IDS');
850: FII_UTIL.stop_timer;
851: FII_UTIL.print_timer('Duration');
852: end if;
853:
854: Exception
855: WHEN OTHERS Then
853:
854: Exception
855: WHEN OTHERS Then
856: g_retcode := -1;
857: FII_UTIL.put_line('
858: ----------------------------
859: Error in Function: Journal_processed
860: Message: '||sqlerrm);
861: ROLLBACK;
892: -- back (status = B)
893: --
894: -----------------------------------------------------------------------
895: if g_debug_flag = 'Y' then
896: FII_UTIL.put_line(' ');
897: FII_UTIL.put_line('Inserting New Journal header ids');
898: FII_UTIL.start_timer;
899: end if;
900:
893: --
894: -----------------------------------------------------------------------
895: if g_debug_flag = 'Y' then
896: FII_UTIL.put_line(' ');
897: FII_UTIL.put_line('Inserting New Journal header ids');
898: FII_UTIL.start_timer;
899: end if;
900:
901: if (g_program_type <> 'L') then
894: -----------------------------------------------------------------------
895: if g_debug_flag = 'Y' then
896: FII_UTIL.put_line(' ');
897: FII_UTIL.put_line('Inserting New Journal header ids');
898: FII_UTIL.start_timer;
899: end if;
900:
901: if (g_program_type <> 'L') then
902:
972:
973: l_number_of_rows := SQL%ROWCOUNT;
974:
975: if g_debug_flag = 'Y' then
976: FII_UTIL.put_line('Inserted '||l_number_of_rows||
977: ' JE header IDs into FII_FA_NEW_EXP_HDR_IDS for new entries');
978: FII_UTIL.stop_timer;
979: FII_UTIL.print_timer('Duration');
980: FII_UTIL.put_line('');
974:
975: if g_debug_flag = 'Y' then
976: FII_UTIL.put_line('Inserted '||l_number_of_rows||
977: ' JE header IDs into FII_FA_NEW_EXP_HDR_IDS for new entries');
978: FII_UTIL.stop_timer;
979: FII_UTIL.print_timer('Duration');
980: FII_UTIL.put_line('');
981: end if;
982:
975: if g_debug_flag = 'Y' then
976: FII_UTIL.put_line('Inserted '||l_number_of_rows||
977: ' JE header IDs into FII_FA_NEW_EXP_HDR_IDS for new entries');
978: FII_UTIL.stop_timer;
979: FII_UTIL.print_timer('Duration');
980: FII_UTIL.put_line('');
981: end if;
982:
983: commit;
976: FII_UTIL.put_line('Inserted '||l_number_of_rows||
977: ' JE header IDs into FII_FA_NEW_EXP_HDR_IDS for new entries');
978: FII_UTIL.stop_timer;
979: FII_UTIL.print_timer('Duration');
980: FII_UTIL.put_line('');
981: end if;
982:
983: commit;
984:
1037: and glh.ledger_id = fset.ledger_id;
1038:
1039: l_number_of_rows := SQL%ROWCOUNT;
1040: if g_debug_flag = 'Y' then
1041: FII_UTIL.put_line('Inserted '||l_number_of_rows||
1042: ' JE header IDs into FII_FA_NEW_EXP_HDR_IDS for main processing');
1043: FII_UTIL.stop_timer;
1044: FII_UTIL.print_timer('Duration');
1045: FII_UTIL.put_line('');
1039: l_number_of_rows := SQL%ROWCOUNT;
1040: if g_debug_flag = 'Y' then
1041: FII_UTIL.put_line('Inserted '||l_number_of_rows||
1042: ' JE header IDs into FII_FA_NEW_EXP_HDR_IDS for main processing');
1043: FII_UTIL.stop_timer;
1044: FII_UTIL.print_timer('Duration');
1045: FII_UTIL.put_line('');
1046: end if;
1047:
1040: if g_debug_flag = 'Y' then
1041: FII_UTIL.put_line('Inserted '||l_number_of_rows||
1042: ' JE header IDs into FII_FA_NEW_EXP_HDR_IDS for main processing');
1043: FII_UTIL.stop_timer;
1044: FII_UTIL.print_timer('Duration');
1045: FII_UTIL.put_line('');
1046: end if;
1047:
1048: commit;
1041: FII_UTIL.put_line('Inserted '||l_number_of_rows||
1042: ' JE header IDs into FII_FA_NEW_EXP_HDR_IDS for main processing');
1043: FII_UTIL.stop_timer;
1044: FII_UTIL.print_timer('Duration');
1045: FII_UTIL.put_line('');
1046: end if;
1047:
1048: commit;
1049:
1054:
1055: Exception
1056: WHEN OTHERS Then
1057: g_retcode := -1;
1058: FII_UTIL.put_line('
1059: ----------------------------
1060: Error in New_Journals Procedure
1061: Message: '||sqlerrm);
1062: RAISE;
1073:
1074: BEGIN
1075:
1076: if g_debug_flag = 'Y' then
1077: FII_UTIL.put_line ('Calling Delete_From_Base_Summary Procedure');
1078: FII_UTIL.start_timer;
1079: end if;
1080:
1081: delete from fii_fa_exp_f
1074: BEGIN
1075:
1076: if g_debug_flag = 'Y' then
1077: FII_UTIL.put_line ('Calling Delete_From_Base_Summary Procedure');
1078: FII_UTIL.start_timer;
1079: end if;
1080:
1081: delete from fii_fa_exp_f
1082: where xla_event_id in
1096:
1097: commit;
1098:
1099: if g_debug_flag = 'Y' then
1100: FII_UTIL.put_line('Deleted '|| l_count ||
1101: ' lines from FII_FA_EXP_F for rolled back entries');
1102: FII_UTIL.stop_timer;
1103: FII_UTIL.print_timer('Duration');
1104: FII_UTIL.put_line('');
1098:
1099: if g_debug_flag = 'Y' then
1100: FII_UTIL.put_line('Deleted '|| l_count ||
1101: ' lines from FII_FA_EXP_F for rolled back entries');
1102: FII_UTIL.stop_timer;
1103: FII_UTIL.print_timer('Duration');
1104: FII_UTIL.put_line('');
1105: end if;
1106:
1099: if g_debug_flag = 'Y' then
1100: FII_UTIL.put_line('Deleted '|| l_count ||
1101: ' lines from FII_FA_EXP_F for rolled back entries');
1102: FII_UTIL.stop_timer;
1103: FII_UTIL.print_timer('Duration');
1104: FII_UTIL.put_line('');
1105: end if;
1106:
1107:
1100: FII_UTIL.put_line('Deleted '|| l_count ||
1101: ' lines from FII_FA_EXP_F for rolled back entries');
1102: FII_UTIL.stop_timer;
1103: FII_UTIL.print_timer('Duration');
1104: FII_UTIL.put_line('');
1105: end if;
1106:
1107:
1108: Exception
1107:
1108: Exception
1109: WHEN OTHERS Then
1110: g_retcode := -1;
1111: FII_UTIL.put_line('
1112: ----------------------------
1113: Error in Delete_From_Base_Summary Procedure
1114: Message: '||sqlerrm);
1115: RAISE;
1135:
1136: BEGIN
1137:
1138: if g_debug_flag = 'Y' then
1139: FII_UTIL.put_line('Calling Procedure: VERIFY_CAT_ID_UP_TO_DATE');
1140: FII_UTIL.put_line('');
1141: end if;
1142:
1143: IF(FII_FA_CAT_C.NEW_CAT_IN_FA) THEN
1136: BEGIN
1137:
1138: if g_debug_flag = 'Y' then
1139: FII_UTIL.put_line('Calling Procedure: VERIFY_CAT_ID_UP_TO_DATE');
1140: FII_UTIL.put_line('');
1141: end if;
1142:
1143: IF(FII_FA_CAT_C.NEW_CAT_IN_FA) THEN
1144:
1142:
1143: IF(FII_FA_CAT_C.NEW_CAT_IN_FA) THEN
1144:
1145: if g_debug_flag = 'Y' then
1146: FII_UTIL.put_line('CAT_ID Dimension is not up to date, calling CAT_ID Dimension update program');
1147: end if;
1148:
1149: g_phase := 'Calling CAT_ID Dimension update program';
1150: l_dummy := FND_REQUEST.SET_MODE(TRUE);
1154:
1155: IF (l_request_id = 0) THEN
1156: rollback;
1157: g_retcode := -1;
1158: FII_UTIL.put_line('
1159: ---------------------------------
1160: Error in Procedure: VERIFY_CAT_ID_UP_TO_DATE
1161: Message: '||fnd_message.get);
1162: raise G_NO_CHILD_PROCESS;
1175: g_phase := 'Finished calling FND_CONCURRENT.wait_for_request -> ' || l_devphase || ', ' || l_devstatus;
1176:
1177: IF (NVL(l_devphase='COMPLETE' AND l_devstatus='NORMAL', FALSE)) THEN
1178: if g_debug_flag = 'Y' then
1179: FII_UTIL.put_line('CAT_ID Dimension populated successfully');
1180: end if;
1181: ELSE
1182: if g_debug_flag = 'Y' then
1183: FII_UTIL.put_line('CAT_ID Dimension populated unsuccessfully');
1179: FII_UTIL.put_line('CAT_ID Dimension populated successfully');
1180: end if;
1181: ELSE
1182: if g_debug_flag = 'Y' then
1183: FII_UTIL.put_line('CAT_ID Dimension populated unsuccessfully');
1184: end if;
1185: raise G_CAT_ID_FAILED;
1186: END IF;
1187:
1187:
1188: ELSE
1189:
1190: if g_debug_flag = 'Y' then
1191: FII_UTIL.put_line('CAT_ID Dimension is up to date');
1192: FII_UTIL.put_line('');
1193: end if;
1194:
1195: END IF;
1188: ELSE
1189:
1190: if g_debug_flag = 'Y' then
1191: FII_UTIL.put_line('CAT_ID Dimension is up to date');
1192: FII_UTIL.put_line('');
1193: end if;
1194:
1195: END IF;
1196:
1196:
1197: EXCEPTION
1198: WHEN G_CAT_ID_FAILED THEN
1199: g_retcode := -1;
1200: FII_UTIL.put_line('
1201: ----------------------------
1202: Error in Procedure : VERIFY_CAT_ID_UP_TO_DATE when running CAT_ID program
1203: Phase: ' || g_phase);
1204: raise;
1204: raise;
1205:
1206: WHEN OTHERS Then
1207: g_retcode := -1;
1208: FII_UTIL.put_line('
1209: ----------------------------
1210: Error in Procedure : VERIFY_CAT_ID_UP_TO_DATE
1211: Phase: ' || g_phase || '
1212: Message: '||sqlerrm);
1242: l_global_prim_curr_code := bis_common_parameters.get_currency_code;
1243: l_global_sec_curr_code := bis_common_parameters.get_secondary_currency_code;
1244:
1245: if g_debug_flag = 'Y' then
1246: fii_util.put_line(' ');
1247: fii_util.put_line('Loading data into rates table');
1248: fii_util.start_timer;
1249: fii_util.put_line('');
1250: end if;
1243: l_global_sec_curr_code := bis_common_parameters.get_secondary_currency_code;
1244:
1245: if g_debug_flag = 'Y' then
1246: fii_util.put_line(' ');
1247: fii_util.put_line('Loading data into rates table');
1248: fii_util.start_timer;
1249: fii_util.put_line('');
1250: end if;
1251:
1244:
1245: if g_debug_flag = 'Y' then
1246: fii_util.put_line(' ');
1247: fii_util.put_line('Loading data into rates table');
1248: fii_util.start_timer;
1249: fii_util.put_line('');
1250: end if;
1251:
1252: g_phase := 'Inserting into fii_fa_exp_rates_temp';
1245: if g_debug_flag = 'Y' then
1246: fii_util.put_line(' ');
1247: fii_util.put_line('Loading data into rates table');
1248: fii_util.start_timer;
1249: fii_util.put_line('');
1250: end if;
1251:
1252: g_phase := 'Inserting into fii_fa_exp_rates_temp';
1253:
1274: (ownname => g_fii_schema,
1275: tabname => 'FII_GL_REVENUE_RATES_TEMP');
1276:
1277: if g_debug_flag = 'Y' then
1278: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_gl_revenue_rates_temp');
1279: fii_util.stop_timer;
1280: fii_util.print_timer('Duration');
1281: end if;
1282:
1275: tabname => 'FII_GL_REVENUE_RATES_TEMP');
1276:
1277: if g_debug_flag = 'Y' then
1278: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_gl_revenue_rates_temp');
1279: fii_util.stop_timer;
1280: fii_util.print_timer('Duration');
1281: end if;
1282:
1283: */
1276:
1277: if g_debug_flag = 'Y' then
1278: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_gl_revenue_rates_temp');
1279: fii_util.stop_timer;
1280: fii_util.print_timer('Duration');
1281: end if;
1282:
1283: */
1284:
1286:
1287: EXCEPTION
1288: WHEN OTHERS Then
1289: g_retcode := -1;
1290: FII_UTIL.put_line('
1291: ----------------------------
1292: Error in Function: Insert_Into_Rates
1293: Phase: ' || g_phase || '
1294: Message: '||sqlerrm);
1316:
1317: g_phase := 'Inserting into fii_fa_exp_f-periodic deprn';
1318:
1319: if g_debug_flag = 'Y' then
1320: fii_util.put_line('g_number_of_process: ' || to_char(g_number_of_process));
1321: fii_util.put_line('g_worker_num: ' || to_char(g_worker_num));
1322:
1323: fii_util.put_line(' ');
1324: fii_util.put_line(g_phase);
1317: g_phase := 'Inserting into fii_fa_exp_f-periodic deprn';
1318:
1319: if g_debug_flag = 'Y' then
1320: fii_util.put_line('g_number_of_process: ' || to_char(g_number_of_process));
1321: fii_util.put_line('g_worker_num: ' || to_char(g_worker_num));
1322:
1323: fii_util.put_line(' ');
1324: fii_util.put_line(g_phase);
1325: fii_util.start_timer;
1319: if g_debug_flag = 'Y' then
1320: fii_util.put_line('g_number_of_process: ' || to_char(g_number_of_process));
1321: fii_util.put_line('g_worker_num: ' || to_char(g_worker_num));
1322:
1323: fii_util.put_line(' ');
1324: fii_util.put_line(g_phase);
1325: fii_util.start_timer;
1326: fii_util.put_line('');
1327: end if;
1320: fii_util.put_line('g_number_of_process: ' || to_char(g_number_of_process));
1321: fii_util.put_line('g_worker_num: ' || to_char(g_worker_num));
1322:
1323: fii_util.put_line(' ');
1324: fii_util.put_line(g_phase);
1325: fii_util.start_timer;
1326: fii_util.put_line('');
1327: end if;
1328:
1321: fii_util.put_line('g_worker_num: ' || to_char(g_worker_num));
1322:
1323: fii_util.put_line(' ');
1324: fii_util.put_line(g_phase);
1325: fii_util.start_timer;
1326: fii_util.put_line('');
1327: end if;
1328:
1329: insert into fii_fa_exp_f
1322:
1323: fii_util.put_line(' ');
1324: fii_util.put_line(g_phase);
1325: fii_util.start_timer;
1326: fii_util.put_line('');
1327: end if;
1328:
1329: insert into fii_fa_exp_f
1330: (LEDGER_ID ,
1439: and bc.book_type_code = dp.book_type_code
1440: and bc.set_of_books_id = sob.ledger_id;
1441:
1442: if g_debug_flag = 'Y' then
1443: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1444: fii_util.stop_timer;
1445: fii_util.print_timer('Duration');
1446: end if;
1447:
1440: and bc.set_of_books_id = sob.ledger_id;
1441:
1442: if g_debug_flag = 'Y' then
1443: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1444: fii_util.stop_timer;
1445: fii_util.print_timer('Duration');
1446: end if;
1447:
1448: commit;
1441:
1442: if g_debug_flag = 'Y' then
1443: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1444: fii_util.stop_timer;
1445: fii_util.print_timer('Duration');
1446: end if;
1447:
1448: commit;
1449:
1449:
1450: g_phase := 'Inserting into fii_fa_exp_f-catchup deprn';
1451:
1452: if g_debug_flag = 'Y' then
1453: fii_util.put_line(' ');
1454: fii_util.put_line(g_phase);
1455: fii_util.start_timer;
1456: fii_util.put_line('');
1457: end if;
1450: g_phase := 'Inserting into fii_fa_exp_f-catchup deprn';
1451:
1452: if g_debug_flag = 'Y' then
1453: fii_util.put_line(' ');
1454: fii_util.put_line(g_phase);
1455: fii_util.start_timer;
1456: fii_util.put_line('');
1457: end if;
1458:
1451:
1452: if g_debug_flag = 'Y' then
1453: fii_util.put_line(' ');
1454: fii_util.put_line(g_phase);
1455: fii_util.start_timer;
1456: fii_util.put_line('');
1457: end if;
1458:
1459: insert into fii_fa_exp_f
1452: if g_debug_flag = 'Y' then
1453: fii_util.put_line(' ');
1454: fii_util.put_line(g_phase);
1455: fii_util.start_timer;
1456: fii_util.put_line('');
1457: end if;
1458:
1459: insert into fii_fa_exp_f
1460: (LEDGER_ID ,
1601:
1602:
1603:
1604: if g_debug_flag = 'Y' then
1605: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1606: fii_util.stop_timer;
1607: fii_util.print_timer('Duration');
1608: end if;
1609:
1602:
1603:
1604: if g_debug_flag = 'Y' then
1605: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1606: fii_util.stop_timer;
1607: fii_util.print_timer('Duration');
1608: end if;
1609:
1610: commit;
1603:
1604: if g_debug_flag = 'Y' then
1605: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1606: fii_util.stop_timer;
1607: fii_util.print_timer('Duration');
1608: end if;
1609:
1610: commit;
1611:
1620:
1621: EXCEPTION
1622: WHEN OTHERS Then
1623: g_retcode := -1;
1624: FII_UTIL.put_line('
1625: ----------------------------
1626: Error in Function: INSERT_INTO_SUMMARY
1627: Phase: ' || g_phase || '
1628: Message: '||sqlerrm);
1649: -- R12: determine accounting classes
1650: GET_ACCT_CLASSES;
1651:
1652: if g_debug_flag = 'Y' then
1653: fii_util.put_line(' ');
1654: fii_util.put_line('Loading data into base summary table - catchup');
1655: fii_util.start_timer;
1656: fii_util.put_line('');
1657: end if;
1650: GET_ACCT_CLASSES;
1651:
1652: if g_debug_flag = 'Y' then
1653: fii_util.put_line(' ');
1654: fii_util.put_line('Loading data into base summary table - catchup');
1655: fii_util.start_timer;
1656: fii_util.put_line('');
1657: end if;
1658:
1651:
1652: if g_debug_flag = 'Y' then
1653: fii_util.put_line(' ');
1654: fii_util.put_line('Loading data into base summary table - catchup');
1655: fii_util.start_timer;
1656: fii_util.put_line('');
1657: end if;
1658:
1659: /*+ append parallel(bsum) */
1652: if g_debug_flag = 'Y' then
1653: fii_util.put_line(' ');
1654: fii_util.put_line('Loading data into base summary table - catchup');
1655: fii_util.start_timer;
1656: fii_util.put_line('');
1657: end if;
1658:
1659: /*+ append parallel(bsum) */
1660:
1804: headers.event_id,
1805: headers.ae_header_id;
1806:
1807: if g_debug_flag = 'Y' then
1808: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1809: fii_util.stop_timer;
1810: fii_util.print_timer('Duration');
1811: end if;
1812:
1805: headers.ae_header_id;
1806:
1807: if g_debug_flag = 'Y' then
1808: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1809: fii_util.stop_timer;
1810: fii_util.print_timer('Duration');
1811: end if;
1812:
1813: commit;
1806:
1807: if g_debug_flag = 'Y' then
1808: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1809: fii_util.stop_timer;
1810: fii_util.print_timer('Duration');
1811: end if;
1812:
1813: commit;
1814:
1814:
1815:
1816: -- R12: adding seperate insert for DD based amounts
1817: if g_debug_flag = 'Y' then
1818: fii_util.put_line(' ');
1819: fii_util.put_line('Loading data into base summary table - periodic deprn');
1820: fii_util.start_timer;
1821: fii_util.put_line('');
1822: end if;
1815:
1816: -- R12: adding seperate insert for DD based amounts
1817: if g_debug_flag = 'Y' then
1818: fii_util.put_line(' ');
1819: fii_util.put_line('Loading data into base summary table - periodic deprn');
1820: fii_util.start_timer;
1821: fii_util.put_line('');
1822: end if;
1823:
1816: -- R12: adding seperate insert for DD based amounts
1817: if g_debug_flag = 'Y' then
1818: fii_util.put_line(' ');
1819: fii_util.put_line('Loading data into base summary table - periodic deprn');
1820: fii_util.start_timer;
1821: fii_util.put_line('');
1822: end if;
1823:
1824: insert
1817: if g_debug_flag = 'Y' then
1818: fii_util.put_line(' ');
1819: fii_util.put_line('Loading data into base summary table - periodic deprn');
1820: fii_util.start_timer;
1821: fii_util.put_line('');
1822: end if;
1823:
1824: insert
1825: into fii_fa_exp_f bsum
1949: and ev_rb.application_id = 140
1950: and ev_rb.event_id > ev_dep.event_id);
1951:
1952: if g_debug_flag = 'Y' then
1953: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1954: fii_util.stop_timer;
1955: fii_util.print_timer('Duration');
1956: end if;
1957:
1950: and ev_rb.event_id > ev_dep.event_id);
1951:
1952: if g_debug_flag = 'Y' then
1953: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1954: fii_util.stop_timer;
1955: fii_util.print_timer('Duration');
1956: end if;
1957:
1958: commit;
1951:
1952: if g_debug_flag = 'Y' then
1953: fii_util.put_line('Inserted '||SQL%ROWCOUNT||' rows into fii_fa_exp_f');
1954: fii_util.stop_timer;
1955: fii_util.print_timer('Duration');
1956: end if;
1957:
1958: commit;
1959:
1963:
1964: EXCEPTION
1965: WHEN OTHERS Then
1966: g_retcode := -1;
1967: FII_UTIL.put_line('
1968: ----------------------------
1969: Error in Function: Insert_Into_Summary_Par
1970: Phase: ' || g_phase || '
1971: Message: '||sqlerrm);
2038: RAISE G_LOGIN_INFO_NOT_AVABLE;
2039: END IF;
2040:
2041: if g_debug_flag = 'Y' then
2042: FII_UTIL.put_line('User ID: ' || g_fii_user_id || ' Login ID: ' || g_fii_login_id);
2043: end if;
2044:
2045: g_program_type := p_program_type;
2046: -----------------------------------------------
2046: -----------------------------------------------
2047: -- Do the necessary setups for logging and
2048: -- output
2049: -----------------------------------------------
2050: l_dir := FII_UTIL.get_utl_file_dir;
2051:
2052: ------------------------------------------------
2053: -- Initialize API will fetch the FII_DEBUG_MODE
2054: -- profile option and intialize g_debug variable
2055: -- accordingly. It will also read in profile
2056: -- option BIS_DEBUG_LOG_DIRECTORY to find out
2057: -- the log directory
2058: ------------------------------------------------
2059: g_phase := 'Calling FII_UTIL.initialize';
2060: IF g_program_type = 'I' THEN
2061: FII_UTIL.initialize('FII_FA_EXP_SUM.log','FII_FA_EXP_SUM.out',l_dir, 'FII_FA_EXP_B_C');
2062: ELSIF g_program_type = 'L' THEN
2063: FII_UTIL.initialize('FII_FA_EXP_SUM.log','FII_FA_EXP_SUM.out',l_dir, 'FII_FA_EXP_F_L');
2057: -- the log directory
2058: ------------------------------------------------
2059: g_phase := 'Calling FII_UTIL.initialize';
2060: IF g_program_type = 'I' THEN
2061: FII_UTIL.initialize('FII_FA_EXP_SUM.log','FII_FA_EXP_SUM.out',l_dir, 'FII_FA_EXP_B_C');
2062: ELSIF g_program_type = 'L' THEN
2063: FII_UTIL.initialize('FII_FA_EXP_SUM.log','FII_FA_EXP_SUM.out',l_dir, 'FII_FA_EXP_F_L');
2064: END IF;
2065:
2059: g_phase := 'Calling FII_UTIL.initialize';
2060: IF g_program_type = 'I' THEN
2061: FII_UTIL.initialize('FII_FA_EXP_SUM.log','FII_FA_EXP_SUM.out',l_dir, 'FII_FA_EXP_B_C');
2062: ELSIF g_program_type = 'L' THEN
2063: FII_UTIL.initialize('FII_FA_EXP_SUM.log','FII_FA_EXP_SUM.out',l_dir, 'FII_FA_EXP_F_L');
2064: END IF;
2065:
2066:
2067: ------------------------------------------------
2153: ------------------------------------------------
2154: IF g_program_type = 'L' THEN
2155:
2156: IF g_debug_flag = 'Y' then
2157: FII_UTIL.put_line('Running in Initial Load mode, truncate STG, summary and other processing tables.');
2158: END IF;
2159:
2160: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_EXP_T',
2161: P_RETCODE => l_ret_code);
2156: IF g_debug_flag = 'Y' then
2157: FII_UTIL.put_line('Running in Initial Load mode, truncate STG, summary and other processing tables.');
2158: END IF;
2159:
2160: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_EXP_T',
2161: P_RETCODE => l_ret_code);
2162:
2163: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_EXP_F',
2164: P_RETCODE => l_ret_code);
2159:
2160: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_EXP_T',
2161: P_RETCODE => l_ret_code);
2162:
2163: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_EXP_F',
2164: P_RETCODE => l_ret_code);
2165:
2166: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_EXP_HDR_IDS',
2167: P_RETCODE => l_ret_code);
2162:
2163: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_EXP_F',
2164: P_RETCODE => l_ret_code);
2165:
2166: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_EXP_HDR_IDS',
2167: P_RETCODE => l_ret_code);
2168:
2169: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_NEW_EXP_HDR_IDS',
2170: P_RETCODE => l_ret_code);
2165:
2166: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_EXP_HDR_IDS',
2167: P_RETCODE => l_ret_code);
2168:
2169: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_NEW_EXP_HDR_IDS',
2170: P_RETCODE => l_ret_code);
2171:
2172:
2173: COMMIT;
2194: -- should fail the program if either slg or prd changed
2195: IF (l_slg_chg = 'TRUE') THEN
2196: FII_MESSAGE.write_output (msg_name => 'FII_TRUNC_SUMMARY', token_num => 0);
2197: FII_MESSAGE.write_log (msg_name => 'FII_TRUNC_SUMMARY', token_num => 0);
2198: --FII_UTIL.put_line('Source Ledger Group setup has changed. Please run the Request Set in the Initial mode to repopulate the summaries.');
2199: retcode := -1;
2200: RETURN;
2201: END IF;
2202:
2235: l_global_start_date := to_date(fnd_profile.value('BIS_GLOBAL_START_DATE'),'MM/DD/YYYY');
2236: g_global_start_date := l_global_start_date;
2237:
2238: if g_debug_flag = 'Y' then
2239: FII_UTIL.put_line('BIS Global Start Date: ' || l_global_start_date);
2240: end if;
2241:
2242: ----------------------------------------------------------
2243: -- FA DOES NOT need to Determine if we need to resume.
2273: -- Calling CLEAN_UP procedure to clean up all processing
2274: -- tables
2275: --------------------------------------------------------------
2276: if g_debug_flag = 'Y' then
2277: FII_UTIL.put_line('');
2278: FII_UTIL.put_line('Cleaning up processing tables before actual processing start');
2279: FII_UTIL.put_line('------------------------------------------------------------');
2280: end if;
2281:
2274: -- tables
2275: --------------------------------------------------------------
2276: if g_debug_flag = 'Y' then
2277: FII_UTIL.put_line('');
2278: FII_UTIL.put_line('Cleaning up processing tables before actual processing start');
2279: FII_UTIL.put_line('------------------------------------------------------------');
2280: end if;
2281:
2282: -- hold off *** testing parallel ****
2275: --------------------------------------------------------------
2276: if g_debug_flag = 'Y' then
2277: FII_UTIL.put_line('');
2278: FII_UTIL.put_line('Cleaning up processing tables before actual processing start');
2279: FII_UTIL.put_line('------------------------------------------------------------');
2280: end if;
2281:
2282: -- hold off *** testing parallel ****
2283: CLEAN_UP;
2282: -- hold off *** testing parallel ****
2283: CLEAN_UP;
2284:
2285: if g_debug_flag = 'Y' then
2286: FII_UTIL.put_line('------------------------------------------------------------');
2287: FII_UTIL.put_line('');
2288: end if;
2289:
2290: ---------------------------------------------------------
2283: CLEAN_UP;
2284:
2285: if g_debug_flag = 'Y' then
2286: FII_UTIL.put_line('------------------------------------------------------------');
2287: FII_UTIL.put_line('');
2288: end if;
2289:
2290: ---------------------------------------------------------
2291: -- After we do initial clean up, we will set this flag to
2299: -- FII_FA_NEW_EXP_HDR_IDS
2300: ----------------------------------------------------------------
2301: g_phase := 'Identify New Journal Headers to process';
2302: if g_debug_flag = 'Y' then
2303: FII_UTIL.put_line(g_phase);
2304: end if;
2305:
2306: --------------------------------------------------------
2307: -- NEW_JOURNALS will identify the new journals which
2314: l_period_end_date);
2315:
2316: IF (l_ids_count = 0) THEN
2317: -- purge the new ids table for deleted lines
2318: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_NEW_EXP_HDR_IDS',
2319: P_RETCODE => l_ret_code);
2320:
2321: if g_debug_flag = 'Y' then
2322: FII_UTIL.put_line('No Journal Entries to Process, exit.');
2318: FII_UTIL.TRUNCATE_TABLE(p_table_name => 'FII_FA_NEW_EXP_HDR_IDS',
2319: P_RETCODE => l_ret_code);
2320:
2321: if g_debug_flag = 'Y' then
2322: FII_UTIL.put_line('No Journal Entries to Process, exit.');
2323: end if;
2324: RETURN;
2325: END IF;
2326:
2343: --
2344: ----------------------------------------------------------------
2345: g_phase := 'Verifying if CCID Dimension is up to date';
2346: if g_debug_flag = 'Y' then
2347: FII_UTIL.put_line(g_phase);
2348: end if;
2349:
2350: VERIFY_CAT_ID_UP_TO_DATE;
2351:
2350: VERIFY_CAT_ID_UP_TO_DATE;
2351:
2352: g_phase := 'Verifying if all FA periods have been upgraded for XLA';
2353: if g_debug_flag = 'Y' then
2354: FII_UTIL.put_line(g_phase);
2355: end if;
2356:
2357: CHECK_XLA_CONVERSION_STATUS;
2358:
2364: if (p_program_type = 'I') then
2365: g_phase := 'Calling Routine Register_Jobs for incremental mode';
2366:
2367: if g_debug_flag = 'Y' then
2368: FII_UTIL.put_line(g_phase);
2369: end if;
2370:
2371: Register_Jobs();
2372:
2380:
2381: g_phase := 'In G_Parent Logic...';
2382:
2383: if g_debug_flag = 'Y' then
2384: FII_UTIL.put_line(g_phase);
2385: end if;
2386:
2387: ----------------------------------------------------------------
2388: -- Launching child processes.
2422: l_tot_cnt
2423: FROM FII_FA_WORKER_JOBS;
2424:
2425: if g_debug_flag = 'Y' then
2426: FII_UTIL.put_line('Job status - Unassigned:'||l_unassigned_cnt||
2427: ' In Process:'||l_wip_cnt||
2428: ' Completed:'||l_completed_cnt||
2429: ' Failed:'||l_failed_cnt);
2430: end if;
2430: end if;
2431:
2432: IF (l_failed_cnt > 0) THEN
2433: g_retcode := -1;
2434: FII_UTIL.put_line('
2435: ---------------------------------
2436: Error in Main Procedure:
2437: Message: At least one of the workers have errored out');
2438: RAISE G_CHILD_PROCESS_ISSUE;
2444: -- have completed. Then we can exit the loop
2445: -- --------------------------------------------
2446: IF (l_tot_cnt = l_completed_cnt) THEN
2447: if g_debug_flag = 'Y' then
2448: FII_UTIL.put_line ('All jobs have completed');
2449: end if;
2450: EXIT;
2451: END IF;
2452:
2469: -- for now
2470: -----------------------------------------
2471: IF (l_cycle > MAX_LOOP) THEN
2472: g_retcode := -1;
2473: FII_UTIL.put_line('
2474: ---------------------------------
2475: Error in Main Procedure:
2476: Message: No progress have been made for '||MAX_LOOP||' minutes.
2477: Terminating');
2503:
2504: g_phase := 'In G_Sole / G_Child Logic...';
2505:
2506: if g_debug_flag = 'Y' then
2507: FII_UTIL.put_line(g_phase);
2508: end if;
2509:
2510: l_stmt := ' ALTER SESSION SET global_names = false';
2511: EXECUTE IMMEDIATE l_stmt;
2509:
2510: l_stmt := ' ALTER SESSION SET global_names = false';
2511: EXECUTE IMMEDIATE l_stmt;
2512:
2513: FII_UTIL.initialize;
2514:
2515: -- R12: determine accounting classes
2516: GET_ACCT_CLASSES;
2517:
2532: l_total_cnt
2533: FROM FII_FA_WORKER_JOBS;
2534:
2535: if g_debug_flag = 'Y' then
2536: FII_UTIL.put_line('Job status - Unassigned: '||l_unassigned_cnt||
2537: ' In Process: '||l_wip_cnt||
2538: ' Completed: '||l_completed_cnt||
2539: ' Failed: '||l_failed_cnt||
2540: ' Total: '|| l_total_cnt);
2541: end if;
2542:
2543: IF (l_failed_cnt > 0) THEN
2544: if g_debug_flag = 'Y' then
2545: FII_UTIL.put_line('');
2546: FII_UTIL.put_line('Another worker have errored out. Stop processing.');
2547: end if;
2548: EXIT;
2549: ELSIF (l_unassigned_cnt = 0) THEN
2542:
2543: IF (l_failed_cnt > 0) THEN
2544: if g_debug_flag = 'Y' then
2545: FII_UTIL.put_line('');
2546: FII_UTIL.put_line('Another worker have errored out. Stop processing.');
2547: end if;
2548: EXIT;
2549: ELSIF (l_unassigned_cnt = 0) THEN
2550: if g_debug_flag = 'Y' then
2547: end if;
2548: EXIT;
2549: ELSIF (l_unassigned_cnt = 0) THEN
2550: if g_debug_flag = 'Y' then
2551: FII_UTIL.put_line('');
2552: FII_UTIL.put_line('No more jobs left. Terminating.');
2553: end if;
2554: EXIT;
2555: ELSIF (l_completed_cnt = l_total_cnt) THEN
2548: EXIT;
2549: ELSIF (l_unassigned_cnt = 0) THEN
2550: if g_debug_flag = 'Y' then
2551: FII_UTIL.put_line('');
2552: FII_UTIL.put_line('No more jobs left. Terminating.');
2553: end if;
2554: EXIT;
2555: ELSIF (l_completed_cnt = l_total_cnt) THEN
2556: if g_debug_flag = 'Y' then
2553: end if;
2554: EXIT;
2555: ELSIF (l_completed_cnt = l_total_cnt) THEN
2556: if g_debug_flag = 'Y' then
2557: FII_UTIL.put_line('');
2558: FII_UTIL.put_line('All jobs completed, no more job. Terminating');
2559: end if;
2560: EXIT;
2561: ELSIF (l_unassigned_cnt > 0) THEN
2554: EXIT;
2555: ELSIF (l_completed_cnt = l_total_cnt) THEN
2556: if g_debug_flag = 'Y' then
2557: FII_UTIL.put_line('');
2558: FII_UTIL.put_line('All jobs completed, no more job. Terminating');
2559: end if;
2560: EXIT;
2561: ELSIF (l_unassigned_cnt > 0) THEN
2562: UPDATE FII_FA_WORKER_JOBS
2564: worker_number = g_worker_num
2565: WHERE status = 'UNASSIGNED'
2566: AND rownum < 2;
2567: if g_debug_flag = 'Y' then
2568: FII_UTIL.put_line('Taking job from job queue');
2569: FII_UTIL.put_line('count: ' || sql%rowcount);
2570: end if;
2571: l_count := sql%rowcount;
2572: COMMIT;
2565: WHERE status = 'UNASSIGNED'
2566: AND rownum < 2;
2567: if g_debug_flag = 'Y' then
2568: FII_UTIL.put_line('Taking job from job queue');
2569: FII_UTIL.put_line('count: ' || sql%rowcount);
2570: end if;
2571: l_count := sql%rowcount;
2572: COMMIT;
2573: END IF;
2584: BEGIN
2585: g_phase := 'Getting ID range from FII_FA_WORKER_JOBS table';
2586:
2587: if g_debug_flag = 'Y' then
2588: FII_UTIL.put_line(g_phase);
2589: end if;
2590:
2591: SELECT start_range,
2592: end_range
2602: -- Passing start range and end range parameters
2603: --------------------------------------------------
2604: g_phase := 'Inserting into summary table';
2605: if g_debug_flag = 'Y' then
2606: FII_UTIL.put_line(g_phase);
2607: end if;
2608:
2609: INSERT_INTO_SUMMARY(l_start_range,
2610: l_end_range);
2623: -- to complete
2624: -----------------------------------------------------
2625: g_phase:='Updating job status in FII_FA_WORKER_JOBS table';
2626: if g_debug_flag = 'Y' then
2627: FII_UTIL.put_line(g_phase);
2628: end if;
2629:
2630: UPDATE FII_FA_WORKER_JOBS
2631: SET status = 'COMPLETED'
2665: -- Passing start range and end range parameters
2666: --------------------------------------------------
2667: g_phase := 'Inserting into staging table';
2668: if g_debug_flag = 'Y' then
2669: FII_UTIL.put_line(g_phase);
2670: end if;
2671:
2672: END IF; -- child or sole
2673:
2676:
2677: g_phase := 'In G_Parent / G_Sole...';
2678:
2679: if g_debug_flag = 'Y' then
2680: FII_UTIL.put_line(g_phase);
2681: end if;
2682:
2683: -----------------------------------------------------------------
2684: -- If all the child process completes successfully then Invoke
2687: -- table.
2688: -----------------------------------------------------------------
2689: g_phase:= 'Summarization Error Check';
2690: if g_debug_flag = 'Y' then
2691: FII_UTIL.put_line(g_phase);
2692: end if;
2693:
2694: Summary_err_check;
2695:
2709: -- now will go directly into the summary table
2710: -------------------------------------------------------------
2711: g_phase := 'Aggregating summarized data';
2712: if g_debug_flag = 'Y' then
2713: FII_UTIL.put_line('');
2714: FII_UTIL.put_line(g_phase);
2715: end if;
2716:
2717: if (g_program_type = 'L') then
2710: -------------------------------------------------------------
2711: g_phase := 'Aggregating summarized data';
2712: if g_debug_flag = 'Y' then
2713: FII_UTIL.put_line('');
2714: FII_UTIL.put_line(g_phase);
2715: end if;
2716:
2717: if (g_program_type = 'L') then
2718: INSERT_INTO_SUMMARY_PAR;
2724: -- Jornals_processed.
2725: -----------------------------------------------------------------
2726: g_phase := 'Inserting processed JE Header IDs';
2727: if g_debug_flag = 'Y' then
2728: FII_UTIL.put_line('');
2729: FII_UTIL.put_line(g_phase);
2730: end if;
2731:
2732: Journals_processed;
2725: -----------------------------------------------------------------
2726: g_phase := 'Inserting processed JE Header IDs';
2727: if g_debug_flag = 'Y' then
2728: FII_UTIL.put_line('');
2729: FII_UTIL.put_line(g_phase);
2730: end if;
2731:
2732: Journals_processed;
2733:
2767:
2768: Exception
2769: WHEN G_LOGIN_INFO_NOT_AVABLE THEN
2770: g_retcode := -1;
2771: FII_UTIL.put_line('Init: can not get User ID and Login ID, program exits');
2772: retcode := g_retcode;
2773:
2774:
2775: WHEN OTHERS Then
2778: --
2779: -- temporarily removing this in order to test child perf
2780: -- via scripts
2781: clean_up;
2782: FII_UTIL.put_line('
2783: Error in Function: Main
2784: Phase: '|| g_phase || '
2785: Message: ' || sqlerrm);
2786: retcode := g_retcode;