39: and legislation_code is null
40: and nvl(business_group_id, p_business_group_id) = p_business_group_id;
41:
42: BEGIN
43: ---hr_utility.trace_on('Y','SandT');
44: g_error_api_path := '';
45: fnd_msg_pub.initialize;
46: psp_general.TRANSACTION_CHANGE_PURGEBLE;
47:
3919: l_txn_source := l_gms_transaction_source;
3920: else
3921: l_txn_source := l_transaction_source;
3922: end if;
3923: hr_utility.trace(' deriving l_txn_source = '|| l_txn_source);
3924: end if; --- phase = 'Summarize_GL_Lines' ..2444657
3925: IF l_rec_count > 0 and gms_batch_rec.phase = 'Summarize_GMS_Lines' THEN ---2444657
3926:
3927: FOR I in 1..org_id_tab.count
3983:
3984: -- mark the successfully transferred records as 'A' in psp_summary_lines and psp_distribution_lines
3985: -- and transfer the successful records to the history table
3986: --- Bug 2663344 reverted NULL to l_period_end_date in tie back call
3987: hr_utility.trace(' before loop for gms_tie_back');
3988: FOR I in 1..org_id_tab.count
3989: LOOP
3990: hr_utility.trace(' tab_count ='||i);
3991: l_gms_batch_name := gms_batch_name_tab(I);
3986: --- Bug 2663344 reverted NULL to l_period_end_date in tie back call
3987: hr_utility.trace(' before loop for gms_tie_back');
3988: FOR I in 1..org_id_tab.count
3989: LOOP
3990: hr_utility.trace(' tab_count ='||i);
3991: l_gms_batch_name := gms_batch_name_tab(I);
3992: hr_utility.trace(' tab_count 2nd time='||i);
3993:
3994: gms_tie_back(gms_batch_rec.payroll_control_id,
3988: FOR I in 1..org_id_tab.count
3989: LOOP
3990: hr_utility.trace(' tab_count ='||i);
3991: l_gms_batch_name := gms_batch_name_tab(I);
3992: hr_utility.trace(' tab_count 2nd time='||i);
3993:
3994: gms_tie_back(gms_batch_rec.payroll_control_id,
3995: gms_batch_rec.source_type,
3996: l_period_end_date,
3999: p_set_of_books_id,
4000: l_txn_source,
4001: 'N', --Introduced as part of Bug fix #1776606
4002: l_return_status);
4003: hr_utility.trace(' after tie back call to gms_tie_back');
4004:
4005: /* Bug 1617846 LD Recovery LOV not showing up fialed S and T */
4006: /* introduced ELSE clause */
4007:
4342: end PROCESS_COMPLETE;
4343:
4344: BEGIN
4345:
4346: hr_utility.trace('entered gms_tie_back');
4347:
4348:
4349: if NOT PROCESS_COMPLETE then
4350: if (l_no_run_status = 'I') then
4354: fnd_msg_pub.add;
4355: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4356: end if;
4357: end if;
4358: hr_utility.trace('entered gms_tie_back2');
4359:
4360: -- Status codes have been added to transaction import process,
4361: -- to accomodate pre and post import extensions in 11i
4362: -- to following select statement
4371: /* moved this statement to beginning for 2444657 */
4372: UPDATE psp_payroll_controls
4373: SET phase = 'GL_Tie_Back'
4374: WHERE payroll_control_id = p_payroll_control_id;
4375: hr_utility.trace('entered gms_tie_back3');
4376:
4377: IF l_cnt_gms_interface > 0 THEN
4378: --
4379: OPEN gms_tie_back_reject_cur;
4408: SELECT summary_amount,dr_cr_flag
4409: INTO l_summary_amount,l_dr_cr_flag
4410: FROM psp_summary_lines
4411: WHERE summary_line_id = to_number(l_orig_trx_reference) ;
4412: hr_utility.trace('entered gms_tie_back4');
4413: IF l_dr_cr_flag = 'D' THEN
4414: l_dr_summary_amount := l_dr_summary_amount + l_summary_amount;
4415: ELSIF l_dr_cr_flag = 'C' THEN
4416: -- credit is marked as -ve for posting to Oracle Projects
4416: -- credit is marked as -ve for posting to Oracle Projects
4417: l_cr_summary_amount := l_cr_summary_amount - l_summary_amount;
4418: END IF;
4419: END IF;
4420: hr_utility.trace('before open assign_susp_ac_cur');
4421: OPEN assign_susp_ac_cur(l_orig_trx_reference);
4422: LOOP
4423:
4424: FETCH assign_susp_ac_cur INTO l_rowid, x_line_id, l_distribution_date, l_suspense_org_account_id;
4446: IF assign_susp_ac_cur%NOTFOUND THEN
4447: CLOSE assign_susp_ac_cur;
4448: EXIT;
4449: END IF;
4450: hr_utility.trace('entered gms_tie_back5');
4451:
4452: IF l_trx_status_code = 'A' THEN
4453: IF p_source_type = 'O' OR p_source_type = 'N' THEN
4454: UPDATE psp_distribution_lines
4487: FROM psp_distribution_lines
4488: WHERE status_code = 'A'
4489: AND summary_line_id = to_number(l_orig_trx_reference);
4490:
4491: hr_utility.trace('after insert into dist lines');
4492: DELETE FROM psp_distribution_lines
4493: WHERE status_code = 'A'
4494: AND summary_line_id = to_number(l_orig_trx_reference);
4495:
4529: FROM psp_pre_gen_dist_lines
4530: WHERE status_code = 'A'
4531: AND summary_line_id = to_number(l_orig_trx_reference);
4532:
4533: hr_utility.trace('after insert into pregen lines');
4534: DELETE FROM psp_pre_gen_dist_lines
4535: WHERE status_code = 'A'
4536: AND summary_line_id = to_number(l_orig_trx_reference);
4537: END IF;
4759: END IF;
4760:
4761: END LOOP;
4762: END LOOP;
4763: hr_utility.trace('update control record');
4764: UPDATE psp_payroll_controls
4765: SET ogm_dr_amount = nvl(ogm_dr_amount,0) + l_dr_summary_amount,
4766: ogm_cr_amount = nvl(ogm_cr_amount,0) + l_cr_summary_amount
4767: WHERE payroll_control_id = p_payroll_control_id;
5830: fetch get_notify_types into notify_type;
5831: if get_notify_types%notfound then
5832: if get_notify_types%rowcount = 0 then
5833: close get_notify_types;
5834: hr_utility.trace( 'SandT_Supercede--> GET_RECIVER_TYPES--> Superceded notifier types not found');
5835: return;
5836: end if;
5837: close get_notify_types;
5838: exit;
5838: exit;
5839: end if;
5840: if notify_type = 'A' then
5841: p_approver_notify := true;
5842: hr_utility.trace( 'SandT_Supercede--> GET_RECIVER_TYPES--> p_apporver_notify');
5843: elsif notify_type = 'I' then
5844: p_initiator_notify := true;
5845: hr_utility.trace( 'SandT_Supercede--> GET_RECIVER_TYPES--> initiator_notify');
5846: elsif notify_type = 'F' then
5841: p_approver_notify := true;
5842: hr_utility.trace( 'SandT_Supercede--> GET_RECIVER_TYPES--> p_apporver_notify');
5843: elsif notify_type = 'I' then
5844: p_initiator_notify := true;
5845: hr_utility.trace( 'SandT_Supercede--> GET_RECIVER_TYPES--> initiator_notify');
5846: elsif notify_type = 'F' then
5847: p_final_recip_notify := true;
5848: hr_utility.trace( 'SandT_Supercede--> GET_RECIVER_TYPES--> final_recip_notify');
5849: elsif notify_type = 'E' then
5844: p_initiator_notify := true;
5845: hr_utility.trace( 'SandT_Supercede--> GET_RECIVER_TYPES--> initiator_notify');
5846: elsif notify_type = 'F' then
5847: p_final_recip_notify := true;
5848: hr_utility.trace( 'SandT_Supercede--> GET_RECIVER_TYPES--> final_recip_notify');
5849: elsif notify_type = 'E' then
5850: p_employee_notify := true;
5851: hr_utility.trace( 'SandT_Supercede--> GET_RECIVER_TYPES--> p_employee_notify');
5852: end if;
5847: p_final_recip_notify := true;
5848: hr_utility.trace( 'SandT_Supercede--> GET_RECIVER_TYPES--> final_recip_notify');
5849: elsif notify_type = 'E' then
5850: p_employee_notify := true;
5851: hr_utility.trace( 'SandT_Supercede--> GET_RECIVER_TYPES--> p_employee_notify');
5852: end if;
5853: end loop;
5854:
5855: EXCEPTION
5854:
5855: EXCEPTION
5856: when others then
5857:
5858: hr_utility.trace( 'SandT_Supercede-->send notifications --> GET_RECEIVER_TYPES when others '||sqlerrm);
5859: fnd_msg_pub.add_exc_msg('PSP_SUM_TRANS','GET_RECEIVER_TYPES');
5860: raise;
5861: END GET_RECEIVER_TYPES;
5862:
5878: l_superceding_proc_param varchar2(500);
5879:
5880: BEGIN
5881:
5882: hr_utility.trace('SandT_Supercede--> send_notifications --> call_wf Parameters: p_supercede_reqid_str = '||
5883: p_supercede_reqid_str||', p_wf_user ='|| p_wf_user||', p_SandT_reqid='||
5884: p_SandT_reqid||
5885: ', p_person_id='||p_person_id||', p_approver_type = '||p_approver_type||
5886: ', p_source_type='|| p_source_type ||', p_source_code='|| p_source_code||
5959: wf_engine.StartProcess(itemtype => 'PSPERAVL',
5960: itemkey => l_wf_itemkey);
5961: EXCEPTION
5962: when others then
5963: hr_utility.trace( 'SandT_Supercede-->send notifications --> call_wf when others '||sqlerrm);
5964: fnd_msg_pub.add_exc_msg('PSP_SUM_TRANS','CALL_WF');
5965: raise;
5966: END CALL_WF;
5967:
5966: END CALL_WF;
5967:
5968:
5969: BEGIN -- send notifications
5970: hr_utility.trace( 'SandT_Supercede--> send_notifications--> Begin params : p_supercede_reqid_str= '||
5971: p_supercede_reqid_str ||', p_template_id = '||p_template_id ||
5972: ', p_SandT_reqid = '||p_SandT_reqid ||
5973: ', p_batch_name = '||p_batch_name ||
5974: ', p_source_type = '||p_source_type ||
5973: ', p_batch_name = '||p_batch_name ||
5974: ', p_source_type = '||p_source_type ||
5975: ', p_source_code = '|| p_source_code ||
5976: ', p_time_period_id = '|| p_time_period_id );
5977: hr_utility.trace( 'SandT_Supercede--> send_notifications-->get_receiver_types');
5978: get_receiver_types(p_template_id,
5979: l_init_notify,
5980: l_frp_notify,
5981: l_approver_notify,
6055: p_time_period_id);
6056: end loop;
6057: end if;
6058:
6059: hr_utility.trace( 'SandT_Supercede-->send_notifications--> has dynamic part for approver start');
6060: if l_approver_notify then
6061: open get_app_wf_names;
6062: fetch get_app_wf_names bulk collect into t_wf_roles;
6063: close get_app_wf_names;
6078: end loop;
6079: end if;
6080: EXCEPTION
6081: when others then
6082: hr_utility.trace( 'SandT_Supercede-->send notifications when others '||sqlerrm);
6083: fnd_msg_pub.add_exc_msg('PSP_SUM_TRANS','SEND_NOTIFICATIONS');
6084: raise;
6085: END SEND_NOTIFICATIONS;
6086: BEGIN ----SUPERCEDE_ER
6084: raise;
6085: END SEND_NOTIFICATIONS;
6086: BEGIN ----SUPERCEDE_ER
6087: --- comment trace.. debug
6088: ---hr_utility.trace_on('Y','ZX');
6089: hr_utility.trace( 'SandT_Supercede--> Begin p_run_id='||p_run_id);
6090: fnd_signon.set_session(to_char(sysdate,'dd-mon-yyyy'));
6091: p_return_status := fnd_api.g_ret_sts_success;
6092: l_S_and_T_reqid := fnd_global.conc_request_id;
6085: END SEND_NOTIFICATIONS;
6086: BEGIN ----SUPERCEDE_ER
6087: --- comment trace.. debug
6088: ---hr_utility.trace_on('Y','ZX');
6089: hr_utility.trace( 'SandT_Supercede--> Begin p_run_id='||p_run_id);
6090: fnd_signon.set_session(to_char(sysdate,'dd-mon-yyyy'));
6091: p_return_status := fnd_api.g_ret_sts_success;
6092: l_S_and_T_reqid := fnd_global.conc_request_id;
6093: fnd_stats.gather_table_stats(ownname => 'PSP',
6099: if t_template_id.count = 0 then
6100: return; --- no template found to supercede
6101: end if;
6102:
6103: hr_utility.trace( 'SandT_Supercede--> template_id.count='||t_template_id.count);
6104:
6105: l_supercede_reqid_str := null;
6106:
6107: delete psp_supercede_persons_gt;
6127: open check_emp_match_option;
6128: fetch check_emp_match_option into l_count_emp_match;
6129: close check_emp_match_option;
6130: ---fnd_file.put_line(fnd_file.log,'l_count_emp_match = '||l_count_emp_match);
6131: hr_utility.trace( 'SandT_Supercede--> Main Loop Entered');
6132: hr_utility.trace( 'SandT_Supercede--> reqid string, p_source_type, template_id ='||
6133: l_supercede_reqid_str||':'||p_source_type||':'||t_template_id(k));
6134: if l_count_emp_match > 0 then
6135: if p_source_type = 'A' then --- from adjustments s_and_t process.
6128: fetch check_emp_match_option into l_count_emp_match;
6129: close check_emp_match_option;
6130: ---fnd_file.put_line(fnd_file.log,'l_count_emp_match = '||l_count_emp_match);
6131: hr_utility.trace( 'SandT_Supercede--> Main Loop Entered');
6132: hr_utility.trace( 'SandT_Supercede--> reqid string, p_source_type, template_id ='||
6133: l_supercede_reqid_str||':'||p_source_type||':'||t_template_id(k));
6134: if l_count_emp_match > 0 then
6135: if p_source_type = 'A' then --- from adjustments s_and_t process.
6136: open adj_er_supercede;
6168: fetch all_asg_er_supercede bulk collect into t_efforts_table, t_person_table, t_sum_line_id;
6169: close all_asg_er_Supercede;
6170: end if; --- source type adjustments
6171: end if;
6172: hr_utility.trace( 'SandT_Supercede--> loaded the superceded persons, count ='|| t_efforts_table.count);
6173: --fnd_file.put_line(fnd_file.log, 'SandT_Supercede--> loaded the superceded persons, count ='|| t_efforts_table.count);
6174: open supercede_tolerance(t_template_id(k));
6175: fetch supercede_tolerance into l_tolerance_amt, l_tolerance_percent;
6176: close supercede_tolerance;
6173: --fnd_file.put_line(fnd_file.log, 'SandT_Supercede--> loaded the superceded persons, count ='|| t_efforts_table.count);
6174: open supercede_tolerance(t_template_id(k));
6175: fetch supercede_tolerance into l_tolerance_amt, l_tolerance_percent;
6176: close supercede_tolerance;
6177: hr_utility.trace( 'SandT_Supercede--> get_tolerance limits AMT, %'||
6178: nvl(l_tolerance_amt,0)||','|| nvl(l_tolerance_percent,0));
6179:
6180: if t_efforts_table.count > 0 then
6181: hr_utility.trace( 'SandT_Supercede--> t_efforts_table.count > 0');
6177: hr_utility.trace( 'SandT_Supercede--> get_tolerance limits AMT, %'||
6178: nvl(l_tolerance_amt,0)||','|| nvl(l_tolerance_percent,0));
6179:
6180: if t_efforts_table.count > 0 then
6181: hr_utility.trace( 'SandT_Supercede--> t_efforts_table.count > 0');
6182: if l_tolerance_amt = -999 and l_tolerance_percent = -999 then
6183: --- if tolerance is not setup then all emps are superceded
6184: --- Summarize/Transfer run will be superceeded.
6185:
6182: if l_tolerance_amt = -999 and l_tolerance_percent = -999 then
6183: --- if tolerance is not setup then all emps are superceded
6184: --- Summarize/Transfer run will be superceeded.
6185:
6186: hr_utility.trace( 'SandT_Supercede--> Before update Eff table 1');
6187: i := 1;
6188: loop
6189: if i > t_efforts_table.count then
6190: exit;
6188: loop
6189: if i > t_efforts_table.count then
6190: exit;
6191: end if;
6192: hr_utility.trace( 'SandT_Supercede--> Effort report id ='||t_efforts_table(i));
6193:
6194: OPEN get_Con_Program_name_csr;
6195: FETCH get_Con_Program_name_csr into l_Con_Program_name;
6196: CLOSE get_Con_Program_name_csr;
6206:
6207: if sql%rowcount > 0 then
6208: l_superceded_flag := true;
6209: end if;
6210: hr_utility.trace( 'SandT_Supercede--> Updated the ER table, to put S');
6211: i := i + 1;
6212: end loop;
6213: else -- tolerance set to non null value
6214: --- load session temp table
6211: i := i + 1;
6212: end loop;
6213: else -- tolerance set to non null value
6214: --- load session temp table
6215: hr_utility.trace( 'SandT_Supercede--> purge GT table - 1');
6216: forall i in 1..t_person_table.count
6217: insert into psp_supercede_persons_gt
6218: (person_id)
6219: values (t_person_table(i));
6216: forall i in 1..t_person_table.count
6217: insert into psp_supercede_persons_gt
6218: (person_id)
6219: values (t_person_table(i));
6220: hr_utility.trace( 'SandT_Supercede--> insert into GT potential persons Number of recodrs=' ||t_person_table.count||'person_id =' ||t_person_table(1));
6221: savepoint populate_er_tables;
6222:
6223: -- create fresh ER for comparison
6224: hr_utility.trace( 'SandT_Supercede--> before call to psp_create_eff_reports.populate_eff_tables');
6220: hr_utility.trace( 'SandT_Supercede--> insert into GT potential persons Number of recodrs=' ||t_person_table.count||'person_id =' ||t_person_table(1));
6221: savepoint populate_er_tables;
6222:
6223: -- create fresh ER for comparison
6224: hr_utility.trace( 'SandT_Supercede--> before call to psp_create_eff_reports.populate_eff_tables');
6225: for n in 1..t_template_id.count
6226: loop
6227: if t_template_id(n) = t_template_id(k) then
6228: hr_utility.trace('SandT_Supercede--> call CREATE_EFF params : superced_request='||
6224: hr_utility.trace( 'SandT_Supercede--> before call to psp_create_eff_reports.populate_eff_tables');
6225: for n in 1..t_template_id.count
6226: loop
6227: if t_template_id(n) = t_template_id(k) then
6228: hr_utility.trace('SandT_Supercede--> call CREATE_EFF params : superced_request='||
6229: t_request_id(n)||' , template_id = '||t_template_id(n));
6230: psp_create_eff_reports.populate_eff_tables(errBuf ,
6231: retCode,
6232: null,
6232: null,
6233: t_request_id(n),
6234: null,
6235: 'Y');
6236: hr_utility.trace('SandT_Supercede--> g_summarization_criteria = '|| PSP_CREATE_EFF_REPORTS.g_summarization_criteria);
6237:
6238: end if;
6239: end loop;
6240: hr_utility.trace( 'SandT_Supercede--> after call to psp_create_eff_reports.populate_eff_tables');
6236: hr_utility.trace('SandT_Supercede--> g_summarization_criteria = '|| PSP_CREATE_EFF_REPORTS.g_summarization_criteria);
6237:
6238: end if;
6239: end loop;
6240: hr_utility.trace( 'SandT_Supercede--> after call to psp_create_eff_reports.populate_eff_tables');
6241:
6242: if l_tolerance_amt <> -999 then --- tolerance_amt is not null then
6243: l_sql_string := ' begin
6244: select distinct er.request_id, er.person_id
6285: END IF;
6286: -- Bug 4319874 : END
6287:
6288:
6289: hr_utility.trace( 'SandT_Supercede--> before exec immediate for tol amt'||l_sql_string);
6290: hr_utility.trace( 'SandT_Supercede--> sql_string ='||l_sql_string);
6291: execute immediate l_sql_string
6292: using out t_tolerance_req,
6293: out t_tolerance_per,
6286: -- Bug 4319874 : END
6287:
6288:
6289: hr_utility.trace( 'SandT_Supercede--> before exec immediate for tol amt'||l_sql_string);
6290: hr_utility.trace( 'SandT_Supercede--> sql_string ='||l_sql_string);
6291: execute immediate l_sql_string
6292: using out t_tolerance_req,
6293: out t_tolerance_per,
6294: in abs(l_tolerance_amt);
6291: execute immediate l_sql_string
6292: using out t_tolerance_req,
6293: out t_tolerance_per,
6294: in abs(l_tolerance_amt);
6295: hr_utility.trace( 'SandT_Supercede--> after exec immediate for tol amt = '||abs(l_tolerance_amt));
6296: else
6297: l_sql_string := ' begin
6298: select distinct er.request_id, er.person_id
6299: bulk collect into :reqtable, :pertable
6338: END IF;
6339: -- Bug 4319874 : END
6340:
6341:
6342: hr_utility.trace( 'SandT_Supercede--> before exec immediate for tol %');
6343: hr_utility.trace( 'SandT_Supercede--> sql_string ='||l_sql_string);
6344: execute immediate l_sql_string
6345: using out t_tolerance_req,
6346: out t_tolerance_per,
6339: -- Bug 4319874 : END
6340:
6341:
6342: hr_utility.trace( 'SandT_Supercede--> before exec immediate for tol %');
6343: hr_utility.trace( 'SandT_Supercede--> sql_string ='||l_sql_string);
6344: execute immediate l_sql_string
6345: using out t_tolerance_req,
6346: out t_tolerance_per,
6347: in abs(l_tolerance_percent);
6344: execute immediate l_sql_string
6345: using out t_tolerance_req,
6346: out t_tolerance_per,
6347: in abs(l_tolerance_percent);
6348: hr_utility.trace( 'SandT_Supercede--> after exec immediate for tol %');
6349: end if;
6350: ---- debug;
6351: ---commit; --- remove commit;
6352: rollback to populate_er_tables;
6349: end if;
6350: ---- debug;
6351: ---commit; --- remove commit;
6352: rollback to populate_er_tables;
6353: hr_utility.trace( 'SandT_Supercede--> before tolerance_req.count = '||t_tolerance_req.count);
6354: for i in 1..t_tolerance_req.count
6355: loop
6356: hr_utility.trace( 'SandT999_Supercede--> before tolerance_req.count = '||t_tolerance_req.count);
6357: open get_eff_id(t_tolerance_req(i), t_tolerance_per(i));
6352: rollback to populate_er_tables;
6353: hr_utility.trace( 'SandT_Supercede--> before tolerance_req.count = '||t_tolerance_req.count);
6354: for i in 1..t_tolerance_req.count
6355: loop
6356: hr_utility.trace( 'SandT999_Supercede--> before tolerance_req.count = '||t_tolerance_req.count);
6357: open get_eff_id(t_tolerance_req(i), t_tolerance_per(i));
6358: fetch get_eff_id into l_eff_id;
6359: close get_eff_id;
6360: hr_utility.trace( 'SandTTTTTTupercede--> before tolerance_req.count = '||t_tolerance_req.count);
6356: hr_utility.trace( 'SandT999_Supercede--> before tolerance_req.count = '||t_tolerance_req.count);
6357: open get_eff_id(t_tolerance_req(i), t_tolerance_per(i));
6358: fetch get_eff_id into l_eff_id;
6359: close get_eff_id;
6360: hr_utility.trace( 'SandTTTTTTupercede--> before tolerance_req.count = '||t_tolerance_req.count);
6361: t_tolerance_erid(i) := l_eff_id;
6362: hr_utility.trace( 'Sand%%%%%%%%%%cede--> before tolerance_req.count = '||t_tolerance_req.count);
6363: end loop;
6364:
6358: fetch get_eff_id into l_eff_id;
6359: close get_eff_id;
6360: hr_utility.trace( 'SandTTTTTTupercede--> before tolerance_req.count = '||t_tolerance_req.count);
6361: t_tolerance_erid(i) := l_eff_id;
6362: hr_utility.trace( 'Sand%%%%%%%%%%cede--> before tolerance_req.count = '||t_tolerance_req.count);
6363: end loop;
6364:
6365: hr_utility.trace( 'SandT_Supercede--> before tolerance_erid.count = '||t_tolerance_erid.count);
6366: if t_tolerance_erid.count > 0 then
6361: t_tolerance_erid(i) := l_eff_id;
6362: hr_utility.trace( 'Sand%%%%%%%%%%cede--> before tolerance_req.count = '||t_tolerance_req.count);
6363: end loop;
6364:
6365: hr_utility.trace( 'SandT_Supercede--> before tolerance_erid.count = '||t_tolerance_erid.count);
6366: if t_tolerance_erid.count > 0 then
6367: for i in 1..t_tolerance_erid.count
6368: loop
6369: hr_utility.trace( 'SandT_Supercede--> tolerance_erid='||t_tolerance_erid(i));
6365: hr_utility.trace( 'SandT_Supercede--> before tolerance_erid.count = '||t_tolerance_erid.count);
6366: if t_tolerance_erid.count > 0 then
6367: for i in 1..t_tolerance_erid.count
6368: loop
6369: hr_utility.trace( 'SandT_Supercede--> tolerance_erid='||t_tolerance_erid(i));
6370: for j in 1..t_efforts_table.count
6371: loop
6372: if t_tolerance_erid(i) = t_efforts_table(j) then
6373: hr_utility.trace( 'SandT_Supercede--> MATCH t_Efforts_Table ='|| t_efforts_table(j));
6369: hr_utility.trace( 'SandT_Supercede--> tolerance_erid='||t_tolerance_erid(i));
6370: for j in 1..t_efforts_table.count
6371: loop
6372: if t_tolerance_erid(i) = t_efforts_table(j) then
6373: hr_utility.trace( 'SandT_Supercede--> MATCH t_Efforts_Table ='|| t_efforts_table(j));
6374: t_tolerance_sline(i) := t_sum_line_id(j);
6375: end if;
6376: end loop;
6377: end loop;
6380: loop
6381: if i > t_tolerance_erid.count then
6382: exit;
6383: end if;
6384: hr_utility.trace( 'SandT_Supercede--> erid='|| t_tolerance_erid(i));
6385: if t_tolerance_sline.exists(i) then
6386: -- found ERs to be superceded.
6387:
6388: OPEN get_Con_Program_name_csr;
6396: superceding_summary_line_id = t_tolerance_sline(i),
6397: superceding_request_id = l_S_and_T_reqid,
6398: superceding_program_name = l_Con_Program_name
6399: where effort_report_id = t_tolerance_erid(i);
6400: hr_utility.trace( 'SandT_Supercede--> Updated erid='|| t_tolerance_erid(i));
6401: if sql%rowcount > 0 then
6402: l_superceded_flag := true;
6403: end if;
6404: end if;
6445: t_tolerance_erid.delete;
6446: t_request_id.delete;
6447: t_template_id.delete;
6448: t_tolerance_sline.delete;
6449: hr_utility.trace( 'SandT_Supercede--> EXITING');
6450: EXCEPTION
6451: when others then
6452: hr_utility.trace( 'SandT_Supercede--> when others in supercede_er'||sqlerrm) ;
6453: fnd_msg_pub.add_exc_msg('PSP_SUM_TRANS', 'SUPERCEDE_ER');
6448: t_tolerance_sline.delete;
6449: hr_utility.trace( 'SandT_Supercede--> EXITING');
6450: EXCEPTION
6451: when others then
6452: hr_utility.trace( 'SandT_Supercede--> when others in supercede_er'||sqlerrm) ;
6453: fnd_msg_pub.add_exc_msg('PSP_SUM_TRANS', 'SUPERCEDE_ER');
6454: p_return_status := fnd_api.g_ret_sts_unexp_error;
6455: END supercede_er;
6456: