1 Package Body ben_pdp_upd as
2 /* $Header: bepdprhi.pkb 120.10.12010000.4 2008/08/05 15:08:01 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_pdp_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_pdp_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_elig_cvrd_dpnt_f',
78 p_base_key_column => 'elig_cvrd_dpnt_id',
79 p_base_key_value => p_rec.elig_cvrd_dpnt_id);
80 --
81 ben_pdp_shd.g_api_dml := true; -- Set the api dml status
82 --
83 -- Update the ben_elig_cvrd_dpnt_f Row
84 --
85 update ben_elig_cvrd_dpnt_f
86 set
87 elig_cvrd_dpnt_id = p_rec.elig_cvrd_dpnt_id,
88 business_group_id = p_rec.business_group_id,
89 prtt_enrt_rslt_id = p_rec.prtt_enrt_rslt_id,
90 dpnt_person_id = p_rec.dpnt_person_id,
91 cvg_strt_dt = p_rec.cvg_strt_dt,
92 cvg_thru_dt = p_rec.cvg_thru_dt,
93 cvg_pndg_flag = p_rec.cvg_pndg_flag,
94 pdp_attribute_category = p_rec.pdp_attribute_category,
95 pdp_attribute1 = p_rec.pdp_attribute1,
96 pdp_attribute2 = p_rec.pdp_attribute2,
97 pdp_attribute3 = p_rec.pdp_attribute3,
98 pdp_attribute4 = p_rec.pdp_attribute4,
99 pdp_attribute5 = p_rec.pdp_attribute5,
100 pdp_attribute6 = p_rec.pdp_attribute6,
101 pdp_attribute7 = p_rec.pdp_attribute7,
102 pdp_attribute8 = p_rec.pdp_attribute8,
103 pdp_attribute9 = p_rec.pdp_attribute9,
104 pdp_attribute10 = p_rec.pdp_attribute10,
105 pdp_attribute11 = p_rec.pdp_attribute11,
106 pdp_attribute12 = p_rec.pdp_attribute12,
107 pdp_attribute13 = p_rec.pdp_attribute13,
108 pdp_attribute14 = p_rec.pdp_attribute14,
109 pdp_attribute15 = p_rec.pdp_attribute15,
110 pdp_attribute16 = p_rec.pdp_attribute16,
111 pdp_attribute17 = p_rec.pdp_attribute17,
112 pdp_attribute18 = p_rec.pdp_attribute18,
113 pdp_attribute19 = p_rec.pdp_attribute19,
114 pdp_attribute20 = p_rec.pdp_attribute20,
115 pdp_attribute21 = p_rec.pdp_attribute21,
116 pdp_attribute22 = p_rec.pdp_attribute22,
117 pdp_attribute23 = p_rec.pdp_attribute23,
118 pdp_attribute24 = p_rec.pdp_attribute24,
119 pdp_attribute25 = p_rec.pdp_attribute25,
120 pdp_attribute26 = p_rec.pdp_attribute26,
121 pdp_attribute27 = p_rec.pdp_attribute27,
122 pdp_attribute28 = p_rec.pdp_attribute28,
123 pdp_attribute29 = p_rec.pdp_attribute29,
124 pdp_attribute30 = p_rec.pdp_attribute30,
125 request_id = p_rec.request_id,
126 program_application_id = p_rec.program_application_id,
127 program_id = p_rec.program_id,
128 program_update_date = p_rec.program_update_date,
129 object_version_number = p_rec.object_version_number,
130 ovrdn_flag = p_rec.ovrdn_flag,
131 per_in_ler_id = p_rec.per_in_ler_id,
132 ovrdn_thru_dt = p_rec.ovrdn_thru_dt
133 where elig_cvrd_dpnt_id = p_rec.elig_cvrd_dpnt_id
134 and effective_start_date = p_validation_start_date
135 and effective_end_date = p_validation_end_date;
136 --
137 ben_pdp_shd.g_api_dml := false; -- Unset the api dml status
138 --
139 -- Set the effective start and end dates
140 --
141 p_rec.effective_start_date := p_validation_start_date;
142 p_rec.effective_end_date := p_validation_end_date;
143 End If;
144 --
145 hr_utility.set_location(' Leaving:'||l_proc, 15);
146 Exception
147 When hr_api.check_integrity_violated Then
148 -- A check constraint has been violated
149 ben_pdp_shd.g_api_dml := false; -- Unset the api dml status
150 ben_pdp_shd.constraint_error
151 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
152 When hr_api.unique_integrity_violated Then
153 -- Unique integrity has been violated
154 ben_pdp_shd.g_api_dml := false; -- Unset the api dml status
155 ben_pdp_shd.constraint_error
156 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
157 When Others Then
158 ben_pdp_shd.g_api_dml := false; -- Unset the api dml status
159 Raise;
160 End dt_update_dml;
161 --
162 -- ----------------------------------------------------------------------------
163 -- |------------------------------< update_dml >------------------------------|
164 -- ----------------------------------------------------------------------------
165 -- {Start Of Comments}
166 --
167 -- Description:
168 -- This procedure calls the dt_update_dml control logic which handles
169 -- the actual datetrack dml.
170 --
171 -- Prerequisites:
172 -- This is an internal private procedure which must be called from the upd
173 -- procedure.
174 --
175 -- In Parameters:
176 -- A Pl/Sql record structre.
177 --
178 -- Post Success:
179 -- Processing contines.
180 --
181 -- Post Failure:
182 -- No specific error handling is required within this procedure.
183 --
184 -- Developer Implementation Notes:
185 -- The update 'set' arguments list should be modified if any of your
186 -- attributes are not updateable.
187 --
188 -- Access Status:
189 -- Internal Row Handler Use Only.
190 --
191 -- {End Of Comments}
192 -- ----------------------------------------------------------------------------
193 Procedure update_dml
194 (p_rec in out nocopy ben_pdp_shd.g_rec_type,
195 p_effective_date in date,
196 p_datetrack_mode in varchar2,
197 p_validation_start_date in date,
198 p_validation_end_date in date) is
199 --
200 l_proc varchar2(72) := g_package||'update_dml';
201 --
202 Begin
203 hr_utility.set_location('Entering:'||l_proc, 5);
204 --
205 dt_update_dml(p_rec => p_rec,
206 p_effective_date => p_effective_date,
207 p_datetrack_mode => p_datetrack_mode,
208 p_validation_start_date => p_validation_start_date,
209 p_validation_end_date => p_validation_end_date);
210 --
211 hr_utility.set_location(' Leaving:'||l_proc, 10);
212 End update_dml;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |----------------------------< dt_pre_update >-----------------------------|
216 -- ----------------------------------------------------------------------------
217 -- {Start Of Comments}
218 --
219 -- Description:
220 -- The dt_pre_update procedure controls the execution
221 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
222 -- and UPDATE_CHANGE_INSERT only. The execution required is as
223 -- follows:
224 --
225 -- 1) Providing the datetrack update mode is not 'CORRECTION'
226 -- then set the effective end date of the current row (this
227 -- will be the validation_start_date - 1).
228 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
229 -- corresponding delete_dml process to delete any future rows
230 -- where the effective_start_date is greater than or equal to
231 -- the validation_start_date.
232 -- 3) Call the insert_dml process to insert the new updated row
233 -- details..
234 --
235 -- Prerequisites:
236 -- This is an internal procedure which is called from the
237 -- pre_update procedure.
238 --
239 -- In Parameters:
240 --
241 -- Post Success:
242 -- Processing continues.
243 --
244 -- Post Failure:
245 -- If an error has occurred, an error message and exception will be raised
246 -- but not handled.
247 --
248 -- Developer Implementation Notes:
249 -- This is an internal procedure which is required by Datetrack. Don't
250 -- remove or modify.
251 --
252 -- Access Status:
253 -- Internal Row Handler Use Only.
254 --
255 -- {End Of Comments}
256 -- ----------------------------------------------------------------------------
257 Procedure dt_pre_update
258 (p_rec in out nocopy ben_pdp_shd.g_rec_type,
259 p_effective_date in date,
260 p_datetrack_mode in varchar2,
261 p_validation_start_date in date,
262 p_validation_end_date in date) is
263 --
264 l_proc varchar2(72) := g_package||'dt_pre_update';
265 l_dummy_version_number number;
266 --
267 Begin
268 hr_utility.set_location('Entering:'||l_proc, 5);
269 If (p_datetrack_mode <> 'CORRECTION') then
270 hr_utility.set_location(l_proc, 10);
271 --
272 -- Update the current effective end date
273 --
274 ben_pdp_shd.upd_effective_end_date
275 (p_effective_date => p_effective_date,
276 p_base_key_value => p_rec.elig_cvrd_dpnt_id,
277 p_new_effective_end_date => (p_validation_start_date - 1),
278 p_validation_start_date => p_validation_start_date,
279 p_validation_end_date => p_validation_end_date,
280 p_object_version_number => l_dummy_version_number);
281 --
282 If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
283 hr_utility.set_location(l_proc, 15);
284 --
285 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
286 -- delete any future rows
287 --
288 ben_pdp_del.delete_dml
289 (p_rec => p_rec,
290 p_effective_date => p_effective_date,
291 p_datetrack_mode => p_datetrack_mode,
292 p_validation_start_date => p_validation_start_date,
293 p_validation_end_date => p_validation_end_date);
294 End If;
295 hr_utility.set_location(l_proc, 20);
296 --
297 -- We must now insert the updated row
298 --
299 ben_pdp_ins.insert_dml
300 (p_rec => p_rec,
301 p_effective_date => p_effective_date,
302 p_datetrack_mode => p_datetrack_mode,
303 p_validation_start_date => p_validation_start_date,
304 p_validation_end_date => p_validation_end_date);
305 End If;
306 hr_utility.set_location(' Leaving:'||l_proc, 20);
307 End dt_pre_update;
308 --
309 -- ----------------------------------------------------------------------------
310 -- |------------------------------< pre_update >------------------------------|
311 -- ----------------------------------------------------------------------------
312 -- {Start Of Comments}
313 --
314 -- Description:
315 -- This private procedure contains any processing which is required before
316 -- the update dml.
317 --
318 -- Prerequisites:
319 -- This is an internal procedure which is called from the upd procedure.
320 --
321 -- In Parameters:
322 -- A Pl/Sql record structre.
323 --
324 -- Post Success:
325 -- Processing continues.
326 --
327 -- Post Failure:
328 -- If an error has occurred, an error message and exception will be raised
329 -- but not handled.
330 --
331 -- Developer Implementation Notes:
332 -- Any pre-processing required before the update dml is issued should be
333 -- coded within this procedure. It is important to note that any 3rd party
334 -- maintenance should be reviewed before placing in this procedure. The call
335 -- to the dt_update_dml procedure should NOT be removed.
336 --
337 -- Access Status:
338 -- Internal Row Handler Use Only.
339 --
340 -- {End Of Comments}
341 -- ----------------------------------------------------------------------------
342 Procedure pre_update
343 (p_rec in out nocopy ben_pdp_shd.g_rec_type,
344 p_effective_date in date,
345 p_datetrack_mode in varchar2,
346 p_validation_start_date in date,
347 p_validation_end_date in date) is
348 --
349 l_proc varchar2(72) := g_package||'pre_update';
350 l_rowid varchar2(72);
351 l_esd date;
352 l_eed date;
353 --
354 cursor csr_rowid is
355 select rowid, effective_start_date, effective_end_date
356 from ben_elig_cvrd_dpnt_f
357 where elig_cvrd_dpnt_id = p_rec.elig_cvrd_dpnt_id
358 and p_effective_date between
359 effective_start_date and effective_end_date;
360
361 cursor csr_rowid_u is
362 select rowid
363 from ben_elig_cvrd_dpnt_f
364 where elig_cvrd_dpnt_id = p_rec.elig_cvrd_dpnt_id
365 and p_effective_date -1 between
366 effective_start_date and effective_end_date;
367 --
368 Begin
369 hr_utility.set_location('Entering:'||l_proc, 5);
370 --
371 --
372 --
373 dt_pre_update
374 (p_rec => p_rec,
375 p_effective_date => p_effective_date,
376 p_datetrack_mode => p_datetrack_mode,
377 p_validation_start_date => p_validation_start_date,
378 p_validation_end_date => p_validation_end_date);
379 --
380 hr_utility.set_location(' Leaving:'||l_proc, 10);
381 --
382 if p_datetrack_mode <> 'CORRECTION' then
383 open csr_rowid_u;
384 fetch csr_rowid_u into l_rowid;
385 close csr_rowid_u;
386 l_esd := p_rec.effective_start_date;
387 l_eed := p_rec.effective_end_date;
388 else
389 open csr_rowid;
390 fetch csr_rowid into l_rowid, l_esd, l_eed;
391 close csr_rowid;
392 end if;
393 --
394 hr_utility.set_location(' pdp rhi esd:'||p_rec.effective_start_date, 10);
395 hr_utility.set_location(' pdp rhi eed:'||p_rec.effective_end_date, 10);
396 hr_utility.set_location(' pdp rhi l_esd:'||l_esd, 10);
397 hr_utility.set_location(' pdp rhi l_eed:'||l_eed, 10);
398 --
399 --Bug 4390330 fix
400 --
401 ben_dt_trgr_handle.elig_cvrd_dpnt
402 (p_rowid => l_rowid
403 ,p_ELIG_CVRD_DPNT_ID => p_rec.ELIG_CVRD_DPNT_ID
404 ,p_dpnt_person_id => p_rec.dpnt_person_id
405 ,p_business_group_id => p_rec.business_group_id
406 ,p_prtt_enrt_rslt_id => p_rec.prtt_enrt_rslt_id
407 ,p_effective_start_date => l_esd
408 ,p_effective_end_date => l_eed
409 ,p_cvg_strt_dt => p_rec.cvg_strt_dt
410 ,p_cvg_thru_dt => p_rec.cvg_thru_dt
411 ,p_ovrdn_flag => p_rec.ovrdn_flag
412 ,p_ovrdn_thru_dt => p_rec.ovrdn_thru_dt
413 );
414 --
415 End pre_update;
416 --
417 -- ----------------------------------------------------------------------------
418 -- |-----------------------------< post_update >------------------------------|
419 -- ----------------------------------------------------------------------------
420 -- {Start Of Comments}
421 --
422 -- Description:
423 -- This private procedure contains any processing which is required after the
424 -- update dml.
425 --
426 -- Prerequisites:
427 -- This is an internal procedure which is called from the upd procedure.
428 --
429 -- In Parameters:
430 -- A Pl/Sql record structre.
431 --
432 -- Post Success:
433 -- Processing continues.
434 --
435 -- Post Failure:
436 -- If an error has occurred, an error message and exception will be raised
437 -- but not handled.
438 --
439 -- Developer Implementation Notes:
440 -- Any post-processing required after the update dml is issued should be
441 -- coded within this procedure. It is important to note that any 3rd party
442 -- maintenance should be reviewed before placing in this procedure.
443 --
444 -- Access Status:
445 -- Internal Row Handler Use Only.
446 --
447 -- {End Of Comments}
448 -- ----------------------------------------------------------------------------
449 Procedure post_update
450 (p_rec in ben_pdp_shd.g_rec_type,
451 p_effective_date in date,
452 p_datetrack_mode in varchar2,
453 p_validation_start_date in date,
454 p_validation_end_date in date) is
455 --
456 l_proc varchar2(72) := g_package||'post_update';
457 --
458 Begin
459 hr_utility.set_location('Entering:'||l_proc, 5);
460 --
461 -- Bug 3756863 : Moved here from UPDATE_VALIDATE
462 ben_pdp_bus.crt_ordr_warning
463 (p_prtt_enrt_rslt_id => p_rec.prtt_enrt_rslt_id,
464 p_effective_date => p_effective_date,
465 p_business_group_id => p_rec.business_group_id);
466 --
467 -- Start of API User Hook for post_update.
468 --
469 if p_rec.cvg_strt_dt > p_rec.cvg_thru_dt then
470 hr_utility.set_location('new update in update rhi :'||l_proc, 5);
471 update ben_elig_dpnt
472 set elig_cvrd_dpnt_id = null
473 where elig_cvrd_dpnt_id = p_rec.elig_cvrd_dpnt_id
474 and dpnt_person_id = p_rec.dpnt_person_id
475 and per_in_ler_id = p_rec.per_in_ler_id;
476 hr_utility.set_location('rowcount in update rhi :'||sql%rowcount, 5);
477 end if;
478
479
480 begin
481 --
482 ben_pdp_rku.after_update
483 (
484 p_elig_cvrd_dpnt_id =>p_rec.elig_cvrd_dpnt_id
485 ,p_effective_start_date =>p_rec.effective_start_date
486 ,p_effective_end_date =>p_rec.effective_end_date
487 ,p_business_group_id =>p_rec.business_group_id
488 ,p_prtt_enrt_rslt_id =>p_rec.prtt_enrt_rslt_id
489 ,p_dpnt_person_id =>p_rec.dpnt_person_id
490 ,p_cvg_strt_dt =>p_rec.cvg_strt_dt
491 ,p_cvg_thru_dt =>p_rec.cvg_thru_dt
492 ,p_cvg_pndg_flag =>p_rec.cvg_pndg_flag
493 ,p_pdp_attribute_category =>p_rec.pdp_attribute_category
494 ,p_pdp_attribute1 =>p_rec.pdp_attribute1
495 ,p_pdp_attribute2 =>p_rec.pdp_attribute2
496 ,p_pdp_attribute3 =>p_rec.pdp_attribute3
497 ,p_pdp_attribute4 =>p_rec.pdp_attribute4
498 ,p_pdp_attribute5 =>p_rec.pdp_attribute5
499 ,p_pdp_attribute6 =>p_rec.pdp_attribute6
500 ,p_pdp_attribute7 =>p_rec.pdp_attribute7
501 ,p_pdp_attribute8 =>p_rec.pdp_attribute8
502 ,p_pdp_attribute9 =>p_rec.pdp_attribute9
503 ,p_pdp_attribute10 =>p_rec.pdp_attribute10
504 ,p_pdp_attribute11 =>p_rec.pdp_attribute11
505 ,p_pdp_attribute12 =>p_rec.pdp_attribute12
506 ,p_pdp_attribute13 =>p_rec.pdp_attribute13
507 ,p_pdp_attribute14 =>p_rec.pdp_attribute14
508 ,p_pdp_attribute15 =>p_rec.pdp_attribute15
509 ,p_pdp_attribute16 =>p_rec.pdp_attribute16
510 ,p_pdp_attribute17 =>p_rec.pdp_attribute17
511 ,p_pdp_attribute18 =>p_rec.pdp_attribute18
512 ,p_pdp_attribute19 =>p_rec.pdp_attribute19
513 ,p_pdp_attribute20 =>p_rec.pdp_attribute20
514 ,p_pdp_attribute21 =>p_rec.pdp_attribute21
515 ,p_pdp_attribute22 =>p_rec.pdp_attribute22
516 ,p_pdp_attribute23 =>p_rec.pdp_attribute23
517 ,p_pdp_attribute24 =>p_rec.pdp_attribute24
518 ,p_pdp_attribute25 =>p_rec.pdp_attribute25
519 ,p_pdp_attribute26 =>p_rec.pdp_attribute26
520 ,p_pdp_attribute27 =>p_rec.pdp_attribute27
521 ,p_pdp_attribute28 =>p_rec.pdp_attribute28
522 ,p_pdp_attribute29 =>p_rec.pdp_attribute29
523 ,p_pdp_attribute30 =>p_rec.pdp_attribute30
524 ,p_request_id =>p_rec.request_id
525 ,p_program_application_id =>p_rec.program_application_id
526 ,p_program_id =>p_rec.program_id
527 ,p_program_update_date =>p_rec.program_update_date
528 ,p_object_version_number =>p_rec.object_version_number
529 ,p_ovrdn_flag =>p_rec.ovrdn_flag
530 ,p_per_in_ler_id =>p_rec.per_in_ler_id
531 ,p_ovrdn_thru_dt =>p_rec.ovrdn_thru_dt
532 ,p_effective_date =>p_effective_date
533 ,p_datetrack_mode =>p_datetrack_mode
534 ,p_validation_start_date =>p_validation_start_date
535 ,p_validation_end_date =>p_validation_end_date
536 ,p_effective_start_date_o =>ben_pdp_shd.g_old_rec.effective_start_date
537 ,p_effective_end_date_o =>ben_pdp_shd.g_old_rec.effective_end_date
538 ,p_business_group_id_o =>ben_pdp_shd.g_old_rec.business_group_id
539 ,p_prtt_enrt_rslt_id_o =>ben_pdp_shd.g_old_rec.prtt_enrt_rslt_id
540 ,p_dpnt_person_id_o =>ben_pdp_shd.g_old_rec.dpnt_person_id
541 ,p_cvg_strt_dt_o =>ben_pdp_shd.g_old_rec.cvg_strt_dt
542 ,p_cvg_thru_dt_o =>ben_pdp_shd.g_old_rec.cvg_thru_dt
543 ,p_cvg_pndg_flag_o =>ben_pdp_shd.g_old_rec.cvg_pndg_flag
544 ,p_pdp_attribute_category_o =>ben_pdp_shd.g_old_rec.pdp_attribute_category
545 ,p_pdp_attribute1_o =>ben_pdp_shd.g_old_rec.pdp_attribute1
546 ,p_pdp_attribute2_o =>ben_pdp_shd.g_old_rec.pdp_attribute2
547 ,p_pdp_attribute3_o =>ben_pdp_shd.g_old_rec.pdp_attribute3
548 ,p_pdp_attribute4_o =>ben_pdp_shd.g_old_rec.pdp_attribute4
549 ,p_pdp_attribute5_o =>ben_pdp_shd.g_old_rec.pdp_attribute5
550 ,p_pdp_attribute6_o =>ben_pdp_shd.g_old_rec.pdp_attribute6
551 ,p_pdp_attribute7_o =>ben_pdp_shd.g_old_rec.pdp_attribute7
552 ,p_pdp_attribute8_o =>ben_pdp_shd.g_old_rec.pdp_attribute8
553 ,p_pdp_attribute9_o =>ben_pdp_shd.g_old_rec.pdp_attribute9
554 ,p_pdp_attribute10_o =>ben_pdp_shd.g_old_rec.pdp_attribute10
555 ,p_pdp_attribute11_o =>ben_pdp_shd.g_old_rec.pdp_attribute11
556 ,p_pdp_attribute12_o =>ben_pdp_shd.g_old_rec.pdp_attribute12
557 ,p_pdp_attribute13_o =>ben_pdp_shd.g_old_rec.pdp_attribute13
558 ,p_pdp_attribute14_o =>ben_pdp_shd.g_old_rec.pdp_attribute14
559 ,p_pdp_attribute15_o =>ben_pdp_shd.g_old_rec.pdp_attribute15
560 ,p_pdp_attribute16_o =>ben_pdp_shd.g_old_rec.pdp_attribute16
561 ,p_pdp_attribute17_o =>ben_pdp_shd.g_old_rec.pdp_attribute17
562 ,p_pdp_attribute18_o =>ben_pdp_shd.g_old_rec.pdp_attribute18
563 ,p_pdp_attribute19_o =>ben_pdp_shd.g_old_rec.pdp_attribute19
564 ,p_pdp_attribute20_o =>ben_pdp_shd.g_old_rec.pdp_attribute20
565 ,p_pdp_attribute21_o =>ben_pdp_shd.g_old_rec.pdp_attribute21
566 ,p_pdp_attribute22_o =>ben_pdp_shd.g_old_rec.pdp_attribute22
567 ,p_pdp_attribute23_o =>ben_pdp_shd.g_old_rec.pdp_attribute23
568 ,p_pdp_attribute24_o =>ben_pdp_shd.g_old_rec.pdp_attribute24
569 ,p_pdp_attribute25_o =>ben_pdp_shd.g_old_rec.pdp_attribute25
570 ,p_pdp_attribute26_o =>ben_pdp_shd.g_old_rec.pdp_attribute26
571 ,p_pdp_attribute27_o =>ben_pdp_shd.g_old_rec.pdp_attribute27
572 ,p_pdp_attribute28_o =>ben_pdp_shd.g_old_rec.pdp_attribute28
573 ,p_pdp_attribute29_o =>ben_pdp_shd.g_old_rec.pdp_attribute29
574 ,p_pdp_attribute30_o =>ben_pdp_shd.g_old_rec.pdp_attribute30
575 ,p_request_id_o =>ben_pdp_shd.g_old_rec.request_id
576 ,p_program_application_id_o =>ben_pdp_shd.g_old_rec.program_application_id
577 ,p_program_id_o =>ben_pdp_shd.g_old_rec.program_id
578 ,p_program_update_date_o =>ben_pdp_shd.g_old_rec.program_update_date
579 ,p_object_version_number_o =>ben_pdp_shd.g_old_rec.object_version_number
580 ,p_ovrdn_flag_o =>ben_pdp_shd.g_old_rec.ovrdn_flag
581 ,p_per_in_ler_id_o =>ben_pdp_shd.g_old_rec.per_in_ler_id
582 ,p_ovrdn_thru_dt_o =>ben_pdp_shd.g_old_rec.ovrdn_thru_dt
583 );
584 --
585 exception
586 --
587 when hr_api.cannot_find_prog_unit then
588 --
589 hr_api.cannot_find_prog_unit_error
590 (p_module_name => 'ben_elig_cvrd_dpnt_f'
591 ,p_hook_type => 'AU');
592 --
593 end;
594 --
595 -- End of API User Hook for post_update.
596 --
597 --
598 hr_utility.set_location(' Leaving:'||l_proc, 10);
599 End post_update;
600 --
601 -- ----------------------------------------------------------------------------
602 -- |-----------------------------< convert_defs >-----------------------------|
603 -- ----------------------------------------------------------------------------
604 -- {Start Of Comments}
605 --
606 -- Description:
607 -- The Convert_Defs procedure has one very important function:
608 -- It must return the record structure for the row with all system defaulted
609 -- values converted into its corresponding parameter value for update. When
610 -- we attempt to update a row through the Upd process , certain
611 -- parameters can be defaulted which enables flexibility in the calling of
612 -- the upd process (e.g. only attributes which need to be updated need to be
613 -- specified). For the upd process to determine which attributes
614 -- have NOT been specified we need to check if the parameter has a reserved
615 -- system default value. Therefore, for all parameters which have a
616 -- corresponding reserved system default mechanism specified we need to
617 -- check if a system default is being used. If a system default is being
618 -- used then we convert the defaulted value into its corresponding attribute
619 -- value held in the g_old_rec data structure.
620 --
621 -- Prerequisites:
622 -- This private function can only be called from the upd process.
623 --
624 -- In Parameters:
625 -- A Pl/Sql record structre.
626 --
627 -- Post Success:
628 -- The record structure will be returned with all system defaulted parameter
629 -- values converted into its current row attribute value.
630 --
631 -- Post Failure:
632 -- No direct error handling is required within this function. Any possible
633 -- errors within this procedure will be a PL/SQL value error due to conversion
634 -- of datatypes or data lengths.
635 --
636 -- Developer Implementation Notes:
637 -- None.
638 --
639 -- Access Status:
640 -- Internal Row Handler Use Only.
641 --
642 -- {End Of Comments}
643 -- ----------------------------------------------------------------------------
644 Procedure convert_defs(p_rec in out nocopy ben_pdp_shd.g_rec_type) is
645 --
646 l_proc varchar2(72) := g_package||'convert_defs';
647 --
648 Begin
649 --
650 hr_utility.set_location('Entering:'||l_proc, 5);
651 --
652 -- We must now examine each argument value in the
653 -- p_rec plsql record structure
654 -- to see if a system default is being used. If a system default
655 -- is being used then we must set to the 'current' argument value.
656 --
657 If (p_rec.business_group_id = hr_api.g_number) then
658 p_rec.business_group_id :=
659 ben_pdp_shd.g_old_rec.business_group_id;
660 End If;
661 If (p_rec.prtt_enrt_rslt_id = hr_api.g_number) then
662 p_rec.prtt_enrt_rslt_id :=
663 ben_pdp_shd.g_old_rec.prtt_enrt_rslt_id;
664 End If;
665 If (p_rec.dpnt_person_id = hr_api.g_number) then
666 p_rec.dpnt_person_id :=
667 ben_pdp_shd.g_old_rec.dpnt_person_id;
668 End If;
669 If (p_rec.cvg_strt_dt = hr_api.g_date) then
670 p_rec.cvg_strt_dt :=
671 ben_pdp_shd.g_old_rec.cvg_strt_dt;
672 End If;
673 If (p_rec.cvg_thru_dt = hr_api.g_date) then
674 p_rec.cvg_thru_dt :=
675 ben_pdp_shd.g_old_rec.cvg_thru_dt;
676 End If;
677 If (p_rec.cvg_pndg_flag = hr_api.g_varchar2) then
678 p_rec.cvg_pndg_flag :=
679 ben_pdp_shd.g_old_rec.cvg_pndg_flag;
680 End If;
681 If (p_rec.pdp_attribute_category = hr_api.g_varchar2) then
682 p_rec.pdp_attribute_category :=
683 ben_pdp_shd.g_old_rec.pdp_attribute_category;
684 End If;
685 If (p_rec.pdp_attribute1 = hr_api.g_varchar2) then
686 p_rec.pdp_attribute1 :=
687 ben_pdp_shd.g_old_rec.pdp_attribute1;
688 End If;
689 If (p_rec.pdp_attribute2 = hr_api.g_varchar2) then
690 p_rec.pdp_attribute2 :=
691 ben_pdp_shd.g_old_rec.pdp_attribute2;
692 End If;
693 If (p_rec.pdp_attribute3 = hr_api.g_varchar2) then
694 p_rec.pdp_attribute3 :=
695 ben_pdp_shd.g_old_rec.pdp_attribute3;
696 End If;
697 If (p_rec.pdp_attribute4 = hr_api.g_varchar2) then
698 p_rec.pdp_attribute4 :=
699 ben_pdp_shd.g_old_rec.pdp_attribute4;
700 End If;
701 If (p_rec.pdp_attribute5 = hr_api.g_varchar2) then
702 p_rec.pdp_attribute5 :=
703 ben_pdp_shd.g_old_rec.pdp_attribute5;
704 End If;
705 If (p_rec.pdp_attribute6 = hr_api.g_varchar2) then
706 p_rec.pdp_attribute6 :=
707 ben_pdp_shd.g_old_rec.pdp_attribute6;
708 End If;
709 If (p_rec.pdp_attribute7 = hr_api.g_varchar2) then
710 p_rec.pdp_attribute7 :=
711 ben_pdp_shd.g_old_rec.pdp_attribute7;
712 End If;
713 If (p_rec.pdp_attribute8 = hr_api.g_varchar2) then
714 p_rec.pdp_attribute8 :=
715 ben_pdp_shd.g_old_rec.pdp_attribute8;
716 End If;
717 If (p_rec.pdp_attribute9 = hr_api.g_varchar2) then
718 p_rec.pdp_attribute9 :=
719 ben_pdp_shd.g_old_rec.pdp_attribute9;
720 End If;
721 If (p_rec.pdp_attribute10 = hr_api.g_varchar2) then
722 p_rec.pdp_attribute10 :=
723 ben_pdp_shd.g_old_rec.pdp_attribute10;
724 End If;
725 If (p_rec.pdp_attribute11 = hr_api.g_varchar2) then
726 p_rec.pdp_attribute11 :=
727 ben_pdp_shd.g_old_rec.pdp_attribute11;
728 End If;
729 If (p_rec.pdp_attribute12 = hr_api.g_varchar2) then
730 p_rec.pdp_attribute12 :=
731 ben_pdp_shd.g_old_rec.pdp_attribute12;
732 End If;
733 If (p_rec.pdp_attribute13 = hr_api.g_varchar2) then
734 p_rec.pdp_attribute13 :=
735 ben_pdp_shd.g_old_rec.pdp_attribute13;
736 End If;
737 If (p_rec.pdp_attribute14 = hr_api.g_varchar2) then
738 p_rec.pdp_attribute14 :=
739 ben_pdp_shd.g_old_rec.pdp_attribute14;
740 End If;
741 If (p_rec.pdp_attribute15 = hr_api.g_varchar2) then
742 p_rec.pdp_attribute15 :=
743 ben_pdp_shd.g_old_rec.pdp_attribute15;
744 End If;
745 If (p_rec.pdp_attribute16 = hr_api.g_varchar2) then
746 p_rec.pdp_attribute16 :=
747 ben_pdp_shd.g_old_rec.pdp_attribute16;
748 End If;
749 If (p_rec.pdp_attribute17 = hr_api.g_varchar2) then
750 p_rec.pdp_attribute17 :=
751 ben_pdp_shd.g_old_rec.pdp_attribute17;
752 End If;
753 If (p_rec.pdp_attribute18 = hr_api.g_varchar2) then
754 p_rec.pdp_attribute18 :=
755 ben_pdp_shd.g_old_rec.pdp_attribute18;
756 End If;
757 If (p_rec.pdp_attribute19 = hr_api.g_varchar2) then
758 p_rec.pdp_attribute19 :=
759 ben_pdp_shd.g_old_rec.pdp_attribute19;
760 End If;
761 If (p_rec.pdp_attribute20 = hr_api.g_varchar2) then
762 p_rec.pdp_attribute20 :=
763 ben_pdp_shd.g_old_rec.pdp_attribute20;
764 End If;
765 If (p_rec.pdp_attribute21 = hr_api.g_varchar2) then
766 p_rec.pdp_attribute21 :=
767 ben_pdp_shd.g_old_rec.pdp_attribute21;
768 End If;
769 If (p_rec.pdp_attribute22 = hr_api.g_varchar2) then
770 p_rec.pdp_attribute22 :=
771 ben_pdp_shd.g_old_rec.pdp_attribute22;
772 End If;
773 If (p_rec.pdp_attribute23 = hr_api.g_varchar2) then
774 p_rec.pdp_attribute23 :=
775 ben_pdp_shd.g_old_rec.pdp_attribute23;
776 End If;
777 If (p_rec.pdp_attribute24 = hr_api.g_varchar2) then
778 p_rec.pdp_attribute24 :=
779 ben_pdp_shd.g_old_rec.pdp_attribute24;
780 End If;
781 If (p_rec.pdp_attribute25 = hr_api.g_varchar2) then
782 p_rec.pdp_attribute25 :=
783 ben_pdp_shd.g_old_rec.pdp_attribute25;
784 End If;
785 If (p_rec.pdp_attribute26 = hr_api.g_varchar2) then
786 p_rec.pdp_attribute26 :=
787 ben_pdp_shd.g_old_rec.pdp_attribute26;
788 End If;
789 If (p_rec.pdp_attribute27 = hr_api.g_varchar2) then
790 p_rec.pdp_attribute27 :=
791 ben_pdp_shd.g_old_rec.pdp_attribute27;
792 End If;
793 If (p_rec.pdp_attribute28 = hr_api.g_varchar2) then
794 p_rec.pdp_attribute28 :=
795 ben_pdp_shd.g_old_rec.pdp_attribute28;
796 End If;
797 If (p_rec.pdp_attribute29 = hr_api.g_varchar2) then
798 p_rec.pdp_attribute29 :=
799 ben_pdp_shd.g_old_rec.pdp_attribute29;
800 End If;
801 If (p_rec.pdp_attribute30 = hr_api.g_varchar2) then
802 p_rec.pdp_attribute30 :=
803 ben_pdp_shd.g_old_rec.pdp_attribute30;
804 End If;
805 If (p_rec.request_id = hr_api.g_number) then
806 p_rec.request_id :=
807 ben_pbc_shd.g_old_rec.request_id;
808 End If;
809 If (p_rec.program_application_id = hr_api.g_number) then
810 p_rec.program_application_id :=
811 ben_pbc_shd.g_old_rec.program_application_id;
812 End If;
813 If (p_rec.program_id = hr_api.g_number) then
814 p_rec.program_id :=
815 ben_pbc_shd.g_old_rec.program_id;
816 End If;
817 If (p_rec.program_update_date = hr_api.g_date) then
818 p_rec.program_update_date :=
819 ben_pbc_shd.g_old_rec.program_update_date;
820 End If;
821 If (p_rec.ovrdn_flag = hr_api.g_varchar2) then
822 p_rec.ovrdn_flag :=
823 ben_pdp_shd.g_old_rec.ovrdn_flag;
824 End If;
825 If (p_rec.per_in_ler_id = hr_api.g_number) then
826 p_rec.per_in_ler_id :=
827 ben_pdp_shd.g_old_rec.per_in_ler_id;
828 End If;
829 If (p_rec.ovrdn_thru_dt = hr_api.g_date) then
830 p_rec.ovrdn_thru_dt :=
831 ben_pdp_shd.g_old_rec.ovrdn_thru_dt;
832 End If;
833 --
834 hr_utility.set_location(' Leaving:'||l_proc, 10);
835 --
836 End convert_defs;
837 --
838 -- ----------------------------------------------------------------------------
839 -- |---------------------------------< upd >----------------------------------|
840 -- ----------------------------------------------------------------------------
841 Procedure upd
842 (
843 p_rec in out nocopy ben_pdp_shd.g_rec_type,
844 p_effective_date in date,
845 p_datetrack_mode in varchar2
846 ) is
847 --
848 l_proc varchar2(72) := g_package||'upd';
849 l_validation_start_date date;
850 l_validation_end_date date;
851 --
852 Begin
853 hr_utility.set_location('Entering:'||l_proc, 5);
854 --
855 -- Ensure that the DateTrack update mode is valid
856 --
857 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
858 --
859 -- We must lock the row which we need to update.
860 --
861 ben_pdp_shd.lck
862 (p_effective_date => p_effective_date,
863 p_datetrack_mode => p_datetrack_mode,
864 p_elig_cvrd_dpnt_id => p_rec.elig_cvrd_dpnt_id,
865 p_object_version_number => p_rec.object_version_number,
866 p_validation_start_date => l_validation_start_date,
867 p_validation_end_date => l_validation_end_date);
868 --
869 -- 1. During an update system defaults are used to determine if
870 -- arguments have been defaulted or not. We must therefore
871 -- derive the full record structure values to be updated.
872 --
873 -- 2. Call the supporting update validate operations.
874 --
875 convert_defs(p_rec);
876 ben_pdp_bus.update_validate
877 (p_rec => p_rec,
878 p_effective_date => p_effective_date,
879 p_datetrack_mode => p_datetrack_mode,
880 p_validation_start_date => l_validation_start_date,
881 p_validation_end_date => l_validation_end_date);
882 --
883 -- Call the supporting pre-update operation
884 --
885 pre_update
886 (p_rec => p_rec,
887 p_effective_date => p_effective_date,
888 p_datetrack_mode => p_datetrack_mode,
889 p_validation_start_date => l_validation_start_date,
890 p_validation_end_date => l_validation_end_date);
891 --
892 -- Update the row.
893 --
894 update_dml
895 (p_rec => p_rec,
896 p_effective_date => p_effective_date,
897 p_datetrack_mode => p_datetrack_mode,
898 p_validation_start_date => l_validation_start_date,
899 p_validation_end_date => l_validation_end_date);
900 --
901 -- Call the supporting post-update operation
902 --
903 post_update
904 (p_rec => p_rec,
905 p_effective_date => p_effective_date,
906 p_datetrack_mode => p_datetrack_mode,
907 p_validation_start_date => l_validation_start_date,
908 p_validation_end_date => l_validation_end_date);
909 End upd;
910 --
911 -- ----------------------------------------------------------------------------
912 -- |---------------------------------< upd >----------------------------------|
913 -- ----------------------------------------------------------------------------
914 Procedure upd
915 (
916 p_elig_cvrd_dpnt_id in number,
917 p_effective_start_date out nocopy date,
918 p_effective_end_date out nocopy date,
919 p_business_group_id in number default hr_api.g_number,
920 p_prtt_enrt_rslt_id in number default hr_api.g_number,
921 p_dpnt_person_id in number default hr_api.g_number,
922 p_cvg_strt_dt in date default hr_api.g_date,
923 p_cvg_thru_dt in date default hr_api.g_date,
924 p_cvg_pndg_flag in varchar2 default hr_api.g_varchar2,
925 p_pdp_attribute_category in varchar2 default hr_api.g_varchar2,
926 p_pdp_attribute1 in varchar2 default hr_api.g_varchar2,
927 p_pdp_attribute2 in varchar2 default hr_api.g_varchar2,
928 p_pdp_attribute3 in varchar2 default hr_api.g_varchar2,
929 p_pdp_attribute4 in varchar2 default hr_api.g_varchar2,
930 p_pdp_attribute5 in varchar2 default hr_api.g_varchar2,
931 p_pdp_attribute6 in varchar2 default hr_api.g_varchar2,
932 p_pdp_attribute7 in varchar2 default hr_api.g_varchar2,
933 p_pdp_attribute8 in varchar2 default hr_api.g_varchar2,
934 p_pdp_attribute9 in varchar2 default hr_api.g_varchar2,
935 p_pdp_attribute10 in varchar2 default hr_api.g_varchar2,
936 p_pdp_attribute11 in varchar2 default hr_api.g_varchar2,
937 p_pdp_attribute12 in varchar2 default hr_api.g_varchar2,
938 p_pdp_attribute13 in varchar2 default hr_api.g_varchar2,
939 p_pdp_attribute14 in varchar2 default hr_api.g_varchar2,
940 p_pdp_attribute15 in varchar2 default hr_api.g_varchar2,
941 p_pdp_attribute16 in varchar2 default hr_api.g_varchar2,
942 p_pdp_attribute17 in varchar2 default hr_api.g_varchar2,
943 p_pdp_attribute18 in varchar2 default hr_api.g_varchar2,
944 p_pdp_attribute19 in varchar2 default hr_api.g_varchar2,
945 p_pdp_attribute20 in varchar2 default hr_api.g_varchar2,
946 p_pdp_attribute21 in varchar2 default hr_api.g_varchar2,
947 p_pdp_attribute22 in varchar2 default hr_api.g_varchar2,
948 p_pdp_attribute23 in varchar2 default hr_api.g_varchar2,
949 p_pdp_attribute24 in varchar2 default hr_api.g_varchar2,
950 p_pdp_attribute25 in varchar2 default hr_api.g_varchar2,
951 p_pdp_attribute26 in varchar2 default hr_api.g_varchar2,
952 p_pdp_attribute27 in varchar2 default hr_api.g_varchar2,
953 p_pdp_attribute28 in varchar2 default hr_api.g_varchar2,
954 p_pdp_attribute29 in varchar2 default hr_api.g_varchar2,
955 p_pdp_attribute30 in varchar2 default hr_api.g_varchar2,
956 p_request_id in number default hr_api.g_number,
957 p_program_application_id in number default hr_api.g_number,
958 p_program_id in number default hr_api.g_number,
959 p_program_update_date in date default hr_api.g_date,
960 p_object_version_number in out nocopy number,
961 p_ovrdn_flag in varchar2 default hr_api.g_varchar2,
962 p_per_in_ler_id in number default hr_api.g_number,
963 p_ovrdn_thru_dt in date default hr_api.g_date,
964 p_effective_date in date,
965 p_datetrack_mode in varchar2
966 ) is
967 --
968 l_rec ben_pdp_shd.g_rec_type;
969 l_proc varchar2(72) := g_package||'upd';
970 --
971 Begin
972 hr_utility.set_location('Entering:'||l_proc, 5);
973 --
974 -- Call conversion function to turn arguments into the
975 -- l_rec structure.
976 --
977 l_rec :=
978 ben_pdp_shd.convert_args
979 (
980 p_elig_cvrd_dpnt_id,
981 null,
982 null,
983 p_business_group_id,
984 p_prtt_enrt_rslt_id,
985 p_dpnt_person_id,
986 p_cvg_strt_dt,
987 p_cvg_thru_dt,
988 p_cvg_pndg_flag,
989 p_pdp_attribute_category,
990 p_pdp_attribute1,
991 p_pdp_attribute2,
992 p_pdp_attribute3,
993 p_pdp_attribute4,
994 p_pdp_attribute5,
995 p_pdp_attribute6,
996 p_pdp_attribute7,
997 p_pdp_attribute8,
998 p_pdp_attribute9,
999 p_pdp_attribute10,
1000 p_pdp_attribute11,
1001 p_pdp_attribute12,
1002 p_pdp_attribute13,
1003 p_pdp_attribute14,
1004 p_pdp_attribute15,
1005 p_pdp_attribute16,
1006 p_pdp_attribute17,
1007 p_pdp_attribute18,
1008 p_pdp_attribute19,
1009 p_pdp_attribute20,
1010 p_pdp_attribute21,
1011 p_pdp_attribute22,
1012 p_pdp_attribute23,
1013 p_pdp_attribute24,
1014 p_pdp_attribute25,
1015 p_pdp_attribute26,
1016 p_pdp_attribute27,
1017 p_pdp_attribute28,
1018 p_pdp_attribute29,
1019 p_pdp_attribute30,
1020 p_request_id,
1021 p_program_application_id,
1022 p_program_id,
1023 p_program_update_date,
1024 p_object_version_number,
1025 p_ovrdn_flag,
1026 p_per_in_ler_id,
1027 p_ovrdn_thru_dt
1028 );
1029 --
1030 -- Having converted the arguments into the
1031 -- plsql record structure we call the corresponding record
1032 -- business process.
1033 --
1034 upd(l_rec, p_effective_date, p_datetrack_mode);
1035 p_object_version_number := l_rec.object_version_number;
1036 p_effective_start_date := l_rec.effective_start_date;
1037 p_effective_end_date := l_rec.effective_end_date;
1038 --
1039 --
1040 hr_utility.set_location(' Leaving:'||l_proc, 10);
1041 End upd;
1042 --
1043 end ben_pdp_upd;