DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CTP_DEL

Source


1 Package Body ben_ctp_del as
2 /* $Header: bectprhi.pkb 120.0 2005/05/28 01:26:14 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ctp_del.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_delete_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml delete logic for the datetrack
17 --   delete modes: ZAP, DELETE, FUTURE_CHANGE and DELETE_NEXT_CHANGE. The
18 --   execution is as follows:
19 --   1) To set and unset the g_api_dml status as required (as we are about to
20 --      perform dml).
21 --   2) If the delete mode is DELETE_NEXT_CHANGE then delete where the
22 --      effective start date is equal to the validation start date.
23 --   3) If the delete mode is not DELETE_NEXT_CHANGE then delete
24 --      all rows for the entity where the effective start date is greater
25 --      than or equal to the validation start date.
26 --   4) To raise any errors.
27 --
28 -- Prerequisites:
29 --   This is an internal private procedure which must be called from the
30 --   delete_dml procedure.
31 --
32 -- In Parameters:
33 --   A Pl/Sql record structre.
34 --
35 -- Post Success:
36 --   The specified row will be delete from the schema.
37 --
38 -- Post Failure:
39 --   On the delete dml failure it is important to note that we always reset the
40 --   g_api_dml status to false.
41 --   If any other error is reported, the error will be raised after the
42 --   g_api_dml status is reset.
43 --
44 -- Developer Implementation Notes:
45 --   This is an internal private procedure which must be called from the
46 --   delete_dml procedure.
47 --
48 -- Access Status:
49 --   Internal Row Handler Use Only.
50 --
51 -- {End Of Comments}
52 -- ----------------------------------------------------------------------------
53 Procedure dt_delete_dml
54 	(p_rec 			 in out nocopy ben_ctp_shd.g_rec_type,
55 	 p_effective_date	 in	date,
56 	 p_datetrack_mode	 in	varchar2,
57 	 p_validation_start_date in	date,
58 	 p_validation_end_date	 in	date) is
59 --
60   l_proc	varchar2(72) := g_package||'dt_delete_dml';
61 --
62 Begin
63   hr_utility.set_location('Entering:'||l_proc, 5);
64   If (p_datetrack_mode = 'DELETE_NEXT_CHANGE') then
65     hr_utility.set_location(l_proc, 10);
66     ben_ctp_shd.g_api_dml := true;  -- Set the api dml status
67     --
68     -- Delete the where the effective start date is equal
69     -- to the validation end date.
70     --
71     delete from ben_ptip_f
72     where       ptip_id = p_rec.ptip_id
73     and	  effective_start_date = p_validation_start_date;
74     --
75     ben_ctp_shd.g_api_dml := false;   -- Unset the api dml status
76   Else
77     hr_utility.set_location(l_proc, 15);
78     ben_ctp_shd.g_api_dml := true;  -- Set the api dml status
79     --
80     -- Delete the row(s) where the effective start date is greater than
81     -- or equal to the validation start date.
82     --
83     delete from ben_ptip_f
84     where        ptip_id = p_rec.ptip_id
85     and	  effective_start_date >= p_validation_start_date;
86     --
87     ben_ctp_shd.g_api_dml := false;   -- Unset the api dml status
88   End If;
89   --
90   hr_utility.set_location(' Leaving:'||l_proc, 20);
91 --
92 Exception
93   When Others Then
94     ben_ctp_shd.g_api_dml := false;   -- Unset the api dml status
95     Raise;
96 End dt_delete_dml;
97 --
98 -- ----------------------------------------------------------------------------
99 -- |------------------------------< delete_dml >------------------------------|
100 -- ----------------------------------------------------------------------------
101 Procedure delete_dml
102 	(p_rec 			 in out nocopy ben_ctp_shd.g_rec_type,
103 	 p_effective_date	 in	date,
104 	 p_datetrack_mode	 in	varchar2,
105 	 p_validation_start_date in	date,
106 	 p_validation_end_date	 in	date) is
107 --
108   l_proc	varchar2(72) := g_package||'delete_dml';
109 --
110 Begin
111   hr_utility.set_location('Entering:'||l_proc, 5);
112   --
113   dt_delete_dml(p_rec			=> p_rec,
114 		p_effective_date	=> p_effective_date,
115 		p_datetrack_mode	=> p_datetrack_mode,
116        		p_validation_start_date	=> p_validation_start_date,
117 		p_validation_end_date	=> p_validation_end_date);
118   --
119   hr_utility.set_location(' Leaving:'||l_proc, 10);
120 End delete_dml;
121 --
122 -- ----------------------------------------------------------------------------
123 -- |----------------------------< dt_pre_delete >-----------------------------|
124 -- ----------------------------------------------------------------------------
125 -- {Start Of Comments}
126 --
127 -- Description:
128 --   The dt_pre_delete process controls the execution of dml
129 --   for the datetrack modes: DELETE, FUTURE_CHANGE
130 --   and DELETE_NEXT_CHANGE only.
131 --
132 -- Prerequisites:
133 --   This is an internal procedure which is called from the pre_delete
134 --   procedure.
135 --
136 -- In Parameters:
137 --   A Pl/Sql record structre.
138 --
139 -- Post Success:
140 --   Processing continues.
141 --
142 -- Post Failure:
143 --   If an error has occurred, an error message and exception will be raised
144 --   but not handled.
145 --
146 -- Developer Implementation Notes:
147 --   This is an internal procedure which is required by Datetrack. Don't
148 --   remove or modify.
149 --
150 -- Access Status:
151 --   Internal Row Handler Use Only.
152 --
153 -- {End Of Comments}
154 -- ----------------------------------------------------------------------------
155 Procedure dt_pre_delete
156 	(p_rec 			 in out nocopy ben_ctp_shd.g_rec_type,
157 	 p_effective_date	 in	date,
158 	 p_datetrack_mode	 in	varchar2,
159 	 p_validation_start_date in	date,
160 	 p_validation_end_date	 in	date) is
161 --
162   l_proc	varchar2(72) := g_package||'dt_pre_delete';
163 --
164 Begin
165   hr_utility.set_location('Entering:'||l_proc, 5);
166   --
167   If (p_datetrack_mode <> 'ZAP') then
168     --
169     p_rec.effective_start_date := ben_ctp_shd.g_old_rec.effective_start_date;
170     --
171     If (p_datetrack_mode = 'DELETE') then
172       p_rec.effective_end_date := p_validation_start_date - 1;
173     Else
174       p_rec.effective_end_date := p_validation_end_date;
175     End If;
176     --
177     -- Update the current effective end date record
178     --
179     ben_ctp_shd.upd_effective_end_date
180       (p_effective_date	        => p_effective_date,
181        p_base_key_value	        => p_rec.ptip_id,
182        p_new_effective_end_date => p_rec.effective_end_date,
183        p_validation_start_date  => p_validation_start_date,
184        p_validation_end_date	=> p_validation_end_date,
185        p_object_version_number  => p_rec.object_version_number);
186   Else
187     p_rec.effective_start_date := null;
188     p_rec.effective_end_date   := null;
189   End If;
190   hr_utility.set_location(' Leaving:'||l_proc, 10);
191 End dt_pre_delete;
192 --
193 -- ----------------------------------------------------------------------------
194 -- |------------------------------< pre_delete >------------------------------|
195 -- ----------------------------------------------------------------------------
196 -- {Start Of Comments}
197 --
198 -- Description:
199 --   This private procedure contains any processing which is required before
200 --   the delete dml.
201 --
202 -- Prerequisites:
203 --   This is an internal procedure which is called from the del procedure.
204 --
205 -- In Parameters:
206 --   A Pl/Sql record structre.
207 --
208 -- Post Success:
209 --   Processing continues.
210 --
211 -- Post Failure:
212 --   If an error has occurred, an error message and exception will be raised
213 --   but not handled.
214 --
215 -- Developer Implementation Notes:
216 --   Any pre-processing required before the delete dml is issued should be
217 --   coded within this procedure. It is important to note that any 3rd party
218 --   maintenance should be reviewed before placing in this procedure. The call
219 --   to the dt_delete_dml procedure should NOT be removed.
220 --
221 -- Access Status:
222 --   Internal Row Handler Use Only.
223 --
224 -- {End Of Comments}
225 -- ----------------------------------------------------------------------------
226 Procedure pre_delete
227 	(p_rec 			 in out nocopy ben_ctp_shd.g_rec_type,
228 	 p_effective_date	 in	date,
229 	 p_datetrack_mode	 in	varchar2,
230 	 p_validation_start_date in	date,
231 	 p_validation_end_date	 in	date) is
232 --
233   l_proc	varchar2(72) := g_package||'pre_delete';
234 --
235   --
236 --
237 Begin
238   hr_utility.set_location('Entering:'||l_proc, 5);
239   --
240   --
241   --
242   dt_pre_delete
243     (p_rec 		     => p_rec,
244      p_effective_date	     => p_effective_date,
245      p_datetrack_mode	     => p_datetrack_mode,
246      p_validation_start_date => p_validation_start_date,
247      p_validation_end_date   => p_validation_end_date);
248   --
249   hr_utility.set_location(' Leaving:'||l_proc, 10);
250 End pre_delete;
251 --
252 -- ----------------------------------------------------------------------------
253 -- |-----------------------------< post_delete >------------------------------|
254 -- ----------------------------------------------------------------------------
255 -- {Start Of Comments}
256 --
257 -- Description:
258 --   This private procedure contains any processing which is required after the
259 --   delete dml.
260 --
261 -- Prerequisites:
262 --   This is an internal procedure which is called from the del procedure.
263 --
264 -- In Parameters:
265 --   A Pl/Sql record structre.
266 --
267 -- Post Success:
268 --   Processing continues.
269 --
270 -- Post Failure:
271 --   If an error has occurred, an error message and exception will be raised
272 --   but not handled.
273 --
274 -- Developer Implementation Notes:
275 --   Any post-processing required after the delete dml is issued should be
276 --   coded within this procedure. It is important to note that any 3rd party
277 --   maintenance should be reviewed before placing in this procedure.
278 --
279 -- Access Status:
280 --   Internal Row Handler Use Only.
281 --
282 -- {End Of Comments}
283 -- ----------------------------------------------------------------------------
284 Procedure post_delete
285 	(p_rec 			 in ben_ctp_shd.g_rec_type,
286 	 p_effective_date	 in date,
287 	 p_datetrack_mode	 in varchar2,
288 	 p_validation_start_date in date,
289 	 p_validation_end_date	 in date) is
290 --
291   l_proc	varchar2(72) := g_package||'post_delete';
292 --
293 Begin
294   hr_utility.set_location('Entering:'||l_proc, 5);
295 --
296   --
297   -- Start of API User Hook for post_delete.
298   --
299   begin
300     --
301     ben_ctp_rkd.after_delete
302       (
303   p_ptip_id                       =>p_rec.ptip_id
304  ,p_datetrack_mode                =>p_datetrack_mode
305  ,p_validation_start_date         =>p_validation_start_date
306  ,p_validation_end_date           =>p_validation_end_date
307  ,p_effective_start_date          =>p_rec.effective_start_date
308  ,p_effective_end_date            =>p_rec.effective_end_date
309  ,p_effective_start_date_o        =>ben_ctp_shd.g_old_rec.effective_start_date
310  ,p_effective_end_date_o          =>ben_ctp_shd.g_old_rec.effective_end_date
311  ,p_coord_cvg_for_all_pls_flag_o  =>ben_ctp_shd.g_old_rec.coord_cvg_for_all_pls_flag
312  ,p_dpnt_dsgn_cd_o                =>ben_ctp_shd.g_old_rec.dpnt_dsgn_cd
313  ,p_dpnt_cvg_strt_dt_rl_o         =>ben_ctp_shd.g_old_rec.dpnt_cvg_strt_dt_rl
314  ,p_dpnt_cvg_end_dt_rl_o          =>ben_ctp_shd.g_old_rec.dpnt_cvg_end_dt_rl
315  ,p_postelcn_edit_rl_o            =>ben_ctp_shd.g_old_rec.postelcn_edit_rl
316  ,p_rt_end_dt_rl_o                =>ben_ctp_shd.g_old_rec.rt_end_dt_rl
317  ,p_rt_strt_dt_rl_o               =>ben_ctp_shd.g_old_rec.rt_strt_dt_rl
318  ,p_enrt_cvg_end_dt_rl_o          =>ben_ctp_shd.g_old_rec.enrt_cvg_end_dt_rl
319  ,p_enrt_cvg_strt_dt_rl_o         =>ben_ctp_shd.g_old_rec.enrt_cvg_strt_dt_rl
320  ,p_rqd_perd_enrt_nenrt_rl_o      =>ben_ctp_shd.g_old_rec.rqd_perd_enrt_nenrt_rl
321  ,p_auto_enrt_mthd_rl_o           =>ben_ctp_shd.g_old_rec.auto_enrt_mthd_rl
322  ,p_enrt_mthd_cd_o                =>ben_ctp_shd.g_old_rec.enrt_mthd_cd
323  ,p_enrt_cd_o                     =>ben_ctp_shd.g_old_rec.enrt_cd
324  ,p_enrt_rl_o                     =>ben_ctp_shd.g_old_rec.enrt_rl
325  ,p_dflt_enrt_cd_o                =>ben_ctp_shd.g_old_rec.dflt_enrt_cd
326  ,p_dflt_enrt_det_rl_o            =>ben_ctp_shd.g_old_rec.dflt_enrt_det_rl
327  ,p_drvbl_fctr_apls_rts_flag_o    =>ben_ctp_shd.g_old_rec.drvbl_fctr_apls_rts_flag
328  ,p_drvbl_fctr_prtn_elig_flag_o   =>ben_ctp_shd.g_old_rec.drvbl_fctr_prtn_elig_flag
329  ,p_elig_apls_flag_o              =>ben_ctp_shd.g_old_rec.elig_apls_flag
330  ,p_prtn_elig_ovrid_alwd_flag_o   =>ben_ctp_shd.g_old_rec.prtn_elig_ovrid_alwd_flag
331  ,p_trk_inelig_per_flag_o         =>ben_ctp_shd.g_old_rec.trk_inelig_per_flag
332  ,p_dpnt_cvg_strt_dt_cd_o         =>ben_ctp_shd.g_old_rec.dpnt_cvg_strt_dt_cd
333  ,p_rt_end_dt_cd_o                =>ben_ctp_shd.g_old_rec.rt_end_dt_cd
334  ,p_rt_strt_dt_cd_o               =>ben_ctp_shd.g_old_rec.rt_strt_dt_cd
335  ,p_enrt_cvg_end_dt_cd_o          =>ben_ctp_shd.g_old_rec.enrt_cvg_end_dt_cd
336  ,p_enrt_cvg_strt_dt_cd_o         =>ben_ctp_shd.g_old_rec.enrt_cvg_strt_dt_cd
337  ,p_dpnt_cvg_end_dt_cd_o          =>ben_ctp_shd.g_old_rec.dpnt_cvg_end_dt_cd
338  ,p_crs_this_pl_typ_only_flag_o   =>ben_ctp_shd.g_old_rec.crs_this_pl_typ_only_flag
339  ,p_ptip_stat_cd_o                =>ben_ctp_shd.g_old_rec.ptip_stat_cd
340  ,p_mx_cvg_alwd_amt_o             =>ben_ctp_shd.g_old_rec.mx_cvg_alwd_amt
341  ,p_mx_enrd_alwd_ovrid_num_o      =>ben_ctp_shd.g_old_rec.mx_enrd_alwd_ovrid_num
342  ,p_mn_enrd_rqd_ovrid_num_o       =>ben_ctp_shd.g_old_rec.mn_enrd_rqd_ovrid_num
343  ,p_no_mx_pl_typ_ovrid_flag_o     =>ben_ctp_shd.g_old_rec.no_mx_pl_typ_ovrid_flag
344  ,p_ordr_num_o                    =>ben_ctp_shd.g_old_rec.ordr_num
345  ,p_prvds_cr_flag_o               =>ben_ctp_shd.g_old_rec.prvds_cr_flag
346  ,p_rqd_perd_enrt_nenrt_val_o     =>ben_ctp_shd.g_old_rec.rqd_perd_enrt_nenrt_val
347  ,p_rqd_perd_enrt_nenrt_tm_uom_o  =>ben_ctp_shd.g_old_rec.rqd_perd_enrt_nenrt_tm_uom
348  ,p_wvbl_flag_o                   =>ben_ctp_shd.g_old_rec.wvbl_flag
349  ,p_dpnt_adrs_rqd_flag_o          =>ben_ctp_shd.g_old_rec.dpnt_adrs_rqd_flag
350  ,p_dpnt_cvg_no_ctfn_rqd_flag_o   =>ben_ctp_shd.g_old_rec.dpnt_cvg_no_ctfn_rqd_flag
351  ,p_dpnt_dob_rqd_flag_o           =>ben_ctp_shd.g_old_rec.dpnt_dob_rqd_flag
352  ,p_dpnt_legv_id_rqd_flag_o       =>ben_ctp_shd.g_old_rec.dpnt_legv_id_rqd_flag
353  ,p_susp_if_dpnt_ssn_nt_prv_cd_o  =>ben_pln_shd.g_old_rec.susp_if_dpnt_ssn_nt_prv_cd
354  ,p_susp_if_dpnt_dob_nt_prv_cd_o  =>ben_pln_shd.g_old_rec.susp_if_dpnt_dob_nt_prv_cd
355  ,p_susp_if_dpnt_adr_nt_prv_cd_o  =>ben_pln_shd.g_old_rec.susp_if_dpnt_adr_nt_prv_cd
356  ,p_susp_if_ctfn_not_dpnt_flag_o  =>ben_pln_shd.g_old_rec.susp_if_ctfn_not_dpnt_flag
357  ,p_dpnt_ctfn_determine_cd_o      =>ben_pln_shd.g_old_rec.dpnt_ctfn_determine_cd
358  ,p_drvd_fctr_dpnt_cvg_flag_o     =>ben_ctp_shd.g_old_rec.drvd_fctr_dpnt_cvg_flag
359  ,p_no_mn_pl_typ_overid_flag_o    =>ben_ctp_shd.g_old_rec.no_mn_pl_typ_overid_flag
360  ,p_sbj_to_sps_lf_ins_mx_flag_o =>ben_ctp_shd.g_old_rec.sbj_to_sps_lf_ins_mx_flag
361  ,p_sbj_to_dpnt_lf_ins_mx_flag_o =>ben_ctp_shd.g_old_rec.sbj_to_dpnt_lf_ins_mx_flag
362  ,p_use_to_sum_ee_lf_ins_flag_o   =>ben_ctp_shd.g_old_rec.use_to_sum_ee_lf_ins_flag
363  ,p_per_cvrd_cd_o                 =>ben_ctp_shd.g_old_rec.per_cvrd_cd
364  ,p_short_name_o                 =>ben_ctp_shd.g_old_rec.short_name
365  ,p_short_code_o                 =>ben_ctp_shd.g_old_rec.short_code
366   ,p_legislation_code_o                 =>ben_ctp_shd.g_old_rec.legislation_code
367   ,p_legislation_subgroup_o                 =>ben_ctp_shd.g_old_rec.legislation_subgroup
368  ,p_vrfy_fmly_mmbr_cd_o           =>ben_ctp_shd.g_old_rec.vrfy_fmly_mmbr_cd
369  ,p_vrfy_fmly_mmbr_rl_o           =>ben_ctp_shd.g_old_rec.vrfy_fmly_mmbr_rl
370  ,p_ivr_ident_o                   =>ben_ctp_shd.g_old_rec.ivr_ident
371  ,p_url_ref_name_o                =>ben_ctp_shd.g_old_rec.url_ref_name
372  ,p_rqd_enrt_perd_tco_cd_o        =>ben_ctp_shd.g_old_rec.rqd_enrt_perd_tco_cd
373  ,p_pgm_id_o                      =>ben_ctp_shd.g_old_rec.pgm_id
374  ,p_pl_typ_id_o                   =>ben_ctp_shd.g_old_rec.pl_typ_id
375  ,p_cmbn_ptip_id_o                =>ben_ctp_shd.g_old_rec.cmbn_ptip_id
376  ,p_cmbn_ptip_opt_id_o            =>ben_ctp_shd.g_old_rec.cmbn_ptip_opt_id
377  ,p_acrs_ptip_cvg_id_o            =>ben_ctp_shd.g_old_rec.acrs_ptip_cvg_id
378  ,p_business_group_id_o           =>ben_ctp_shd.g_old_rec.business_group_id
379  ,p_ctp_attribute_category_o      =>ben_ctp_shd.g_old_rec.ctp_attribute_category
380  ,p_ctp_attribute1_o              =>ben_ctp_shd.g_old_rec.ctp_attribute1
381  ,p_ctp_attribute2_o              =>ben_ctp_shd.g_old_rec.ctp_attribute2
382  ,p_ctp_attribute3_o              =>ben_ctp_shd.g_old_rec.ctp_attribute3
383  ,p_ctp_attribute4_o              =>ben_ctp_shd.g_old_rec.ctp_attribute4
384  ,p_ctp_attribute5_o              =>ben_ctp_shd.g_old_rec.ctp_attribute5
385  ,p_ctp_attribute6_o              =>ben_ctp_shd.g_old_rec.ctp_attribute6
386  ,p_ctp_attribute7_o              =>ben_ctp_shd.g_old_rec.ctp_attribute7
387  ,p_ctp_attribute8_o              =>ben_ctp_shd.g_old_rec.ctp_attribute8
388  ,p_ctp_attribute9_o              =>ben_ctp_shd.g_old_rec.ctp_attribute9
389  ,p_ctp_attribute10_o             =>ben_ctp_shd.g_old_rec.ctp_attribute10
390  ,p_ctp_attribute11_o             =>ben_ctp_shd.g_old_rec.ctp_attribute11
391  ,p_ctp_attribute12_o             =>ben_ctp_shd.g_old_rec.ctp_attribute12
392  ,p_ctp_attribute13_o             =>ben_ctp_shd.g_old_rec.ctp_attribute13
393  ,p_ctp_attribute14_o             =>ben_ctp_shd.g_old_rec.ctp_attribute14
394  ,p_ctp_attribute15_o             =>ben_ctp_shd.g_old_rec.ctp_attribute15
395  ,p_ctp_attribute16_o             =>ben_ctp_shd.g_old_rec.ctp_attribute16
396  ,p_ctp_attribute17_o             =>ben_ctp_shd.g_old_rec.ctp_attribute17
397  ,p_ctp_attribute18_o             =>ben_ctp_shd.g_old_rec.ctp_attribute18
398  ,p_ctp_attribute19_o             =>ben_ctp_shd.g_old_rec.ctp_attribute19
399  ,p_ctp_attribute20_o             =>ben_ctp_shd.g_old_rec.ctp_attribute20
400  ,p_ctp_attribute21_o             =>ben_ctp_shd.g_old_rec.ctp_attribute21
401  ,p_ctp_attribute22_o             =>ben_ctp_shd.g_old_rec.ctp_attribute22
402  ,p_ctp_attribute23_o             =>ben_ctp_shd.g_old_rec.ctp_attribute23
403  ,p_ctp_attribute24_o             =>ben_ctp_shd.g_old_rec.ctp_attribute24
404  ,p_ctp_attribute25_o             =>ben_ctp_shd.g_old_rec.ctp_attribute25
405  ,p_ctp_attribute26_o             =>ben_ctp_shd.g_old_rec.ctp_attribute26
406  ,p_ctp_attribute27_o             =>ben_ctp_shd.g_old_rec.ctp_attribute27
407  ,p_ctp_attribute28_o             =>ben_ctp_shd.g_old_rec.ctp_attribute28
408  ,p_ctp_attribute29_o             =>ben_ctp_shd.g_old_rec.ctp_attribute29
409  ,p_ctp_attribute30_o             =>ben_ctp_shd.g_old_rec.ctp_attribute30
410  ,p_object_version_number_o       =>ben_ctp_shd.g_old_rec.object_version_number
411       );
412     --
413   exception
414     --
415     when hr_api.cannot_find_prog_unit then
416       --
417       hr_api.cannot_find_prog_unit_error
418         (p_module_name => 'ben_ptip_f'
419         ,p_hook_type   => 'AD');
420       --
421   end;
422   --
423   -- End of API User Hook for post_delete.
424   --
425   --
426   hr_utility.set_location(' Leaving:'||l_proc, 10);
427 End post_delete;
428 --
429 -- ----------------------------------------------------------------------------
430 -- |---------------------------------< del >----------------------------------|
431 -- ----------------------------------------------------------------------------
432 Procedure del
433   (
434   p_rec			in out nocopy 	ben_ctp_shd.g_rec_type,
435   p_effective_date	in 	date,
436   p_datetrack_mode	in 	varchar2
437   ) is
438 --
439   l_proc			varchar2(72) := g_package||'del';
440   l_validation_start_date	date;
441   l_validation_end_date		date;
442 --
443 Begin
444   hr_utility.set_location('Entering:'||l_proc, 5);
445   --
446   -- Ensure that the DateTrack delete mode is valid
447   --
448   dt_api.validate_dt_del_mode(p_datetrack_mode => p_datetrack_mode);
449   --
450   -- We must lock the row which we need to delete.
451   --
452   ben_ctp_shd.lck
453 	(p_effective_date	 => p_effective_date,
454       	 p_datetrack_mode	 => p_datetrack_mode,
455       	 p_ptip_id	 => p_rec.ptip_id,
456       	 p_object_version_number => p_rec.object_version_number,
457       	 p_validation_start_date => l_validation_start_date,
458       	 p_validation_end_date	 => l_validation_end_date);
459   --
460   -- Call the supporting delete validate operation
461   --
462   ben_ctp_bus.delete_validate
463 	(p_rec			 => p_rec,
464 	 p_effective_date	 => p_effective_date,
465 	 p_datetrack_mode	 => p_datetrack_mode,
466 	 p_validation_start_date => l_validation_start_date,
467 	 p_validation_end_date	 => l_validation_end_date);
468   --
469   -- Call the supporting pre-delete operation
470   --
471   pre_delete
472 	(p_rec			 => p_rec,
473 	 p_effective_date	 => p_effective_date,
474 	 p_datetrack_mode	 => p_datetrack_mode,
475 	 p_validation_start_date => l_validation_start_date,
476 	 p_validation_end_date	 => l_validation_end_date);
477   --
478   -- Delete the row.
479   --
480   delete_dml
481 	(p_rec			 => p_rec,
482 	 p_effective_date	 => p_effective_date,
483 	 p_datetrack_mode	 => p_datetrack_mode,
484 	 p_validation_start_date => l_validation_start_date,
485 	 p_validation_end_date	 => l_validation_end_date);
486   --
487   -- Call the supporting post-delete operation
488   --
489   post_delete
490 	(p_rec			 => p_rec,
491 	 p_effective_date	 => p_effective_date,
492 	 p_datetrack_mode	 => p_datetrack_mode,
493 	 p_validation_start_date => l_validation_start_date,
494 	 p_validation_end_date	 => l_validation_end_date);
495 End del;
496 --
497 -- ----------------------------------------------------------------------------
498 -- |---------------------------------< del >----------------------------------|
499 -- ----------------------------------------------------------------------------
500 Procedure del
501   (
502   p_ptip_id	  in 	 number,
503   p_effective_start_date     out nocopy date,
504   p_effective_end_date	     out nocopy date,
505   p_object_version_number in out nocopy number,
506   p_effective_date	  in     date,
507   p_datetrack_mode  	  in     varchar2
508   ) is
509 --
510   l_rec		ben_ctp_shd.g_rec_type;
511   l_proc	varchar2(72) := g_package||'del';
512 --
513 Begin
514   hr_utility.set_location('Entering:'||l_proc, 5);
515   --
516   -- As the delete procedure accepts a plsql record structure we do need to
517   -- convert the  arguments into the record structure.
518   -- We don't need to call the supplied conversion argument routine as we
519   -- only need a few attributes.
520   --
521   l_rec.ptip_id		:= p_ptip_id;
522   l_rec.object_version_number 	:= p_object_version_number;
523   --
524   -- Having converted the arguments into the ben_ctp_rec
525   -- plsql record structure we must call the corresponding entity
526   -- business process
527   --
528   del(l_rec, p_effective_date, p_datetrack_mode);
529   --
530   -- Set the out arguments
531   --
532   p_object_version_number := l_rec.object_version_number;
533   p_effective_start_date  := l_rec.effective_start_date;
534   p_effective_end_date    := l_rec.effective_end_date;
535   --
536   hr_utility.set_location(' Leaving:'||l_proc, 10);
537 End del;
538 --
539 end ben_ctp_del;