[Home] [Help]
PACKAGE BODY: APPS.PAY_BTL_DEL
Source
1 Package Body pay_btl_del as
2 /* $Header: pybtlrhi.pkb 120.7 2005/11/09 08:16:09 mkataria noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' pay_btl_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 pay_btl_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 pay_btl_shd.g_api_dml := true; -- Set the api dml status
61 --
62 -- Delete the pay_batch_lines row.
63 --
64 delete from pay_batch_lines
65 where batch_line_id = p_rec.batch_line_id;
66 --
67 pay_btl_shd.g_api_dml := false; -- Unset the api dml status
68 --
69 hr_utility.set_location(' Leaving:'||l_proc, 10);
70 --
71 Exception
72 When hr_api.child_integrity_violated then
73 -- Child integrity has been violated
74 pay_btl_shd.g_api_dml := false; -- Unset the api dml status
75 pay_btl_shd.constraint_error
76 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
77 When Others Then
78 pay_btl_shd.g_api_dml := false; -- Unset the api dml status
79 Raise;
80 End delete_dml;
81 --
82 -- ----------------------------------------------------------------------------
83 -- |------------------------------< pre_delete >------------------------------|
84 -- ----------------------------------------------------------------------------
85 -- {Start Of Comments}
86 --
87 -- Description:
88 -- This private procedure contains any processing which is required before
89 -- the delete dml.
90 --
91 -- Prerequisites:
92 -- This is an internal procedure which is called from the del procedure.
93 --
94 -- In Parameters:
95 -- A Pl/Sql record structre.
96 --
97 -- Post Success:
98 -- Processing continues.
99 --
100 -- Post Failure:
101 -- If an error has occurred, an error message and exception will be raised
102 -- but not handled.
103 --
104 -- Developer Implementation Notes:
105 -- Any pre-processing required before the delete dml is issued should be
106 -- coded within this procedure. It is important to note that any 3rd party
107 -- maintenance should be reviewed before placing in this procedure.
108 --
109 -- Access Status:
110 -- Internal Row Handler Use Only.
111 --
112 -- {End Of Comments}
113 -- ----------------------------------------------------------------------------
114 Procedure pre_delete(p_rec in pay_btl_shd.g_rec_type) is
115 --
116 l_proc varchar2(72) := g_package||'pre_delete';
117 --
118 Begin
119 hr_utility.set_location('Entering:'||l_proc, 5);
120 --
121 hr_utility.set_location(' Leaving:'||l_proc, 10);
122 End pre_delete;
123 --
124 -- ----------------------------------------------------------------------------
125 -- |-----------------------------< post_delete >------------------------------|
126 -- ----------------------------------------------------------------------------
127 -- {Start Of Comments}
128 --
129 -- Description:
130 -- This private procedure contains any processing which is required after the
131 -- delete dml.
132 --
133 -- Prerequistes:
134 -- This is an internal procedure which is called from the del procedure.
135 --
136 -- In Parameters:
137 -- A Pl/Sql record structure.
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 -- Any post-processing required after the delete dml is issued should be
148 -- coded within this procedure. It is important to note that any 3rd party
149 -- maintenance should be reviewed before placing in this procedure.
150 --
151 -- Access Status:
152 -- Internal Row Handler Use Only.
153 --
154 -- {End Of Comments}
155 -- -----------------------------------------------------------------------------
156 Procedure post_delete(p_rec in pay_btl_shd.g_rec_type) is
157 --
158 l_proc varchar2(72) := g_package||'post_delete';
159 --
160 Begin
161 hr_utility.set_location('Entering:'||l_proc, 5);
162 begin
163 --
164 pay_btl_rkd.after_delete
165 (p_batch_line_id
166 => p_rec.batch_line_id
167 ,p_cost_allocation_keyflex_id_o
168 => pay_btl_shd.g_old_rec.cost_allocation_keyflex_id
169 ,p_element_type_id_o
170 => pay_btl_shd.g_old_rec.element_type_id
171 ,p_assignment_id_o
172 => pay_btl_shd.g_old_rec.assignment_id
173 ,p_batch_id_o
174 => pay_btl_shd.g_old_rec.batch_id
175 ,p_batch_line_status_o
176 => pay_btl_shd.g_old_rec.batch_line_status
177 ,p_assignment_number_o
178 => pay_btl_shd.g_old_rec.assignment_number
179 ,p_batch_sequence_o
180 => pay_btl_shd.g_old_rec.batch_sequence
181 ,p_concatenated_segments_o
182 => pay_btl_shd.g_old_rec.concatenated_segments
183 ,p_effective_date_o
184 => pay_btl_shd.g_old_rec.effective_date
185 ,p_element_name_o
186 => pay_btl_shd.g_old_rec.element_name
187 ,p_entry_type_o
188 => pay_btl_shd.g_old_rec.entry_type
189 ,p_reason_o
190 => pay_btl_shd.g_old_rec.reason
191 ,p_segment1_o
192 => pay_btl_shd.g_old_rec.segment1
193 ,p_segment2_o
194 => pay_btl_shd.g_old_rec.segment2
195 ,p_segment3_o
196 => pay_btl_shd.g_old_rec.segment3
197 ,p_segment4_o
198 => pay_btl_shd.g_old_rec.segment4
199 ,p_segment5_o
200 => pay_btl_shd.g_old_rec.segment5
201 ,p_segment6_o
202 => pay_btl_shd.g_old_rec.segment6
203 ,p_segment7_o
204 => pay_btl_shd.g_old_rec.segment7
205 ,p_segment8_o
206 => pay_btl_shd.g_old_rec.segment8
207 ,p_segment9_o
208 => pay_btl_shd.g_old_rec.segment9
209 ,p_segment10_o
210 => pay_btl_shd.g_old_rec.segment10
211 ,p_segment11_o
212 => pay_btl_shd.g_old_rec.segment11
213 ,p_segment12_o
214 => pay_btl_shd.g_old_rec.segment12
215 ,p_segment13_o
216 => pay_btl_shd.g_old_rec.segment13
217 ,p_segment14_o
218 => pay_btl_shd.g_old_rec.segment14
219 ,p_segment15_o
220 => pay_btl_shd.g_old_rec.segment15
221 ,p_segment16_o
222 => pay_btl_shd.g_old_rec.segment16
223 ,p_segment17_o
224 => pay_btl_shd.g_old_rec.segment17
225 ,p_segment18_o
226 => pay_btl_shd.g_old_rec.segment18
227 ,p_segment19_o
228 => pay_btl_shd.g_old_rec.segment19
229 ,p_segment20_o
230 => pay_btl_shd.g_old_rec.segment20
231 ,p_segment21_o
232 => pay_btl_shd.g_old_rec.segment21
233 ,p_segment22_o
234 => pay_btl_shd.g_old_rec.segment22
235 ,p_segment23_o
236 => pay_btl_shd.g_old_rec.segment23
237 ,p_segment24_o
238 => pay_btl_shd.g_old_rec.segment24
239 ,p_segment25_o
240 => pay_btl_shd.g_old_rec.segment25
241 ,p_segment26_o
242 => pay_btl_shd.g_old_rec.segment26
243 ,p_segment27_o
244 => pay_btl_shd.g_old_rec.segment27
245 ,p_segment28_o
246 => pay_btl_shd.g_old_rec.segment28
247 ,p_segment29_o
248 => pay_btl_shd.g_old_rec.segment29
249 ,p_segment30_o
250 => pay_btl_shd.g_old_rec.segment30
251 ,p_value_1_o
252 => pay_btl_shd.g_old_rec.value_1
253 ,p_value_2_o
254 => pay_btl_shd.g_old_rec.value_2
255 ,p_value_3_o
256 => pay_btl_shd.g_old_rec.value_3
257 ,p_value_4_o
258 => pay_btl_shd.g_old_rec.value_4
259 ,p_value_5_o
260 => pay_btl_shd.g_old_rec.value_5
261 ,p_value_6_o
262 => pay_btl_shd.g_old_rec.value_6
263 ,p_value_7_o
264 => pay_btl_shd.g_old_rec.value_7
265 ,p_value_8_o
266 => pay_btl_shd.g_old_rec.value_8
267 ,p_value_9_o
268 => pay_btl_shd.g_old_rec.value_9
269 ,p_value_10_o
270 => pay_btl_shd.g_old_rec.value_10
271 ,p_value_11_o
272 => pay_btl_shd.g_old_rec.value_11
273 ,p_value_12_o
274 => pay_btl_shd.g_old_rec.value_12
275 ,p_value_13_o
276 => pay_btl_shd.g_old_rec.value_13
277 ,p_value_14_o
278 => pay_btl_shd.g_old_rec.value_14
279 ,p_value_15_o
280 => pay_btl_shd.g_old_rec.value_15
281 ,p_attribute_category_o
282 => pay_btl_shd.g_old_rec.attribute_category
283 ,p_attribute1_o
284 => pay_btl_shd.g_old_rec.attribute1
285 ,p_attribute2_o
286 => pay_btl_shd.g_old_rec.attribute2
287 ,p_attribute3_o
288 => pay_btl_shd.g_old_rec.attribute3
289 ,p_attribute4_o
290 => pay_btl_shd.g_old_rec.attribute4
291 ,p_attribute5_o
292 => pay_btl_shd.g_old_rec.attribute5
293 ,p_attribute6_o
294 => pay_btl_shd.g_old_rec.attribute6
295 ,p_attribute7_o
296 => pay_btl_shd.g_old_rec.attribute7
297 ,p_attribute8_o
298 => pay_btl_shd.g_old_rec.attribute8
299 ,p_attribute9_o
300 => pay_btl_shd.g_old_rec.attribute9
301 ,p_attribute10_o
302 => pay_btl_shd.g_old_rec.attribute10
303 ,p_attribute11_o
304 => pay_btl_shd.g_old_rec.attribute11
305 ,p_attribute12_o
306 => pay_btl_shd.g_old_rec.attribute12
307 ,p_attribute13_o
308 => pay_btl_shd.g_old_rec.attribute13
309 ,p_attribute14_o
310 => pay_btl_shd.g_old_rec.attribute14
311 ,p_attribute15_o
312 => pay_btl_shd.g_old_rec.attribute15
313 ,p_attribute16_o
314 => pay_btl_shd.g_old_rec.attribute16
315 ,p_attribute17_o
316 => pay_btl_shd.g_old_rec.attribute17
317 ,p_attribute18_o
318 => pay_btl_shd.g_old_rec.attribute18
319 ,p_attribute19_o
320 => pay_btl_shd.g_old_rec.attribute19
321 ,p_attribute20_o
322 => pay_btl_shd.g_old_rec.attribute20
323 ,p_entry_information_category_o
324 => pay_btl_shd.g_old_rec.entry_information_category
325 ,p_entry_information1_o
326 => pay_btl_shd.g_old_rec.entry_information1
327 ,p_entry_information2_o
328 => pay_btl_shd.g_old_rec.entry_information2
329 ,p_entry_information3_o
330 => pay_btl_shd.g_old_rec.entry_information3
331 ,p_entry_information4_o
332 => pay_btl_shd.g_old_rec.entry_information4
333 ,p_entry_information5_o
334 => pay_btl_shd.g_old_rec.entry_information5
335 ,p_entry_information6_o
336 => pay_btl_shd.g_old_rec.entry_information6
337 ,p_entry_information7_o
338 => pay_btl_shd.g_old_rec.entry_information7
339 ,p_entry_information8_o
340 => pay_btl_shd.g_old_rec.entry_information8
341 ,p_entry_information9_o
342 => pay_btl_shd.g_old_rec.entry_information9
343 ,p_entry_information10_o
344 => pay_btl_shd.g_old_rec.entry_information10
345 ,p_entry_information11_o
346 => pay_btl_shd.g_old_rec.entry_information11
347 ,p_entry_information12_o
348 => pay_btl_shd.g_old_rec.entry_information12
349 ,p_entry_information13_o
350 => pay_btl_shd.g_old_rec.entry_information13
351 ,p_entry_information14_o
352 => pay_btl_shd.g_old_rec.entry_information14
353 ,p_entry_information15_o
354 => pay_btl_shd.g_old_rec.entry_information15
355 ,p_entry_information16_o
356 => pay_btl_shd.g_old_rec.entry_information16
357 ,p_entry_information17_o
358 => pay_btl_shd.g_old_rec.entry_information17
359 ,p_entry_information18_o
360 => pay_btl_shd.g_old_rec.entry_information18
361 ,p_entry_information19_o
362 => pay_btl_shd.g_old_rec.entry_information19
363 ,p_entry_information20_o
364 => pay_btl_shd.g_old_rec.entry_information20
365 ,p_entry_information21_o
366 => pay_btl_shd.g_old_rec.entry_information21
367 ,p_entry_information22_o
368 => pay_btl_shd.g_old_rec.entry_information22
369 ,p_entry_information23_o
370 => pay_btl_shd.g_old_rec.entry_information23
371 ,p_entry_information24_o
372 => pay_btl_shd.g_old_rec.entry_information24
373 ,p_entry_information25_o
374 => pay_btl_shd.g_old_rec.entry_information25
375 ,p_entry_information26_o
376 => pay_btl_shd.g_old_rec.entry_information26
377 ,p_entry_information27_o
378 => pay_btl_shd.g_old_rec.entry_information27
379 ,p_entry_information28_o
380 => pay_btl_shd.g_old_rec.entry_information28
381 ,p_entry_information29_o
382 => pay_btl_shd.g_old_rec.entry_information29
383 ,p_entry_information30_o
384 => pay_btl_shd.g_old_rec.entry_information30
385 ,p_date_earned_o
386 => pay_btl_shd.g_old_rec.date_earned
387 ,p_personal_payment_method_id_o
388 => pay_btl_shd.g_old_rec.personal_payment_method_id
389 ,p_subpriority_o
390 => pay_btl_shd.g_old_rec.subpriority
391 ,p_effective_start_date_o
392 => pay_btl_shd.g_old_rec.effective_start_date
393 ,p_effective_end_date_o
394 => pay_btl_shd.g_old_rec.effective_end_date
395 ,p_object_version_number_o
396 => pay_btl_shd.g_old_rec.object_version_number
397 );
398 --
399 exception
400 --
401 when hr_api.cannot_find_prog_unit then
402 --
403 hr_api.cannot_find_prog_unit_error
404 (p_module_name => 'PAY_BATCH_LINES'
405 ,p_hook_type => 'AD');
406 --
407 end;
408 --
409 hr_utility.set_location(' Leaving:'||l_proc, 10);
410 End post_delete;
411 --
412 -- ----------------------------------------------------------------------------
413 -- |---------------------------------< del >----------------------------------|
414 -- ----------------------------------------------------------------------------
415 Procedure del
416 (p_rec in pay_btl_shd.g_rec_type
417 ) is
418 --
419 l_proc varchar2(72) := g_package||'del';
420 --
421 Begin
422 hr_utility.set_location('Entering:'||l_proc, 5);
423 --
424 -- We must lock the row which we need to delete.
425 --
426 pay_btl_shd.lck
427 (p_rec.batch_line_id
428 ,p_rec.object_version_number
429 );
430 --
431 -- Call the supporting delete validate operation
432 --
433 pay_btl_bus.delete_validate(p_rec);
434 --
435 -- Call the supporting pre-delete operation
436 --
437 pay_btl_del.pre_delete(p_rec);
438 --
439 -- Delete the row.
440 --
441 pay_btl_del.delete_dml(p_rec);
442 --
443 -- Call the supporting post-delete operation
444 --
445 pay_btl_del.post_delete(p_rec);
446 --
447 End del;
448 --
449 -- ----------------------------------------------------------------------------
450 -- |---------------------------------< del >----------------------------------|
451 -- ----------------------------------------------------------------------------
452 Procedure del
453 (p_batch_line_id in number
454 ,p_object_version_number in number
455 ) is
456 --
457 l_rec pay_btl_shd.g_rec_type;
458 l_proc varchar2(72) := g_package||'del';
459 --
460 Begin
461 hr_utility.set_location('Entering:'||l_proc, 5);
462 --
463 -- As the delete procedure accepts a plsql record structure we do need to
464 -- convert the arguments into the record structure.
465 -- We don't need to call the supplied conversion argument routine as we
466 -- only need a few attributes.
467 --
468 l_rec.batch_line_id := p_batch_line_id;
469 l_rec.object_version_number := p_object_version_number;
470 --
471 -- Having converted the arguments into the pay_btl_rec
472 -- plsql record structure we must call the corresponding entity
473 -- business process
474 --
475 pay_btl_del.del(l_rec);
476 --
477 hr_utility.set_location(' Leaving:'||l_proc, 10);
478 End del;
479 --
480 end pay_btl_del;