[Home] [Help]
PACKAGE BODY: APPS.BEN_CPD_DEL
Source
1 Package Body ben_cpd_del as
2 /* $Header: becpdrhi.pkb 120.4.12020000.3 2013/01/02 07:16:14 kmsuresh ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_cpd_del.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< delete_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the actual dml delete logic. The functions of
17 -- this procedure are as follows:
18 -- 1) To set and unset the g_api_dml status as required (as we are about to
19 -- perform dml).
20 -- 2) To delete the specified row from the schema using the primary key in
21 -- the predicates.
22 -- 3) To trap any constraint violations that may have occurred.
23 -- 4) To raise any other errors.
24 --
25 -- Prerequisites:
26 -- This is an internal private procedure which must be called from the del
27 -- procedure.
28 --
29 -- In Parameters:
30 -- A Pl/Sql record structre.
31 --
32 -- Post Success:
33 -- The specified row will be delete from the schema.
34 --
35 -- Post Failure:
36 -- On the delete dml failure it is important to note that we always reset the
37 -- g_api_dml status to false.
38 -- If a child integrity constraint violation is raised the
39 -- constraint_error procedure will be called.
40 -- If any other error is reported, the error will be raised after the
41 -- g_api_dml status is reset.
42 --
43 -- Developer Implementation Notes:
44 -- None.
45 --
46 -- Access Status:
47 -- Internal Row Handler Use Only.
48 --
49 -- {End Of Comments}
50 -- ----------------------------------------------------------------------------
51 Procedure delete_dml
52 (p_rec in ben_cpd_shd.g_rec_type
53 ) is
54 --
55 l_proc varchar2(72) := g_package||'delete_dml';
56 --
57 Begin
58 hr_utility.set_location('Entering:'||l_proc, 5);
59 --
60 ben_cpd_shd.g_api_dml := true; -- Set the api dml status
61 --
62 -- Delete the ben_cwb_pl_dsgn row.
63 --
64 delete from ben_cwb_pl_dsgn
65 where pl_id = p_rec.pl_id
66 and lf_evt_ocrd_dt = p_rec.lf_evt_ocrd_dt
67 and oipl_id = p_rec.oipl_id;
68 --
69 ben_cpd_shd.g_api_dml := false; -- Unset the api dml status
70 --
71 hr_utility.set_location(' Leaving:'||l_proc, 10);
72 --
73 Exception
74 When hr_api.child_integrity_violated then
75 -- Child integrity has been violated
76 ben_cpd_shd.g_api_dml := false; -- Unset the api dml status
77 ben_cpd_shd.constraint_error
78 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
79 When Others Then
80 ben_cpd_shd.g_api_dml := false; -- Unset the api dml status
81 Raise;
82 End delete_dml;
83 --
84 -- ----------------------------------------------------------------------------
88 --
85 -- |------------------------------< pre_delete >------------------------------|
86 -- ----------------------------------------------------------------------------
87 -- {Start Of Comments}
89 -- Description:
90 -- This private procedure contains any processing which is required before
91 -- the delete dml.
92 --
93 -- Prerequisites:
94 -- This is an internal procedure which is called from the del procedure.
95 --
96 -- In Parameters:
97 -- A Pl/Sql record structre.
98 --
99 -- Post Success:
100 -- Processing continues.
101 --
102 -- Post Failure:
103 -- If an error has occurred, an error message and exception will be raised
104 -- but not handled.
105 --
106 -- Developer Implementation Notes:
107 -- Any pre-processing required before the delete dml is issued should be
108 -- coded within this procedure. It is important to note that any 3rd party
109 -- maintenance should be reviewed before placing in this procedure.
110 --
111 -- Access Status:
112 -- Internal Row Handler Use Only.
113 --
114 -- {End Of Comments}
115 -- ----------------------------------------------------------------------------
116 Procedure pre_delete(p_rec in ben_cpd_shd.g_rec_type) is
117 --
118 l_proc varchar2(72) := g_package||'pre_delete';
119 --
120 Begin
121 hr_utility.set_location('Entering:'||l_proc, 5);
122 --
123 hr_utility.set_location(' Leaving:'||l_proc, 10);
124 End pre_delete;
125 --
126 -- ----------------------------------------------------------------------------
127 -- |-----------------------------< post_delete >------------------------------|
128 -- ----------------------------------------------------------------------------
129 -- {Start Of Comments}
130 --
131 -- Description:
132 -- This private procedure contains any processing which is required after
133 -- the delete dml.
134 --
135 -- Prerequistes:
136 -- This is an internal procedure which is called from the del procedure.
137 --
138 -- In Parameters:
139 -- A Pl/Sql record structure.
140 --
141 -- Post Success:
142 -- Processing continues.
143 --
144 -- Post Failure:
145 -- If an error has occurred, an error message and exception will be raised
146 -- but not handled.
147 --
148 -- Developer Implementation Notes:
149 -- Any post-processing required after the delete dml is issued should be
150 -- coded within this procedure. It is important to note that any 3rd party
151 -- maintenance should be reviewed before placing in this procedure.
152 --
153 -- Access Status:
154 -- Internal Row Handler Use Only.
155 --
156 -- {End Of Comments}
157 -- -----------------------------------------------------------------------------
158 Procedure post_delete(p_rec in ben_cpd_shd.g_rec_type) is
159 --
160 l_proc varchar2(72) := g_package||'post_delete';
161 --
162 Begin
163 hr_utility.set_location('Entering:'||l_proc, 5);
164 begin
165 ben_cpd_rkd.after_delete
166 (p_pl_id
167 => p_rec.pl_id
168 ,p_oipl_id
169 => p_rec.oipl_id
170 ,p_lf_evt_ocrd_dt
171 => p_rec.lf_evt_ocrd_dt
172 ,p_effective_date_o
173 => ben_cpd_shd.g_old_rec.effective_date
174 ,p_name_o
175 => ben_cpd_shd.g_old_rec.name
176 ,p_group_pl_id_o
177 => ben_cpd_shd.g_old_rec.group_pl_id
178 ,p_group_oipl_id_o
179 => ben_cpd_shd.g_old_rec.group_oipl_id
180 ,p_opt_hidden_flag_o
181 => ben_cpd_shd.g_old_rec.opt_hidden_flag
182 ,p_opt_id_o
183 => ben_cpd_shd.g_old_rec.opt_id
184 ,p_pl_uom_o
185 => ben_cpd_shd.g_old_rec.pl_uom
186 ,p_pl_ordr_num_o
187 => ben_cpd_shd.g_old_rec.pl_ordr_num
188 ,p_oipl_ordr_num_o
189 => ben_cpd_shd.g_old_rec.oipl_ordr_num
190 ,p_pl_xchg_rate_o
191 => ben_cpd_shd.g_old_rec.pl_xchg_rate
192 ,p_opt_count_o
193 => ben_cpd_shd.g_old_rec.opt_count
194 ,p_uses_bdgt_flag_o
195 => ben_cpd_shd.g_old_rec.uses_bdgt_flag
196 ,p_prsrv_bdgt_cd_o
197 => ben_cpd_shd.g_old_rec.prsrv_bdgt_cd
198 ,p_upd_start_dt_o
199 => ben_cpd_shd.g_old_rec.upd_start_dt
200 ,p_upd_end_dt_o
201 => ben_cpd_shd.g_old_rec.upd_end_dt
202 ,p_approval_mode_o
203 => ben_cpd_shd.g_old_rec.approval_mode
204 ,p_enrt_perd_start_dt_o
205 => ben_cpd_shd.g_old_rec.enrt_perd_start_dt
206 ,p_enrt_perd_end_dt_o
207 => ben_cpd_shd.g_old_rec.enrt_perd_end_dt
208 ,p_yr_perd_start_dt_o
209 => ben_cpd_shd.g_old_rec.yr_perd_start_dt
210 ,p_yr_perd_end_dt_o
211 => ben_cpd_shd.g_old_rec.yr_perd_end_dt
212 ,p_wthn_yr_start_dt_o
213 => ben_cpd_shd.g_old_rec.wthn_yr_start_dt
214 ,p_wthn_yr_end_dt_o
215 => ben_cpd_shd.g_old_rec.wthn_yr_end_dt
216 ,p_enrt_perd_id_o
217 => ben_cpd_shd.g_old_rec.enrt_perd_id
218 ,p_yr_perd_id_o
219 => ben_cpd_shd.g_old_rec.yr_perd_id
220 ,p_business_group_id_o
221 => ben_cpd_shd.g_old_rec.business_group_id
222 ,p_perf_revw_strt_dt_o
223 => ben_cpd_shd.g_old_rec.perf_revw_strt_dt
224 ,p_asg_updt_eff_date_o
225 => ben_cpd_shd.g_old_rec.asg_updt_eff_date
226 ,p_emp_interview_typ_cd_o
227 => ben_cpd_shd.g_old_rec.emp_interview_typ_cd
228 ,p_salary_change_reason_o
229 => ben_cpd_shd.g_old_rec.salary_change_reason
230 ,p_ws_abr_id_o
231 => ben_cpd_shd.g_old_rec.ws_abr_id
232 ,p_ws_nnmntry_uom_o
233 => ben_cpd_shd.g_old_rec.ws_nnmntry_uom
234 ,p_ws_rndg_cd_o
238 ,p_dist_bdgt_abr_id_o
235 => ben_cpd_shd.g_old_rec.ws_rndg_cd
236 ,p_ws_sub_acty_typ_cd_o
237 => ben_cpd_shd.g_old_rec.ws_sub_acty_typ_cd
239 => ben_cpd_shd.g_old_rec.dist_bdgt_abr_id
240 ,p_dist_bdgt_nnmntry_uom_o
241 => ben_cpd_shd.g_old_rec.dist_bdgt_nnmntry_uom
242 ,p_dist_bdgt_rndg_cd_o
243 => ben_cpd_shd.g_old_rec.dist_bdgt_rndg_cd
244 ,p_ws_bdgt_abr_id_o
245 => ben_cpd_shd.g_old_rec.ws_bdgt_abr_id
246 ,p_ws_bdgt_nnmntry_uom_o
247 => ben_cpd_shd.g_old_rec.ws_bdgt_nnmntry_uom
248 ,p_ws_bdgt_rndg_cd_o
249 => ben_cpd_shd.g_old_rec.ws_bdgt_rndg_cd
250 ,p_rsrv_abr_id_o
251 => ben_cpd_shd.g_old_rec.rsrv_abr_id
252 ,p_rsrv_nnmntry_uom_o
253 => ben_cpd_shd.g_old_rec.rsrv_nnmntry_uom
254 ,p_rsrv_rndg_cd_o
255 => ben_cpd_shd.g_old_rec.rsrv_rndg_cd
256 ,p_elig_sal_abr_id_o
257 => ben_cpd_shd.g_old_rec.elig_sal_abr_id
258 ,p_elig_sal_nnmntry_uom_o
259 => ben_cpd_shd.g_old_rec.elig_sal_nnmntry_uom
260 ,p_elig_sal_rndg_cd_o
261 => ben_cpd_shd.g_old_rec.elig_sal_rndg_cd
262 ,p_misc1_abr_id_o
263 => ben_cpd_shd.g_old_rec.misc1_abr_id
264 ,p_misc1_nnmntry_uom_o
265 => ben_cpd_shd.g_old_rec.misc1_nnmntry_uom
266 ,p_misc1_rndg_cd_o
267 => ben_cpd_shd.g_old_rec.misc1_rndg_cd
268 ,p_misc2_abr_id_o
269 => ben_cpd_shd.g_old_rec.misc2_abr_id
270 ,p_misc2_nnmntry_uom_o
271 => ben_cpd_shd.g_old_rec.misc2_nnmntry_uom
272 ,p_misc2_rndg_cd_o
273 => ben_cpd_shd.g_old_rec.misc2_rndg_cd
274 ,p_misc3_abr_id_o
275 => ben_cpd_shd.g_old_rec.misc3_abr_id
276 ,p_misc3_nnmntry_uom_o
277 => ben_cpd_shd.g_old_rec.misc3_nnmntry_uom
278 ,p_misc3_rndg_cd_o
279 => ben_cpd_shd.g_old_rec.misc3_rndg_cd
280 ,p_stat_sal_abr_id_o
281 => ben_cpd_shd.g_old_rec.stat_sal_abr_id
282 ,p_stat_sal_nnmntry_uom_o
283 => ben_cpd_shd.g_old_rec.stat_sal_nnmntry_uom
284 ,p_stat_sal_rndg_cd_o
285 => ben_cpd_shd.g_old_rec.stat_sal_rndg_cd
286 ,p_rec_abr_id_o
287 => ben_cpd_shd.g_old_rec.rec_abr_id
288 ,p_rec_nnmntry_uom_o
289 => ben_cpd_shd.g_old_rec.rec_nnmntry_uom
290 ,p_rec_rndg_cd_o
291 => ben_cpd_shd.g_old_rec.rec_rndg_cd
292 ,p_tot_comp_abr_id_o
293 => ben_cpd_shd.g_old_rec.tot_comp_abr_id
294 ,p_tot_comp_nnmntry_uom_o
295 => ben_cpd_shd.g_old_rec.tot_comp_nnmntry_uom
296 ,p_tot_comp_rndg_cd_o
297 => ben_cpd_shd.g_old_rec.tot_comp_rndg_cd
298 ,p_oth_comp_abr_id_o
299 => ben_cpd_shd.g_old_rec.oth_comp_abr_id
300 ,p_oth_comp_nnmntry_uom_o
301 => ben_cpd_shd.g_old_rec.oth_comp_nnmntry_uom
302 ,p_oth_comp_rndg_cd_o
303 => ben_cpd_shd.g_old_rec.oth_comp_rndg_cd
304 ,p_actual_flag_o
305 => ben_cpd_shd.g_old_rec.actual_flag
306 ,p_acty_ref_perd_cd_o
307 => ben_cpd_shd.g_old_rec.acty_ref_perd_cd
308 ,p_legislation_code_o
309 => ben_cpd_shd.g_old_rec.legislation_code
310 ,p_pl_annulization_factor_o
311 => ben_cpd_shd.g_old_rec.pl_annulization_factor
312 ,p_pl_stat_cd_o
313 => ben_cpd_shd.g_old_rec.pl_stat_cd
314 ,p_uom_precision_o
315 => ben_cpd_shd.g_old_rec.uom_precision
316 ,p_ws_element_type_id_o
317 => ben_cpd_shd.g_old_rec.ws_element_type_id
318 ,p_ws_input_value_id_o
319 => ben_cpd_shd.g_old_rec.ws_input_value_id
320 ,p_data_freeze_date_o
321 => ben_cpd_shd.g_old_rec.data_freeze_date
322 ,p_ws_amt_edit_cd_o
323 => ben_cpd_shd.g_old_rec.ws_amt_edit_cd
324 ,p_ws_amt_edit_enf_cd_for_nul_o
325 => ben_cpd_shd.g_old_rec.ws_amt_edit_enf_cd_for_nulls
326 ,p_ws_over_budget_edit_cd_o
327 => ben_cpd_shd.g_old_rec.ws_over_budget_edit_cd
328 ,p_ws_over_budget_tol_pct_o
329 => ben_cpd_shd.g_old_rec.ws_over_budget_tolerance_pct
330 ,p_bdgt_over_budget_edit_cd_o
331 => ben_cpd_shd.g_old_rec.bdgt_over_budget_edit_cd
332 ,p_bdgt_over_budget_tol_pct_o
333 => ben_cpd_shd.g_old_rec.bdgt_over_budget_tolerance_pct
334 ,p_auto_distr_flag_o
335 => ben_cpd_shd.g_old_rec.auto_distr_flag
336 ,p_pqh_document_short_name_o
337 => ben_cpd_shd.g_old_rec.pqh_document_short_name
338 ,p_ovrid_rt_strt_dt_o
339 => ben_cpd_shd.g_old_rec.ovrid_rt_strt_dt
340 ,p_do_not_process_flag_o
341 => ben_cpd_shd.g_old_rec.do_not_process_flag
342 ,p_ovr_perf_revw_strt_dt_o
343 => ben_cpd_shd.g_old_rec.ovr_perf_revw_strt_dt
344 ,p_post_zero_salary_increase_o
345 => ben_cpd_shd.g_old_rec.post_zero_salary_increase
346 ,p_show_appraisals_n_days_o
347 => ben_cpd_shd.g_old_rec.show_appraisals_n_days
348 ,p_grade_range_validation_o
349 => ben_cpd_shd.g_old_rec.grade_range_validation
350 ,p_object_version_number_o
351 => ben_cpd_shd.g_old_rec.object_version_number
352 );
353 --
354 exception
355 --
356 when hr_api.cannot_find_prog_unit then
357 --
358 hr_api.cannot_find_prog_unit_error
359 (p_module_name => 'BEN_CWB_PL_DSGN'
360 ,p_hook_type => 'AD');
361 --
362 end;
363 --
364 hr_utility.set_location(' Leaving:'||l_proc, 10);
365 End post_delete;
366 --
367 -- ----------------------------------------------------------------------------
368 -- |---------------------------------< del >----------------------------------|
369 -- ----------------------------------------------------------------------------
370 Procedure del
371 (p_rec in ben_cpd_shd.g_rec_type
372 ) is
373 --
377 hr_utility.set_location('Entering:'||l_proc, 5);
374 l_proc varchar2(72) := g_package||'del';
375 --
376 Begin
378 --
379 -- We must lock the row which we need to delete.
380 --
381 ben_cpd_shd.lck
382 (p_rec.pl_id
383 ,p_rec.lf_evt_ocrd_dt
384 ,p_rec.oipl_id
385 ,p_rec.object_version_number
386 );
387 --
388 -- Call the supporting delete validate operation
389 --
390 ben_cpd_bus.delete_validate(p_rec);
391 --
392 -- Call to raise any errors on multi-message list
393 hr_multi_message.end_validation_set;
394 --
395 -- Call the supporting pre-delete operation
396 --
397 ben_cpd_del.pre_delete(p_rec);
398 --
399 -- Delete the row.
400 --
401 ben_cpd_del.delete_dml(p_rec);
402 --
403 -- Call the supporting post-delete operation
404 --
405 ben_cpd_del.post_delete(p_rec);
406 --
407 -- Call to raise any errors on multi-message list
408 hr_multi_message.end_validation_set;
409 --
410 End del;
411 --
412 -- ----------------------------------------------------------------------------
413 -- |---------------------------------< del >----------------------------------|
414 -- ----------------------------------------------------------------------------
415 Procedure del
416 (p_pl_id in number
417 ,p_lf_evt_ocrd_dt in date
418 ,p_oipl_id in number
419 ,p_object_version_number in number
420 ) is
421 --
422 l_rec ben_cpd_shd.g_rec_type;
423 l_proc varchar2(72) := g_package||'del';
424 --
425 Begin
426 hr_utility.set_location('Entering:'||l_proc, 5);
427 --
428 -- As the delete procedure accepts a plsql record structure we do need to
429 -- convert the arguments into the record structure.
430 -- We don't need to call the supplied conversion argument routine as we
431 -- only need a few attributes.
432 --
433 l_rec.pl_id := p_pl_id;
434 l_rec.lf_evt_ocrd_dt := p_lf_evt_ocrd_dt;
435 l_rec.oipl_id := p_oipl_id;
436 l_rec.object_version_number := p_object_version_number;
437 --
438 -- Having converted the arguments into the ben_cpd_rec
439 -- plsql record structure we must call the corresponding entity
440 -- business process
441 --
442 ben_cpd_del.del(l_rec);
443 --
444 hr_utility.set_location(' Leaving:'||l_proc, 10);
445 End del;
446 --
447 end ben_cpd_del;