The following lines contain the word 'select', 'insert', 'update' or 'delete':
,p_program_update_date in date default null
,p_object_version_number out nocopy number
,p_per_in_ler_id in number default null
,p_effective_date in date
,p_multi_row_actn in boolean default TRUE
) is
--
--
-- Declare cursors and local variables
--
l_pl_bnf_id ben_pl_bnf_f.pl_bnf_id%TYPE;
select pil.per_in_ler_id
from ben_prtt_enrt_rslt_f pen ,
ben_per_in_ler pil
where pen.prtt_enrt_rslt_id = p_prtt_enrt_rslt_id
and pen.per_in_ler_id = pil.per_in_ler_id
and pen.prtt_enrt_rslt_stat_cd is null
and pil.per_in_ler_stat_cd not in ('BCKDT','VOIDD')
order by pil.lf_evt_ocrd_dt asc;
,p_program_update_date => p_program_update_date
,p_per_in_ler_id => l_per_in_ler_id
,p_effective_date => trunc(p_effective_date)
);
,p_program_update_date => p_program_update_date
,p_object_version_number => l_object_version_number
,p_per_in_ler_id => l_per_in_ler_id
,p_effective_date => trunc(p_effective_date)
);
,p_program_update_date => p_program_update_date
,p_object_version_number => l_object_version_number
,p_per_in_ler_id => l_per_in_ler_id
,p_effective_date => trunc(p_effective_date)
);
procedure update_PLAN_BENEFICIARY
(p_validate in boolean default false
,p_pl_bnf_id in number
,p_effective_start_date out nocopy date
,p_effective_end_date out nocopy date
,p_business_group_id in number default hr_api.g_number
,p_prtt_enrt_rslt_id in number default hr_api.g_number
,p_bnf_person_id in number default hr_api.g_number
,p_organization_id in number default hr_api.g_number
,p_ttee_person_id in number default hr_api.g_number
,p_prmry_cntngnt_cd in varchar2 default hr_api.g_varchar2
,p_pct_dsgd_num in number default hr_api.g_number
,p_amt_dsgd_val in number default hr_api.g_number
,p_amt_dsgd_uom in varchar2 default hr_api.g_varchar2
,p_dsgn_strt_dt in date default hr_api.g_date
,p_dsgn_thru_dt in date default hr_api.g_date
,p_addl_instrn_txt in varchar2 default hr_api.g_varchar2
,p_pbn_attribute_category in varchar2 default hr_api.g_varchar2
,p_pbn_attribute1 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute2 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute3 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute4 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute5 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute6 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute7 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute8 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute9 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute10 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute11 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute12 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute13 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute14 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute15 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute16 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute17 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute18 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute19 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute20 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute21 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute22 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute23 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute24 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute25 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute26 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute27 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute28 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute29 in varchar2 default hr_api.g_varchar2
,p_pbn_attribute30 in varchar2 default hr_api.g_varchar2
,p_request_id in number default hr_api.g_number
,p_program_application_id in number default hr_api.g_number
,p_program_id in number default hr_api.g_number
,p_program_update_date in date default hr_api.g_date
,p_object_version_number in out nocopy number
,p_per_in_ler_id in number default hr_api.g_number
,p_effective_date in date
,p_datetrack_mode in varchar2
,p_multi_row_actn in boolean default TRUE
) is
--
-- Declare cursors and local variables
--
--
l_proc varchar2(72) := g_package||'update_PLAN_BENEFICIARY';
savepoint update_PLAN_BENEFICIARY;
ben_PLAN_BENEFICIARY_bk2.update_PLAN_BENEFICIARY_b
(
p_pl_bnf_id => p_pl_bnf_id
,p_business_group_id => p_business_group_id
,p_prtt_enrt_rslt_id => p_prtt_enrt_rslt_id
,p_bnf_person_id => p_bnf_person_id
,p_organization_id => p_organization_id
,p_ttee_person_id => p_ttee_person_id
,p_prmry_cntngnt_cd => p_prmry_cntngnt_cd
,p_pct_dsgd_num => p_pct_dsgd_num
,p_amt_dsgd_val => p_amt_dsgd_val
,p_amt_dsgd_uom => p_amt_dsgd_uom
,p_dsgn_strt_dt => p_dsgn_strt_dt
,p_dsgn_thru_dt => p_dsgn_thru_dt
,p_addl_instrn_txt => p_addl_instrn_txt
,p_pbn_attribute_category => p_pbn_attribute_category
,p_pbn_attribute1 => p_pbn_attribute1
,p_pbn_attribute2 => p_pbn_attribute2
,p_pbn_attribute3 => p_pbn_attribute3
,p_pbn_attribute4 => p_pbn_attribute4
,p_pbn_attribute5 => p_pbn_attribute5
,p_pbn_attribute6 => p_pbn_attribute6
,p_pbn_attribute7 => p_pbn_attribute7
,p_pbn_attribute8 => p_pbn_attribute8
,p_pbn_attribute9 => p_pbn_attribute9
,p_pbn_attribute10 => p_pbn_attribute10
,p_pbn_attribute11 => p_pbn_attribute11
,p_pbn_attribute12 => p_pbn_attribute12
,p_pbn_attribute13 => p_pbn_attribute13
,p_pbn_attribute14 => p_pbn_attribute14
,p_pbn_attribute15 => p_pbn_attribute15
,p_pbn_attribute16 => p_pbn_attribute16
,p_pbn_attribute17 => p_pbn_attribute17
,p_pbn_attribute18 => p_pbn_attribute18
,p_pbn_attribute19 => p_pbn_attribute19
,p_pbn_attribute20 => p_pbn_attribute20
,p_pbn_attribute21 => p_pbn_attribute21
,p_pbn_attribute22 => p_pbn_attribute22
,p_pbn_attribute23 => p_pbn_attribute23
,p_pbn_attribute24 => p_pbn_attribute24
,p_pbn_attribute25 => p_pbn_attribute25
,p_pbn_attribute26 => p_pbn_attribute26
,p_pbn_attribute27 => p_pbn_attribute27
,p_pbn_attribute28 => p_pbn_attribute28
,p_pbn_attribute29 => p_pbn_attribute29
,p_pbn_attribute30 => p_pbn_attribute30
,p_request_id => p_request_id
,p_program_application_id => p_program_application_id
,p_program_id => p_program_id
,p_program_update_date => p_program_update_date
,p_object_version_number => p_object_version_number
,p_per_in_ler_id => p_per_in_ler_id
,p_effective_date => trunc(p_effective_date)
,p_datetrack_mode => p_datetrack_mode
);
(p_module_name => 'UPDATE_PLAN_BENEFICIARY'
,p_hook_type => 'BP'
);
,p_program_update_date => p_program_update_date
,p_object_version_number => l_object_version_number
,p_per_in_ler_id => p_per_in_ler_id
,p_effective_date => trunc(p_effective_date)
,p_datetrack_mode => p_datetrack_mode
);
ben_prtt_enrt_actn_api.delete_prtt_enrt_actn
(p_validate => p_validate,
p_effective_date => p_effective_date,
p_business_group_id => p_business_group_id,
p_datetrack_mode => hr_api.g_zap,
p_object_version_number => l_object_version_number,
p_prtt_enrt_rslt_id => p_prtt_enrt_rslt_id,
p_rslt_object_version_number => l_rslt_object_version_number,
p_unsuspend_enrt_flag => 'N',
p_effective_start_date => l_effective_start_date,
p_effective_end_date => l_effective_end_date,
p_prtt_enrt_actn_id => l_prtt_enrt_actn_id);
if p_datetrack_mode = 'UPDATE' then
l2_datetrack_mode := 'DELETE';
ben_PLAN_BENEFICIARY_bk2.update_PLAN_BENEFICIARY_a
(
p_pl_bnf_id => p_pl_bnf_id
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_business_group_id => p_business_group_id
,p_prtt_enrt_rslt_id => p_prtt_enrt_rslt_id
,p_bnf_person_id => p_bnf_person_id
,p_organization_id => p_organization_id
,p_ttee_person_id => p_ttee_person_id
,p_prmry_cntngnt_cd => p_prmry_cntngnt_cd
,p_pct_dsgd_num => p_pct_dsgd_num
,p_amt_dsgd_val => p_amt_dsgd_val
,p_amt_dsgd_uom => p_amt_dsgd_uom
,p_dsgn_strt_dt => p_dsgn_strt_dt
,p_dsgn_thru_dt => p_dsgn_thru_dt
,p_addl_instrn_txt => p_addl_instrn_txt
,p_pbn_attribute_category => p_pbn_attribute_category
,p_pbn_attribute1 => p_pbn_attribute1
,p_pbn_attribute2 => p_pbn_attribute2
,p_pbn_attribute3 => p_pbn_attribute3
,p_pbn_attribute4 => p_pbn_attribute4
,p_pbn_attribute5 => p_pbn_attribute5
,p_pbn_attribute6 => p_pbn_attribute6
,p_pbn_attribute7 => p_pbn_attribute7
,p_pbn_attribute8 => p_pbn_attribute8
,p_pbn_attribute9 => p_pbn_attribute9
,p_pbn_attribute10 => p_pbn_attribute10
,p_pbn_attribute11 => p_pbn_attribute11
,p_pbn_attribute12 => p_pbn_attribute12
,p_pbn_attribute13 => p_pbn_attribute13
,p_pbn_attribute14 => p_pbn_attribute14
,p_pbn_attribute15 => p_pbn_attribute15
,p_pbn_attribute16 => p_pbn_attribute16
,p_pbn_attribute17 => p_pbn_attribute17
,p_pbn_attribute18 => p_pbn_attribute18
,p_pbn_attribute19 => p_pbn_attribute19
,p_pbn_attribute20 => p_pbn_attribute20
,p_pbn_attribute21 => p_pbn_attribute21
,p_pbn_attribute22 => p_pbn_attribute22
,p_pbn_attribute23 => p_pbn_attribute23
,p_pbn_attribute24 => p_pbn_attribute24
,p_pbn_attribute25 => p_pbn_attribute25
,p_pbn_attribute26 => p_pbn_attribute26
,p_pbn_attribute27 => p_pbn_attribute27
,p_pbn_attribute28 => p_pbn_attribute28
,p_pbn_attribute29 => p_pbn_attribute29
,p_pbn_attribute30 => p_pbn_attribute30
,p_request_id => p_request_id
,p_program_application_id => p_program_application_id
,p_program_id => p_program_id
,p_program_update_date => p_program_update_date
,p_object_version_number => l_object_version_number
,p_per_in_ler_id => p_per_in_ler_id
,p_effective_date => trunc(p_effective_date)
,p_datetrack_mode => p_datetrack_mode
);
(p_module_name => 'UPDATE_PLAN_BENEFICIARY'
,p_hook_type => 'AP'
);
ROLLBACK TO update_PLAN_BENEFICIARY;
ROLLBACK TO update_PLAN_BENEFICIARY;
end update_PLAN_BENEFICIARY;
procedure update_plan_beneficiary_w
(
p_validate in varchar2
,p_pl_bnf_id in number
,p_effective_start_date out nocopy date
,p_effective_end_date out nocopy date
,p_business_group_id in number
,p_prtt_enrt_rslt_id in number
,p_bnf_person_id in number default hr_api.g_number
,p_organization_id in number default hr_api.g_number
,p_prmry_cntngnt_cd in varchar2
,p_pct_dsgd_num in number
,p_dsgn_strt_dt in date
,p_dsgn_thru_dt in date
,p_object_version_number in out nocopy number
,p_per_in_ler_id in number
,p_effective_date in date
,p_datetrack_mode in varchar2
,p_multi_row_actn in varchar2
)
is
l_proc varchar2(72) := g_package||'update_plan_beneficiary - wrapper';
update_plan_beneficiary
(
p_validate => l_validate
,p_pl_bnf_id => p_pl_bnf_id
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_business_group_id => p_business_group_id
,p_prtt_enrt_rslt_id => p_prtt_enrt_rslt_id
,p_bnf_person_id => p_bnf_person_id
,p_organization_id => p_organization_id
,p_prmry_cntngnt_cd => p_prmry_cntngnt_cd
,p_pct_dsgd_num => p_pct_dsgd_num
,p_amt_dsgd_val => null
,p_amt_dsgd_uom => null
,p_dsgn_strt_dt => p_dsgn_strt_dt
,p_dsgn_thru_dt => p_dsgn_thru_dt
,p_object_version_number => l_object_version_number
,p_per_in_ler_id => p_per_in_ler_id
,p_effective_date => p_effective_date
,p_datetrack_mode => p_datetrack_mode
,p_multi_row_actn => l_multi_row_actn
);
end update_plan_beneficiary_w;
procedure delete_PLAN_BENEFICIARY
(p_validate in boolean default false
,p_pl_bnf_id in number
,p_effective_start_date out nocopy date
,p_effective_end_date out nocopy date
,p_object_version_number in out nocopy number
,p_business_group_id in number
,p_effective_date in date
,p_datetrack_mode in varchar2
,p_multi_row_actn in boolean default TRUE
) is
--
-- Declare cursors and local variables
--
l_proc varchar2(72) := g_package||'DELETE_PLAN_BENEFICIARY';
select effective_start_date
from ben_pl_bnf_f pnb
where pnb.pl_bnf_id = p_pl_bnf_id
and p_effective_date between pnb.effective_start_date
and pnb.effective_end_date ;
select pl_bnf_ctfn_prvdd_id,
object_version_number,
effective_end_date
from ben_pl_bnf_ctfn_prvdd_f
where pl_bnf_id = p_pl_bnf_id
and business_group_id = p_business_group_id
and l_effective_date between effective_start_date
and effective_end_date;
select null
from ben_pl_bnf_ctfn_prvdd_f
where pl_bnf_ctfn_prvdd_id = p_pl_bnf_ctfn_prvdd_id
and effective_start_date > p_effective_date;
select distinct pl_bnf_ctfn_prvdd_id
from ben_pl_bnf_ctfn_prvdd_f
where pl_bnf_id = p_pl_bnf_id;
select max(object_version_number)
from ben_pl_bnf_ctfn_prvdd_f
where pl_bnf_ctfn_prvdd_id = l_pl_bnf_ctfn_prvdd_id;
elsif p_datetrack_mode = hr_api.g_delete then
l_effective_date := p_effective_date - 1 ;
savepoint delete_PLAN_BENEFICIARY;
ben_pl_bnf_ctfn_prvdd_api.delete_pl_bnf_ctfn_prvdd
(p_validate => FALSE
,p_pl_bnf_ctfn_prvdd_id => ctfn_rec.pl_bnf_ctfn_prvdd_id
,p_effective_start_date => l2_effective_start_date
,p_effective_end_date => l2_effective_end_date
,p_object_version_number => l2_object_version_number
,p_business_group_id => p_business_group_id
,p_effective_date => l_effective_date
,p_datetrack_mode => l_datetrack_mode
);
l_datetrack_mode := hr_api.g_delete;
ben_pl_bnf_ctfn_prvdd_api.delete_pl_bnf_ctfn_prvdd
(p_validate => FALSE
,p_pl_bnf_ctfn_prvdd_id => ctfn_rec.pl_bnf_ctfn_prvdd_id
,p_effective_start_date => l2_effective_start_date
,p_effective_end_date => l2_effective_end_date
,p_object_version_number => l2_object_version_number
,p_business_group_id => p_business_group_id
,p_effective_date => l_effective_date
,p_datetrack_mode => l_datetrack_mode
);
ben_PLAN_BENEFICIARY_bk3.delete_PLAN_BENEFICIARY_b
(
p_pl_bnf_id => p_pl_bnf_id
,p_object_version_number => p_object_version_number
,p_effective_date => trunc(l_effective_date)
,p_datetrack_mode => l_datetrack_mode
);
(p_module_name => 'DELETE_PLAN_BENEFICIARY'
,p_hook_type => 'BP'
);
otherwise process will recreate the action items which got deleted above.
-- Call Action item RCO if p_multi_row_actn = TRUE
--
if p_multi_row_actn then
--
bnf_actn_items(
p_prtt_enrt_rslt_id => null
,p_pl_bnf_id => p_pl_bnf_id
,p_effective_date => l_effective_date
,p_business_group_id => null
,p_validate => p_validate
,p_datetrack_mode => l_datetrack_mode
,p_delete_flag => 'Y'
);
if p_datetrack_mode not in ('FUTURE_CHANGE','DELETE_NEXT_CHANGE') then
--
remove_usage(
p_validate => p_validate
,p_pl_bnf_id => p_pl_bnf_id
,p_effective_date => l_effective_date
,p_datetrack_mode => l_datetrack_mode
,p_business_group_id => p_business_group_id
-- 5668052
,p_dsgn_thru_dt => NULL
);
,p_delete_flag => 'Y'
);
ben_PLAN_BENEFICIARY_bk3.delete_PLAN_BENEFICIARY_a
(
p_pl_bnf_id => p_pl_bnf_id
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_object_version_number => l_object_version_number
,p_effective_date => trunc(l_effective_date)
,p_datetrack_mode => l_datetrack_mode
);
(p_module_name => 'DELETE_PLAN_BENEFICIARY'
,p_hook_type => 'AP'
);
ROLLBACK TO delete_PLAN_BENEFICIARY;
ROLLBACK TO delete_PLAN_BENEFICIARY;
end delete_PLAN_BENEFICIARY;
procedure delete_plan_beneficiary_w
(
p_validate in varchar2
,p_pl_bnf_id in number
,p_effective_start_date out nocopy date
,p_effective_end_date out nocopy date
,p_object_version_number in out nocopy number
,p_business_group_id in number
,p_effective_date in date
,p_datetrack_mode in varchar2
,p_prtt_enrt_rslt_id in number
,p_multi_row_actn in varchar2
)
is
l_proc varchar2(72) := g_package||'delete_plan_beneficiary - wrapper';
delete_plan_beneficiary
(
p_validate => l_validate
,p_pl_bnf_id => p_pl_bnf_id
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
,p_business_group_id => p_business_group_id
,p_object_version_number => l_object_version_number
,p_effective_date => p_effective_date
,p_datetrack_mode => p_datetrack_mode
,p_multi_row_actn => l_multi_row_actn
);
,p_delete_flag => 'N'
);
end delete_plan_beneficiary_w;
,p_delete_flag in varchar2 default 'N'
) is
--
l_proc varchar2(72) := g_package||'bnf_actn_items';
select prtt_enrt_rslt_id,
business_group_id,
decode(prmry_cntngnt_cd, 'PRIMY',pct_dsgd_num,0) prmry_dsgd_pct,
decode(prmry_cntngnt_cd, 'CNTNGNT',pct_dsgd_num,0) cntngnt_dsgd_pct,
decode(prmry_cntngnt_cd, 'PRIMY',amt_dsgd_val,0) prmry_dsgd_amt,
decode(prmry_cntngnt_cd, 'CNTNGNT',amt_dsgd_val,0) cntngnt_dsgd_amt
from ben_pl_bnf_f
where pl_bnf_id = p_pl_bnf_id
and p_effective_date between effective_start_date
and effective_end_date;
select object_version_number,
sspndd_flag,
bnft_amt
from ben_prtt_enrt_rslt_f
where prtt_enrt_rslt_id = l_prtt_enrt_rslt_id
and business_group_id = l_business_group_id
and prtt_enrt_rslt_stat_cd is null
and p_effective_date
between effective_start_date and effective_end_date;
select pbn.prmry_cntngnt_cd prmry_cntngnt_cd,
sum(pbn.pct_dsgd_num) prcnt,
sum(pbn.amt_dsgd_val) amount
from ben_pl_bnf_f pbn,
ben_per_in_ler pil
where pbn.prtt_enrt_rslt_id = l_prtt_enrt_rslt_id
and pbn.business_group_id = l_business_group_id
-- and p_effective_date between pbn.effective_start_date and pbn.effective_end_date
and p_effective_date >= pbn.effective_start_date
and p_effective_date < pbn.effective_end_date
and pil.per_in_ler_id=pbn.per_in_ler_id
and pil.per_in_ler_stat_cd not in ('VOIDD','BCKDT')
group by pbn.prmry_cntngnt_cd;
p_delete_flag = 'Y' then
--
open get_rslt_id_c;
if p_delete_flag = 'N' then
l_prmry_dsgd_pct := 0;
select person_type_id
from per_person_types
where system_person_type = 'BNF'
and business_group_id = p_business_group_id;
select enrt_cvg_strt_dt
from ben_prtt_enrt_rslt_f a
where a.prtt_enrt_rslt_id = p_prtt_enrt_rslt_id
and a.business_group_id = p_business_group_id
and a.prtt_enrt_rslt_stat_cd is null
and p_effective_date between nvl(a.effective_start_date, p_effective_date)
and nvl(a.effective_end_date, p_effective_date);
select a.effective_start_date,
a.effective_end_date,
a.person_type_usage_id
from per_person_type_usages_f a
where a.person_id = p_bnf_person_id
and a.person_type_id = l_person_type_id
-- and a.effective_start_date <= hr_api.g_date
and a.effective_end_date >= l_dsg_strt_dt
;
update per_person_type_usages_f
set effective_end_date = hr_api.g_date
where person_type_usage_id = l_person_type_usage_id;
update per_person_type_usages_f
set effective_start_date = l_dsg_strt_dt
where person_type_usage_id = l_person_type_usage_id;
update per_person_type_usages_f
set effective_start_date = l_dsg_strt_dt,
effective_end_date = hr_api.g_date
where person_type_usage_id = l_person_type_usage_id;
select b.bnf_person_id,
b.business_group_id
from ben_pl_bnf_f b
where b.pl_bnf_id = p_pl_bnf_id
and business_group_id = p_business_group_id
and p_effective_date between b.effective_start_date
and b.effective_end_date;
select null
from ben_pl_bnf_f a
where a.bnf_person_id = l_bnf_person_id
and a.business_group_id = p_business_group_id
and a.pl_bnf_id <> p_pl_bnf_id
-- and p_effective_date between a.effective_start_date
-- and a.effective_end_date;
select a.person_type_usage_id,
a.object_version_number,
a.effective_end_date
-- bug 5668052
,a.effective_start_date
from per_person_type_usages_f a,
per_person_types b
where a.person_id = l_bnf_person_id
and a.person_type_id = b.person_type_id
and b.system_person_type = 'BNF'
and b.business_group_id = l_business_group_id
and p_effective_date between a.effective_start_date
and a.effective_end_date;
SELECT pl_bnf_id
FROM ben_pl_bnf_f pbn
WHERE pbn.bnf_person_id = v_bnf_person_id
AND pbn.pl_bnf_id <> p_pl_bnf_id
AND pbn.business_group_id = p_business_group_id;
if l_datetrack_mode = hr_api.g_delete
and p_dsgn_thru_dt < l_usg_effective_start_date
then
l_datetrack_mode := 'ZAP';
if l_datetrack_mode = 'DELETE' AND l_effective_end_date = hr_api.g_eot
then
hr_per_type_usage_internal.delete_person_type_usage
(p_validate => FALSE
,p_person_type_usage_id => l_person_type_usage_id
,p_effective_date => p_effective_date
-- ,p_datetrack_mode => p_datetrack_mode
,p_datetrack_mode => l_datetrack_mode
,p_object_version_number => l_object_version_number
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
);
hr_utility.set_location('Deleteing in zap mode ',121);
hr_per_type_usage_internal.delete_person_type_usage
(p_validate => FALSE
,p_person_type_usage_id => l_person_type_usage_id
,p_effective_date => p_effective_date
-- ,p_datetrack_mode => p_datetrack_mode
,p_datetrack_mode => l_datetrack_mode
,p_object_version_number => l_object_version_number
,p_effective_start_date => l_effective_start_date
,p_effective_end_date => l_effective_end_date
);