DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_RTS_DEL

Source


1 Package Body ben_rts_del as
2 /* $Header: bertsrhi.pkb 120.1 2006/01/09 14:37 maagrawa noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ben_rts_del.';  -- Global package name
9 g_debug boolean := hr_utility.debug_enabled;
10 --
11 -- ----------------------------------------------------------------------------
12 -- |------------------------------< delete_dml >------------------------------|
13 -- ----------------------------------------------------------------------------
14 -- {Start Of Comments}
15 --
16 -- Description:
17 --   This procedure controls the actual dml delete logic. The functions of
18 --   this procedure are 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) To delete the specified row from the schema using the primary key in
22 --      the predicates.
23 --   3) To trap any constraint violations that may have occurred.
24 --   4) To raise any other errors.
25 --
26 -- Prerequisites:
27 --   This is an internal private procedure which must be called from the del
28 --   procedure.
29 --
30 -- In Parameters:
31 --   A Pl/Sql record structre.
32 --
33 -- Post Success:
34 --   The specified row will be delete from the schema.
35 --
36 -- Post Failure:
37 --   On the delete dml failure it is important to note that we always reset the
38 --   g_api_dml status to false.
39 --   If a child integrity constraint violation is raised the
40 --   constraint_error procedure will be called.
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 --   None.
46 --
47 -- Access Status:
48 --   Internal Row Handler Use Only.
49 --
50 -- {End Of Comments}
51 -- ----------------------------------------------------------------------------
52 Procedure delete_dml
53   (p_rec in ben_rts_shd.g_rec_type
54   ) is
55 --
56   l_proc  varchar2(72) := g_package||'delete_dml';
57 --
58 Begin
59   if g_debug then
60      hr_utility.set_location('Entering:'||l_proc, 5);
61   end if;
62   --
63   ben_rts_shd.g_api_dml := true;  -- Set the api dml status
64   --
65   -- Delete the ben_cwb_person_rates row.
66   --
67   delete from ben_cwb_person_rates
68   where group_per_in_ler_id = p_rec.group_per_in_ler_id
69     and pl_id = p_rec.pl_id
70     and oipl_id = p_rec.oipl_id;
71   --
72   ben_rts_shd.g_api_dml := false;   -- Unset the api dml status
73   --
74   if g_debug then
75      hr_utility.set_location(' Leaving:'||l_proc, 10);
76   end if;
77 --
78 Exception
79   When hr_api.child_integrity_violated then
80     -- Child integrity has been violated
81     ben_rts_shd.g_api_dml := false;   -- Unset the api dml status
82     ben_rts_shd.constraint_error
83       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
84   When Others Then
85     ben_rts_shd.g_api_dml := false;   -- Unset the api dml status
86     Raise;
87 End delete_dml;
88 --
89 -- ----------------------------------------------------------------------------
90 -- |------------------------------< pre_delete >------------------------------|
91 -- ----------------------------------------------------------------------------
92 -- {Start Of Comments}
93 --
94 -- Description:
95 --   This private procedure contains any processing which is required before
96 --   the delete dml.
97 --
98 -- Prerequisites:
99 --   This is an internal procedure which is called from the del procedure.
100 --
101 -- In Parameters:
102 --   A Pl/Sql record structre.
103 --
104 -- Post Success:
105 --   Processing continues.
106 --
107 -- Post Failure:
108 --   If an error has occurred, an error message and exception will be raised
109 --   but not handled.
110 --
111 -- Developer Implementation Notes:
112 --   Any pre-processing required before the delete dml is issued should be
113 --   coded within this procedure. It is important to note that any 3rd party
114 --   maintenance should be reviewed before placing in this procedure.
115 --
116 -- Access Status:
117 --   Internal Row Handler Use Only.
118 --
119 -- {End Of Comments}
120 -- ----------------------------------------------------------------------------
121 Procedure pre_delete(p_rec in ben_rts_shd.g_rec_type) is
122 --
123   l_proc  varchar2(72) := g_package||'pre_delete';
124 --
125 Begin
126   if g_debug then
127      hr_utility.set_location('Entering:'||l_proc, 5);
128   end if;
129   --
130   if g_debug then
131      hr_utility.set_location(' Leaving:'||l_proc, 10);
132   end if;
133 End pre_delete;
134 --
135 -- ----------------------------------------------------------------------------
136 -- |-----------------------------< post_delete >------------------------------|
137 -- ----------------------------------------------------------------------------
138 -- {Start Of Comments}
139 --
140 -- Description:
141 --   This private procedure contains any processing which is required after
142 --   the delete dml.
143 --
144 -- Prerequistes:
145 --   This is an internal procedure which is called from the del procedure.
146 --
147 -- In Parameters:
148 --   A Pl/Sql record structure.
149 --
150 -- Post Success:
151 --   Processing continues.
152 --
153 -- Post Failure:
154 --   If an error has occurred, an error message and exception will be raised
155 --   but not handled.
156 --
157 -- Developer Implementation Notes:
158 --   Any post-processing required after the delete dml is issued should be
159 --   coded within this procedure. It is important to note that any 3rd party
160 --   maintenance should be reviewed before placing in this procedure.
161 --
162 -- Access Status:
163 --   Internal Row Handler Use Only.
164 --
165 -- {End Of Comments}
166 -- -----------------------------------------------------------------------------
167 Procedure post_delete(p_rec in ben_rts_shd.g_rec_type) is
168 --
169   l_proc  varchar2(72) := g_package||'post_delete';
170 --
171 Begin
172   if g_debug then
173      hr_utility.set_location('Entering:'||l_proc, 5);
174   end if;
175   begin
176     --
177     ben_rts_rkd.after_delete
178       (p_person_rate_id
179       => p_rec.person_rate_id
180       ,p_group_per_in_ler_id_o
181       => ben_rts_shd.g_old_rec.group_per_in_ler_id
182       ,p_pl_id_o
183       => ben_rts_shd.g_old_rec.pl_id
184       ,p_oipl_id_o
185       => ben_rts_shd.g_old_rec.oipl_id
186       ,p_group_pl_id_o
187       => ben_rts_shd.g_old_rec.group_pl_id
188       ,p_group_oipl_id_o
189       => ben_rts_shd.g_old_rec.group_oipl_id
190       ,p_lf_evt_ocrd_dt_o
191       => ben_rts_shd.g_old_rec.lf_evt_ocrd_dt
192       ,p_person_id_o
193       => ben_rts_shd.g_old_rec.person_id
194       ,p_assignment_id_o
195       => ben_rts_shd.g_old_rec.assignment_id
196       ,p_elig_flag_o
197       => ben_rts_shd.g_old_rec.elig_flag
198       ,p_ws_val_o
199       => ben_rts_shd.g_old_rec.ws_val
200       ,p_ws_mn_val_o
201       => ben_rts_shd.g_old_rec.ws_mn_val
202       ,p_ws_mx_val_o
203       => ben_rts_shd.g_old_rec.ws_mx_val
204       ,p_ws_incr_val_o
205       => ben_rts_shd.g_old_rec.ws_incr_val
206       ,p_elig_sal_val_o
207       => ben_rts_shd.g_old_rec.elig_sal_val
208       ,p_stat_sal_val_o
209       => ben_rts_shd.g_old_rec.stat_sal_val
210       ,p_oth_comp_val_o
211       => ben_rts_shd.g_old_rec.oth_comp_val
212       ,p_tot_comp_val_o
213       => ben_rts_shd.g_old_rec.tot_comp_val
214       ,p_misc1_val_o
215       => ben_rts_shd.g_old_rec.misc1_val
216       ,p_misc2_val_o
217       => ben_rts_shd.g_old_rec.misc2_val
218       ,p_misc3_val_o
219       => ben_rts_shd.g_old_rec.misc3_val
220       ,p_rec_val_o
221       => ben_rts_shd.g_old_rec.rec_val
222       ,p_rec_mn_val_o
223       => ben_rts_shd.g_old_rec.rec_mn_val
224       ,p_rec_mx_val_o
225       => ben_rts_shd.g_old_rec.rec_mx_val
226       ,p_rec_incr_val_o
227       => ben_rts_shd.g_old_rec.rec_incr_val
228       ,p_ws_val_last_upd_date_o
229       => ben_rts_shd.g_old_rec.ws_val_last_upd_date
230       ,p_ws_val_last_upd_by_o
231       => ben_rts_shd.g_old_rec.ws_val_last_upd_by
232       ,p_pay_proposal_id_o
233       => ben_rts_shd.g_old_rec.pay_proposal_id
234       ,p_element_entry_value_id_o
235       => ben_rts_shd.g_old_rec.element_entry_value_id
236       ,p_inelig_rsn_cd_o
237       => ben_rts_shd.g_old_rec.inelig_rsn_cd
238       ,p_elig_ovrid_dt_o
239       => ben_rts_shd.g_old_rec.elig_ovrid_dt
240       ,p_elig_ovrid_person_id_o
241       => ben_rts_shd.g_old_rec.elig_ovrid_person_id
242       ,p_copy_dist_bdgt_val_o
243       => ben_rts_shd.g_old_rec.copy_dist_bdgt_val
244       ,p_copy_ws_bdgt_val_o
245       => ben_rts_shd.g_old_rec.copy_ws_bdgt_val
246       ,p_copy_rsrv_val_o
247       => ben_rts_shd.g_old_rec.copy_rsrv_val
248       ,p_copy_dist_bdgt_mn_val_o
249       => ben_rts_shd.g_old_rec.copy_dist_bdgt_mn_val
250       ,p_copy_dist_bdgt_mx_val_o
251       => ben_rts_shd.g_old_rec.copy_dist_bdgt_mx_val
252       ,p_copy_dist_bdgt_incr_val_o
253       => ben_rts_shd.g_old_rec.copy_dist_bdgt_incr_val
254       ,p_copy_ws_bdgt_mn_val_o
255       => ben_rts_shd.g_old_rec.copy_ws_bdgt_mn_val
256       ,p_copy_ws_bdgt_mx_val_o
257       => ben_rts_shd.g_old_rec.copy_ws_bdgt_mx_val
258       ,p_copy_ws_bdgt_incr_val_o
259       => ben_rts_shd.g_old_rec.copy_ws_bdgt_incr_val
260       ,p_copy_rsrv_mn_val_o
261       => ben_rts_shd.g_old_rec.copy_rsrv_mn_val
262       ,p_copy_rsrv_mx_val_o
263       => ben_rts_shd.g_old_rec.copy_rsrv_mx_val
264       ,p_copy_rsrv_incr_val_o
265       => ben_rts_shd.g_old_rec.copy_rsrv_incr_val
266       ,p_copy_dist_bdgt_iss_val_o
267       => ben_rts_shd.g_old_rec.copy_dist_bdgt_iss_val
268       ,p_copy_ws_bdgt_iss_val_o
269       => ben_rts_shd.g_old_rec.copy_ws_bdgt_iss_val
270       ,p_copy_dist_bdgt_iss_date_o
271       => ben_rts_shd.g_old_rec.copy_dist_bdgt_iss_date
272       ,p_copy_ws_bdgt_iss_date_o
273       => ben_rts_shd.g_old_rec.copy_ws_bdgt_iss_date
274       ,p_comp_posting_date_o
275       => ben_rts_shd.g_old_rec.comp_posting_date
276       ,p_ws_rt_start_date_o
277       => ben_rts_shd.g_old_rec.ws_rt_start_date
278       ,p_currency_o
279       => ben_rts_shd.g_old_rec.currency
280       ,p_object_version_number_o
281       => ben_rts_shd.g_old_rec.object_version_number
282       );
283     --
284   exception
285     --
286     when hr_api.cannot_find_prog_unit then
287       --
288       hr_api.cannot_find_prog_unit_error
289         (p_module_name => 'BEN_CWB_PERSON_RATES'
290         ,p_hook_type   => 'AD');
291       --
292   end;
293   --
294   if g_debug then
295      hr_utility.set_location(' Leaving:'||l_proc, 10);
296   end if;
297 End post_delete;
298 --
299 -- ----------------------------------------------------------------------------
300 -- |---------------------------------< del >----------------------------------|
301 -- ----------------------------------------------------------------------------
302 Procedure del
303   (p_rec              in ben_rts_shd.g_rec_type
304   ) is
305 --
306   l_proc  varchar2(72) := g_package||'del';
307 --
308 Begin
309   if g_debug then
310      hr_utility.set_location('Entering:'||l_proc, 5);
311   end if;
312   --
313   -- We must lock the row which we need to delete.
314   --
315   ben_rts_shd.lck
316     (p_rec.group_per_in_ler_id
317     ,p_rec.pl_id
318     ,p_rec.oipl_id
319     ,p_rec.object_version_number
320     );
321   --
322   -- Call the supporting delete validate operation
323   --
324   ben_rts_bus.delete_validate(p_rec);
325   --
326   -- Call to raise any errors on multi-message list
327   hr_multi_message.end_validation_set;
328   --
329   -- Call the supporting pre-delete operation
330   --
331   ben_rts_del.pre_delete(p_rec);
332   --
333   -- Delete the row.
334   --
335   ben_rts_del.delete_dml(p_rec);
336   --
337   -- Call the supporting post-delete operation
338   --
339   ben_rts_del.post_delete(p_rec);
340   --
341   -- Call to raise any errors on multi-message list
342   hr_multi_message.end_validation_set;
343   --
344 End del;
345 --
346 -- ----------------------------------------------------------------------------
347 -- |---------------------------------< del >----------------------------------|
348 -- ----------------------------------------------------------------------------
349 Procedure del
350   (p_group_per_in_ler_id                  in     number
351   ,p_pl_id                                in     number
352   ,p_oipl_id                              in     number
353   ,p_object_version_number                in     number
354   ) is
355 --
356   l_rec   ben_rts_shd.g_rec_type;
357   l_proc  varchar2(72) := g_package||'del';
358 --
359 Begin
360   if g_debug then
361      hr_utility.set_location('Entering:'||l_proc, 5);
362   end if;
363   --
364   -- As the delete procedure accepts a plsql record structure we do need to
365   -- convert the  arguments into the record structure.
366   -- We don't need to call the supplied conversion argument routine as we
367   -- only need a few attributes.
368   --
369   l_rec.group_per_in_ler_id := p_group_per_in_ler_id;
370   l_rec.pl_id := p_pl_id;
371   l_rec.oipl_id := p_oipl_id;
372   l_rec.object_version_number := p_object_version_number;
373   --
374   -- Having converted the arguments into the ben_rts_rec
375   -- plsql record structure we must call the corresponding entity
376   -- business process
377   --
378   ben_rts_del.del(l_rec);
379   --
380   if g_debug then
381      hr_utility.set_location(' Leaving:'||l_proc, 10);
382   end if;
383 End del;
384 --
385 end ben_rts_del;