1 Package Body ben_bep_upd as
2 /* $Header: bebeprhi.pkb 120.0.12010000.2 2008/08/05 14:07:52 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_bep_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
21 -- this 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 structure.
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_bep_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
63 ) is
64 --
65 l_proc varchar2(72) := g_package||'dt_update_dml';
66 --
67 Begin
68 hr_utility.set_location('Entering:'||l_proc, 5);
69 --
70 If (p_datetrack_mode = hr_api.g_correction) then
71 hr_utility.set_location(l_proc, 10);
72 --
73 -- Because we are updating a row we must get the next object
74 -- version number.
75 --
76 p_rec.object_version_number :=
77 dt_api.get_object_version_number
78 (p_base_table_name => 'ben_elig_obj_elig_profl_f'
79 ,p_base_key_column => 'elig_obj_elig_prfl_id'
80 ,p_base_key_value => p_rec.elig_obj_elig_prfl_id
81 );
82 --
83 --
84 --
85 -- Update the ben_elig_obj_elig_profl_f Row
86 --
87 update ben_elig_obj_elig_profl_f
88 set
89 elig_obj_elig_prfl_id = p_rec.elig_obj_elig_prfl_id
90 ,elig_obj_id = p_rec.elig_obj_id
91 ,elig_prfl_id = p_rec.elig_prfl_id
92 ,mndtry_flag = p_rec.mndtry_flag
93 ,business_group_id = p_rec.business_group_id
94 ,bep_attribute_category = p_rec.bep_attribute_category
95 ,bep_attribute1 = p_rec.bep_attribute1
96 ,bep_attribute2 = p_rec.bep_attribute2
97 ,bep_attribute3 = p_rec.bep_attribute3
98 ,bep_attribute4 = p_rec.bep_attribute4
99 ,bep_attribute5 = p_rec.bep_attribute5
100 ,bep_attribute6 = p_rec.bep_attribute6
101 ,bep_attribute7 = p_rec.bep_attribute7
102 ,bep_attribute8 = p_rec.bep_attribute8
103 ,bep_attribute9 = p_rec.bep_attribute9
104 ,bep_attribute10 = p_rec.bep_attribute10
105 ,bep_attribute11 = p_rec.bep_attribute11
106 ,bep_attribute12 = p_rec.bep_attribute12
107 ,bep_attribute13 = p_rec.bep_attribute13
108 ,bep_attribute14 = p_rec.bep_attribute14
109 ,bep_attribute15 = p_rec.bep_attribute15
110 ,bep_attribute16 = p_rec.bep_attribute16
111 ,bep_attribute17 = p_rec.bep_attribute17
112 ,bep_attribute18 = p_rec.bep_attribute18
113 ,bep_attribute19 = p_rec.bep_attribute19
114 ,bep_attribute20 = p_rec.bep_attribute20
115 ,object_version_number = p_rec.object_version_number
116 where elig_obj_elig_prfl_id = p_rec.elig_obj_elig_prfl_id
117 and effective_start_date = p_validation_start_date
118 and effective_end_date = p_validation_end_date;
119 --
120 --
121 --
122 -- Set the effective start and end dates
123 --
124 p_rec.effective_start_date := p_validation_start_date;
125 p_rec.effective_end_date := p_validation_end_date;
126 End If;
127 --
128 hr_utility.set_location(' Leaving:'||l_proc, 15);
129 Exception
130 When hr_api.check_integrity_violated Then
131 -- A check constraint has been violated
132 --
133 ben_bep_shd.constraint_error
134 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
135 When hr_api.unique_integrity_violated Then
136 -- Unique integrity has been violated
137 --
138 ben_bep_shd.constraint_error
139 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
140 When Others Then
141 --
142 Raise;
143 End dt_update_dml;
144 --
145 -- ----------------------------------------------------------------------------
146 -- |------------------------------< update_dml >------------------------------|
147 -- ----------------------------------------------------------------------------
148 -- {Start Of Comments}
149 --
150 -- Description:
151 -- This procedure calls the dt_update_dml control logic which handles
152 -- the actual datetrack dml.
153 --
154 -- Prerequisites:
155 -- This is an internal private procedure which must be called from the upd
156 -- procedure.
157 --
158 -- In Parameters:
159 -- A Pl/Sql record structre.
160 --
161 -- Post Success:
162 -- Processing contines.
163 --
164 -- Post Failure:
165 -- No specific error handling is required within this procedure.
166 --
167 -- Developer Implementation Notes:
168 -- The update 'set' arguments list should be modified if any of your
169 -- attributes are not updateable.
170 --
171 -- Access Status:
172 -- Internal Row Handler Use Only.
173 --
174 -- {End Of Comments}
175 -- ----------------------------------------------------------------------------
176 Procedure update_dml
177 (p_rec in out nocopy ben_bep_shd.g_rec_type
178 ,p_effective_date in date
179 ,p_datetrack_mode in varchar2
180 ,p_validation_start_date in date
181 ,p_validation_end_date in date
182 ) is
183 --
184 l_proc varchar2(72) := g_package||'update_dml';
185 --
186 Begin
187 hr_utility.set_location('Entering:'||l_proc, 5);
188 --
189 ben_bep_upd.dt_update_dml
190 (p_rec => p_rec
191 ,p_effective_date => p_effective_date
192 ,p_datetrack_mode => p_datetrack_mode
193 ,p_validation_start_date => p_validation_start_date
194 ,p_validation_end_date => p_validation_end_date
195 );
196 --
197 hr_utility.set_location(' Leaving:'||l_proc, 10);
198 End update_dml;
199 --
200 -- ----------------------------------------------------------------------------
201 -- |----------------------------< dt_pre_update >-----------------------------|
202 -- ----------------------------------------------------------------------------
203 -- {Start Of Comments}
204 --
205 -- Description:
206 -- The dt_pre_update procedure controls the execution
207 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
208 -- and UPDATE_CHANGE_INSERT only. The execution required is as
209 -- follows:
210 --
211 -- 1) Providing the datetrack update mode is not 'CORRECTION'
212 -- then set the effective end date of the current row (this
213 -- will be the validation_start_date - 1).
214 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
215 -- corresponding delete_dml process to delete any future rows
216 -- where the effective_start_date is greater than or equal to
217 -- the validation_start_date.
218 -- 3) Call the insert_dml process to insert the new updated row
219 -- details.
220 --
221 -- Prerequisites:
222 -- This is an internal procedure which is called from the
223 -- pre_update procedure.
224 --
225 -- In Parameters:
226 --
227 -- Post Success:
228 -- Processing continues.
229 --
230 -- Post Failure:
231 -- If an error has occurred, an error message and exception will be raised
232 -- but not handled.
233 --
234 -- Developer Implementation Notes:
235 -- This is an internal procedure which is required by Datetrack. Don't
236 -- remove or modify.
237 --
238 -- Access Status:
239 -- Internal Row Handler Use Only.
240 --
241 -- {End Of Comments}
242 -- ----------------------------------------------------------------------------
243 Procedure dt_pre_update
244 (p_rec in out nocopy ben_bep_shd.g_rec_type
245 ,p_effective_date in date
246 ,p_datetrack_mode in varchar2
247 ,p_validation_start_date in date
248 ,p_validation_end_date in date
249 ) is
250 --
251 l_proc varchar2(72) := g_package||'dt_pre_update';
252 l_dummy_version_number number;
253 --
254 Begin
255 hr_utility.set_location('Entering:'||l_proc, 5);
256 If (p_datetrack_mode <> hr_api.g_correction) then
257 --
258 -- Update the current effective end date
259 --
260 ben_bep_shd.upd_effective_end_date
261 (p_effective_date => p_effective_date
262 ,p_base_key_value => p_rec.elig_obj_elig_prfl_id
263 ,p_new_effective_end_date => (p_validation_start_date - 1)
264 ,p_validation_start_date => p_validation_start_date
265 ,p_validation_end_date => p_validation_end_date
266 ,p_object_version_number => l_dummy_version_number
267 );
268 --
269 If (p_datetrack_mode = hr_api.g_update_override) then
270 --
271 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
272 -- delete any future rows
273 --
274 ben_bep_del.delete_dml
275 (p_rec => p_rec
276 ,p_effective_date => p_effective_date
277 ,p_datetrack_mode => p_datetrack_mode
278 ,p_validation_start_date => p_validation_start_date
279 ,p_validation_end_date => p_validation_end_date
280 );
281 End If;
282 --
283 -- We must now insert the updated row
284 --
285 ben_bep_ins.insert_dml
286 (p_rec => p_rec
287 ,p_effective_date => p_effective_date
288 ,p_datetrack_mode => p_datetrack_mode
289 ,p_validation_start_date => p_validation_start_date
290 ,p_validation_end_date => p_validation_end_date
291 );
292 End If;
293 hr_utility.set_location(' Leaving:'||l_proc, 20);
294 End dt_pre_update;
295 --
296 -- ----------------------------------------------------------------------------
297 -- |------------------------------< pre_update >------------------------------|
298 -- ----------------------------------------------------------------------------
299 -- {Start Of Comments}
300 --
301 -- Description:
302 -- This private procedure contains any processing which is required before
303 -- the update dml.
304 --
305 -- Prerequisites:
306 -- This is an internal procedure which is called from the upd procedure.
307 --
308 -- In Parameters:
309 -- A Pl/Sql record structure.
310 --
311 -- Post Success:
312 -- Processing continues.
313 --
314 -- Post Failure:
315 -- If an error has occurred, an error message and exception will be raised
316 -- but not handled.
317 -- Developer Implementation Notes:
318 -- Any pre-processing required before the update dml is issued should be
319 -- coded within this procedure. It is important to note that any 3rd party
320 -- maintenance should be reviewed before placing in this procedure. The call
321 -- to the dt_update_dml procedure should NOT be removed.
322 --
323 -- Access Status:
324 -- Internal Row Handler Use Only.
325 --
326 -- {End Of Comments}
327 -- ----------------------------------------------------------------------------
328 Procedure pre_update
329 (p_rec in out nocopy ben_bep_shd.g_rec_type
330 ,p_effective_date in date
331 ,p_datetrack_mode in varchar2
332 ,p_validation_start_date in date
333 ,p_validation_end_date in date
334 ) is
335 --
336 l_proc varchar2(72) := g_package||'pre_update';
337 --
338 Begin
339 hr_utility.set_location('Entering:'||l_proc, 5);
340 --
341 --
342 --
343 dt_pre_update
344 (p_rec => p_rec
345 ,p_effective_date => p_effective_date
346 ,p_datetrack_mode => p_datetrack_mode
347 ,p_validation_start_date => p_validation_start_date
348 ,p_validation_end_date => p_validation_end_date
349 );
350 --
351 hr_utility.set_location(' Leaving:'||l_proc, 10);
352 End pre_update;
353 --
354 -- ----------------------------------------------------------------------------
355 -- |----------------------------< post_update >-------------------------------|
356 -- ----------------------------------------------------------------------------
357 -- {Start Of Comments}
358 --
359 -- Description:
360 -- This private procedure contains any processing which is required after
361 -- the update dml.
362 --
363 -- Prerequisites:
364 -- This is an internal procedure which is called from the upd procedure.
365 --
366 -- In Parameters:
367 -- A Pl/Sql record structure.
368 --
369 -- Post Success:
370 -- Processing continues.
371 --
372 -- Post Failure:
373 -- If an error has occurred, an error message and exception will be raised
374 -- but not handled.
375 --
376 -- Developer Implementation Notes:
377 -- Any post-processing required after the update dml is issued should be
378 -- coded within this procedure. It is important to note that any 3rd party
379 -- maintenance should be reviewed before placing in this procedure.
380 --
381 -- Access Status:
382 -- Internal Row Handler Use Only.
383 --
384 -- {End Of Comments}
385 -- ----------------------------------------------------------------------------
386 Procedure post_update
387 (p_rec in ben_bep_shd.g_rec_type
388 ,p_effective_date in date
389 ,p_datetrack_mode in varchar2
390 ,p_validation_start_date in date
391 ,p_validation_end_date in date
392 ) is
393 --
394 l_proc varchar2(72) := g_package||'post_update';
395 --
396 Begin
397 hr_utility.set_location('Entering:'||l_proc, 5);
398 begin
399 --
400 ben_bep_rku.after_update
401 (p_effective_date
402 => p_effective_date
403 ,p_datetrack_mode
404 => p_datetrack_mode
405 ,p_validation_start_date
406 => p_validation_start_date
407 ,p_validation_end_date
408 => p_validation_end_date
409 ,p_elig_obj_elig_prfl_id
410 => p_rec.elig_obj_elig_prfl_id
411 ,p_effective_start_date
412 => p_rec.effective_start_date
413 ,p_effective_end_date
414 => p_rec.effective_end_date
415 ,p_elig_obj_id
416 => p_rec.elig_obj_id
417 ,p_elig_prfl_id
418 => p_rec.elig_prfl_id
419 ,p_mndtry_flag
420 => p_rec.mndtry_flag
421 ,p_business_group_id
422 => p_rec.business_group_id
423 ,p_bep_attribute_category
424 => p_rec.bep_attribute_category
425 ,p_bep_attribute1
426 => p_rec.bep_attribute1
427 ,p_bep_attribute2
428 => p_rec.bep_attribute2
429 ,p_bep_attribute3
430 => p_rec.bep_attribute3
431 ,p_bep_attribute4
432 => p_rec.bep_attribute4
433 ,p_bep_attribute5
434 => p_rec.bep_attribute5
435 ,p_bep_attribute6
436 => p_rec.bep_attribute6
437 ,p_bep_attribute7
438 => p_rec.bep_attribute7
439 ,p_bep_attribute8
440 => p_rec.bep_attribute8
441 ,p_bep_attribute9
442 => p_rec.bep_attribute9
443 ,p_bep_attribute10
444 => p_rec.bep_attribute10
445 ,p_bep_attribute11
446 => p_rec.bep_attribute11
447 ,p_bep_attribute12
448 => p_rec.bep_attribute12
449 ,p_bep_attribute13
450 => p_rec.bep_attribute13
451 ,p_bep_attribute14
452 => p_rec.bep_attribute14
453 ,p_bep_attribute15
454 => p_rec.bep_attribute15
455 ,p_bep_attribute16
456 => p_rec.bep_attribute16
457 ,p_bep_attribute17
458 => p_rec.bep_attribute17
459 ,p_bep_attribute18
460 => p_rec.bep_attribute18
461 ,p_bep_attribute19
462 => p_rec.bep_attribute19
463 ,p_bep_attribute20
464 => p_rec.bep_attribute20
465 ,p_object_version_number
466 => p_rec.object_version_number
467 ,p_effective_start_date_o
468 => ben_bep_shd.g_old_rec.effective_start_date
469 ,p_effective_end_date_o
470 => ben_bep_shd.g_old_rec.effective_end_date
471 ,p_elig_obj_id_o
472 => ben_bep_shd.g_old_rec.elig_obj_id
473 ,p_elig_prfl_id_o
474 => ben_bep_shd.g_old_rec.elig_prfl_id
475 ,p_mndtry_flag_o
476 => ben_bep_shd.g_old_rec.mndtry_flag
477 ,p_business_group_id_o
478 => ben_bep_shd.g_old_rec.business_group_id
479 ,p_bep_attribute_category_o
480 => ben_bep_shd.g_old_rec.bep_attribute_category
481 ,p_bep_attribute1_o
482 => ben_bep_shd.g_old_rec.bep_attribute1
483 ,p_bep_attribute2_o
484 => ben_bep_shd.g_old_rec.bep_attribute2
485 ,p_bep_attribute3_o
486 => ben_bep_shd.g_old_rec.bep_attribute3
487 ,p_bep_attribute4_o
488 => ben_bep_shd.g_old_rec.bep_attribute4
489 ,p_bep_attribute5_o
490 => ben_bep_shd.g_old_rec.bep_attribute5
491 ,p_bep_attribute6_o
492 => ben_bep_shd.g_old_rec.bep_attribute6
493 ,p_bep_attribute7_o
494 => ben_bep_shd.g_old_rec.bep_attribute7
495 ,p_bep_attribute8_o
496 => ben_bep_shd.g_old_rec.bep_attribute8
497 ,p_bep_attribute9_o
498 => ben_bep_shd.g_old_rec.bep_attribute9
499 ,p_bep_attribute10_o
500 => ben_bep_shd.g_old_rec.bep_attribute10
501 ,p_bep_attribute11_o
502 => ben_bep_shd.g_old_rec.bep_attribute11
503 ,p_bep_attribute12_o
504 => ben_bep_shd.g_old_rec.bep_attribute12
505 ,p_bep_attribute13_o
506 => ben_bep_shd.g_old_rec.bep_attribute13
507 ,p_bep_attribute14_o
508 => ben_bep_shd.g_old_rec.bep_attribute14
509 ,p_bep_attribute15_o
510 => ben_bep_shd.g_old_rec.bep_attribute15
511 ,p_bep_attribute16_o
512 => ben_bep_shd.g_old_rec.bep_attribute16
513 ,p_bep_attribute17_o
514 => ben_bep_shd.g_old_rec.bep_attribute17
515 ,p_bep_attribute18_o
516 => ben_bep_shd.g_old_rec.bep_attribute18
517 ,p_bep_attribute19_o
518 => ben_bep_shd.g_old_rec.bep_attribute19
519 ,p_bep_attribute20_o
520 => ben_bep_shd.g_old_rec.bep_attribute20
521 ,p_object_version_number_o
522 => ben_bep_shd.g_old_rec.object_version_number
523 );
524 --
525 exception
526 --
527 when hr_api.cannot_find_prog_unit then
528 --
529 hr_api.cannot_find_prog_unit_error
530 (p_module_name => 'BEN_ELIG_OBJ_ELIG_PROFL_F'
531 ,p_hook_type => 'AU');
532 --
533 end;
534 --
535 hr_utility.set_location(' Leaving:'||l_proc, 10);
536 End post_update;
537 --
538 -- ----------------------------------------------------------------------------
539 -- |-----------------------------< convert_defs >-----------------------------|
540 -- ----------------------------------------------------------------------------
541 -- {Start Of Comments}
542 --
543 -- Description:
544 -- The Convert_Defs procedure has one very important function:
545 -- It must return the record structure for the row with all system defaulted
546 -- values converted into its corresponding parameter value for update. When
547 -- we attempt to update a row through the Upd process , certain
548 -- parameters can be defaulted which enables flexibility in the calling of
549 -- the upd process (e.g. only attributes which need to be updated need to be
550 -- specified). For the upd process to determine which attributes
551 -- have NOT been specified we need to check if the parameter has a reserved
552 -- system default value. Therefore, for all parameters which have a
553 -- corresponding reserved system default mechanism specified we need to
554 -- check if a system default is being used. If a system default is being
555 -- used then we convert the defaulted value into its corresponding attribute
556 -- value held in the g_old_rec data structure.
557 --
558 -- Prerequisites:
559 -- This private function can only be called from the upd process.
560 --
561 -- In Parameters:
562 -- A Pl/Sql record structure.
563 --
564 -- Post Success:
565 -- The record structure will be returned with all system defaulted parameter
566 -- values converted into its current row attribute value.
567 --
568 -- Post Failure:
569 -- No direct error handling is required within this function. Any possible
570 -- errors within this procedure will be a PL/SQL value error due to
571 -- conversion of datatypes or data lengths.
572 --
573 -- Developer Implementation Notes:
574 -- None.
575 --
576 -- Access Status:
577 -- Internal Row Handler Use Only.
578 --
579 -- {End Of Comments}
580 -- ----------------------------------------------------------------------------
581 Procedure convert_defs
582 (p_rec in out nocopy ben_bep_shd.g_rec_type
583 ) is
584 --
585 Begin
586 --
587 -- We must now examine each argument value in the
588 -- p_rec plsql record structure
589 -- to see if a system default is being used. If a system default
590 -- is being used then we must set to the 'current' argument value.
591 --
592 If (p_rec.elig_obj_id = hr_api.g_number) then
593 p_rec.elig_obj_id :=
594 ben_bep_shd.g_old_rec.elig_obj_id;
595 End If;
596 If (p_rec.elig_prfl_id = hr_api.g_number) then
597 p_rec.elig_prfl_id :=
598 ben_bep_shd.g_old_rec.elig_prfl_id;
599 End If;
600 If (p_rec.mndtry_flag = hr_api.g_varchar2) then
601 p_rec.mndtry_flag :=
602 ben_bep_shd.g_old_rec.mndtry_flag;
603 End If;
604 If (p_rec.business_group_id = hr_api.g_number) then
605 p_rec.business_group_id :=
606 ben_bep_shd.g_old_rec.business_group_id;
607 End If;
608 If (p_rec.bep_attribute_category = hr_api.g_varchar2) then
609 p_rec.bep_attribute_category :=
610 ben_bep_shd.g_old_rec.bep_attribute_category;
611 End If;
612 If (p_rec.bep_attribute1 = hr_api.g_varchar2) then
613 p_rec.bep_attribute1 :=
614 ben_bep_shd.g_old_rec.bep_attribute1;
615 End If;
616 If (p_rec.bep_attribute2 = hr_api.g_varchar2) then
617 p_rec.bep_attribute2 :=
618 ben_bep_shd.g_old_rec.bep_attribute2;
619 End If;
620 If (p_rec.bep_attribute3 = hr_api.g_varchar2) then
621 p_rec.bep_attribute3 :=
622 ben_bep_shd.g_old_rec.bep_attribute3;
623 End If;
624 If (p_rec.bep_attribute4 = hr_api.g_varchar2) then
625 p_rec.bep_attribute4 :=
626 ben_bep_shd.g_old_rec.bep_attribute4;
627 End If;
628 If (p_rec.bep_attribute5 = hr_api.g_varchar2) then
629 p_rec.bep_attribute5 :=
630 ben_bep_shd.g_old_rec.bep_attribute5;
631 End If;
632 If (p_rec.bep_attribute6 = hr_api.g_varchar2) then
633 p_rec.bep_attribute6 :=
634 ben_bep_shd.g_old_rec.bep_attribute6;
635 End If;
636 If (p_rec.bep_attribute7 = hr_api.g_varchar2) then
637 p_rec.bep_attribute7 :=
638 ben_bep_shd.g_old_rec.bep_attribute7;
639 End If;
640 If (p_rec.bep_attribute8 = hr_api.g_varchar2) then
641 p_rec.bep_attribute8 :=
642 ben_bep_shd.g_old_rec.bep_attribute8;
643 End If;
644 If (p_rec.bep_attribute9 = hr_api.g_varchar2) then
645 p_rec.bep_attribute9 :=
646 ben_bep_shd.g_old_rec.bep_attribute9;
647 End If;
648 If (p_rec.bep_attribute10 = hr_api.g_varchar2) then
649 p_rec.bep_attribute10 :=
650 ben_bep_shd.g_old_rec.bep_attribute10;
651 End If;
652 If (p_rec.bep_attribute11 = hr_api.g_varchar2) then
653 p_rec.bep_attribute11 :=
654 ben_bep_shd.g_old_rec.bep_attribute11;
655 End If;
656 If (p_rec.bep_attribute12 = hr_api.g_varchar2) then
657 p_rec.bep_attribute12 :=
658 ben_bep_shd.g_old_rec.bep_attribute12;
659 End If;
660 If (p_rec.bep_attribute13 = hr_api.g_varchar2) then
661 p_rec.bep_attribute13 :=
662 ben_bep_shd.g_old_rec.bep_attribute13;
663 End If;
664 If (p_rec.bep_attribute14 = hr_api.g_varchar2) then
665 p_rec.bep_attribute14 :=
666 ben_bep_shd.g_old_rec.bep_attribute14;
667 End If;
668 If (p_rec.bep_attribute15 = hr_api.g_varchar2) then
669 p_rec.bep_attribute15 :=
670 ben_bep_shd.g_old_rec.bep_attribute15;
671 End If;
672 If (p_rec.bep_attribute16 = hr_api.g_varchar2) then
673 p_rec.bep_attribute16 :=
674 ben_bep_shd.g_old_rec.bep_attribute16;
675 End If;
676 If (p_rec.bep_attribute17 = hr_api.g_varchar2) then
677 p_rec.bep_attribute17 :=
678 ben_bep_shd.g_old_rec.bep_attribute17;
679 End If;
680 If (p_rec.bep_attribute18 = hr_api.g_varchar2) then
681 p_rec.bep_attribute18 :=
682 ben_bep_shd.g_old_rec.bep_attribute18;
683 End If;
684 If (p_rec.bep_attribute19 = hr_api.g_varchar2) then
685 p_rec.bep_attribute19 :=
686 ben_bep_shd.g_old_rec.bep_attribute19;
687 End If;
688 If (p_rec.bep_attribute20 = hr_api.g_varchar2) then
689 p_rec.bep_attribute20 :=
690 ben_bep_shd.g_old_rec.bep_attribute20;
691 End If;
692 --
693 End convert_defs;
694 --
695 -- ----------------------------------------------------------------------------
696 -- |---------------------------------< upd >----------------------------------|
697 -- ----------------------------------------------------------------------------
698 Procedure upd
699 (p_effective_date in date
700 ,p_datetrack_mode in varchar2
701 ,p_rec in out nocopy ben_bep_shd.g_rec_type
702 ) is
703 --
704 l_proc varchar2(72) := g_package||'upd';
705 l_validation_start_date date;
706 l_validation_end_date date;
707 --
708 Begin
709 hr_utility.set_location('Entering:'||l_proc, 5);
710 --
711 -- Ensure that the DateTrack update mode is valid
712 --
713 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
714 --
715 -- We must lock the row which we need to update.
716 --
717 ben_bep_shd.lck
718 (p_effective_date => p_effective_date
719 ,p_datetrack_mode => p_datetrack_mode
720 ,p_elig_obj_elig_prfl_id => p_rec.elig_obj_elig_prfl_id
721 ,p_object_version_number => p_rec.object_version_number
722 ,p_validation_start_date => l_validation_start_date
723 ,p_validation_end_date => l_validation_end_date
724 );
725 --
726 -- 1. During an update system defaults are used to determine if
727 -- arguments have been defaulted or not. We must therefore
728 -- derive the full record structure values to be updated.
729 --
730 -- 2. Call the supporting update validate operations.
731 --
732 ben_bep_upd.convert_defs(p_rec);
733 --
734 ben_bep_bus.update_validate
735 (p_rec => p_rec
736 ,p_effective_date => p_effective_date
737 ,p_datetrack_mode => p_datetrack_mode
738 ,p_validation_start_date => l_validation_start_date
739 ,p_validation_end_date => l_validation_end_date
740 );
741 --
742 -- Call to raise any errors on multi-message list
743 hr_multi_message.end_validation_set;
744 --
745 -- Call the supporting pre-update operation
746 --
747 pre_update
748 (p_rec => p_rec
749 ,p_effective_date => p_effective_date
750 ,p_datetrack_mode => p_datetrack_mode
751 ,p_validation_start_date => l_validation_start_date
752 ,p_validation_end_date => l_validation_end_date
753 );
754 --
755 -- Update the row.
756 --
757 update_dml
758 (p_rec => p_rec
759 ,p_effective_date => p_effective_date
760 ,p_datetrack_mode => p_datetrack_mode
761 ,p_validation_start_date => l_validation_start_date
762 ,p_validation_end_date => l_validation_end_date
763 );
764 --
765 -- Call the supporting post-update operation
766 --
767 post_update
768 (p_rec => p_rec
769 ,p_effective_date => p_effective_date
770 ,p_datetrack_mode => p_datetrack_mode
771 ,p_validation_start_date => l_validation_start_date
772 ,p_validation_end_date => l_validation_end_date
773 );
774 --
775 -- Call to raise any errors on multi-message list
776 hr_multi_message.end_validation_set;
777 End upd;
778 --
779 -- ----------------------------------------------------------------------------
780 -- |------------------------------< upd >-------------------------------------|
781 -- ----------------------------------------------------------------------------
782 Procedure upd
783 (p_effective_date in date
784 ,p_datetrack_mode in varchar2
785 ,p_elig_obj_elig_prfl_id in number
786 ,p_object_version_number in out nocopy number
787 ,p_elig_obj_id in number default hr_api.g_number
788 ,p_elig_prfl_id in number default hr_api.g_number
789 ,p_mndtry_flag in varchar2 default hr_api.g_varchar2
790 ,p_business_group_id in number default hr_api.g_number
791 ,p_bep_attribute_category in varchar2 default hr_api.g_varchar2
792 ,p_bep_attribute1 in varchar2 default hr_api.g_varchar2
793 ,p_bep_attribute2 in varchar2 default hr_api.g_varchar2
794 ,p_bep_attribute3 in varchar2 default hr_api.g_varchar2
795 ,p_bep_attribute4 in varchar2 default hr_api.g_varchar2
796 ,p_bep_attribute5 in varchar2 default hr_api.g_varchar2
797 ,p_bep_attribute6 in varchar2 default hr_api.g_varchar2
798 ,p_bep_attribute7 in varchar2 default hr_api.g_varchar2
799 ,p_bep_attribute8 in varchar2 default hr_api.g_varchar2
800 ,p_bep_attribute9 in varchar2 default hr_api.g_varchar2
801 ,p_bep_attribute10 in varchar2 default hr_api.g_varchar2
802 ,p_bep_attribute11 in varchar2 default hr_api.g_varchar2
803 ,p_bep_attribute12 in varchar2 default hr_api.g_varchar2
804 ,p_bep_attribute13 in varchar2 default hr_api.g_varchar2
805 ,p_bep_attribute14 in varchar2 default hr_api.g_varchar2
806 ,p_bep_attribute15 in varchar2 default hr_api.g_varchar2
807 ,p_bep_attribute16 in varchar2 default hr_api.g_varchar2
808 ,p_bep_attribute17 in varchar2 default hr_api.g_varchar2
809 ,p_bep_attribute18 in varchar2 default hr_api.g_varchar2
810 ,p_bep_attribute19 in varchar2 default hr_api.g_varchar2
811 ,p_bep_attribute20 in varchar2 default hr_api.g_varchar2
812 ,p_effective_start_date out nocopy date
813 ,p_effective_end_date out nocopy date
814 ) is
815 --
816 l_rec ben_bep_shd.g_rec_type;
817 l_proc varchar2(72) := g_package||'upd';
818 --
819 Begin
820 hr_utility.set_location('Entering:'||l_proc, 5);
821 --
822 -- Call conversion function to turn arguments into the
823 -- l_rec structure.
824 --
825 l_rec :=
826 ben_bep_shd.convert_args
827 (p_elig_obj_elig_prfl_id
828 ,null
829 ,null
830 ,p_elig_obj_id
831 ,p_elig_prfl_id
832 ,p_mndtry_flag
833 ,p_business_group_id
834 ,p_bep_attribute_category
835 ,p_bep_attribute1
836 ,p_bep_attribute2
837 ,p_bep_attribute3
838 ,p_bep_attribute4
839 ,p_bep_attribute5
840 ,p_bep_attribute6
841 ,p_bep_attribute7
842 ,p_bep_attribute8
843 ,p_bep_attribute9
844 ,p_bep_attribute10
845 ,p_bep_attribute11
846 ,p_bep_attribute12
847 ,p_bep_attribute13
848 ,p_bep_attribute14
849 ,p_bep_attribute15
850 ,p_bep_attribute16
851 ,p_bep_attribute17
852 ,p_bep_attribute18
853 ,p_bep_attribute19
854 ,p_bep_attribute20
855 ,p_object_version_number
856 );
857 --
858 -- Having converted the arguments into the
859 -- plsql record structure we call the corresponding record
860 -- business process.
861 --
862 ben_bep_upd.upd
863 (p_effective_date
864 ,p_datetrack_mode
865 ,l_rec
866 );
867 --
868 -- Set the out parameters
869 --
870 p_object_version_number := l_rec.object_version_number;
871 p_effective_start_date := l_rec.effective_start_date;
872 p_effective_end_date := l_rec.effective_end_date;
873 --
874 --
875 hr_utility.set_location(' Leaving:'||l_proc, 10);
876 End upd;
877 --
878 end ben_bep_upd;