1 Package Body ben_pnd_upd as
2 /* $Header: bepndrhi.pkb 120.0.12010000.2 2008/08/05 15:15:31 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_pnd_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_update_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the execution of dml from the datetrack mode
17 -- of CORRECTION only. It is important to note that the object version
18 -- number is only increment by 1 because the datetrack correction is
19 -- soley for one datetracked row.
20 -- This procedure controls the actual dml update logic. The functions of this
21 -- procedure are as follows:
22 -- 1) Get the next object_version_number.
23 -- 2) To set and unset the g_api_dml status as required (as we are about to
24 -- perform dml).
25 -- 3) To update the specified row in the schema using the primary key in
26 -- the predicates.
27 -- 4) To trap any constraint violations that may have occurred.
28 -- 5) To raise any other errors.
29 --
30 -- Prerequisites:
31 -- This is an internal private procedure which must be called from the
32 -- update_dml procedure.
33 --
34 -- In Parameters:
35 -- A Pl/Sql record structre.
36 --
37 -- Post Success:
38 -- The specified row will be updated in the schema.
39 --
40 -- Post Failure:
41 -- On the update dml failure it is important to note that we always reset the
42 -- g_api_dml status to false.
43 -- If a check or unique integrity constraint violation is raised the
44 -- constraint_error procedure will be called.
45 -- If any other error is reported, the error will be raised after the
46 -- g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 -- The update 'set' arguments list should be modified if any of your
50 -- attributes are not updateable.
51 --
52 -- Access Status:
53 -- Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_update_dml
58 (p_rec in out nocopy ben_pnd_shd.g_rec_type,
59 p_effective_date in date,
60 p_datetrack_mode in varchar2,
61 p_validation_start_date in date,
62 p_validation_end_date in date) is
63 --
64 l_proc varchar2(72) := g_package||'dt_update_dml';
65 --
66 Begin
67 hr_utility.set_location('Entering:'||l_proc, 5);
68 --
69 If (p_datetrack_mode = 'CORRECTION') then
70 hr_utility.set_location(l_proc, 10);
71 --
72 -- Because we are updating a row we must get the next object
73 -- version number.
74 --
75 p_rec.object_version_number :=
76 dt_api.get_object_version_number
77 (p_base_table_name => 'ben_pl_dpnt_cvg_ctfn_f',
78 p_base_key_column => 'pl_dpnt_cvg_ctfn_id',
79 p_base_key_value => p_rec.pl_dpnt_cvg_ctfn_id);
80 --
81 ben_pnd_shd.g_api_dml := true; -- Set the api dml status
82 --
83 -- Update the ben_pl_dpnt_cvg_ctfn_f Row
84 --
85 update ben_pl_dpnt_cvg_ctfn_f
86 set
87 pl_dpnt_cvg_ctfn_id = p_rec.pl_dpnt_cvg_ctfn_id,
88 pl_id = p_rec.pl_id,
89 pfd_flag = p_rec.pfd_flag,
90 ctfn_rqd_when_rl = p_rec.ctfn_rqd_when_rl,
91 lack_ctfn_sspnd_enrt_flag = p_rec.lack_ctfn_sspnd_enrt_flag,
92 dpnt_cvg_ctfn_typ_cd = p_rec.dpnt_cvg_ctfn_typ_cd,
93 rqd_flag = p_rec.rqd_flag,
94 rlshp_typ_cd = p_rec.rlshp_typ_cd,
95 business_group_id = p_rec.business_group_id,
96 pnd_attribute_category = p_rec.pnd_attribute_category,
97 pnd_attribute1 = p_rec.pnd_attribute1,
98 pnd_attribute2 = p_rec.pnd_attribute2,
99 pnd_attribute3 = p_rec.pnd_attribute3,
100 pnd_attribute4 = p_rec.pnd_attribute4,
101 pnd_attribute5 = p_rec.pnd_attribute5,
102 pnd_attribute6 = p_rec.pnd_attribute6,
103 pnd_attribute7 = p_rec.pnd_attribute7,
104 pnd_attribute8 = p_rec.pnd_attribute8,
105 pnd_attribute9 = p_rec.pnd_attribute9,
106 pnd_attribute10 = p_rec.pnd_attribute10,
107 pnd_attribute11 = p_rec.pnd_attribute11,
108 pnd_attribute12 = p_rec.pnd_attribute12,
109 pnd_attribute13 = p_rec.pnd_attribute13,
110 pnd_attribute14 = p_rec.pnd_attribute14,
111 pnd_attribute15 = p_rec.pnd_attribute15,
112 pnd_attribute16 = p_rec.pnd_attribute16,
113 pnd_attribute17 = p_rec.pnd_attribute17,
114 pnd_attribute18 = p_rec.pnd_attribute18,
115 pnd_attribute19 = p_rec.pnd_attribute19,
116 pnd_attribute20 = p_rec.pnd_attribute20,
117 pnd_attribute21 = p_rec.pnd_attribute21,
118 pnd_attribute22 = p_rec.pnd_attribute22,
119 pnd_attribute23 = p_rec.pnd_attribute23,
120 pnd_attribute24 = p_rec.pnd_attribute24,
121 pnd_attribute25 = p_rec.pnd_attribute25,
122 pnd_attribute26 = p_rec.pnd_attribute26,
123 pnd_attribute27 = p_rec.pnd_attribute27,
124 pnd_attribute28 = p_rec.pnd_attribute28,
125 pnd_attribute29 = p_rec.pnd_attribute29,
126 pnd_attribute30 = p_rec.pnd_attribute30,
127 request_id = p_rec.request_id,
128 program_application_id = p_rec.program_application_id,
129 program_id = p_rec.program_id,
130 program_update_date = p_rec.program_update_date,
131 object_version_number = p_rec.object_version_number
132 where pl_dpnt_cvg_ctfn_id = p_rec.pl_dpnt_cvg_ctfn_id
133 and effective_start_date = p_validation_start_date
134 and effective_end_date = p_validation_end_date;
135 --
136 ben_pnd_shd.g_api_dml := false; -- Unset the api dml status
137 --
138 -- Set the effective start and end dates
139 --
140 p_rec.effective_start_date := p_validation_start_date;
141 p_rec.effective_end_date := p_validation_end_date;
142 End If;
143 --
144 hr_utility.set_location(' Leaving:'||l_proc, 15);
145 Exception
146 When hr_api.check_integrity_violated Then
147 -- A check constraint has been violated
148 ben_pnd_shd.g_api_dml := false; -- Unset the api dml status
149 ben_pnd_shd.constraint_error
150 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
151 When hr_api.unique_integrity_violated Then
152 -- Unique integrity has been violated
153 ben_pnd_shd.g_api_dml := false; -- Unset the api dml status
154 ben_pnd_shd.constraint_error
155 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
156 When Others Then
157 ben_pnd_shd.g_api_dml := false; -- Unset the api dml status
158 Raise;
159 End dt_update_dml;
160 --
161 -- ----------------------------------------------------------------------------
162 -- |------------------------------< update_dml >------------------------------|
163 -- ----------------------------------------------------------------------------
164 -- {Start Of Comments}
165 --
166 -- Description:
167 -- This procedure calls the dt_update_dml control logic which handles
168 -- the actual datetrack dml.
169 --
170 -- Prerequisites:
171 -- This is an internal private procedure which must be called from the upd
172 -- procedure.
173 --
174 -- In Parameters:
175 -- A Pl/Sql record structre.
176 --
177 -- Post Success:
178 -- Processing contines.
179 --
180 -- Post Failure:
181 -- No specific error handling is required within this procedure.
182 --
183 -- Developer Implementation Notes:
184 -- The update 'set' arguments list should be modified if any of your
185 -- attributes are not updateable.
186 --
187 -- Access Status:
188 -- Internal Row Handler Use Only.
189 --
190 -- {End Of Comments}
191 -- ----------------------------------------------------------------------------
192 Procedure update_dml
193 (p_rec in out nocopy ben_pnd_shd.g_rec_type,
194 p_effective_date in date,
195 p_datetrack_mode in varchar2,
196 p_validation_start_date in date,
197 p_validation_end_date in date) is
198 --
199 l_proc varchar2(72) := g_package||'update_dml';
200 --
201 Begin
202 hr_utility.set_location('Entering:'||l_proc, 5);
203 --
204 dt_update_dml(p_rec => p_rec,
205 p_effective_date => p_effective_date,
206 p_datetrack_mode => p_datetrack_mode,
207 p_validation_start_date => p_validation_start_date,
208 p_validation_end_date => p_validation_end_date);
209 --
210 hr_utility.set_location(' Leaving:'||l_proc, 10);
211 End update_dml;
212 --
213 -- ----------------------------------------------------------------------------
214 -- |----------------------------< dt_pre_update >-----------------------------|
215 -- ----------------------------------------------------------------------------
216 -- {Start Of Comments}
217 --
218 -- Description:
219 -- The dt_pre_update procedure controls the execution
220 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
221 -- and UPDATE_CHANGE_INSERT only. The execution required is as
222 -- follows:
223 --
224 -- 1) Providing the datetrack update mode is not 'CORRECTION'
225 -- then set the effective end date of the current row (this
226 -- will be the validation_start_date - 1).
227 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
228 -- corresponding delete_dml process to delete any future rows
229 -- where the effective_start_date is greater than or equal to
230 -- the validation_start_date.
231 -- 3) Call the insert_dml process to insert the new updated row
232 -- details..
233 --
234 -- Prerequisites:
235 -- This is an internal procedure which is called from the
236 -- pre_update procedure.
237 --
238 -- In Parameters:
239 --
240 -- Post Success:
241 -- Processing continues.
242 --
243 -- Post Failure:
244 -- If an error has occurred, an error message and exception will be raised
245 -- but not handled.
246 --
247 -- Developer Implementation Notes:
248 -- This is an internal procedure which is required by Datetrack. Don't
249 -- remove or modify.
250 --
251 -- Access Status:
252 -- Internal Row Handler Use Only.
253 --
254 -- {End Of Comments}
255 -- ----------------------------------------------------------------------------
256 Procedure dt_pre_update
257 (p_rec in out nocopy ben_pnd_shd.g_rec_type,
258 p_effective_date in date,
259 p_datetrack_mode in varchar2,
260 p_validation_start_date in date,
261 p_validation_end_date in date) is
262 --
263 l_proc varchar2(72) := g_package||'dt_pre_update';
264 l_dummy_version_number number;
265 --
266 Begin
267 hr_utility.set_location('Entering:'||l_proc, 5);
268 If (p_datetrack_mode <> 'CORRECTION') then
269 hr_utility.set_location(l_proc, 10);
270 --
271 -- Update the current effective end date
272 --
273 ben_pnd_shd.upd_effective_end_date
274 (p_effective_date => p_effective_date,
275 p_base_key_value => p_rec.pl_dpnt_cvg_ctfn_id,
276 p_new_effective_end_date => (p_validation_start_date - 1),
277 p_validation_start_date => p_validation_start_date,
278 p_validation_end_date => p_validation_end_date,
279 p_object_version_number => l_dummy_version_number);
280 --
281 If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
282 hr_utility.set_location(l_proc, 15);
283 --
284 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
285 -- delete any future rows
286 --
287 ben_pnd_del.delete_dml
288 (p_rec => p_rec,
289 p_effective_date => p_effective_date,
290 p_datetrack_mode => p_datetrack_mode,
291 p_validation_start_date => p_validation_start_date,
292 p_validation_end_date => p_validation_end_date);
293 End If;
294 hr_utility.set_location(l_proc, 20);
295 --
296 -- We must now insert the updated row
297 --
298 ben_pnd_ins.insert_dml
299 (p_rec => p_rec,
300 p_effective_date => p_effective_date,
301 p_datetrack_mode => p_datetrack_mode,
302 p_validation_start_date => p_validation_start_date,
303 p_validation_end_date => p_validation_end_date);
304 End If;
305 hr_utility.set_location(' Leaving:'||l_proc, 20);
306 End dt_pre_update;
307 --
308 -- ----------------------------------------------------------------------------
309 -- |------------------------------< pre_update >------------------------------|
310 -- ----------------------------------------------------------------------------
311 -- {Start Of Comments}
312 --
313 -- Description:
314 -- This private procedure contains any processing which is required before
315 -- the update dml.
316 --
317 -- Prerequisites:
318 -- This is an internal procedure which is called from the upd procedure.
319 --
320 -- In Parameters:
321 -- A Pl/Sql record structre.
322 --
323 -- Post Success:
324 -- Processing continues.
325 --
326 -- Post Failure:
327 -- If an error has occurred, an error message and exception will be raised
328 -- but not handled.
329 --
330 -- Developer Implementation Notes:
331 -- Any pre-processing required before the update dml is issued should be
332 -- coded within this procedure. It is important to note that any 3rd party
333 -- maintenance should be reviewed before placing in this procedure. The call
334 -- to the dt_update_dml procedure should NOT be removed.
335 --
336 -- Access Status:
337 -- Internal Row Handler Use Only.
338 --
339 -- {End Of Comments}
340 -- ----------------------------------------------------------------------------
341 Procedure pre_update
342 (p_rec in out nocopy ben_pnd_shd.g_rec_type,
343 p_effective_date in date,
344 p_datetrack_mode in varchar2,
345 p_validation_start_date in date,
346 p_validation_end_date in date) is
347 --
348 l_proc varchar2(72) := g_package||'pre_update';
349 --
350 Begin
351 hr_utility.set_location('Entering:'||l_proc, 5);
352 --
353 --
354 --
355 dt_pre_update
356 (p_rec => p_rec,
357 p_effective_date => p_effective_date,
358 p_datetrack_mode => p_datetrack_mode,
359 p_validation_start_date => p_validation_start_date,
360 p_validation_end_date => p_validation_end_date);
361 --
362 hr_utility.set_location(' Leaving:'||l_proc, 10);
363 End pre_update;
364 --
365 -- ----------------------------------------------------------------------------
366 -- |-----------------------------< post_update >------------------------------|
367 -- ----------------------------------------------------------------------------
368 -- {Start Of Comments}
369 --
370 -- Description:
371 -- This private procedure contains any processing which is required after the
372 -- update dml.
373 --
374 -- Prerequisites:
375 -- This is an internal procedure which is called from the upd procedure.
376 --
377 -- In Parameters:
378 -- A Pl/Sql record structre.
379 --
380 -- Post Success:
381 -- Processing continues.
382 --
383 -- Post Failure:
384 -- If an error has occurred, an error message and exception will be raised
385 -- but not handled.
386 --
387 -- Developer Implementation Notes:
388 -- Any post-processing required after the update dml is issued should be
389 -- coded within this procedure. It is important to note that any 3rd party
390 -- maintenance should be reviewed before placing in this procedure.
391 --
392 -- Access Status:
393 -- Internal Row Handler Use Only.
394 --
395 -- {End Of Comments}
396 -- ----------------------------------------------------------------------------
397 Procedure post_update
398 (p_rec in ben_pnd_shd.g_rec_type,
399 p_effective_date in date,
400 p_datetrack_mode in varchar2,
401 p_validation_start_date in date,
402 p_validation_end_date in date) is
403 --
404 l_proc varchar2(72) := g_package||'post_update';
405 --
406 Begin
407 hr_utility.set_location('Entering:'||l_proc, 5);
408 --
409 --
410 -- Start of API User Hook for post_update.
411 --
412 begin
413 --
414 ben_pnd_rku.after_update
415 (
416 p_pl_dpnt_cvg_ctfn_id =>p_rec.pl_dpnt_cvg_ctfn_id
417 ,p_effective_start_date =>p_rec.effective_start_date
418 ,p_effective_end_date =>p_rec.effective_end_date
419 ,p_pl_id =>p_rec.pl_id
420 ,p_pfd_flag =>p_rec.pfd_flag
421 ,p_ctfn_rqd_when_rl =>p_rec.ctfn_rqd_when_rl
422 ,p_lack_ctfn_sspnd_enrt_flag =>p_rec.lack_ctfn_sspnd_enrt_flag
423 ,p_dpnt_cvg_ctfn_typ_cd =>p_rec.dpnt_cvg_ctfn_typ_cd
424 ,p_rqd_flag =>p_rec.rqd_flag
425 ,p_rlshp_typ_cd =>p_rec.rlshp_typ_cd
426 ,p_business_group_id =>p_rec.business_group_id
427 ,p_pnd_attribute_category =>p_rec.pnd_attribute_category
428 ,p_pnd_attribute1 =>p_rec.pnd_attribute1
429 ,p_pnd_attribute2 =>p_rec.pnd_attribute2
430 ,p_pnd_attribute3 =>p_rec.pnd_attribute3
431 ,p_pnd_attribute4 =>p_rec.pnd_attribute4
432 ,p_pnd_attribute5 =>p_rec.pnd_attribute5
433 ,p_pnd_attribute6 =>p_rec.pnd_attribute6
434 ,p_pnd_attribute7 =>p_rec.pnd_attribute7
435 ,p_pnd_attribute8 =>p_rec.pnd_attribute8
436 ,p_pnd_attribute9 =>p_rec.pnd_attribute9
437 ,p_pnd_attribute10 =>p_rec.pnd_attribute10
438 ,p_pnd_attribute11 =>p_rec.pnd_attribute11
439 ,p_pnd_attribute12 =>p_rec.pnd_attribute12
440 ,p_pnd_attribute13 =>p_rec.pnd_attribute13
441 ,p_pnd_attribute14 =>p_rec.pnd_attribute14
442 ,p_pnd_attribute15 =>p_rec.pnd_attribute15
443 ,p_pnd_attribute16 =>p_rec.pnd_attribute16
444 ,p_pnd_attribute17 =>p_rec.pnd_attribute17
445 ,p_pnd_attribute18 =>p_rec.pnd_attribute18
446 ,p_pnd_attribute19 =>p_rec.pnd_attribute19
447 ,p_pnd_attribute20 =>p_rec.pnd_attribute20
448 ,p_pnd_attribute21 =>p_rec.pnd_attribute21
449 ,p_pnd_attribute22 =>p_rec.pnd_attribute22
450 ,p_pnd_attribute23 =>p_rec.pnd_attribute23
451 ,p_pnd_attribute24 =>p_rec.pnd_attribute24
452 ,p_pnd_attribute25 =>p_rec.pnd_attribute25
453 ,p_pnd_attribute26 =>p_rec.pnd_attribute26
454 ,p_pnd_attribute27 =>p_rec.pnd_attribute27
455 ,p_pnd_attribute28 =>p_rec.pnd_attribute28
456 ,p_pnd_attribute29 =>p_rec.pnd_attribute29
457 ,p_pnd_attribute30 =>p_rec.pnd_attribute30
458 ,p_request_id =>p_rec.request_id
459 ,p_program_application_id =>p_rec.program_application_id
460 ,p_program_id =>p_rec.program_id
461 ,p_program_update_date =>p_rec.program_update_date
462 ,p_object_version_number =>p_rec.object_version_number
463 ,p_effective_date =>p_effective_date
464 ,p_datetrack_mode =>p_datetrack_mode
465 ,p_validation_start_date =>p_validation_start_date
466 ,p_validation_end_date =>p_validation_end_date
467 ,p_effective_start_date_o =>ben_pnd_shd.g_old_rec.effective_start_date
468 ,p_effective_end_date_o =>ben_pnd_shd.g_old_rec.effective_end_date
469 ,p_pl_id_o =>ben_pnd_shd.g_old_rec.pl_id
470 ,p_pfd_flag_o =>ben_pnd_shd.g_old_rec.pfd_flag
471 ,p_ctfn_rqd_when_rl_o =>ben_pnd_shd.g_old_rec.ctfn_rqd_when_rl
472 ,p_lack_ctfn_sspnd_enrt_flag_o =>ben_pnd_shd.g_old_rec.lack_ctfn_sspnd_enrt_flag
473 ,p_dpnt_cvg_ctfn_typ_cd_o =>ben_pnd_shd.g_old_rec.dpnt_cvg_ctfn_typ_cd
474 ,p_rqd_flag_o =>ben_pnd_shd.g_old_rec.rqd_flag
475 ,p_rlshp_typ_cd_o =>ben_pnd_shd.g_old_rec.rlshp_typ_cd
476 ,p_business_group_id_o =>ben_pnd_shd.g_old_rec.business_group_id
477 ,p_pnd_attribute_category_o =>ben_pnd_shd.g_old_rec.pnd_attribute_category
478 ,p_pnd_attribute1_o =>ben_pnd_shd.g_old_rec.pnd_attribute1
479 ,p_pnd_attribute2_o =>ben_pnd_shd.g_old_rec.pnd_attribute2
480 ,p_pnd_attribute3_o =>ben_pnd_shd.g_old_rec.pnd_attribute3
481 ,p_pnd_attribute4_o =>ben_pnd_shd.g_old_rec.pnd_attribute4
482 ,p_pnd_attribute5_o =>ben_pnd_shd.g_old_rec.pnd_attribute5
483 ,p_pnd_attribute6_o =>ben_pnd_shd.g_old_rec.pnd_attribute6
484 ,p_pnd_attribute7_o =>ben_pnd_shd.g_old_rec.pnd_attribute7
485 ,p_pnd_attribute8_o =>ben_pnd_shd.g_old_rec.pnd_attribute8
486 ,p_pnd_attribute9_o =>ben_pnd_shd.g_old_rec.pnd_attribute9
487 ,p_pnd_attribute10_o =>ben_pnd_shd.g_old_rec.pnd_attribute10
488 ,p_pnd_attribute11_o =>ben_pnd_shd.g_old_rec.pnd_attribute11
489 ,p_pnd_attribute12_o =>ben_pnd_shd.g_old_rec.pnd_attribute12
490 ,p_pnd_attribute13_o =>ben_pnd_shd.g_old_rec.pnd_attribute13
491 ,p_pnd_attribute14_o =>ben_pnd_shd.g_old_rec.pnd_attribute14
492 ,p_pnd_attribute15_o =>ben_pnd_shd.g_old_rec.pnd_attribute15
493 ,p_pnd_attribute16_o =>ben_pnd_shd.g_old_rec.pnd_attribute16
494 ,p_pnd_attribute17_o =>ben_pnd_shd.g_old_rec.pnd_attribute17
495 ,p_pnd_attribute18_o =>ben_pnd_shd.g_old_rec.pnd_attribute18
496 ,p_pnd_attribute19_o =>ben_pnd_shd.g_old_rec.pnd_attribute19
497 ,p_pnd_attribute20_o =>ben_pnd_shd.g_old_rec.pnd_attribute20
498 ,p_pnd_attribute21_o =>ben_pnd_shd.g_old_rec.pnd_attribute21
499 ,p_pnd_attribute22_o =>ben_pnd_shd.g_old_rec.pnd_attribute22
500 ,p_pnd_attribute23_o =>ben_pnd_shd.g_old_rec.pnd_attribute23
501 ,p_pnd_attribute24_o =>ben_pnd_shd.g_old_rec.pnd_attribute24
502 ,p_pnd_attribute25_o =>ben_pnd_shd.g_old_rec.pnd_attribute25
503 ,p_pnd_attribute26_o =>ben_pnd_shd.g_old_rec.pnd_attribute26
504 ,p_pnd_attribute27_o =>ben_pnd_shd.g_old_rec.pnd_attribute27
505 ,p_pnd_attribute28_o =>ben_pnd_shd.g_old_rec.pnd_attribute28
506 ,p_pnd_attribute29_o =>ben_pnd_shd.g_old_rec.pnd_attribute29
507 ,p_pnd_attribute30_o =>ben_pnd_shd.g_old_rec.pnd_attribute30
508 ,p_request_id_o =>ben_pnd_shd.g_old_rec.request_id
509 ,p_program_application_id_o =>ben_pnd_shd.g_old_rec.program_application_id
510 ,p_program_id_o =>ben_pnd_shd.g_old_rec.program_id
511 ,p_program_update_date_o =>ben_pnd_shd.g_old_rec.program_update_date
512 ,p_object_version_number_o =>ben_pnd_shd.g_old_rec.object_version_number
513 );
514 --
515 exception
516 --
517 when hr_api.cannot_find_prog_unit then
518 --
519 hr_api.cannot_find_prog_unit_error
520 (p_module_name => 'ben_pl_dpnt_cvg_ctfn_f'
521 ,p_hook_type => 'AU');
522 --
523 end;
524 --
525 -- End of API User Hook for post_update.
526 --
527 --
528 hr_utility.set_location(' Leaving:'||l_proc, 10);
529 End post_update;
530 --
531 -- ----------------------------------------------------------------------------
532 -- |-----------------------------< convert_defs >-----------------------------|
533 -- ----------------------------------------------------------------------------
534 -- {Start Of Comments}
535 --
536 -- Description:
537 -- The Convert_Defs procedure has one very important function:
538 -- It must return the record structure for the row with all system defaulted
539 -- values converted into its corresponding parameter value for update. When
540 -- we attempt to update a row through the Upd process , certain
541 -- parameters can be defaulted which enables flexibility in the calling of
542 -- the upd process (e.g. only attributes which need to be updated need to be
543 -- specified). For the upd process to determine which attributes
544 -- have NOT been specified we need to check if the parameter has a reserved
545 -- system default value. Therefore, for all parameters which have a
546 -- corresponding reserved system default mechanism specified we need to
547 -- check if a system default is being used. If a system default is being
548 -- used then we convert the defaulted value into its corresponding attribute
549 -- value held in the g_old_rec data structure.
550 --
551 -- Prerequisites:
552 -- This private function can only be called from the upd process.
553 --
554 -- In Parameters:
555 -- A Pl/Sql record structre.
556 --
557 -- Post Success:
558 -- The record structure will be returned with all system defaulted parameter
559 -- values converted into its current row attribute value.
560 --
561 -- Post Failure:
562 -- No direct error handling is required within this function. Any possible
563 -- errors within this procedure will be a PL/SQL value error due to conversion
564 -- of datatypes or data lengths.
565 --
566 -- Developer Implementation Notes:
567 -- None.
568 --
569 -- Access Status:
570 -- Internal Row Handler Use Only.
571 --
572 -- {End Of Comments}
573 -- ----------------------------------------------------------------------------
574 Procedure convert_defs(p_rec in out nocopy ben_pnd_shd.g_rec_type) is
575 --
576 l_proc varchar2(72) := g_package||'convert_defs';
577 --
578 Begin
579 --
580 hr_utility.set_location('Entering:'||l_proc, 5);
581 --
582 -- We must now examine each argument value in the
583 -- p_rec plsql record structure
584 -- to see if a system default is being used. If a system default
585 -- is being used then we must set to the 'current' argument value.
586 --
587 If (p_rec.pl_id = hr_api.g_number) then
588 p_rec.pl_id :=
589 ben_pnd_shd.g_old_rec.pl_id;
590 End If;
591 If (p_rec.pfd_flag = hr_api.g_varchar2) then
592 p_rec.pfd_flag :=
593 ben_pnd_shd.g_old_rec.pfd_flag;
594 End If;
595 If (p_rec.ctfn_rqd_when_rl = hr_api.g_number) then
596 p_rec.ctfn_rqd_when_rl :=
597 ben_pnd_shd.g_old_rec.ctfn_rqd_when_rl;
598 End If;
599 If (p_rec.lack_ctfn_sspnd_enrt_flag = hr_api.g_varchar2) then
600 p_rec.lack_ctfn_sspnd_enrt_flag :=
601 ben_pnd_shd.g_old_rec.lack_ctfn_sspnd_enrt_flag;
602 End If;
603 If (p_rec.dpnt_cvg_ctfn_typ_cd = hr_api.g_varchar2) then
604 p_rec.dpnt_cvg_ctfn_typ_cd :=
605 ben_pnd_shd.g_old_rec.dpnt_cvg_ctfn_typ_cd;
606 End If;
607 If (p_rec.rqd_flag = hr_api.g_varchar2) then
608 p_rec.rqd_flag :=
609 ben_pnd_shd.g_old_rec.rqd_flag;
610 End If;
611 If (p_rec.rlshp_typ_cd = hr_api.g_varchar2) then
612 p_rec.rlshp_typ_cd :=
613 ben_pnd_shd.g_old_rec.rlshp_typ_cd;
614 End If;
615 If (p_rec.business_group_id = hr_api.g_number) then
616 p_rec.business_group_id :=
617 ben_pnd_shd.g_old_rec.business_group_id;
618 End If;
619 If (p_rec.pnd_attribute_category = hr_api.g_varchar2) then
620 p_rec.pnd_attribute_category :=
621 ben_pnd_shd.g_old_rec.pnd_attribute_category;
622 End If;
623 If (p_rec.pnd_attribute1 = hr_api.g_varchar2) then
624 p_rec.pnd_attribute1 :=
625 ben_pnd_shd.g_old_rec.pnd_attribute1;
626 End If;
627 If (p_rec.pnd_attribute2 = hr_api.g_varchar2) then
628 p_rec.pnd_attribute2 :=
629 ben_pnd_shd.g_old_rec.pnd_attribute2;
630 End If;
631 If (p_rec.pnd_attribute3 = hr_api.g_varchar2) then
632 p_rec.pnd_attribute3 :=
633 ben_pnd_shd.g_old_rec.pnd_attribute3;
634 End If;
635 If (p_rec.pnd_attribute4 = hr_api.g_varchar2) then
636 p_rec.pnd_attribute4 :=
637 ben_pnd_shd.g_old_rec.pnd_attribute4;
638 End If;
639 If (p_rec.pnd_attribute5 = hr_api.g_varchar2) then
640 p_rec.pnd_attribute5 :=
641 ben_pnd_shd.g_old_rec.pnd_attribute5;
642 End If;
643 If (p_rec.pnd_attribute6 = hr_api.g_varchar2) then
644 p_rec.pnd_attribute6 :=
645 ben_pnd_shd.g_old_rec.pnd_attribute6;
646 End If;
647 If (p_rec.pnd_attribute7 = hr_api.g_varchar2) then
648 p_rec.pnd_attribute7 :=
649 ben_pnd_shd.g_old_rec.pnd_attribute7;
650 End If;
651 If (p_rec.pnd_attribute8 = hr_api.g_varchar2) then
652 p_rec.pnd_attribute8 :=
653 ben_pnd_shd.g_old_rec.pnd_attribute8;
654 End If;
655 If (p_rec.pnd_attribute9 = hr_api.g_varchar2) then
656 p_rec.pnd_attribute9 :=
657 ben_pnd_shd.g_old_rec.pnd_attribute9;
658 End If;
659 If (p_rec.pnd_attribute10 = hr_api.g_varchar2) then
660 p_rec.pnd_attribute10 :=
661 ben_pnd_shd.g_old_rec.pnd_attribute10;
662 End If;
663 If (p_rec.pnd_attribute11 = hr_api.g_varchar2) then
664 p_rec.pnd_attribute11 :=
665 ben_pnd_shd.g_old_rec.pnd_attribute11;
666 End If;
667 If (p_rec.pnd_attribute12 = hr_api.g_varchar2) then
668 p_rec.pnd_attribute12 :=
669 ben_pnd_shd.g_old_rec.pnd_attribute12;
670 End If;
671 If (p_rec.pnd_attribute13 = hr_api.g_varchar2) then
672 p_rec.pnd_attribute13 :=
673 ben_pnd_shd.g_old_rec.pnd_attribute13;
674 End If;
675 If (p_rec.pnd_attribute14 = hr_api.g_varchar2) then
676 p_rec.pnd_attribute14 :=
677 ben_pnd_shd.g_old_rec.pnd_attribute14;
678 End If;
679 If (p_rec.pnd_attribute15 = hr_api.g_varchar2) then
680 p_rec.pnd_attribute15 :=
681 ben_pnd_shd.g_old_rec.pnd_attribute15;
682 End If;
683 If (p_rec.pnd_attribute16 = hr_api.g_varchar2) then
684 p_rec.pnd_attribute16 :=
685 ben_pnd_shd.g_old_rec.pnd_attribute16;
686 End If;
687 If (p_rec.pnd_attribute17 = hr_api.g_varchar2) then
688 p_rec.pnd_attribute17 :=
689 ben_pnd_shd.g_old_rec.pnd_attribute17;
690 End If;
691 If (p_rec.pnd_attribute18 = hr_api.g_varchar2) then
692 p_rec.pnd_attribute18 :=
693 ben_pnd_shd.g_old_rec.pnd_attribute18;
694 End If;
695 If (p_rec.pnd_attribute19 = hr_api.g_varchar2) then
696 p_rec.pnd_attribute19 :=
697 ben_pnd_shd.g_old_rec.pnd_attribute19;
698 End If;
699 If (p_rec.pnd_attribute20 = hr_api.g_varchar2) then
700 p_rec.pnd_attribute20 :=
701 ben_pnd_shd.g_old_rec.pnd_attribute20;
702 End If;
703 If (p_rec.pnd_attribute21 = hr_api.g_varchar2) then
704 p_rec.pnd_attribute21 :=
705 ben_pnd_shd.g_old_rec.pnd_attribute21;
706 End If;
707 If (p_rec.pnd_attribute22 = hr_api.g_varchar2) then
708 p_rec.pnd_attribute22 :=
709 ben_pnd_shd.g_old_rec.pnd_attribute22;
710 End If;
711 If (p_rec.pnd_attribute23 = hr_api.g_varchar2) then
712 p_rec.pnd_attribute23 :=
713 ben_pnd_shd.g_old_rec.pnd_attribute23;
714 End If;
715 If (p_rec.pnd_attribute24 = hr_api.g_varchar2) then
716 p_rec.pnd_attribute24 :=
717 ben_pnd_shd.g_old_rec.pnd_attribute24;
718 End If;
719 If (p_rec.pnd_attribute25 = hr_api.g_varchar2) then
720 p_rec.pnd_attribute25 :=
721 ben_pnd_shd.g_old_rec.pnd_attribute25;
722 End If;
723 If (p_rec.pnd_attribute26 = hr_api.g_varchar2) then
724 p_rec.pnd_attribute26 :=
725 ben_pnd_shd.g_old_rec.pnd_attribute26;
726 End If;
727 If (p_rec.pnd_attribute27 = hr_api.g_varchar2) then
728 p_rec.pnd_attribute27 :=
729 ben_pnd_shd.g_old_rec.pnd_attribute27;
730 End If;
731 If (p_rec.pnd_attribute28 = hr_api.g_varchar2) then
732 p_rec.pnd_attribute28 :=
733 ben_pnd_shd.g_old_rec.pnd_attribute28;
734 End If;
735 If (p_rec.pnd_attribute29 = hr_api.g_varchar2) then
736 p_rec.pnd_attribute29 :=
737 ben_pnd_shd.g_old_rec.pnd_attribute29;
738 End If;
739 If (p_rec.pnd_attribute30 = hr_api.g_varchar2) then
740 p_rec.pnd_attribute30 :=
741 ben_pnd_shd.g_old_rec.pnd_attribute30;
742 End If;
743 If (p_rec.request_id = hr_api.g_number) then
744 p_rec.request_id :=
745 ben_pnd_shd.g_old_rec.request_id;
746 End If;
747 If (p_rec.program_application_id = hr_api.g_number) then
748 p_rec.program_application_id :=
749 ben_pnd_shd.g_old_rec.program_application_id;
750 End If;
751 If (p_rec.program_id = hr_api.g_number) then
752 p_rec.program_id :=
753 ben_pnd_shd.g_old_rec.program_id;
754 End If;
755 If (p_rec.program_update_date = hr_api.g_date) then
756 p_rec.program_update_date :=
757 ben_pnd_shd.g_old_rec.program_update_date;
758 End If;
759
760 --
761 hr_utility.set_location(' Leaving:'||l_proc, 10);
762 --
763 End convert_defs;
764 --
765 -- ----------------------------------------------------------------------------
766 -- |---------------------------------< upd >----------------------------------|
767 -- ----------------------------------------------------------------------------
768 Procedure upd
769 (
770 p_rec in out nocopy ben_pnd_shd.g_rec_type,
771 p_effective_date in date,
772 p_datetrack_mode in varchar2
773 ) is
774 --
775 l_proc varchar2(72) := g_package||'upd';
776 l_validation_start_date date;
777 l_validation_end_date date;
778 --
779 Begin
780 hr_utility.set_location('Entering:'||l_proc, 5);
781 --
782 -- Ensure that the DateTrack update mode is valid
783 --
784 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
785 --
786 -- We must lock the row which we need to update.
787 --
788 ben_pnd_shd.lck
789 (p_effective_date => p_effective_date,
790 p_datetrack_mode => p_datetrack_mode,
791 p_pl_dpnt_cvg_ctfn_id => p_rec.pl_dpnt_cvg_ctfn_id,
792 p_object_version_number => p_rec.object_version_number,
793 p_validation_start_date => l_validation_start_date,
794 p_validation_end_date => l_validation_end_date);
795 --
796 -- 1. During an update system defaults are used to determine if
797 -- arguments have been defaulted or not. We must therefore
798 -- derive the full record structure values to be updated.
799 --
800 -- 2. Call the supporting update validate operations.
801 --
802 convert_defs(p_rec);
803 ben_pnd_bus.update_validate
804 (p_rec => p_rec,
805 p_effective_date => p_effective_date,
806 p_datetrack_mode => p_datetrack_mode,
807 p_validation_start_date => l_validation_start_date,
808 p_validation_end_date => l_validation_end_date);
809 --
810 -- Call the supporting pre-update operation
811 --
812 pre_update
813 (p_rec => p_rec,
814 p_effective_date => p_effective_date,
815 p_datetrack_mode => p_datetrack_mode,
816 p_validation_start_date => l_validation_start_date,
817 p_validation_end_date => l_validation_end_date);
818 --
819 -- Update the row.
820 --
821 update_dml
822 (p_rec => p_rec,
823 p_effective_date => p_effective_date,
824 p_datetrack_mode => p_datetrack_mode,
825 p_validation_start_date => l_validation_start_date,
826 p_validation_end_date => l_validation_end_date);
827 --
828 -- Call the supporting post-update operation
829 --
830 post_update
831 (p_rec => p_rec,
832 p_effective_date => p_effective_date,
833 p_datetrack_mode => p_datetrack_mode,
834 p_validation_start_date => l_validation_start_date,
835 p_validation_end_date => l_validation_end_date);
836 End upd;
837 --
838 -- ----------------------------------------------------------------------------
839 -- |---------------------------------< upd >----------------------------------|
840 -- ----------------------------------------------------------------------------
841 Procedure upd
842 (
843 p_pl_dpnt_cvg_ctfn_id in number,
844 p_effective_start_date out nocopy date,
845 p_effective_end_date out nocopy date,
846 p_pl_id in number default hr_api.g_number,
847 p_pfd_flag in varchar2 default hr_api.g_varchar2,
848 p_ctfn_rqd_when_rl in number default hr_api.g_number,
849 p_lack_ctfn_sspnd_enrt_flag in varchar2 default hr_api.g_varchar2,
850 p_dpnt_cvg_ctfn_typ_cd in varchar2 default hr_api.g_varchar2,
851 p_rqd_flag in varchar2 default hr_api.g_varchar2,
852 p_rlshp_typ_cd in varchar2 default hr_api.g_varchar2,
853 p_business_group_id in number default hr_api.g_number,
854 p_pnd_attribute_category in varchar2 default hr_api.g_varchar2,
855 p_pnd_attribute1 in varchar2 default hr_api.g_varchar2,
856 p_pnd_attribute2 in varchar2 default hr_api.g_varchar2,
857 p_pnd_attribute3 in varchar2 default hr_api.g_varchar2,
858 p_pnd_attribute4 in varchar2 default hr_api.g_varchar2,
859 p_pnd_attribute5 in varchar2 default hr_api.g_varchar2,
860 p_pnd_attribute6 in varchar2 default hr_api.g_varchar2,
861 p_pnd_attribute7 in varchar2 default hr_api.g_varchar2,
862 p_pnd_attribute8 in varchar2 default hr_api.g_varchar2,
863 p_pnd_attribute9 in varchar2 default hr_api.g_varchar2,
864 p_pnd_attribute10 in varchar2 default hr_api.g_varchar2,
865 p_pnd_attribute11 in varchar2 default hr_api.g_varchar2,
866 p_pnd_attribute12 in varchar2 default hr_api.g_varchar2,
867 p_pnd_attribute13 in varchar2 default hr_api.g_varchar2,
868 p_pnd_attribute14 in varchar2 default hr_api.g_varchar2,
869 p_pnd_attribute15 in varchar2 default hr_api.g_varchar2,
870 p_pnd_attribute16 in varchar2 default hr_api.g_varchar2,
871 p_pnd_attribute17 in varchar2 default hr_api.g_varchar2,
872 p_pnd_attribute18 in varchar2 default hr_api.g_varchar2,
873 p_pnd_attribute19 in varchar2 default hr_api.g_varchar2,
874 p_pnd_attribute20 in varchar2 default hr_api.g_varchar2,
875 p_pnd_attribute21 in varchar2 default hr_api.g_varchar2,
876 p_pnd_attribute22 in varchar2 default hr_api.g_varchar2,
877 p_pnd_attribute23 in varchar2 default hr_api.g_varchar2,
878 p_pnd_attribute24 in varchar2 default hr_api.g_varchar2,
879 p_pnd_attribute25 in varchar2 default hr_api.g_varchar2,
880 p_pnd_attribute26 in varchar2 default hr_api.g_varchar2,
881 p_pnd_attribute27 in varchar2 default hr_api.g_varchar2,
882 p_pnd_attribute28 in varchar2 default hr_api.g_varchar2,
883 p_pnd_attribute29 in varchar2 default hr_api.g_varchar2,
884 p_pnd_attribute30 in varchar2 default hr_api.g_varchar2,
885 p_request_id in number default hr_api.g_number,
886 p_program_application_id in number default hr_api.g_number,
887 p_program_id in number default hr_api.g_number,
888 p_program_update_date in date default hr_api.g_date,
889 p_object_version_number in out nocopy number,
890 p_effective_date in date,
891 p_datetrack_mode in varchar2
892 ) is
893 --
894 l_rec ben_pnd_shd.g_rec_type;
895 l_proc varchar2(72) := g_package||'upd';
896 --
897 Begin
898 hr_utility.set_location('Entering:'||l_proc, 5);
899 --
900 -- Call conversion function to turn arguments into the
901 -- l_rec structure.
902 --
903 l_rec :=
904 ben_pnd_shd.convert_args
905 (
906 p_pl_dpnt_cvg_ctfn_id,
907 null,
908 null,
909 p_pl_id,
910 p_pfd_flag,
911 p_ctfn_rqd_when_rl,
912 p_lack_ctfn_sspnd_enrt_flag,
913 p_dpnt_cvg_ctfn_typ_cd,
914 p_rqd_flag,
915 p_rlshp_typ_cd,
916 p_business_group_id,
917 p_pnd_attribute_category,
918 p_pnd_attribute1,
919 p_pnd_attribute2,
920 p_pnd_attribute3,
921 p_pnd_attribute4,
922 p_pnd_attribute5,
923 p_pnd_attribute6,
924 p_pnd_attribute7,
925 p_pnd_attribute8,
926 p_pnd_attribute9,
927 p_pnd_attribute10,
928 p_pnd_attribute11,
929 p_pnd_attribute12,
930 p_pnd_attribute13,
931 p_pnd_attribute14,
932 p_pnd_attribute15,
933 p_pnd_attribute16,
934 p_pnd_attribute17,
935 p_pnd_attribute18,
936 p_pnd_attribute19,
937 p_pnd_attribute20,
938 p_pnd_attribute21,
939 p_pnd_attribute22,
940 p_pnd_attribute23,
941 p_pnd_attribute24,
942 p_pnd_attribute25,
943 p_pnd_attribute26,
944 p_pnd_attribute27,
945 p_pnd_attribute28,
946 p_pnd_attribute29,
947 p_pnd_attribute30,
948 p_request_id,
949 p_program_application_id,
950 p_program_id,
951 p_program_update_date,
952 p_object_version_number
953 );
954 --
955 -- Having converted the arguments into the
956 -- plsql record structure we call the corresponding record
957 -- business process.
958 --
959 upd(l_rec, p_effective_date, p_datetrack_mode);
960 p_object_version_number := l_rec.object_version_number;
961 p_effective_start_date := l_rec.effective_start_date;
962 p_effective_end_date := l_rec.effective_end_date;
963 --
964 --
965 hr_utility.set_location(' Leaving:'||l_proc, 10);
966 End upd;
967 --
968 end ben_pnd_upd;