1 Package Body ben_pbn_upd as
2 /* $Header: bepbnrhi.pkb 120.1.12010000.4 2009/09/18 07:26:53 stee ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_pbn_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_pbn_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_bnf_f',
78 p_base_key_column => 'pl_bnf_id',
79 p_base_key_value => p_rec.pl_bnf_id);
80 --
81 ben_pbn_shd.g_api_dml := true; -- Set the api dml status
82 --
83 -- Update the ben_pl_bnf_f Row
84 --
85 update ben_pl_bnf_f
86 set
87 pl_bnf_id = p_rec.pl_bnf_id,
88 business_group_id = p_rec.business_group_id,
89 prtt_enrt_rslt_id = p_rec.prtt_enrt_rslt_id,
90 bnf_person_id = p_rec.bnf_person_id,
91 organization_id = p_rec.organization_id,
92 ttee_person_id = p_rec.ttee_person_id,
93 prmry_cntngnt_cd = p_rec.prmry_cntngnt_cd,
94 pct_dsgd_num = p_rec.pct_dsgd_num,
95 amt_dsgd_val = p_rec.amt_dsgd_val,
96 amt_dsgd_uom = p_rec.amt_dsgd_uom,
97 dsgn_strt_dt = p_rec.dsgn_strt_dt,
98 dsgn_thru_dt = p_rec.dsgn_thru_dt,
99 addl_instrn_txt = p_rec.addl_instrn_txt,
100 pbn_attribute_category = p_rec.pbn_attribute_category,
101 pbn_attribute1 = p_rec.pbn_attribute1,
102 pbn_attribute2 = p_rec.pbn_attribute2,
103 pbn_attribute3 = p_rec.pbn_attribute3,
104 pbn_attribute4 = p_rec.pbn_attribute4,
105 pbn_attribute5 = p_rec.pbn_attribute5,
106 pbn_attribute6 = p_rec.pbn_attribute6,
107 pbn_attribute7 = p_rec.pbn_attribute7,
108 pbn_attribute8 = p_rec.pbn_attribute8,
109 pbn_attribute9 = p_rec.pbn_attribute9,
110 pbn_attribute10 = p_rec.pbn_attribute10,
111 pbn_attribute11 = p_rec.pbn_attribute11,
112 pbn_attribute12 = p_rec.pbn_attribute12,
113 pbn_attribute13 = p_rec.pbn_attribute13,
114 pbn_attribute14 = p_rec.pbn_attribute14,
115 pbn_attribute15 = p_rec.pbn_attribute15,
116 pbn_attribute16 = p_rec.pbn_attribute16,
117 pbn_attribute17 = p_rec.pbn_attribute17,
118 pbn_attribute18 = p_rec.pbn_attribute18,
119 pbn_attribute19 = p_rec.pbn_attribute19,
120 pbn_attribute20 = p_rec.pbn_attribute20,
121 pbn_attribute21 = p_rec.pbn_attribute21,
122 pbn_attribute22 = p_rec.pbn_attribute22,
123 pbn_attribute23 = p_rec.pbn_attribute23,
124 pbn_attribute24 = p_rec.pbn_attribute24,
125 pbn_attribute25 = p_rec.pbn_attribute25,
126 pbn_attribute26 = p_rec.pbn_attribute26,
127 pbn_attribute27 = p_rec.pbn_attribute27,
128 pbn_attribute28 = p_rec.pbn_attribute28,
129 pbn_attribute29 = p_rec.pbn_attribute29,
130 pbn_attribute30 = p_rec.pbn_attribute30,
131 request_id = p_rec.request_id,
132 program_application_id = p_rec.program_application_id,
133 program_id = p_rec.program_id,
134 program_update_date = p_rec.program_update_date,
135 object_version_number = p_rec.object_version_number,
136 per_in_ler_id = p_rec.per_in_ler_id
137 where pl_bnf_id = p_rec.pl_bnf_id
138 and effective_start_date = p_validation_start_date
139 and effective_end_date = p_validation_end_date;
140 --
141 ben_pbn_shd.g_api_dml := false; -- Unset the api dml status
142 --
143 -- Set the effective start and end dates
144 --
145 p_rec.effective_start_date := p_validation_start_date;
146 p_rec.effective_end_date := p_validation_end_date;
147 End If;
148 --
149 hr_utility.set_location(' Leaving:'||l_proc, 15);
150 Exception
151 When hr_api.check_integrity_violated Then
152 -- A check constraint has been violated
153 ben_pbn_shd.g_api_dml := false; -- Unset the api dml status
154 ben_pbn_shd.constraint_error
155 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
156 When hr_api.unique_integrity_violated Then
157 -- Unique integrity has been violated
158 ben_pbn_shd.g_api_dml := false; -- Unset the api dml status
159 ben_pbn_shd.constraint_error
160 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
161 When Others Then
162 ben_pbn_shd.g_api_dml := false; -- Unset the api dml status
163 Raise;
164 End dt_update_dml;
165 --
166 -- ----------------------------------------------------------------------------
167 -- |------------------------------< update_dml >------------------------------|
168 -- ----------------------------------------------------------------------------
169 -- {Start Of Comments}
170 --
171 -- Description:
172 -- This procedure calls the dt_update_dml control logic which handles
173 -- the actual datetrack dml.
174 --
175 -- Prerequisites:
176 -- This is an internal private procedure which must be called from the upd
177 -- procedure.
178 --
179 -- In Parameters:
180 -- A Pl/Sql record structre.
181 --
182 -- Post Success:
183 -- Processing contines.
184 --
185 -- Post Failure:
186 -- No specific error handling is required within this procedure.
187 --
188 -- Developer Implementation Notes:
189 -- The update 'set' arguments list should be modified if any of your
190 -- attributes are not updateable.
191 --
192 -- Access Status:
193 -- Internal Row Handler Use Only.
194 --
195 -- {End Of Comments}
196 -- ----------------------------------------------------------------------------
197 Procedure update_dml
198 (p_rec in out nocopy ben_pbn_shd.g_rec_type,
199 p_effective_date in date,
200 p_datetrack_mode in varchar2,
201 p_validation_start_date in date,
202 p_validation_end_date in date) is
203 --
204 l_proc varchar2(72) := g_package||'update_dml';
205 --
206 Begin
207 hr_utility.set_location('Entering:'||l_proc, 5);
208 --
209 dt_update_dml(p_rec => p_rec,
210 p_effective_date => p_effective_date,
211 p_datetrack_mode => p_datetrack_mode,
212 p_validation_start_date => p_validation_start_date,
213 p_validation_end_date => p_validation_end_date);
214 --
215 hr_utility.set_location(' Leaving:'||l_proc, 10);
216 End update_dml;
217 --
218 -- ----------------------------------------------------------------------------
219 -- |----------------------------< dt_pre_update >-----------------------------|
220 -- ----------------------------------------------------------------------------
221 -- {Start Of Comments}
222 --
223 -- Description:
224 -- The dt_pre_update procedure controls the execution
225 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
226 -- and UPDATE_CHANGE_INSERT only. The execution required is as
227 -- follows:
228 --
229 -- 1) Providing the datetrack update mode is not 'CORRECTION'
230 -- then set the effective end date of the current row (this
231 -- will be the validation_start_date - 1).
232 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
233 -- corresponding delete_dml process to delete any future rows
234 -- where the effective_start_date is greater than or equal to
235 -- the validation_start_date.
236 -- 3) Call the insert_dml process to insert the new updated row
237 -- details..
238 --
239 -- Prerequisites:
240 -- This is an internal procedure which is called from the
241 -- pre_update procedure.
242 --
243 -- In Parameters:
244 --
245 -- Post Success:
246 -- Processing continues.
247 --
248 -- Post Failure:
249 -- If an error has occurred, an error message and exception will be raised
250 -- but not handled.
251 --
252 -- Developer Implementation Notes:
253 -- This is an internal procedure which is required by Datetrack. Don't
254 -- remove or modify.
255 --
256 -- Access Status:
257 -- Internal Row Handler Use Only.
258 --
259 -- {End Of Comments}
260 -- ----------------------------------------------------------------------------
261 Procedure dt_pre_update
262 (p_rec in out nocopy ben_pbn_shd.g_rec_type,
263 p_effective_date in date,
264 p_datetrack_mode in varchar2,
265 p_validation_start_date in date,
266 p_validation_end_date in date) is
267 --
268 l_proc varchar2(72) := g_package||'dt_pre_update';
269 l_dummy_version_number number;
270 --
271 Begin
272 hr_utility.set_location('Entering:'||l_proc, 5);
273 If (p_datetrack_mode <> 'CORRECTION') then
274 hr_utility.set_location(l_proc, 10);
275 --
276 -- Update the current effective end date
277 --
278 ben_pbn_shd.upd_effective_end_date
279 (p_effective_date => p_effective_date,
280 p_base_key_value => p_rec.pl_bnf_id,
281 p_new_effective_end_date => (p_validation_start_date - 1),
282 p_validation_start_date => p_validation_start_date,
283 p_validation_end_date => p_validation_end_date,
284 p_object_version_number => l_dummy_version_number);
285 --
286 If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
287 hr_utility.set_location(l_proc, 15);
288 --
289 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
290 -- delete any future rows
291 --
292 ben_pbn_del.delete_dml
293 (p_rec => p_rec,
294 p_effective_date => p_effective_date,
295 p_datetrack_mode => p_datetrack_mode,
296 p_validation_start_date => p_validation_start_date,
297 p_validation_end_date => p_validation_end_date);
298 End If;
299 hr_utility.set_location(l_proc, 20);
300 --
301 -- We must now insert the updated row
302 --
303 ben_pbn_ins.insert_dml
304 (p_rec => p_rec,
305 p_effective_date => p_effective_date,
306 p_datetrack_mode => p_datetrack_mode,
307 p_validation_start_date => p_validation_start_date,
308 p_validation_end_date => p_validation_end_date);
309 End If;
310 hr_utility.set_location(' Leaving:'||l_proc, 20);
311 End dt_pre_update;
312 --
313 -- ----------------------------------------------------------------------------
314 -- |------------------------------< pre_update >------------------------------|
315 -- ----------------------------------------------------------------------------
316 -- {Start Of Comments}
317 --
318 -- Description:
319 -- This private procedure contains any processing which is required before
320 -- the update dml.
321 --
322 -- Prerequisites:
323 -- This is an internal procedure which is called from the upd procedure.
324 --
325 -- In Parameters:
326 -- A Pl/Sql record structre.
327 --
328 -- Post Success:
329 -- Processing continues.
330 --
331 -- Post Failure:
332 -- If an error has occurred, an error message and exception will be raised
333 -- but not handled.
334 --
335 -- Developer Implementation Notes:
336 -- Any pre-processing required before the update dml is issued should be
337 -- coded within this procedure. It is important to note that any 3rd party
338 -- maintenance should be reviewed before placing in this procedure. The call
339 -- to the dt_update_dml procedure should NOT be removed.
340 --
341 -- Access Status:
342 -- Internal Row Handler Use Only.
343 --
344 -- {End Of Comments}
345 -- ----------------------------------------------------------------------------
346 Procedure pre_update
347 (p_rec in out nocopy ben_pbn_shd.g_rec_type,
348 p_effective_date in date,
349 p_datetrack_mode in varchar2,
350 p_validation_start_date in date,
351 p_validation_end_date in date) is
352 --
353 l_proc varchar2(72) := g_package||'pre_update';
354 --
355 Begin
356 hr_utility.set_location('Entering:'||l_proc, 5);
357 --
358 --
359 --
360 dt_pre_update
361 (p_rec => p_rec,
362 p_effective_date => p_effective_date,
363 p_datetrack_mode => p_datetrack_mode,
364 p_validation_start_date => p_validation_start_date,
365 p_validation_end_date => p_validation_end_date);
366 --
367 hr_utility.set_location(' Leaving:'||l_proc, 10);
368 End pre_update;
369 --
370 -- ----------------------------------------------------------------------------
371 -- |-----------------------------< post_update >------------------------------|
372 -- ----------------------------------------------------------------------------
373 -- {Start Of Comments}
374 --
375 -- Description:
376 -- This private procedure contains any processing which is required after the
377 -- update dml.
378 --
379 -- Prerequisites:
380 -- This is an internal procedure which is called from the upd procedure.
381 --
382 -- In Parameters:
383 -- A Pl/Sql record structre.
384 --
385 -- Post Success:
386 -- Processing continues.
387 --
388 -- Post Failure:
389 -- If an error has occurred, an error message and exception will be raised
390 -- but not handled.
391 --
392 -- Developer Implementation Notes:
393 -- Any post-processing required after the update dml is issued should be
394 -- coded within this procedure. It is important to note that any 3rd party
395 -- maintenance should be reviewed before placing in this procedure.
396 --
397 -- Access Status:
398 -- Internal Row Handler Use Only.
399 --
400 -- {End Of Comments}
401 -- ----------------------------------------------------------------------------
402 Procedure post_update
403 (p_rec in ben_pbn_shd.g_rec_type,
404 p_effective_date in date,
405 p_datetrack_mode in varchar2,
406 p_validation_start_date in date,
407 p_validation_end_date in date) is
408 --
409 l_proc varchar2(72) := g_package||'post_update';
410 --
411 Begin
412 hr_utility.set_location('Entering:'||l_proc, 5);
413 --
414 --
415 -- Start of API User Hook for post_update.
416 --
417 begin
418 --
419 ben_pbn_rku.after_update
420 (
421 p_pl_bnf_id =>p_rec.pl_bnf_id
422 ,p_effective_start_date =>p_rec.effective_start_date
423 ,p_effective_end_date =>p_rec.effective_end_date
424 ,p_business_group_id =>p_rec.business_group_id
425 ,p_prtt_enrt_rslt_id =>p_rec.prtt_enrt_rslt_id
426 ,p_bnf_person_id =>p_rec.bnf_person_id
427 ,p_organization_id =>p_rec.organization_id
428 ,p_ttee_person_id =>p_rec.ttee_person_id
429 ,p_prmry_cntngnt_cd =>p_rec.prmry_cntngnt_cd
430 ,p_pct_dsgd_num =>p_rec.pct_dsgd_num
431 ,p_amt_dsgd_val =>p_rec.amt_dsgd_val
432 ,p_amt_dsgd_uom =>p_rec.amt_dsgd_uom
433 ,p_dsgn_strt_dt =>p_rec.dsgn_strt_dt
434 ,p_dsgn_thru_dt =>p_rec.dsgn_thru_dt
435 ,p_addl_instrn_txt =>p_rec.addl_instrn_txt
436 ,p_pbn_attribute_category =>p_rec.pbn_attribute_category
437 ,p_pbn_attribute1 =>p_rec.pbn_attribute1
438 ,p_pbn_attribute2 =>p_rec.pbn_attribute2
439 ,p_pbn_attribute3 =>p_rec.pbn_attribute3
440 ,p_pbn_attribute4 =>p_rec.pbn_attribute4
441 ,p_pbn_attribute5 =>p_rec.pbn_attribute5
442 ,p_pbn_attribute6 =>p_rec.pbn_attribute6
443 ,p_pbn_attribute7 =>p_rec.pbn_attribute7
444 ,p_pbn_attribute8 =>p_rec.pbn_attribute8
445 ,p_pbn_attribute9 =>p_rec.pbn_attribute9
446 ,p_pbn_attribute10 =>p_rec.pbn_attribute10
447 ,p_pbn_attribute11 =>p_rec.pbn_attribute11
448 ,p_pbn_attribute12 =>p_rec.pbn_attribute12
449 ,p_pbn_attribute13 =>p_rec.pbn_attribute13
450 ,p_pbn_attribute14 =>p_rec.pbn_attribute14
451 ,p_pbn_attribute15 =>p_rec.pbn_attribute15
452 ,p_pbn_attribute16 =>p_rec.pbn_attribute16
453 ,p_pbn_attribute17 =>p_rec.pbn_attribute17
454 ,p_pbn_attribute18 =>p_rec.pbn_attribute18
455 ,p_pbn_attribute19 =>p_rec.pbn_attribute19
456 ,p_pbn_attribute20 =>p_rec.pbn_attribute20
457 ,p_pbn_attribute21 =>p_rec.pbn_attribute21
458 ,p_pbn_attribute22 =>p_rec.pbn_attribute22
459 ,p_pbn_attribute23 =>p_rec.pbn_attribute23
460 ,p_pbn_attribute24 =>p_rec.pbn_attribute24
461 ,p_pbn_attribute25 =>p_rec.pbn_attribute25
462 ,p_pbn_attribute26 =>p_rec.pbn_attribute26
463 ,p_pbn_attribute27 =>p_rec.pbn_attribute27
464 ,p_pbn_attribute28 =>p_rec.pbn_attribute28
465 ,p_pbn_attribute29 =>p_rec.pbn_attribute29
466 ,p_pbn_attribute30 =>p_rec.pbn_attribute30
467 ,p_request_id =>p_rec.request_id
468 ,p_program_application_id =>p_rec.program_application_id
469 ,p_program_id =>p_rec.program_id
470 ,p_program_update_date =>p_rec.program_update_date
471 ,p_object_version_number =>p_rec.object_version_number
472 ,p_per_in_ler_id =>p_rec.per_in_ler_id
473 ,p_effective_date =>p_effective_date
474 ,p_datetrack_mode =>p_datetrack_mode
475 ,p_validation_start_date =>p_validation_start_date
476 ,p_validation_end_date =>p_validation_end_date
477 ,p_effective_start_date_o =>ben_pbn_shd.g_old_rec.effective_start_date
478 ,p_effective_end_date_o =>ben_pbn_shd.g_old_rec.effective_end_date
479 ,p_business_group_id_o =>ben_pbn_shd.g_old_rec.business_group_id
480 ,p_prtt_enrt_rslt_id_o =>ben_pbn_shd.g_old_rec.prtt_enrt_rslt_id
481 ,p_bnf_person_id_o =>ben_pbn_shd.g_old_rec.bnf_person_id
482 ,p_organization_id_o =>ben_pbn_shd.g_old_rec.organization_id
483 ,p_ttee_person_id_o =>ben_pbn_shd.g_old_rec.ttee_person_id
484 ,p_prmry_cntngnt_cd_o =>ben_pbn_shd.g_old_rec.prmry_cntngnt_cd
485 ,p_pct_dsgd_num_o =>ben_pbn_shd.g_old_rec.pct_dsgd_num
486 ,p_amt_dsgd_val_o =>ben_pbn_shd.g_old_rec.amt_dsgd_val
487 ,p_amt_dsgd_uom_o =>ben_pbn_shd.g_old_rec.amt_dsgd_uom
488 ,p_dsgn_strt_dt_o =>ben_pbn_shd.g_old_rec.dsgn_strt_dt
489 ,p_dsgn_thru_dt_o =>ben_pbn_shd.g_old_rec.dsgn_thru_dt
490 ,p_addl_instrn_txt_o =>ben_pbn_shd.g_old_rec.addl_instrn_txt
491 ,p_pbn_attribute_category_o =>ben_pbn_shd.g_old_rec.pbn_attribute_category
492 ,p_pbn_attribute1_o =>ben_pbn_shd.g_old_rec.pbn_attribute1
493 ,p_pbn_attribute2_o =>ben_pbn_shd.g_old_rec.pbn_attribute2
494 ,p_pbn_attribute3_o =>ben_pbn_shd.g_old_rec.pbn_attribute3
495 ,p_pbn_attribute4_o =>ben_pbn_shd.g_old_rec.pbn_attribute4
496 ,p_pbn_attribute5_o =>ben_pbn_shd.g_old_rec.pbn_attribute5
497 ,p_pbn_attribute6_o =>ben_pbn_shd.g_old_rec.pbn_attribute6
498 ,p_pbn_attribute7_o =>ben_pbn_shd.g_old_rec.pbn_attribute7
499 ,p_pbn_attribute8_o =>ben_pbn_shd.g_old_rec.pbn_attribute8
500 ,p_pbn_attribute9_o =>ben_pbn_shd.g_old_rec.pbn_attribute9
501 ,p_pbn_attribute10_o =>ben_pbn_shd.g_old_rec.pbn_attribute10
502 ,p_pbn_attribute11_o =>ben_pbn_shd.g_old_rec.pbn_attribute11
503 ,p_pbn_attribute12_o =>ben_pbn_shd.g_old_rec.pbn_attribute12
504 ,p_pbn_attribute13_o =>ben_pbn_shd.g_old_rec.pbn_attribute13
505 ,p_pbn_attribute14_o =>ben_pbn_shd.g_old_rec.pbn_attribute14
506 ,p_pbn_attribute15_o =>ben_pbn_shd.g_old_rec.pbn_attribute15
507 ,p_pbn_attribute16_o =>ben_pbn_shd.g_old_rec.pbn_attribute16
508 ,p_pbn_attribute17_o =>ben_pbn_shd.g_old_rec.pbn_attribute17
509 ,p_pbn_attribute18_o =>ben_pbn_shd.g_old_rec.pbn_attribute18
510 ,p_pbn_attribute19_o =>ben_pbn_shd.g_old_rec.pbn_attribute19
511 ,p_pbn_attribute20_o =>ben_pbn_shd.g_old_rec.pbn_attribute20
512 ,p_pbn_attribute21_o =>ben_pbn_shd.g_old_rec.pbn_attribute21
513 ,p_pbn_attribute22_o =>ben_pbn_shd.g_old_rec.pbn_attribute22
514 ,p_pbn_attribute23_o =>ben_pbn_shd.g_old_rec.pbn_attribute23
515 ,p_pbn_attribute24_o =>ben_pbn_shd.g_old_rec.pbn_attribute24
516 ,p_pbn_attribute25_o =>ben_pbn_shd.g_old_rec.pbn_attribute25
517 ,p_pbn_attribute26_o =>ben_pbn_shd.g_old_rec.pbn_attribute26
518 ,p_pbn_attribute27_o =>ben_pbn_shd.g_old_rec.pbn_attribute27
519 ,p_pbn_attribute28_o =>ben_pbn_shd.g_old_rec.pbn_attribute28
520 ,p_pbn_attribute29_o =>ben_pbn_shd.g_old_rec.pbn_attribute29
521 ,p_pbn_attribute30_o =>ben_pbn_shd.g_old_rec.pbn_attribute30
522 ,p_request_id_o =>ben_pbn_shd.g_old_rec.request_id
523 ,p_program_application_id_o =>ben_pbn_shd.g_old_rec.program_application_id
524 ,p_program_id_o =>ben_pbn_shd.g_old_rec.program_id
525 ,p_program_update_date_o =>ben_pbn_shd.g_old_rec.program_update_date
526 ,p_object_version_number_o =>ben_pbn_shd.g_old_rec.object_version_number
527 ,p_per_in_ler_id_o =>ben_pbn_shd.g_old_rec.per_in_ler_id
528 );
529 --
530 exception
531 --
532 when hr_api.cannot_find_prog_unit then
533 --
534 hr_api.cannot_find_prog_unit_error
535 (p_module_name => 'ben_pl_bnf_f'
536 ,p_hook_type => 'AU');
537 --
538 end;
539 --
540 -- End of API User Hook for post_update.
541 --
542 --
543 hr_utility.set_location(' Leaving:'||l_proc, 10);
544 End post_update;
545 --
546 -- ----------------------------------------------------------------------------
547 -- |-----------------------------< convert_defs >-----------------------------|
548 -- ----------------------------------------------------------------------------
549 -- {Start Of Comments}
550 --
551 -- Description:
552 -- The Convert_Defs procedure has one very important function:
553 -- It must return the record structure for the row with all system defaulted
554 -- values converted into its corresponding parameter value for update. When
555 -- we attempt to update a row through the Upd process , certain
556 -- parameters can be defaulted which enables flexibility in the calling of
557 -- the upd process (e.g. only attributes which need to be updated need to be
558 -- specified). For the upd process to determine which attributes
559 -- have NOT been specified we need to check if the parameter has a reserved
560 -- system default value. Therefore, for all parameters which have a
561 -- corresponding reserved system default mechanism specified we need to
562 -- check if a system default is being used. If a system default is being
563 -- used then we convert the defaulted value into its corresponding attribute
564 -- value held in the g_old_rec data structure.
565 --
566 -- Prerequisites:
567 -- This private function can only be called from the upd process.
568 --
569 -- In Parameters:
570 -- A Pl/Sql record structre.
571 --
572 -- Post Success:
573 -- The record structure will be returned with all system defaulted parameter
574 -- values converted into its current row attribute value.
575 --
576 -- Post Failure:
577 -- No direct error handling is required within this function. Any possible
578 -- errors within this procedure will be a PL/SQL value error due to conversion
579 -- of datatypes or data lengths.
580 --
581 -- Developer Implementation Notes:
582 -- None.
583 --
584 -- Access Status:
585 -- Internal Row Handler Use Only.
586 --
587 -- {End Of Comments}
588 -- ----------------------------------------------------------------------------
589 Procedure convert_defs(p_rec in out nocopy ben_pbn_shd.g_rec_type) is
590 --
591 l_proc varchar2(72) := g_package||'convert_defs';
592 --
593 Begin
594 --
595 hr_utility.set_location('Entering:'||l_proc, 5);
596 --
597 -- We must now examine each argument value in the
598 -- p_rec plsql record structure
599 -- to see if a system default is being used. If a system default
600 -- is being used then we must set to the 'current' argument value.
601 --
602 If (p_rec.business_group_id = hr_api.g_number) then
603 p_rec.business_group_id :=
604 ben_pbn_shd.g_old_rec.business_group_id;
605 End If;
606 If (p_rec.prtt_enrt_rslt_id = hr_api.g_number) then
607 p_rec.prtt_enrt_rslt_id :=
608 ben_pbn_shd.g_old_rec.prtt_enrt_rslt_id;
609 End If;
610 If (p_rec.bnf_person_id = hr_api.g_number) then
611 p_rec.bnf_person_id :=
612 ben_pbn_shd.g_old_rec.bnf_person_id;
613 End If;
614 If (p_rec.organization_id = hr_api.g_number) then
615 p_rec.organization_id :=
616 ben_pbn_shd.g_old_rec.organization_id;
617 End If;
618 If (p_rec.ttee_person_id = hr_api.g_number) then
619 p_rec.ttee_person_id :=
620 ben_pbn_shd.g_old_rec.ttee_person_id;
621 End If;
622 If (p_rec.prmry_cntngnt_cd = hr_api.g_varchar2) then
623 p_rec.prmry_cntngnt_cd :=
624 ben_pbn_shd.g_old_rec.prmry_cntngnt_cd;
625 End If;
626 If (p_rec.pct_dsgd_num = hr_api.g_number) then
627 p_rec.pct_dsgd_num :=
628 ben_pbn_shd.g_old_rec.pct_dsgd_num;
629 End If;
630 If (p_rec.amt_dsgd_val = hr_api.g_number) then
631 p_rec.amt_dsgd_val :=
632 ben_pbn_shd.g_old_rec.amt_dsgd_val;
633 End If;
634 If (p_rec.amt_dsgd_uom = hr_api.g_varchar2) then
635 p_rec.amt_dsgd_uom :=
636 ben_pbn_shd.g_old_rec.amt_dsgd_uom;
637 End If;
638 If (p_rec.dsgn_strt_dt = hr_api.g_date) then
639 p_rec.dsgn_strt_dt :=
640 ben_pbn_shd.g_old_rec.dsgn_strt_dt;
641 End If;
642 If (p_rec.dsgn_thru_dt = hr_api.g_date) then
643 p_rec.dsgn_thru_dt :=
644 ben_pbn_shd.g_old_rec.dsgn_thru_dt;
645 End If;
646 If (p_rec.addl_instrn_txt = hr_api.g_varchar2) then
647 p_rec.addl_instrn_txt :=
648 ben_pbn_shd.g_old_rec.addl_instrn_txt;
649 End If;
650 If (p_rec.pbn_attribute_category = hr_api.g_varchar2) then
651 p_rec.pbn_attribute_category :=
652 ben_pbn_shd.g_old_rec.pbn_attribute_category;
653 End If;
654 If (p_rec.pbn_attribute1 = hr_api.g_varchar2) then
655 p_rec.pbn_attribute1 :=
656 ben_pbn_shd.g_old_rec.pbn_attribute1;
657 End If;
658 If (p_rec.pbn_attribute2 = hr_api.g_varchar2) then
659 p_rec.pbn_attribute2 :=
660 ben_pbn_shd.g_old_rec.pbn_attribute2;
661 End If;
662 If (p_rec.pbn_attribute3 = hr_api.g_varchar2) then
663 p_rec.pbn_attribute3 :=
664 ben_pbn_shd.g_old_rec.pbn_attribute3;
665 End If;
666 If (p_rec.pbn_attribute4 = hr_api.g_varchar2) then
667 p_rec.pbn_attribute4 :=
668 ben_pbn_shd.g_old_rec.pbn_attribute4;
669 End If;
670 If (p_rec.pbn_attribute5 = hr_api.g_varchar2) then
671 p_rec.pbn_attribute5 :=
672 ben_pbn_shd.g_old_rec.pbn_attribute5;
673 End If;
674 If (p_rec.pbn_attribute6 = hr_api.g_varchar2) then
675 p_rec.pbn_attribute6 :=
676 ben_pbn_shd.g_old_rec.pbn_attribute6;
677 End If;
678 If (p_rec.pbn_attribute7 = hr_api.g_varchar2) then
679 p_rec.pbn_attribute7 :=
680 ben_pbn_shd.g_old_rec.pbn_attribute7;
681 End If;
682 If (p_rec.pbn_attribute8 = hr_api.g_varchar2) then
683 p_rec.pbn_attribute8 :=
684 ben_pbn_shd.g_old_rec.pbn_attribute8;
685 End If;
686 If (p_rec.pbn_attribute9 = hr_api.g_varchar2) then
687 p_rec.pbn_attribute9 :=
688 ben_pbn_shd.g_old_rec.pbn_attribute9;
689 End If;
690 If (p_rec.pbn_attribute10 = hr_api.g_varchar2) then
691 p_rec.pbn_attribute10 :=
692 ben_pbn_shd.g_old_rec.pbn_attribute10;
693 End If;
694 If (p_rec.pbn_attribute11 = hr_api.g_varchar2) then
695 p_rec.pbn_attribute11 :=
696 ben_pbn_shd.g_old_rec.pbn_attribute11;
697 End If;
698 If (p_rec.pbn_attribute12 = hr_api.g_varchar2) then
699 p_rec.pbn_attribute12 :=
700 ben_pbn_shd.g_old_rec.pbn_attribute12;
701 End If;
702 If (p_rec.pbn_attribute13 = hr_api.g_varchar2) then
703 p_rec.pbn_attribute13 :=
704 ben_pbn_shd.g_old_rec.pbn_attribute13;
705 End If;
706 If (p_rec.pbn_attribute14 = hr_api.g_varchar2) then
707 p_rec.pbn_attribute14 :=
708 ben_pbn_shd.g_old_rec.pbn_attribute14;
709 End If;
710 If (p_rec.pbn_attribute15 = hr_api.g_varchar2) then
711 p_rec.pbn_attribute15 :=
712 ben_pbn_shd.g_old_rec.pbn_attribute15;
713 End If;
714 If (p_rec.pbn_attribute16 = hr_api.g_varchar2) then
715 p_rec.pbn_attribute16 :=
716 ben_pbn_shd.g_old_rec.pbn_attribute16;
717 End If;
718 If (p_rec.pbn_attribute17 = hr_api.g_varchar2) then
719 p_rec.pbn_attribute17 :=
720 ben_pbn_shd.g_old_rec.pbn_attribute17;
721 End If;
722 If (p_rec.pbn_attribute18 = hr_api.g_varchar2) then
723 p_rec.pbn_attribute18 :=
724 ben_pbn_shd.g_old_rec.pbn_attribute18;
725 End If;
726 If (p_rec.pbn_attribute19 = hr_api.g_varchar2) then
727 p_rec.pbn_attribute19 :=
728 ben_pbn_shd.g_old_rec.pbn_attribute19;
729 End If;
730 If (p_rec.pbn_attribute20 = hr_api.g_varchar2) then
731 p_rec.pbn_attribute20 :=
732 ben_pbn_shd.g_old_rec.pbn_attribute20;
733 End If;
734 If (p_rec.pbn_attribute21 = hr_api.g_varchar2) then
735 p_rec.pbn_attribute21 :=
736 ben_pbn_shd.g_old_rec.pbn_attribute21;
737 End If;
738 If (p_rec.pbn_attribute22 = hr_api.g_varchar2) then
739 p_rec.pbn_attribute22 :=
740 ben_pbn_shd.g_old_rec.pbn_attribute22;
741 End If;
742 If (p_rec.pbn_attribute23 = hr_api.g_varchar2) then
743 p_rec.pbn_attribute23 :=
744 ben_pbn_shd.g_old_rec.pbn_attribute23;
745 End If;
746 If (p_rec.pbn_attribute24 = hr_api.g_varchar2) then
747 p_rec.pbn_attribute24 :=
748 ben_pbn_shd.g_old_rec.pbn_attribute24;
749 End If;
750 If (p_rec.pbn_attribute25 = hr_api.g_varchar2) then
751 p_rec.pbn_attribute25 :=
752 ben_pbn_shd.g_old_rec.pbn_attribute25;
753 End If;
754 If (p_rec.pbn_attribute26 = hr_api.g_varchar2) then
755 p_rec.pbn_attribute26 :=
756 ben_pbn_shd.g_old_rec.pbn_attribute26;
757 End If;
758 If (p_rec.pbn_attribute27 = hr_api.g_varchar2) then
759 p_rec.pbn_attribute27 :=
760 ben_pbn_shd.g_old_rec.pbn_attribute27;
761 End If;
762 If (p_rec.pbn_attribute28 = hr_api.g_varchar2) then
763 p_rec.pbn_attribute28 :=
764 ben_pbn_shd.g_old_rec.pbn_attribute28;
765 End If;
766 If (p_rec.pbn_attribute29 = hr_api.g_varchar2) then
767 p_rec.pbn_attribute29 :=
768 ben_pbn_shd.g_old_rec.pbn_attribute29;
769 End If;
770 If (p_rec.pbn_attribute30 = hr_api.g_varchar2) then
771 p_rec.pbn_attribute30 :=
772 ben_pbn_shd.g_old_rec.pbn_attribute30;
773 End If;
774 If (p_rec.request_id = hr_api.g_number) then
775 p_rec.request_id :=
776 ben_pbn_shd.g_old_rec.request_id;
777 End If;
778 If (p_rec.program_application_id = hr_api.g_number) then
779 p_rec.program_application_id :=
780 ben_pbn_shd.g_old_rec.program_application_id;
781 End If;
782 If (p_rec.program_id = hr_api.g_number) then
783 p_rec.program_id :=
784 ben_pbn_shd.g_old_rec.program_id;
785 End If;
786 If (p_rec.program_update_date = hr_api.g_date) then
787 p_rec.program_update_date :=
788 ben_pbn_shd.g_old_rec.program_update_date;
789 End If;
790 If (p_rec.per_in_ler_id = hr_api.g_number) then
791 p_rec.per_in_ler_id :=
792 ben_pbn_shd.g_old_rec.per_in_ler_id;
793 End If;
794 --
795 hr_utility.set_location(' Leaving:'||l_proc, 10);
796 --
797 End convert_defs;
798 --
799 -- ----------------------------------------------------------------------------
800 -- |---------------------------------< upd >----------------------------------|
801 -- ----------------------------------------------------------------------------
802 Procedure upd
803 (
804 p_rec in out nocopy ben_pbn_shd.g_rec_type,
805 p_effective_date in date,
806 p_datetrack_mode in varchar2
807 ) is
808 --
809 l_proc varchar2(72) := g_package||'upd';
810 l_validation_start_date date;
811 l_validation_end_date date;
812 --
813 Begin
814 hr_utility.set_location('Entering:'||l_proc, 5);
815 --
816 -- Ensure that the DateTrack update mode is valid
817 --
818 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
819 --
820 -- We must lock the row which we need to update.
821 --
822 ben_pbn_shd.lck
823 (p_effective_date => p_effective_date,
824 p_datetrack_mode => p_datetrack_mode,
825 p_pl_bnf_id => p_rec.pl_bnf_id,
826 p_object_version_number => p_rec.object_version_number,
827 p_validation_start_date => l_validation_start_date,
828 p_validation_end_date => l_validation_end_date);
829 --
830 -- 1. During an update system defaults are used to determine if
831 -- arguments have been defaulted or not. We must therefore
832 -- derive the full record structure values to be updated.
833 --
834 -- 2. Call the supporting update validate operations.
835 --
836 convert_defs(p_rec);
837 ben_pbn_bus.update_validate
838 (p_rec => p_rec,
839 p_effective_date => p_effective_date,
840 p_datetrack_mode => p_datetrack_mode,
841 p_validation_start_date => l_validation_start_date,
842 p_validation_end_date => l_validation_end_date);
843 --
844 -- Call the supporting pre-update operation
845 --
846 pre_update
847 (p_rec => p_rec,
848 p_effective_date => p_effective_date,
849 p_datetrack_mode => p_datetrack_mode,
850 p_validation_start_date => l_validation_start_date,
851 p_validation_end_date => l_validation_end_date);
852 --
853 -- Update the row.
854 --
855 update_dml
856 (p_rec => p_rec,
857 p_effective_date => p_effective_date,
858 p_datetrack_mode => p_datetrack_mode,
859 p_validation_start_date => l_validation_start_date,
860 p_validation_end_date => l_validation_end_date);
861 --
862 -- Call the supporting post-update operation
863 --
864 post_update
865 (p_rec => p_rec,
866 p_effective_date => p_effective_date,
867 p_datetrack_mode => p_datetrack_mode,
868 p_validation_start_date => l_validation_start_date,
869 p_validation_end_date => l_validation_end_date);
870 End upd;
871 --
872 -- ----------------------------------------------------------------------------
873 -- |---------------------------------< upd >----------------------------------|
874 -- ----------------------------------------------------------------------------
875 Procedure upd
876 (
877 p_pl_bnf_id in number,
878 p_effective_start_date out nocopy date,
879 p_effective_end_date out nocopy date,
880 p_business_group_id in number default hr_api.g_number,
881 p_prtt_enrt_rslt_id in number default hr_api.g_number,
882 p_bnf_person_id in number default hr_api.g_number,
883 p_organization_id in number default hr_api.g_number,
884 p_ttee_person_id in number default hr_api.g_number,
885 p_prmry_cntngnt_cd in varchar2 default hr_api.g_varchar2,
886 p_pct_dsgd_num in number default hr_api.g_number,
887 p_amt_dsgd_val in number default hr_api.g_number,
888 p_amt_dsgd_uom in varchar2 default hr_api.g_varchar2,
889 p_dsgn_strt_dt in date default hr_api.g_date,
890 p_dsgn_thru_dt in date default hr_api.g_date,
891 p_addl_instrn_txt in varchar2 default hr_api.g_varchar2,
892 p_pbn_attribute_category in varchar2 default hr_api.g_varchar2,
893 p_pbn_attribute1 in varchar2 default hr_api.g_varchar2,
894 p_pbn_attribute2 in varchar2 default hr_api.g_varchar2,
895 p_pbn_attribute3 in varchar2 default hr_api.g_varchar2,
896 p_pbn_attribute4 in varchar2 default hr_api.g_varchar2,
897 p_pbn_attribute5 in varchar2 default hr_api.g_varchar2,
898 p_pbn_attribute6 in varchar2 default hr_api.g_varchar2,
899 p_pbn_attribute7 in varchar2 default hr_api.g_varchar2,
900 p_pbn_attribute8 in varchar2 default hr_api.g_varchar2,
901 p_pbn_attribute9 in varchar2 default hr_api.g_varchar2,
902 p_pbn_attribute10 in varchar2 default hr_api.g_varchar2,
903 p_pbn_attribute11 in varchar2 default hr_api.g_varchar2,
904 p_pbn_attribute12 in varchar2 default hr_api.g_varchar2,
905 p_pbn_attribute13 in varchar2 default hr_api.g_varchar2,
906 p_pbn_attribute14 in varchar2 default hr_api.g_varchar2,
907 p_pbn_attribute15 in varchar2 default hr_api.g_varchar2,
908 p_pbn_attribute16 in varchar2 default hr_api.g_varchar2,
909 p_pbn_attribute17 in varchar2 default hr_api.g_varchar2,
910 p_pbn_attribute18 in varchar2 default hr_api.g_varchar2,
911 p_pbn_attribute19 in varchar2 default hr_api.g_varchar2,
912 p_pbn_attribute20 in varchar2 default hr_api.g_varchar2,
913 p_pbn_attribute21 in varchar2 default hr_api.g_varchar2,
914 p_pbn_attribute22 in varchar2 default hr_api.g_varchar2,
915 p_pbn_attribute23 in varchar2 default hr_api.g_varchar2,
916 p_pbn_attribute24 in varchar2 default hr_api.g_varchar2,
917 p_pbn_attribute25 in varchar2 default hr_api.g_varchar2,
918 p_pbn_attribute26 in varchar2 default hr_api.g_varchar2,
919 p_pbn_attribute27 in varchar2 default hr_api.g_varchar2,
920 p_pbn_attribute28 in varchar2 default hr_api.g_varchar2,
921 p_pbn_attribute29 in varchar2 default hr_api.g_varchar2,
922 p_pbn_attribute30 in varchar2 default hr_api.g_varchar2,
923 p_request_id in number default hr_api.g_number,
924 p_program_application_id in number default hr_api.g_number,
925 p_program_id in number default hr_api.g_number,
926 p_program_update_date in date default hr_api.g_date,
927 p_object_version_number in out nocopy number,
928 p_per_in_ler_id in number default hr_api.g_number,
929 p_effective_date in date,
930 p_datetrack_mode in varchar2
931 ) is
932 --
933 l_rec ben_pbn_shd.g_rec_type;
934 l_proc varchar2(72) := g_package||'upd';
935 --
936 Begin
937 hr_utility.set_location('Entering:'||l_proc, 5);
938 --
939 -- Call conversion function to turn arguments into the
940 -- l_rec structure.
941 --
942 l_rec :=
943 ben_pbn_shd.convert_args
944 (
945 p_pl_bnf_id,
946 null,
947 null,
948 p_business_group_id,
949 p_prtt_enrt_rslt_id,
950 p_bnf_person_id,
951 p_organization_id,
952 p_ttee_person_id,
953 p_prmry_cntngnt_cd,
954 p_pct_dsgd_num,
955 p_amt_dsgd_val,
956 p_amt_dsgd_uom,
957 p_dsgn_strt_dt,
958 p_dsgn_thru_dt,
959 p_addl_instrn_txt,
960 p_pbn_attribute_category,
961 p_pbn_attribute1,
962 p_pbn_attribute2,
963 p_pbn_attribute3,
964 p_pbn_attribute4,
965 p_pbn_attribute5,
966 p_pbn_attribute6,
967 p_pbn_attribute7,
968 p_pbn_attribute8,
969 p_pbn_attribute9,
970 p_pbn_attribute10,
971 p_pbn_attribute11,
972 p_pbn_attribute12,
973 p_pbn_attribute13,
974 p_pbn_attribute14,
975 p_pbn_attribute15,
976 p_pbn_attribute16,
977 p_pbn_attribute17,
978 p_pbn_attribute18,
979 p_pbn_attribute19,
980 p_pbn_attribute20,
981 p_pbn_attribute21,
982 p_pbn_attribute22,
983 p_pbn_attribute23,
984 p_pbn_attribute24,
985 p_pbn_attribute25,
986 p_pbn_attribute26,
987 p_pbn_attribute27,
988 p_pbn_attribute28,
989 p_pbn_attribute29,
990 p_pbn_attribute30,
991 p_request_id,
992 p_program_application_id,
993 p_program_id,
994 p_program_update_date,
995 p_object_version_number,
996 p_per_in_ler_id
997 );
998 --
999 -- Having converted the arguments into the
1000 -- plsql record structure we call the corresponding record
1001 -- business process.
1002 --
1003 upd(l_rec, p_effective_date, p_datetrack_mode);
1004 p_object_version_number := l_rec.object_version_number;
1005 p_effective_start_date := l_rec.effective_start_date;
1006 p_effective_end_date := l_rec.effective_end_date;
1007 --
1008 --
1009 hr_utility.set_location(' Leaving:'||l_proc, 10);
1010 End upd;
1011 --
1012 end ben_pbn_upd;