165:
166: l_primary_sob_id := fa_cache_pkg.fazcbc_record.set_of_books_id;
167:
168: if (g_log_level_rec.statement_level) then
169: fa_debug_pkg.add(l_calling_fn,'opening c_assets cursor','');
170: fa_debug_pkg.add(l_calling_fn,'g_start_pc',g_start_pc);
171: fa_debug_pkg.add(l_calling_fn,'g_end_pc',g_end_pc);
172: end if;
173:
166: l_primary_sob_id := fa_cache_pkg.fazcbc_record.set_of_books_id;
167:
168: if (g_log_level_rec.statement_level) then
169: fa_debug_pkg.add(l_calling_fn,'opening c_assets cursor','');
170: fa_debug_pkg.add(l_calling_fn,'g_start_pc',g_start_pc);
171: fa_debug_pkg.add(l_calling_fn,'g_end_pc',g_end_pc);
172: end if;
173:
174: Open c_assets;
167:
168: if (g_log_level_rec.statement_level) then
169: fa_debug_pkg.add(l_calling_fn,'opening c_assets cursor','');
170: fa_debug_pkg.add(l_calling_fn,'g_start_pc',g_start_pc);
171: fa_debug_pkg.add(l_calling_fn,'g_end_pc',g_end_pc);
172: end if;
173:
174: Open c_assets;
175:
175:
176: loop
177:
178: if (g_log_level_rec.statement_level) then
179: fa_debug_pkg.add(l_calling_fn,'in main loop ' , '');
180: end if;
181:
182: fetch c_assets into l_asset_id;
183: Exit when c_assets%NOTFOUND;
184:
185: BEGIN /* Inside Loop */
186:
187: if (g_log_level_rec.statement_level) then
188: fa_debug_pkg.add(l_calling_fn,'in main block ' , '');
189: end if;
190:
191: g_adj_asset_hdr_rec.asset_id := l_asset_id;
192:
634: --Bug7630553: fa_tax_rsv_adj_pub.do_tax_rsv_adj is expecting delta reserve between current one and user specified reserve
635: g_asset_tax_rsv_adj_rec.adjusted_ytd_deprn := (g_asset_tax_rsv_adj_rec.adjusted_ytd_deprn - l_deprn_rsv_adj_end);
636:
637: if (g_log_level_rec.statement_level) then
638: fa_debug_pkg.add(l_calling_fn,'g_asset_tax_rsv_adj_rec.adjusted_ytd_deprn',
639: g_asset_tax_rsv_adj_rec.adjusted_ytd_deprn, g_log_level_rec);
640: end if;
641:
642:
688: fa_srvr_msg.add_message(
689: calling_fn => l_calling_fn,
690: name => 'FA_TAX_FULLY_RET');
691: if (g_log_level_rec.statement_level) then
692: fa_debug_pkg.add(l_calling_fn,'asset_ret ','',g_log_level_rec);
693:
694: -- Commented for bugfix 4672237
695: -- FA_DEBUG_PKG.dump_debug_messages(max_mesgs => 0);
696:
691: if (g_log_level_rec.statement_level) then
692: fa_debug_pkg.add(l_calling_fn,'asset_ret ','',g_log_level_rec);
693:
694: -- Commented for bugfix 4672237
695: -- FA_DEBUG_PKG.dump_debug_messages(max_mesgs => 0);
696:
697: end if;
698: when mass_dpr_rsv_adj_err then
699: FND_CONCURRENT.AF_ROLLBACK;
698: when mass_dpr_rsv_adj_err then
699: FND_CONCURRENT.AF_ROLLBACK;
700: fa_srvr_msg.add_message(calling_fn => l_calling_fn);
701: if (g_log_level_rec.statement_level) then
702: fa_debug_pkg.add(l_calling_fn,'mass_dpr_rsv_adj_err','',g_log_level_rec);
703:
704: -- Commented for bugfix 4672237
705: -- FA_DEBUG_PKG.dump_debug_messages(max_mesgs => 0);
706:
701: if (g_log_level_rec.statement_level) then
702: fa_debug_pkg.add(l_calling_fn,'mass_dpr_rsv_adj_err','',g_log_level_rec);
703:
704: -- Commented for bugfix 4672237
705: -- FA_DEBUG_PKG.dump_debug_messages(max_mesgs => 0);
706:
707: end if;
708: G_failure_count := G_failure_count + 1;
709:
713: CALLING_FN => l_calling_fn,
714: p_log_level_rec => g_log_level_rec);
715: fnd_concurrent.af_rollback;
716: if (g_log_level_rec.statement_level) then
717: fa_debug_pkg.add(l_calling_fn,'when others','end of main block in loop',g_log_level_rec);
718:
719: -- Commented for bugfix 4672237
720: -- fa_debug_pkg.dump_debug_messages(max_mesgs => 0);
721: end if;
716: if (g_log_level_rec.statement_level) then
717: fa_debug_pkg.add(l_calling_fn,'when others','end of main block in loop',g_log_level_rec);
718:
719: -- Commented for bugfix 4672237
720: -- fa_debug_pkg.dump_debug_messages(max_mesgs => 0);
721: end if;
722: G_failure_count := G_failure_count + 1;
723:
724: END; /* Inside Loop */
731: CALLING_FN => l_calling_fn,
732: p_log_level_rec => g_log_level_rec);
733: fnd_concurrent.af_rollback;
734: if (g_log_level_rec.statement_level) then
735: fa_debug_pkg.add(l_calling_fn,'when others','end of process_assets', g_log_level_rec);
736:
737: -- Commented for bugfix 4672237
738: -- fa_debug_pkg.dump_debug_messages(max_mesgs => 0);
739:
734: if (g_log_level_rec.statement_level) then
735: fa_debug_pkg.add(l_calling_fn,'when others','end of process_assets', g_log_level_rec);
736:
737: -- Commented for bugfix 4672237
738: -- fa_debug_pkg.dump_debug_messages(max_mesgs => 0);
739:
740: end if;
741:
742: END PROCESS_ASSETS;
838: FROM FA_WORKER_JOBS
839: WHERE request_Id = p_parent_request_id;
840:
841: if (g_log_level_rec.statement_level) then
842: fa_debug_pkg.add(l_calling_fn,'Job status - Unassigned: '||l_unassigned_cnt||
843: ' In Process: '||l_wip_cnt||
844: ' Completed: '||l_completed_cnt||
845: ' Failed: '||l_failed_cnt||
846: ' Total: ', l_total_cnt);
843: ' In Process: '||l_wip_cnt||
844: ' Completed: '||l_completed_cnt||
845: ' Failed: '||l_failed_cnt||
846: ' Total: ', l_total_cnt);
847: fa_debug_pkg.add(l_calling_fn,'p_parent_request_id',p_parent_request_id);
848: end if;
849:
850:
851: IF (l_failed_cnt > 0) THEN
849:
850:
851: IF (l_failed_cnt > 0) THEN
852: if (g_log_level_rec.statement_level) then
853: fa_debug_pkg.add(l_calling_fn,'','');
854: fa_debug_pkg.add(l_calling_fn,'Another worker have errored out. Stop processing.','');
855: end if;
856: raise error_found; -- ??? this is dbi behavior - we shoudl probably continue
857: ELSIF (l_unassigned_cnt = 0) THEN
850:
851: IF (l_failed_cnt > 0) THEN
852: if (g_log_level_rec.statement_level) then
853: fa_debug_pkg.add(l_calling_fn,'','');
854: fa_debug_pkg.add(l_calling_fn,'Another worker have errored out. Stop processing.','');
855: end if;
856: raise error_found; -- ??? this is dbi behavior - we shoudl probably continue
857: ELSIF (l_unassigned_cnt = 0) THEN
858: if (g_log_level_rec.statement_level) then
855: end if;
856: raise error_found; -- ??? this is dbi behavior - we shoudl probably continue
857: ELSIF (l_unassigned_cnt = 0) THEN
858: if (g_log_level_rec.statement_level) then
859: fa_debug_pkg.add(l_calling_fn,'','');
860: fa_debug_pkg.add(l_calling_fn,'No more jobs left. Terminating.','');
861: end if;
862: raise done_exc;
863: ELSIF (l_completed_cnt = l_total_cnt) THEN
856: raise error_found; -- ??? this is dbi behavior - we shoudl probably continue
857: ELSIF (l_unassigned_cnt = 0) THEN
858: if (g_log_level_rec.statement_level) then
859: fa_debug_pkg.add(l_calling_fn,'','');
860: fa_debug_pkg.add(l_calling_fn,'No more jobs left. Terminating.','');
861: end if;
862: raise done_exc;
863: ELSIF (l_completed_cnt = l_total_cnt) THEN
864: if (g_log_level_rec.statement_level) then
861: end if;
862: raise done_exc;
863: ELSIF (l_completed_cnt = l_total_cnt) THEN
864: if (g_log_level_rec.statement_level) then
865: fa_debug_pkg.add(l_calling_fn,'','');
866: fa_debug_pkg.add(l_calling_fn,'All jobs completed, no more job. Terminating','');
867: end if;
868: raise done_exc;
869: ELSIF (l_unassigned_cnt > 0) THEN
862: raise done_exc;
863: ELSIF (l_completed_cnt = l_total_cnt) THEN
864: if (g_log_level_rec.statement_level) then
865: fa_debug_pkg.add(l_calling_fn,'','');
866: fa_debug_pkg.add(l_calling_fn,'All jobs completed, no more job. Terminating','');
867: end if;
868: raise done_exc;
869: ELSIF (l_unassigned_cnt > 0) THEN
870: UPDATE FA_WORKER_JOBS
876:
877: l_count := sql%rowcount;
878:
879: if (g_log_level_rec.statement_level) then
880: fa_debug_pkg.add(l_calling_fn,'Taking job from job queue','');
881: fa_debug_pkg.add(l_calling_fn,'count: ' , l_count);
882: end if;
883:
884: FND_CONCURRENT.AF_COMMIT;
877: l_count := sql%rowcount;
878:
879: if (g_log_level_rec.statement_level) then
880: fa_debug_pkg.add(l_calling_fn,'Taking job from job queue','');
881: fa_debug_pkg.add(l_calling_fn,'count: ' , l_count);
882: end if;
883:
884: FND_CONCURRENT.AF_COMMIT;
885: END IF;
896: BEGIN
897: g_phase := 'Getting ID range from FA_WORKER_JOBS table';
898:
899: if (g_log_level_rec.statement_level) then
900: fa_debug_pkg.add(l_calling_fn,g_phase,'');
901: end if;
902:
903: SELECT start_range,
904: end_range
915: -- using the start_range and end_range.
916: --------------------------------------------------
917: g_phase := 'Calc. adj. deprn expense ';
918: if (g_log_level_rec.statement_level) then
919: fa_debug_pkg.add(l_calling_fn,g_phase,'');
920: end if;
921:
922: PROCESS_ASSETS(p_mass_tax_adjustment_id,
923: p_parent_request_id,
932: -- to complete
933: -----------------------------------------------------
934: g_phase:='Updating job status in FA_WORKER_JOBS table';
935: if (g_log_level_rec.statement_level) then
936: fa_debug_pkg.add(l_calling_fn,g_phase,'');
937: end if;
938:
939: UPDATE FA_WORKER_JOBS
940: SET status = 'COMPLETED'
972: x_failure_count := G_failure_count;
973:
974: -- Commented for bugfix 4672237
975: -- if (g_log_level_rec.statement_level) then
976: -- fa_debug_pkg.dump_debug_messages(max_mesgs => 0);
977: -- end if;
978:
979: x_return_status := 0;
980:
984: x_failure_count := G_failure_count;
985:
986: -- Commented for bugfix 4672237
987: -- if (g_log_level_rec.statement_level) then
988: -- fa_debug_pkg.dump_debug_messages(max_mesgs => 0);
989: -- end if;
990:
991: x_return_status := 0;
992:
997: p_log_level_rec => g_log_level_rec);
998:
999: -- Commented for bugfix 4672237
1000: -- if (g_log_level_rec.statement_level) then
1001: -- fa_debug_pkg.dump_debug_messages(max_mesgs => 0);
1002: -- end if;
1003: x_return_status := 2;
1004:
1005: WHEN OTHERS THEN
1010: p_log_level_rec => g_log_level_rec);
1011:
1012: -- Commented for bugfix 4672237
1013: -- if (g_log_level_rec.statement_level) then
1014: -- fa_debug_pkg.dump_debug_messages(max_mesgs => 0);
1015: -- end if;
1016: x_return_status := 2;
1017:
1018: END Do_Deprn_Adjustment;
1048: end if;
1049: end if;
1050:
1051: if (g_log_level_rec.statement_level) then
1052: fa_debug_pkg.add(l_calling_fn,'Calling procedure: LOAD_JOBS','');
1053: fa_debug_pkg.add(l_calling_fn,'','');
1054: end if;
1055:
1056: if not (fa_cache_pkg.fazcbc(x_book => p_book_type_code
1049: end if;
1050:
1051: if (g_log_level_rec.statement_level) then
1052: fa_debug_pkg.add(l_calling_fn,'Calling procedure: LOAD_JOBS','');
1053: fa_debug_pkg.add(l_calling_fn,'','');
1054: end if;
1055:
1056: if not (fa_cache_pkg.fazcbc(x_book => p_book_type_code
1057: ,p_log_level_rec => g_log_level_rec)) then
1061: l_batch_size := nvl(fa_cache_pkg.fa_batch_size, 1000);
1062:
1063: g_phase := 'Register jobs for workers';
1064: if (g_log_level_rec.statement_level) then
1065: fa_debug_pkg.add(l_calling_fn,'Register jobs for workers','');
1066: fa_debug_pkg.add(l_calling_fn,'p_parent_request_id',p_parent_request_id);
1067: end if;
1068:
1069: ------------------------------------------------------------
1062:
1063: g_phase := 'Register jobs for workers';
1064: if (g_log_level_rec.statement_level) then
1065: fa_debug_pkg.add(l_calling_fn,'Register jobs for workers','');
1066: fa_debug_pkg.add(l_calling_fn,'p_parent_request_id',p_parent_request_id);
1067: end if;
1068:
1069: ------------------------------------------------------------
1070: -- select min and max sequence IDs from your ID Temp table
1112: AND BK.TRANSACTION_HEADER_ID_OUT IS NULL )
1113: GROUP BY UNIT_ID;
1114:
1115: if (g_log_level_rec.statement_level) then
1116: fa_debug_pkg.add(l_calling_fn,'Inserted ' || SQL%ROWCOUNT || ' jobs into FA_WORKER_JOBS table','');
1117: end if;
1118:
1119: fnd_concurrent.af_commit;
1120:
1125: fnd_concurrent.af_rollback;
1126:
1127: -- Commented for bugfix 4672237
1128: -- if (g_log_level_rec.statement_level) then
1129: -- fa_debug_pkg.dump_debug_messages(max_mesgs => 0);
1130: -- end if;
1131: fa_srvr_msg.add_message(calling_fn => l_calling_fn,
1132: p_log_level_rec => g_log_level_rec);
1133: x_return_status := 2;
1139: fnd_concurrent.af_rollback;
1140:
1141: -- Commented for bugfix 4672237
1142: -- if (g_log_level_rec.statement_level) then
1143: -- fa_debug_pkg.dump_debug_messages(max_mesgs => 0);
1144: -- end if;
1145: x_return_status := 2;
1146:
1147: END LOAD_WORKERS;