DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_BPD_DEL

Source


1 Package Body per_bpd_del as
2 /* $Header: pebpdrhi.pkb 115.6 2002/12/02 13:52:43 apholt noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_bpd_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(p_rec in per_bpd_shd.g_rec_type) is
52 --
53   l_proc  varchar2(72) := g_package||'delete_dml';
54 --
55 Begin
56   hr_utility.set_location('Entering:'||l_proc, 5);
57   --
58   --
59   -- Delete the per_bf_payment_details row.
60   --
61   delete from per_bf_payment_details
62   where payment_detail_id = p_rec.payment_detail_id;
63   --
64   --
65   hr_utility.set_location(' Leaving:'||l_proc, 10);
66 --
67 Exception
68   When hr_api.child_integrity_violated then
69     -- Child integrity has been violated
70     per_bpd_shd.constraint_error
71       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
72   When Others Then
73     Raise;
74 End delete_dml;
75 --
76 -- ----------------------------------------------------------------------------
77 -- |------------------------------< pre_delete >------------------------------|
78 -- ----------------------------------------------------------------------------
79 -- {Start Of Comments}
80 --
81 -- Description:
82 --   This private procedure contains any processing which is required before
83 --   the delete dml.
84 --
85 -- Prerequisites:
86 --   This is an internal procedure which is called from the del procedure.
87 --
88 -- In Parameters:
89 --   A Pl/Sql record structre.
90 --
91 -- Post Success:
92 --   Processing continues.
93 --
94 -- Post Failure:
95 --   If an error has occurred, an error message and exception will be raised
96 --   but not handled.
97 --
98 -- Developer Implementation Notes:
99 --   Any pre-processing required before the delete dml is issued should be
100 --   coded within this procedure. It is important to note that any 3rd party
101 --   maintenance should be reviewed before placing in this procedure.
102 --
103 -- Access Status:
104 --   Internal Row Handler Use Only.
105 --
106 -- {End Of Comments}
107 -- ----------------------------------------------------------------------------
108 Procedure pre_delete(p_rec in per_bpd_shd.g_rec_type) is
109 --
110   l_proc  varchar2(72) := g_package||'pre_delete';
111 --
112 Begin
113   hr_utility.set_location('Entering:'||l_proc, 5);
114   --
115   hr_utility.set_location(' Leaving:'||l_proc, 10);
116 End pre_delete;
117 --
118 -- ----------------------------------------------------------------------------
119 -- |-----------------------------< post_delete >------------------------------|
120 -- ----------------------------------------------------------------------------
121 -- {Start Of Comments}
122 --
123 -- Description:
124 --   This private procedure contains any processing which is required after the
125 --   delete dml.
126 --
127 -- Prerequistes:
128 --   This is an internal procedure which is called from the del procedure.
129 --
130 -- In Parameters:
131 --   A Pl/Sql record structure.
132 --
133 -- Post Success:
134 --   Processing continues.
135 --
136 -- Post Failure:
137 --   If an error has occurred, an error message and exception will be raised
138 --   but not handled.
139 --
140 -- Developer Implementation Notes:
141 --   Any post-processing required after the delete dml is issued should be
142 --   coded within this procedure. It is important to note that any 3rd party
143 --   maintenance should be reviewed before placing in this procedure.
144 --
145 -- Access Status:
146 --   Internal Row Handler Use Only.
147 --
148 -- {End Of Comments}
149 -- -----------------------------------------------------------------------------
150 Procedure post_delete(p_rec in per_bpd_shd.g_rec_type) is
151 --
152   l_proc  varchar2(72) := g_package||'post_delete';
153 --
154 Begin
155   hr_utility.set_location('Entering:'||l_proc, 5);
156     begin
157     --
158     per_bpd_rkd.after_delete
159       (
160       p_payment_detail_id
161         => p_rec.payment_detail_id,
162       p_processed_assignment_id_o
163       => per_bpd_shd.g_old_rec.processed_assignment_id,
164       p_personal_payment_method_id_o
165       => per_bpd_shd.g_old_rec.personal_payment_method_id,
166       p_business_group_id_o
167       => per_bpd_shd.g_old_rec.business_group_id,
168       p_check_number_o
169       => per_bpd_shd.g_old_rec.check_number,
170       p_payment_date_o
171       => per_bpd_shd.g_old_rec.payment_date,
172       p_amount_o
173       => per_bpd_shd.g_old_rec.amount,
174       p_check_type_o
175       => per_bpd_shd.g_old_rec.check_type,
176       p_object_version_number_o
177       => per_bpd_shd.g_old_rec.object_version_number,
178       p_bpd_attribute_category_o
179       => per_bpd_shd.g_old_rec.bpd_attribute_category,
180       p_bpd_attribute1_o
181       => per_bpd_shd.g_old_rec.bpd_attribute1,
182       p_bpd_attribute2_o
183       => per_bpd_shd.g_old_rec.bpd_attribute2,
184       p_bpd_attribute3_o
185       => per_bpd_shd.g_old_rec.bpd_attribute3,
186       p_bpd_attribute4_o
187       => per_bpd_shd.g_old_rec.bpd_attribute4,
188       p_bpd_attribute5_o
189       => per_bpd_shd.g_old_rec.bpd_attribute5,
190       p_bpd_attribute6_o
191       => per_bpd_shd.g_old_rec.bpd_attribute6,
192       p_bpd_attribute7_o
193       => per_bpd_shd.g_old_rec.bpd_attribute7,
194       p_bpd_attribute8_o
195       => per_bpd_shd.g_old_rec.bpd_attribute8,
196       p_bpd_attribute9_o
197       => per_bpd_shd.g_old_rec.bpd_attribute9,
198       p_bpd_attribute10_o
199       => per_bpd_shd.g_old_rec.bpd_attribute10,
200       p_bpd_attribute11_o
201       => per_bpd_shd.g_old_rec.bpd_attribute11,
202       p_bpd_attribute12_o
203       => per_bpd_shd.g_old_rec.bpd_attribute12,
204       p_bpd_attribute13_o
205       => per_bpd_shd.g_old_rec.bpd_attribute13,
206       p_bpd_attribute14_o
207       => per_bpd_shd.g_old_rec.bpd_attribute14,
208       p_bpd_attribute15_o
209       => per_bpd_shd.g_old_rec.bpd_attribute15,
210       p_bpd_attribute16_o
211       => per_bpd_shd.g_old_rec.bpd_attribute16,
212       p_bpd_attribute17_o
213       => per_bpd_shd.g_old_rec.bpd_attribute17,
214       p_bpd_attribute18_o
215       => per_bpd_shd.g_old_rec.bpd_attribute18,
216       p_bpd_attribute19_o
217       => per_bpd_shd.g_old_rec.bpd_attribute19,
218       p_bpd_attribute20_o
219       => per_bpd_shd.g_old_rec.bpd_attribute20,
220       p_bpd_attribute21_o
221       => per_bpd_shd.g_old_rec.bpd_attribute21,
222       p_bpd_attribute22_o
223       => per_bpd_shd.g_old_rec.bpd_attribute22,
224       p_bpd_attribute23_o
225       => per_bpd_shd.g_old_rec.bpd_attribute23,
226       p_bpd_attribute24_o
227       => per_bpd_shd.g_old_rec.bpd_attribute24,
228       p_bpd_attribute25_o
229       => per_bpd_shd.g_old_rec.bpd_attribute25,
230       p_bpd_attribute26_o
231       => per_bpd_shd.g_old_rec.bpd_attribute26,
232       p_bpd_attribute27_o
233       => per_bpd_shd.g_old_rec.bpd_attribute27,
234       p_bpd_attribute28_o
235       => per_bpd_shd.g_old_rec.bpd_attribute28,
236       p_bpd_attribute29_o
237       => per_bpd_shd.g_old_rec.bpd_attribute29,
238       p_bpd_attribute30_o
239       => per_bpd_shd.g_old_rec.bpd_attribute30
240       );
241     --
242   exception
243     --
244     when hr_api.cannot_find_prog_unit then
245       --
246       hr_api.cannot_find_prog_unit_error
247         (p_module_name => 'PER_BF_PAYMENT_DETAILS'
248         ,p_hook_type   => 'AD');
249       --
250   end;
251   --
252   hr_utility.set_location(' Leaving:'||l_proc, 10);
253 End post_delete;
254 --
255 -- ----------------------------------------------------------------------------
256 -- |---------------------------------< del >----------------------------------|
257 -- ----------------------------------------------------------------------------
258 Procedure del
259   (
260   p_rec	      in per_bpd_shd.g_rec_type
261   ) is
262 --
263   l_proc  varchar2(72) := g_package||'del';
264 --
265 Begin
266   hr_utility.set_location('Entering:'||l_proc, 5);
267   --
268   -- We must lock the row which we need to delete.
269   --
270   per_bpd_shd.lck
271     (
272       p_rec.payment_detail_id,
273        p_rec.object_version_number
274     );
275   --
276   -- Call the supporting delete validate operation
277   --
278   per_bpd_bus.delete_validate(p_rec);
279   --
280   -- Call the supporting pre-delete operation
281   --
282   pre_delete(p_rec);
283   --
284   -- Delete the row.
285   --
286   delete_dml(p_rec);
287   --
288   -- Call the supporting post-delete operation
289   --
290   post_delete(p_rec);
291 End del;
292 --
293 -- ----------------------------------------------------------------------------
294 -- |---------------------------------< del >----------------------------------|
295 -- ----------------------------------------------------------------------------
296 Procedure del
297   (
298 p_payment_detail_id                    in number,
299   p_object_version_number              in number
300   ) is
301 --
302   l_rec	  per_bpd_shd.g_rec_type;
303   l_proc  varchar2(72) := g_package||'del';
304 --
305 Begin
306   hr_utility.set_location('Entering:'||l_proc, 5);
307   --
308   -- As the delete procedure accepts a plsql record structure we do need to
309   -- convert the  arguments into the record structure.
310   -- We don't need to call the supplied conversion argument routine as we
311   -- only need a few attributes.
312   --
313   l_rec.payment_detail_id := p_payment_detail_id;
314   l_rec.object_version_number := p_object_version_number;
315   --
316   -- Having converted the arguments into the per_bpd_rec
317   -- plsql record structure we must call the corresponding entity
318   -- business process
319   --
320   del(l_rec);
321   --
322   hr_utility.set_location(' Leaving:'||l_proc, 10);
323 End del;
324 --
325 end per_bpd_del;