1 Package Body ben_ptp_upd as
2 /* $Header: beptprhi.pkb 120.1 2005/06/02 03:22:51 bmanyam noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_ptp_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_ptp_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_typ_f',
78 p_base_key_column => 'pl_typ_id',
79 p_base_key_value => p_rec.pl_typ_id);
80 --
81 ben_ptp_shd.g_api_dml := true; -- Set the api dml status
82 --
83 -- Update the ben_pl_typ_f Row
84 --
85 update ben_pl_typ_f
86 set
87 pl_typ_id = p_rec.pl_typ_id,
88 name = p_rec.name,
89 mx_enrl_alwd_num = p_rec.mx_enrl_alwd_num,
90 mn_enrl_rqd_num = p_rec.mn_enrl_rqd_num,
91 pl_typ_stat_cd = p_rec.pl_typ_stat_cd,
92 opt_typ_cd = p_rec.opt_typ_cd,
93 opt_dsply_fmt_cd = p_rec.opt_dsply_fmt_cd,
94 comp_typ_cd = p_rec.comp_typ_cd,
95 ivr_ident = p_rec.ivr_ident,
96 no_mx_enrl_num_dfnd_flag = p_rec.no_mx_enrl_num_dfnd_flag,
97 no_mn_enrl_num_dfnd_flag = p_rec.no_mn_enrl_num_dfnd_flag,
98 business_group_id = p_rec.business_group_id,
99 ptp_attribute_category = p_rec.ptp_attribute_category,
100 ptp_attribute1 = p_rec.ptp_attribute1,
101 ptp_attribute2 = p_rec.ptp_attribute2,
102 ptp_attribute3 = p_rec.ptp_attribute3,
103 ptp_attribute4 = p_rec.ptp_attribute4,
104 ptp_attribute5 = p_rec.ptp_attribute5,
105 ptp_attribute6 = p_rec.ptp_attribute6,
106 ptp_attribute7 = p_rec.ptp_attribute7,
107 ptp_attribute8 = p_rec.ptp_attribute8,
108 ptp_attribute9 = p_rec.ptp_attribute9,
109 ptp_attribute10 = p_rec.ptp_attribute10,
110 ptp_attribute11 = p_rec.ptp_attribute11,
111 ptp_attribute12 = p_rec.ptp_attribute12,
112 ptp_attribute13 = p_rec.ptp_attribute13,
113 ptp_attribute14 = p_rec.ptp_attribute14,
114 ptp_attribute15 = p_rec.ptp_attribute15,
115 ptp_attribute16 = p_rec.ptp_attribute16,
116 ptp_attribute17 = p_rec.ptp_attribute17,
117 ptp_attribute18 = p_rec.ptp_attribute18,
118 ptp_attribute19 = p_rec.ptp_attribute19,
119 ptp_attribute20 = p_rec.ptp_attribute20,
120 ptp_attribute21 = p_rec.ptp_attribute21,
121 ptp_attribute22 = p_rec.ptp_attribute22,
122 ptp_attribute23 = p_rec.ptp_attribute23,
123 ptp_attribute24 = p_rec.ptp_attribute24,
124 ptp_attribute25 = p_rec.ptp_attribute25,
125 ptp_attribute26 = p_rec.ptp_attribute26,
126 ptp_attribute27 = p_rec.ptp_attribute27,
127 ptp_attribute28 = p_rec.ptp_attribute28,
128 ptp_attribute29 = p_rec.ptp_attribute29,
129 ptp_attribute30 = p_rec.ptp_attribute30,
130 short_name = p_rec.short_name, /*FHR*/
131 short_code = p_rec.short_code, /*FHR*/
132 legislation_code = p_rec.legislation_code,
133 legislation_subgroup = p_rec.legislation_subgroup,
134 object_version_number = p_rec.object_version_number
135 where pl_typ_id = p_rec.pl_typ_id
136 and effective_start_date = p_validation_start_date
137 and effective_end_date = p_validation_end_date;
138 --
139 ben_ptp_shd.g_api_dml := false; -- Unset the api dml status
140 --
141 -- Set the effective start and end dates
142 --
143 p_rec.effective_start_date := p_validation_start_date;
144 p_rec.effective_end_date := p_validation_end_date;
145 End If;
146 --
147 hr_utility.set_location(' Leaving:'||l_proc, 15);
148 Exception
149 When hr_api.check_integrity_violated Then
150 -- A check constraint has been violated
151 ben_ptp_shd.g_api_dml := false; -- Unset the api dml status
152 ben_ptp_shd.constraint_error
153 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
154 When hr_api.unique_integrity_violated Then
155 -- Unique integrity has been violated
156 ben_ptp_shd.g_api_dml := false; -- Unset the api dml status
157 ben_ptp_shd.constraint_error
158 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
159 When Others Then
160 ben_ptp_shd.g_api_dml := false; -- Unset the api dml status
161 Raise;
162 End dt_update_dml;
163 --
164 -- ----------------------------------------------------------------------------
165 -- |------------------------------< update_dml >------------------------------|
166 -- ----------------------------------------------------------------------------
167 -- {Start Of Comments}
168 --
169 -- Description:
170 -- This procedure calls the dt_update_dml control logic which handles
171 -- the actual datetrack dml.
172 --
173 -- Prerequisites:
174 -- This is an internal private procedure which must be called from the upd
175 -- procedure.
176 --
177 -- In Parameters:
178 -- A Pl/Sql record structre.
179 --
180 -- Post Success:
181 -- Processing contines.
182 --
183 -- Post Failure:
184 -- No specific error handling is required within this procedure.
185 --
186 -- Developer Implementation Notes:
187 -- The update 'set' arguments list should be modified if any of your
188 -- attributes are not updateable.
189 --
190 -- Access Status:
191 -- Internal Row Handler Use Only.
192 --
193 -- {End Of Comments}
194 -- ----------------------------------------------------------------------------
195 Procedure update_dml
196 (p_rec in out nocopy ben_ptp_shd.g_rec_type,
197 p_effective_date in date,
198 p_datetrack_mode in varchar2,
199 p_validation_start_date in date,
200 p_validation_end_date in date) is
201 --
202 l_proc varchar2(72) := g_package||'update_dml';
203 --
204 Begin
205 hr_utility.set_location('Entering:'||l_proc, 5);
206 --
207 dt_update_dml(p_rec => p_rec,
208 p_effective_date => p_effective_date,
209 p_datetrack_mode => p_datetrack_mode,
210 p_validation_start_date => p_validation_start_date,
211 p_validation_end_date => p_validation_end_date);
212 --
213 hr_utility.set_location(' Leaving:'||l_proc, 10);
214 End update_dml;
215 --
216 -- ----------------------------------------------------------------------------
217 -- |----------------------------< dt_pre_update >-----------------------------|
218 -- ----------------------------------------------------------------------------
219 -- {Start Of Comments}
220 --
221 -- Description:
222 -- The dt_pre_update procedure controls the execution
223 -- of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
224 -- and UPDATE_CHANGE_INSERT only. The execution required is as
225 -- follows:
226 --
227 -- 1) Providing the datetrack update mode is not 'CORRECTION'
228 -- then set the effective end date of the current row (this
229 -- will be the validation_start_date - 1).
230 -- 2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
231 -- corresponding delete_dml process to delete any future rows
232 -- where the effective_start_date is greater than or equal to
233 -- the validation_start_date.
234 -- 3) Call the insert_dml process to insert the new updated row
235 -- details..
236 --
237 -- Prerequisites:
238 -- This is an internal procedure which is called from the
239 -- pre_update procedure.
240 --
241 -- In Parameters:
242 --
243 -- Post Success:
244 -- Processing continues.
245 --
246 -- Post Failure:
247 -- If an error has occurred, an error message and exception will be raised
248 -- but not handled.
249 --
250 -- Developer Implementation Notes:
251 -- This is an internal procedure which is required by Datetrack. Don't
252 -- remove or modify.
253 --
254 -- Access Status:
255 -- Internal Row Handler Use Only.
256 --
257 -- {End Of Comments}
258 -- ----------------------------------------------------------------------------
259 Procedure dt_pre_update
260 (p_rec in out nocopy ben_ptp_shd.g_rec_type,
261 p_effective_date in date,
262 p_datetrack_mode in varchar2,
263 p_validation_start_date in date,
264 p_validation_end_date in date) is
265 --
266 l_proc varchar2(72) := g_package||'dt_pre_update';
267 l_dummy_version_number number;
268 --
269 Begin
270 hr_utility.set_location('Entering:'||l_proc, 5);
271 If (p_datetrack_mode <> 'CORRECTION') then
272 hr_utility.set_location(l_proc, 10);
273 --
274 -- Update the current effective end date
275 --
276 ben_ptp_shd.upd_effective_end_date
277 (p_effective_date => p_effective_date,
278 p_base_key_value => p_rec.pl_typ_id,
279 p_new_effective_end_date => (p_validation_start_date - 1),
280 p_validation_start_date => p_validation_start_date,
281 p_validation_end_date => p_validation_end_date,
282 p_object_version_number => l_dummy_version_number);
283 --
284 If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
285 hr_utility.set_location(l_proc, 15);
286 --
287 -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
288 -- delete any future rows
289 --
290 ben_ptp_del.delete_dml
291 (p_rec => p_rec,
292 p_effective_date => p_effective_date,
293 p_datetrack_mode => p_datetrack_mode,
294 p_validation_start_date => p_validation_start_date,
295 p_validation_end_date => p_validation_end_date);
296 End If;
297 hr_utility.set_location(l_proc, 20);
298 --
299 -- We must now insert the updated row
300 --
301 ben_ptp_ins.insert_dml
302 (p_rec => p_rec,
303 p_effective_date => p_effective_date,
304 p_datetrack_mode => p_datetrack_mode,
305 p_validation_start_date => p_validation_start_date,
306 p_validation_end_date => p_validation_end_date);
307 End If;
308 hr_utility.set_location(' Leaving:'||l_proc, 20);
309 End dt_pre_update;
310 --
311 -- ----------------------------------------------------------------------------
312 -- |------------------------------< pre_update >------------------------------|
313 -- ----------------------------------------------------------------------------
314 -- {Start Of Comments}
315 --
316 -- Description:
317 -- This private procedure contains any processing which is required before
318 -- the update dml.
319 --
320 -- Prerequisites:
321 -- This is an internal procedure which is called from the upd procedure.
322 --
323 -- In Parameters:
324 -- A Pl/Sql record structre.
325 --
326 -- Post Success:
327 -- Processing continues.
328 --
329 -- Post Failure:
330 -- If an error has occurred, an error message and exception will be raised
331 -- but not handled.
332 --
333 -- Developer Implementation Notes:
334 -- Any pre-processing required before the update dml is issued should be
335 -- coded within this procedure. It is important to note that any 3rd party
336 -- maintenance should be reviewed before placing in this procedure. The call
337 -- to the dt_update_dml procedure should NOT be removed.
338 --
339 -- Access Status:
340 -- Internal Row Handler Use Only.
341 --
342 -- {End Of Comments}
343 -- ----------------------------------------------------------------------------
344 Procedure pre_update
345 (p_rec in out nocopy ben_ptp_shd.g_rec_type,
346 p_effective_date in date,
347 p_datetrack_mode in varchar2,
348 p_validation_start_date in date,
349 p_validation_end_date in date) is
350 --
351 l_proc varchar2(72) := g_package||'pre_update';
352 --
353 Begin
354 hr_utility.set_location('Entering:'||l_proc, 5);
355 --
356 --
357 --
358 dt_pre_update
359 (p_rec => p_rec,
360 p_effective_date => p_effective_date,
361 p_datetrack_mode => p_datetrack_mode,
362 p_validation_start_date => p_validation_start_date,
363 p_validation_end_date => p_validation_end_date);
364 --
365 hr_utility.set_location(' Leaving:'||l_proc, 10);
366 End pre_update;
367 --
368 -- ----------------------------------------------------------------------------
369 -- |-----------------------------< post_update >------------------------------|
370 -- ----------------------------------------------------------------------------
371 -- {Start Of Comments}
372 --
373 -- Description:
374 -- This private procedure contains any processing which is required after the
375 -- update dml.
376 --
377 -- Prerequisites:
378 -- This is an internal procedure which is called from the upd procedure.
379 --
380 -- In Parameters:
381 -- A Pl/Sql record structre.
382 --
383 -- Post Success:
384 -- Processing continues.
385 --
386 -- Post Failure:
387 -- If an error has occurred, an error message and exception will be raised
388 -- but not handled.
389 --
390 -- Developer Implementation Notes:
391 -- Any post-processing required after the update dml is issued should be
392 -- coded within this procedure. It is important to note that any 3rd party
393 -- maintenance should be reviewed before placing in this procedure.
394 --
395 -- Access Status:
396 -- Internal Row Handler Use Only.
397 --
398 -- {End Of Comments}
399 -- ----------------------------------------------------------------------------
400 Procedure post_update
401 (p_rec in ben_ptp_shd.g_rec_type,
402 p_effective_date in date,
403 p_datetrack_mode in varchar2,
404 p_validation_start_date in date,
405 p_validation_end_date in date) is
406 --
407 l_proc varchar2(72) := g_package||'post_update';
408 l_option_type_cd varchar2(30);
409 dt_1 date;
410 dt_2 date;
411 --
412 cursor c1 is
413 select pl_typ_opt_typ_id, object_version_number
414 from ben_pl_typ_opt_typ_f
415 where p_effective_Date between effective_start_date and effective_end_date
416 and pl_typ_id = p_rec.pl_typ_id;
417 --
418 Begin
419 hr_utility.set_location('Entering:'||l_proc, 5);
420 --
421 --
422 -- Start of API User Hook for post_update.
423 --
424 begin
425 --Bug 3412944
426 if ben_ptp_shd.g_old_rec.opt_typ_cd <> p_rec.opt_typ_cd then
427 for rec_c1 in c1 loop
428 ben_plan_type_option_type_api.update_plan_type_option_type
429 ( p_pl_typ_opt_typ_id => rec_c1.pl_typ_opt_typ_id,
430 p_pl_typ_opt_typ_cd => p_rec.opt_typ_cd,
431 p_effective_Start_date => dt_1,
432 p_effective_end_Date => dt_2,
433 p_object_version_number => rec_c1.object_version_number,
434 p_effective_date => p_effective_date,
435 p_datetrack_mode => p_datetrack_mode
436 );
437 end loop;
438 end if;
439 --Bug 3412944
440 --
441 ben_ptp_rku.after_update
442 (
443 p_pl_typ_id =>p_rec.pl_typ_id
444 ,p_effective_start_date =>p_rec.effective_start_date
445 ,p_effective_end_date =>p_rec.effective_end_date
446 ,p_name =>p_rec.name
447 ,p_mx_enrl_alwd_num =>p_rec.mx_enrl_alwd_num
448 ,p_mn_enrl_rqd_num =>p_rec.mn_enrl_rqd_num
449 ,p_pl_typ_stat_cd =>p_rec.pl_typ_stat_cd
450 ,p_opt_typ_cd =>p_rec.opt_typ_cd
451 ,p_opt_dsply_fmt_cd =>p_rec.opt_dsply_fmt_cd
452 ,p_comp_typ_cd =>p_rec.comp_typ_cd
453 ,p_ivr_ident =>p_rec.ivr_ident
454 ,p_no_mx_enrl_num_dfnd_flag =>p_rec.no_mx_enrl_num_dfnd_flag
455 ,p_no_mn_enrl_num_dfnd_flag =>p_rec.no_mn_enrl_num_dfnd_flag
456 ,p_business_group_id =>p_rec.business_group_id
457 ,p_ptp_attribute_category =>p_rec.ptp_attribute_category
458 ,p_ptp_attribute1 =>p_rec.ptp_attribute1
459 ,p_ptp_attribute2 =>p_rec.ptp_attribute2
460 ,p_ptp_attribute3 =>p_rec.ptp_attribute3
461 ,p_ptp_attribute4 =>p_rec.ptp_attribute4
462 ,p_ptp_attribute5 =>p_rec.ptp_attribute5
463 ,p_ptp_attribute6 =>p_rec.ptp_attribute6
464 ,p_ptp_attribute7 =>p_rec.ptp_attribute7
465 ,p_ptp_attribute8 =>p_rec.ptp_attribute8
466 ,p_ptp_attribute9 =>p_rec.ptp_attribute9
467 ,p_ptp_attribute10 =>p_rec.ptp_attribute10
468 ,p_ptp_attribute11 =>p_rec.ptp_attribute11
469 ,p_ptp_attribute12 =>p_rec.ptp_attribute12
470 ,p_ptp_attribute13 =>p_rec.ptp_attribute13
471 ,p_ptp_attribute14 =>p_rec.ptp_attribute14
472 ,p_ptp_attribute15 =>p_rec.ptp_attribute15
473 ,p_ptp_attribute16 =>p_rec.ptp_attribute16
474 ,p_ptp_attribute17 =>p_rec.ptp_attribute17
475 ,p_ptp_attribute18 =>p_rec.ptp_attribute18
476 ,p_ptp_attribute19 =>p_rec.ptp_attribute19
477 ,p_ptp_attribute20 =>p_rec.ptp_attribute20
478 ,p_ptp_attribute21 =>p_rec.ptp_attribute21
479 ,p_ptp_attribute22 =>p_rec.ptp_attribute22
480 ,p_ptp_attribute23 =>p_rec.ptp_attribute23
481 ,p_ptp_attribute24 =>p_rec.ptp_attribute24
482 ,p_ptp_attribute25 =>p_rec.ptp_attribute25
483 ,p_ptp_attribute26 =>p_rec.ptp_attribute26
484 ,p_ptp_attribute27 =>p_rec.ptp_attribute27
485 ,p_ptp_attribute28 =>p_rec.ptp_attribute28
486 ,p_ptp_attribute29 =>p_rec.ptp_attribute29
487 ,p_ptp_attribute30 =>p_rec.ptp_attribute30
488 ,p_short_name =>p_rec.short_name --FHR
489 ,p_short_code =>p_rec.short_code --FHR
490 ,p_legislation_code =>p_rec.legislation_code
491 ,p_legislation_subgroup =>p_rec.legislation_subgroup
492 ,p_object_version_number =>p_rec.object_version_number
493 ,p_effective_date =>p_effective_date
494 ,p_datetrack_mode =>p_datetrack_mode
495 ,p_validation_start_date =>p_validation_start_date
496 ,p_validation_end_date =>p_validation_end_date
497 ,p_effective_start_date_o =>ben_ptp_shd.g_old_rec.effective_start_date
498 ,p_effective_end_date_o =>ben_ptp_shd.g_old_rec.effective_end_date
499 ,p_name_o =>ben_ptp_shd.g_old_rec.name
500 ,p_mx_enrl_alwd_num_o =>ben_ptp_shd.g_old_rec.mx_enrl_alwd_num
501 ,p_mn_enrl_rqd_num_o =>ben_ptp_shd.g_old_rec.mn_enrl_rqd_num
502 ,p_pl_typ_stat_cd_o =>ben_ptp_shd.g_old_rec.pl_typ_stat_cd
503 ,p_opt_typ_cd_o =>ben_ptp_shd.g_old_rec.opt_typ_cd
504 ,p_opt_dsply_fmt_cd_o =>ben_ptp_shd.g_old_rec.opt_dsply_fmt_cd
505 ,p_comp_typ_cd_o =>ben_ptp_shd.g_old_rec.comp_typ_cd
506 ,p_ivr_ident_o =>ben_ptp_shd.g_old_rec.ivr_ident
507 ,p_no_mx_enrl_num_dfnd_flag_o =>ben_ptp_shd.g_old_rec.no_mx_enrl_num_dfnd_flag
508 ,p_no_mn_enrl_num_dfnd_flag_o =>ben_ptp_shd.g_old_rec.no_mn_enrl_num_dfnd_flag
509 ,p_business_group_id_o =>ben_ptp_shd.g_old_rec.business_group_id
510 ,p_ptp_attribute_category_o =>ben_ptp_shd.g_old_rec.ptp_attribute_category
511 ,p_ptp_attribute1_o =>ben_ptp_shd.g_old_rec.ptp_attribute1
512 ,p_ptp_attribute2_o =>ben_ptp_shd.g_old_rec.ptp_attribute2
513 ,p_ptp_attribute3_o =>ben_ptp_shd.g_old_rec.ptp_attribute3
514 ,p_ptp_attribute4_o =>ben_ptp_shd.g_old_rec.ptp_attribute4
515 ,p_ptp_attribute5_o =>ben_ptp_shd.g_old_rec.ptp_attribute5
516 ,p_ptp_attribute6_o =>ben_ptp_shd.g_old_rec.ptp_attribute6
517 ,p_ptp_attribute7_o =>ben_ptp_shd.g_old_rec.ptp_attribute7
518 ,p_ptp_attribute8_o =>ben_ptp_shd.g_old_rec.ptp_attribute8
519 ,p_ptp_attribute9_o =>ben_ptp_shd.g_old_rec.ptp_attribute9
520 ,p_ptp_attribute10_o =>ben_ptp_shd.g_old_rec.ptp_attribute10
521 ,p_ptp_attribute11_o =>ben_ptp_shd.g_old_rec.ptp_attribute11
522 ,p_ptp_attribute12_o =>ben_ptp_shd.g_old_rec.ptp_attribute12
523 ,p_ptp_attribute13_o =>ben_ptp_shd.g_old_rec.ptp_attribute13
524 ,p_ptp_attribute14_o =>ben_ptp_shd.g_old_rec.ptp_attribute14
525 ,p_ptp_attribute15_o =>ben_ptp_shd.g_old_rec.ptp_attribute15
526 ,p_ptp_attribute16_o =>ben_ptp_shd.g_old_rec.ptp_attribute16
527 ,p_ptp_attribute17_o =>ben_ptp_shd.g_old_rec.ptp_attribute17
528 ,p_ptp_attribute18_o =>ben_ptp_shd.g_old_rec.ptp_attribute18
529 ,p_ptp_attribute19_o =>ben_ptp_shd.g_old_rec.ptp_attribute19
530 ,p_ptp_attribute20_o =>ben_ptp_shd.g_old_rec.ptp_attribute20
531 ,p_ptp_attribute21_o =>ben_ptp_shd.g_old_rec.ptp_attribute21
532 ,p_ptp_attribute22_o =>ben_ptp_shd.g_old_rec.ptp_attribute22
533 ,p_ptp_attribute23_o =>ben_ptp_shd.g_old_rec.ptp_attribute23
534 ,p_ptp_attribute24_o =>ben_ptp_shd.g_old_rec.ptp_attribute24
535 ,p_ptp_attribute25_o =>ben_ptp_shd.g_old_rec.ptp_attribute25
536 ,p_ptp_attribute26_o =>ben_ptp_shd.g_old_rec.ptp_attribute26
537 ,p_ptp_attribute27_o =>ben_ptp_shd.g_old_rec.ptp_attribute27
538 ,p_ptp_attribute28_o =>ben_ptp_shd.g_old_rec.ptp_attribute28
539 ,p_ptp_attribute29_o =>ben_ptp_shd.g_old_rec.ptp_attribute29
540 ,p_ptp_attribute30_o =>ben_ptp_shd.g_old_rec.ptp_attribute30
541 ,p_short_name_o =>ben_ptp_shd.g_old_rec.short_name --FHR
542 ,p_short_code_o =>ben_ptp_shd.g_old_rec.short_code --FHR
543 ,p_legislation_code_o =>ben_ptp_shd.g_old_rec.legislation_code
544 ,p_legislation_subgroup_o =>ben_ptp_shd.g_old_rec.legislation_subgroup
545 ,p_object_version_number_o =>ben_ptp_shd.g_old_rec.object_version_number
546 );
547 --
548 exception
549 --
550 when hr_api.cannot_find_prog_unit then
551 --
552 hr_api.cannot_find_prog_unit_error
553 (p_module_name => 'ben_pl_typ_f'
554 ,p_hook_type => 'AU');
555 --
556 end;
557 --
558 -- End of API User Hook for post_update.
559 --
560 --
561 hr_utility.set_location(' Leaving:'||l_proc, 10);
562 End post_update;
563 --
564 -- ----------------------------------------------------------------------------
565 -- |-----------------------------< convert_defs >-----------------------------|
566 -- ----------------------------------------------------------------------------
567 -- {Start Of Comments}
568 --
569 -- Description:
570 -- The Convert_Defs procedure has one very important function:
571 -- It must return the record structure for the row with all system defaulted
572 -- values converted into its corresponding parameter value for update. When
573 -- we attempt to update a row through the Upd process , certain
574 -- parameters can be defaulted which enables flexibility in the calling of
575 -- the upd process (e.g. only attributes which need to be updated need to be
576 -- specified). For the upd process to determine which attributes
577 -- have NOT been specified we need to check if the parameter has a reserved
578 -- system default value. Therefore, for all parameters which have a
579 -- corresponding reserved system default mechanism specified we need to
580 -- check if a system default is being used. If a system default is being
581 -- used then we convert the defaulted value into its corresponding attribute
582 -- value held in the g_old_rec data structure.
583 --
584 -- Prerequisites:
585 -- This private function can only be called from the upd process.
586 --
587 -- In Parameters:
588 -- A Pl/Sql record structre.
589 --
590 -- Post Success:
591 -- The record structure will be returned with all system defaulted parameter
592 -- values converted into its current row attribute value.
593 --
594 -- Post Failure:
595 -- No direct error handling is required within this function. Any possible
596 -- errors within this procedure will be a PL/SQL value error due to conversion
597 -- of datatypes or data lengths.
598 --
599 -- Developer Implementation Notes:
600 -- None.
601 --
602 -- Access Status:
603 -- Internal Row Handler Use Only.
604 --
605 -- {End Of Comments}
606 -- ----------------------------------------------------------------------------
607 Procedure convert_defs(p_rec in out nocopy ben_ptp_shd.g_rec_type) is
608 --
609 l_proc varchar2(72) := g_package||'convert_defs';
610 --
611 Begin
612 --
613 hr_utility.set_location('Entering:'||l_proc, 5);
614 --
615 -- We must now examine each argument value in the
616 -- p_rec plsql record structure
617 -- to see if a system default is being used. If a system default
618 -- is being used then we must set to the 'current' argument value.
619 --
620 If (p_rec.name = hr_api.g_varchar2) then
621 p_rec.name :=
622 ben_ptp_shd.g_old_rec.name;
623 End If;
624 If (p_rec.mx_enrl_alwd_num = hr_api.g_number) then
625 p_rec.mx_enrl_alwd_num :=
626 ben_ptp_shd.g_old_rec.mx_enrl_alwd_num;
627 End If;
628 If (p_rec.mn_enrl_rqd_num = hr_api.g_number) then
629 p_rec.mn_enrl_rqd_num :=
630 ben_ptp_shd.g_old_rec.mn_enrl_rqd_num;
631 End If;
632 If (p_rec.pl_typ_stat_cd = hr_api.g_varchar2) then
633 p_rec.pl_typ_stat_cd :=
634 ben_ptp_shd.g_old_rec.pl_typ_stat_cd;
635 End If;
636 If (p_rec.opt_typ_cd = hr_api.g_varchar2) then
637 p_rec.opt_typ_cd :=
638 ben_ptp_shd.g_old_rec.opt_typ_cd;
639 End If;
640 If (p_rec.opt_dsply_fmt_cd = hr_api.g_varchar2) then
641 p_rec.opt_dsply_fmt_cd :=
642 ben_ptp_shd.g_old_rec.opt_dsply_fmt_cd;
643 End If;
644 If (p_rec.comp_typ_cd = hr_api.g_varchar2) then
645 p_rec.comp_typ_cd :=
646 ben_ptp_shd.g_old_rec.comp_typ_cd;
647 End If;
648 If (p_rec.ivr_ident = hr_api.g_varchar2) then
649 p_rec.ivr_ident :=
650 ben_ptp_shd.g_old_rec.ivr_ident;
651 End If;
652 If (p_rec.no_mx_enrl_num_dfnd_flag = hr_api.g_varchar2) then
653 p_rec.no_mx_enrl_num_dfnd_flag :=
654 ben_ptp_shd.g_old_rec.no_mx_enrl_num_dfnd_flag;
655 End If;
656 If (p_rec.no_mn_enrl_num_dfnd_flag = hr_api.g_varchar2) then
657 p_rec.no_mn_enrl_num_dfnd_flag :=
658 ben_ptp_shd.g_old_rec.no_mn_enrl_num_dfnd_flag;
659 End If;
660 If (p_rec.business_group_id = hr_api.g_number) then
661 p_rec.business_group_id :=
662 ben_ptp_shd.g_old_rec.business_group_id;
663 End If;
664 If (p_rec.ptp_attribute_category = hr_api.g_varchar2) then
665 p_rec.ptp_attribute_category :=
666 ben_ptp_shd.g_old_rec.ptp_attribute_category;
667 End If;
668 If (p_rec.ptp_attribute1 = hr_api.g_varchar2) then
669 p_rec.ptp_attribute1 :=
670 ben_ptp_shd.g_old_rec.ptp_attribute1;
671 End If;
672 If (p_rec.ptp_attribute2 = hr_api.g_varchar2) then
673 p_rec.ptp_attribute2 :=
674 ben_ptp_shd.g_old_rec.ptp_attribute2;
675 End If;
676 If (p_rec.ptp_attribute3 = hr_api.g_varchar2) then
677 p_rec.ptp_attribute3 :=
678 ben_ptp_shd.g_old_rec.ptp_attribute3;
679 End If;
680 If (p_rec.ptp_attribute4 = hr_api.g_varchar2) then
681 p_rec.ptp_attribute4 :=
682 ben_ptp_shd.g_old_rec.ptp_attribute4;
683 End If;
684 If (p_rec.ptp_attribute5 = hr_api.g_varchar2) then
685 p_rec.ptp_attribute5 :=
686 ben_ptp_shd.g_old_rec.ptp_attribute5;
687 End If;
688 If (p_rec.ptp_attribute6 = hr_api.g_varchar2) then
689 p_rec.ptp_attribute6 :=
690 ben_ptp_shd.g_old_rec.ptp_attribute6;
691 End If;
692 If (p_rec.ptp_attribute7 = hr_api.g_varchar2) then
693 p_rec.ptp_attribute7 :=
694 ben_ptp_shd.g_old_rec.ptp_attribute7;
695 End If;
696 If (p_rec.ptp_attribute8 = hr_api.g_varchar2) then
697 p_rec.ptp_attribute8 :=
698 ben_ptp_shd.g_old_rec.ptp_attribute8;
699 End If;
700 If (p_rec.ptp_attribute9 = hr_api.g_varchar2) then
701 p_rec.ptp_attribute9 :=
702 ben_ptp_shd.g_old_rec.ptp_attribute9;
703 End If;
704 If (p_rec.ptp_attribute10 = hr_api.g_varchar2) then
705 p_rec.ptp_attribute10 :=
706 ben_ptp_shd.g_old_rec.ptp_attribute10;
707 End If;
708 If (p_rec.ptp_attribute11 = hr_api.g_varchar2) then
709 p_rec.ptp_attribute11 :=
710 ben_ptp_shd.g_old_rec.ptp_attribute11;
711 End If;
712 If (p_rec.ptp_attribute12 = hr_api.g_varchar2) then
713 p_rec.ptp_attribute12 :=
714 ben_ptp_shd.g_old_rec.ptp_attribute12;
715 End If;
716 If (p_rec.ptp_attribute13 = hr_api.g_varchar2) then
717 p_rec.ptp_attribute13 :=
718 ben_ptp_shd.g_old_rec.ptp_attribute13;
719 End If;
720 If (p_rec.ptp_attribute14 = hr_api.g_varchar2) then
721 p_rec.ptp_attribute14 :=
722 ben_ptp_shd.g_old_rec.ptp_attribute14;
723 End If;
724 If (p_rec.ptp_attribute15 = hr_api.g_varchar2) then
725 p_rec.ptp_attribute15 :=
726 ben_ptp_shd.g_old_rec.ptp_attribute15;
727 End If;
728 If (p_rec.ptp_attribute16 = hr_api.g_varchar2) then
729 p_rec.ptp_attribute16 :=
730 ben_ptp_shd.g_old_rec.ptp_attribute16;
731 End If;
732 If (p_rec.ptp_attribute17 = hr_api.g_varchar2) then
733 p_rec.ptp_attribute17 :=
734 ben_ptp_shd.g_old_rec.ptp_attribute17;
735 End If;
736 If (p_rec.ptp_attribute18 = hr_api.g_varchar2) then
737 p_rec.ptp_attribute18 :=
738 ben_ptp_shd.g_old_rec.ptp_attribute18;
739 End If;
740 If (p_rec.ptp_attribute19 = hr_api.g_varchar2) then
741 p_rec.ptp_attribute19 :=
742 ben_ptp_shd.g_old_rec.ptp_attribute19;
743 End If;
744 If (p_rec.ptp_attribute20 = hr_api.g_varchar2) then
745 p_rec.ptp_attribute20 :=
746 ben_ptp_shd.g_old_rec.ptp_attribute20;
747 End If;
748 If (p_rec.ptp_attribute21 = hr_api.g_varchar2) then
749 p_rec.ptp_attribute21 :=
750 ben_ptp_shd.g_old_rec.ptp_attribute21;
751 End If;
752 If (p_rec.ptp_attribute22 = hr_api.g_varchar2) then
753 p_rec.ptp_attribute22 :=
754 ben_ptp_shd.g_old_rec.ptp_attribute22;
755 End If;
756 If (p_rec.ptp_attribute23 = hr_api.g_varchar2) then
757 p_rec.ptp_attribute23 :=
758 ben_ptp_shd.g_old_rec.ptp_attribute23;
759 End If;
760 If (p_rec.ptp_attribute24 = hr_api.g_varchar2) then
761 p_rec.ptp_attribute24 :=
762 ben_ptp_shd.g_old_rec.ptp_attribute24;
763 End If;
764 If (p_rec.ptp_attribute25 = hr_api.g_varchar2) then
765 p_rec.ptp_attribute25 :=
766 ben_ptp_shd.g_old_rec.ptp_attribute25;
767 End If;
768 If (p_rec.ptp_attribute26 = hr_api.g_varchar2) then
769 p_rec.ptp_attribute26 :=
770 ben_ptp_shd.g_old_rec.ptp_attribute26;
771 End If;
772 If (p_rec.ptp_attribute27 = hr_api.g_varchar2) then
773 p_rec.ptp_attribute27 :=
774 ben_ptp_shd.g_old_rec.ptp_attribute27;
775 End If;
776 If (p_rec.ptp_attribute28 = hr_api.g_varchar2) then
777 p_rec.ptp_attribute28 :=
778 ben_ptp_shd.g_old_rec.ptp_attribute28;
779 End If;
780 If (p_rec.ptp_attribute29 = hr_api.g_varchar2) then
781 p_rec.ptp_attribute29 :=
782 ben_ptp_shd.g_old_rec.ptp_attribute29;
783 End If;
784 If (p_rec.ptp_attribute30 = hr_api.g_varchar2) then
785 p_rec.ptp_attribute30 :=
786 ben_ptp_shd.g_old_rec.ptp_attribute30;
787 End If;
788 --FHR
789 If (p_rec.short_name = hr_api.g_varchar2) then
790 p_rec.short_name :=
791 ben_ptp_shd.g_old_rec.short_name;
792 End If;
793 If (p_rec.short_code = hr_api.g_varchar2) then
794 p_rec.short_code :=
795 ben_ptp_shd.g_old_rec.short_code;
796 End If;
797
798 If (p_rec.legislation_code = hr_api.g_varchar2) then
799 p_rec.legislation_code :=
800 ben_ptp_shd.g_old_rec.legislation_code;
801 End If;
802
803 If (p_rec.legislation_subgroup = hr_api.g_varchar2) then
804 p_rec.legislation_subgroup :=
805 ben_ptp_shd.g_old_rec.legislation_subgroup;
806 End If;
807 --
808 hr_utility.set_location(' Leaving:'||l_proc, 10);
809 --
810 End convert_defs;
811 --
812 -- ----------------------------------------------------------------------------
813 -- |---------------------------------< upd >----------------------------------|
814 -- ----------------------------------------------------------------------------
815 Procedure upd
816 (
817 p_rec in out nocopy ben_ptp_shd.g_rec_type,
818 p_effective_date in date,
819 p_datetrack_mode in varchar2
820 ) is
821 --
822 l_proc varchar2(72) := g_package||'upd';
823 l_validation_start_date date;
824 l_validation_end_date date;
825 --
826 Begin
827 hr_utility.set_location('Entering:'||l_proc, 5);
828 --
829 -- Ensure that the DateTrack update mode is valid
830 --
831 dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
832 --
833 -- We must lock the row which we need to update.
834 --
835 ben_ptp_shd.lck
836 (p_effective_date => p_effective_date,
837 p_datetrack_mode => p_datetrack_mode,
838 p_pl_typ_id => p_rec.pl_typ_id,
839 p_object_version_number => p_rec.object_version_number,
840 p_validation_start_date => l_validation_start_date,
841 p_validation_end_date => l_validation_end_date);
842 --
843 -- 1. During an update system defaults are used to determine if
844 -- arguments have been defaulted or not. We must therefore
845 -- derive the full record structure values to be updated.
846 --
847 -- 2. Call the supporting update validate operations.
848 --
849 convert_defs(p_rec);
850 ben_ptp_bus.update_validate
851 (p_rec => p_rec,
852 p_effective_date => p_effective_date,
853 p_datetrack_mode => p_datetrack_mode,
854 p_validation_start_date => l_validation_start_date,
855 p_validation_end_date => l_validation_end_date);
856 --
857 -- Call the supporting pre-update operation
858 --
859 pre_update
860 (p_rec => p_rec,
861 p_effective_date => p_effective_date,
862 p_datetrack_mode => p_datetrack_mode,
863 p_validation_start_date => l_validation_start_date,
864 p_validation_end_date => l_validation_end_date);
865 --
866 -- Update the row.
867 --
868 update_dml
869 (p_rec => p_rec,
870 p_effective_date => p_effective_date,
871 p_datetrack_mode => p_datetrack_mode,
872 p_validation_start_date => l_validation_start_date,
873 p_validation_end_date => l_validation_end_date);
874 --
875 -- Call the supporting post-update operation
876 --
877 post_update
878 (p_rec => p_rec,
879 p_effective_date => p_effective_date,
880 p_datetrack_mode => p_datetrack_mode,
881 p_validation_start_date => l_validation_start_date,
882 p_validation_end_date => l_validation_end_date);
883 End upd;
884 --
885 -- ----------------------------------------------------------------------------
886 -- |---------------------------------< upd >----------------------------------|
887 -- ----------------------------------------------------------------------------
888 Procedure upd
889 (
890 p_pl_typ_id in number,
891 p_effective_start_date out nocopy date,
892 p_effective_end_date out nocopy date,
893 p_name in varchar2 default hr_api.g_varchar2,
894 p_mx_enrl_alwd_num in number default hr_api.g_number,
895 p_mn_enrl_rqd_num in number default hr_api.g_number,
896 p_pl_typ_stat_cd in varchar2 default hr_api.g_varchar2,
897 p_opt_typ_cd in varchar2 default hr_api.g_varchar2,
898 p_opt_dsply_fmt_cd in varchar2 default hr_api.g_varchar2,
899 p_comp_typ_cd in varchar2 default hr_api.g_varchar2,
900 p_ivr_ident in varchar2 default hr_api.g_varchar2,
901 p_no_mx_enrl_num_dfnd_flag in varchar2 default hr_api.g_varchar2,
902 p_no_mn_enrl_num_dfnd_flag in varchar2 default hr_api.g_varchar2,
903 p_business_group_id in number default hr_api.g_number,
904 p_ptp_attribute_category in varchar2 default hr_api.g_varchar2,
905 p_ptp_attribute1 in varchar2 default hr_api.g_varchar2,
906 p_ptp_attribute2 in varchar2 default hr_api.g_varchar2,
907 p_ptp_attribute3 in varchar2 default hr_api.g_varchar2,
908 p_ptp_attribute4 in varchar2 default hr_api.g_varchar2,
909 p_ptp_attribute5 in varchar2 default hr_api.g_varchar2,
910 p_ptp_attribute6 in varchar2 default hr_api.g_varchar2,
911 p_ptp_attribute7 in varchar2 default hr_api.g_varchar2,
912 p_ptp_attribute8 in varchar2 default hr_api.g_varchar2,
913 p_ptp_attribute9 in varchar2 default hr_api.g_varchar2,
914 p_ptp_attribute10 in varchar2 default hr_api.g_varchar2,
915 p_ptp_attribute11 in varchar2 default hr_api.g_varchar2,
916 p_ptp_attribute12 in varchar2 default hr_api.g_varchar2,
917 p_ptp_attribute13 in varchar2 default hr_api.g_varchar2,
918 p_ptp_attribute14 in varchar2 default hr_api.g_varchar2,
919 p_ptp_attribute15 in varchar2 default hr_api.g_varchar2,
920 p_ptp_attribute16 in varchar2 default hr_api.g_varchar2,
921 p_ptp_attribute17 in varchar2 default hr_api.g_varchar2,
922 p_ptp_attribute18 in varchar2 default hr_api.g_varchar2,
923 p_ptp_attribute19 in varchar2 default hr_api.g_varchar2,
924 p_ptp_attribute20 in varchar2 default hr_api.g_varchar2,
925 p_ptp_attribute21 in varchar2 default hr_api.g_varchar2,
926 p_ptp_attribute22 in varchar2 default hr_api.g_varchar2,
927 p_ptp_attribute23 in varchar2 default hr_api.g_varchar2,
928 p_ptp_attribute24 in varchar2 default hr_api.g_varchar2,
929 p_ptp_attribute25 in varchar2 default hr_api.g_varchar2,
930 p_ptp_attribute26 in varchar2 default hr_api.g_varchar2,
931 p_ptp_attribute27 in varchar2 default hr_api.g_varchar2,
932 p_ptp_attribute28 in varchar2 default hr_api.g_varchar2,
933 p_ptp_attribute29 in varchar2 default hr_api.g_varchar2,
934 p_ptp_attribute30 in varchar2 default hr_api.g_varchar2,
935 p_short_name in varchar2 default hr_api.g_varchar2, --FHR
936 p_short_code in varchar2 default hr_api.g_varchar2, --FHR
937 p_legislation_code in varchar2 default hr_api.g_varchar2,
938 p_legislation_subgroup in varchar2 default hr_api.g_varchar2,
939 p_object_version_number in out nocopy number,
940 p_effective_date in date,
941 p_datetrack_mode in varchar2
942 ) is
943 --
944 l_rec ben_ptp_shd.g_rec_type;
945 l_proc varchar2(72) := g_package||'upd';
946 --
947 Begin
948 hr_utility.set_location('Entering:'||l_proc, 5);
949 --
950 -- Call conversion function to turn arguments into the
951 -- l_rec structure.
952 --
953 l_rec :=
954 ben_ptp_shd.convert_args
955 (
956 p_pl_typ_id,
957 null,
958 null,
959 p_name,
960 p_mx_enrl_alwd_num,
961 p_mn_enrl_rqd_num,
962 p_pl_typ_stat_cd,
963 p_opt_typ_cd,
964 p_opt_dsply_fmt_cd,
965 p_comp_typ_cd,
966 p_ivr_ident,
967 p_no_mx_enrl_num_dfnd_flag,
968 p_no_mn_enrl_num_dfnd_flag,
969 p_business_group_id,
970 p_ptp_attribute_category,
971 p_ptp_attribute1,
972 p_ptp_attribute2,
973 p_ptp_attribute3,
974 p_ptp_attribute4,
975 p_ptp_attribute5,
976 p_ptp_attribute6,
977 p_ptp_attribute7,
978 p_ptp_attribute8,
979 p_ptp_attribute9,
980 p_ptp_attribute10,
981 p_ptp_attribute11,
982 p_ptp_attribute12,
983 p_ptp_attribute13,
984 p_ptp_attribute14,
985 p_ptp_attribute15,
986 p_ptp_attribute16,
987 p_ptp_attribute17,
988 p_ptp_attribute18,
989 p_ptp_attribute19,
990 p_ptp_attribute20,
991 p_ptp_attribute21,
992 p_ptp_attribute22,
993 p_ptp_attribute23,
994 p_ptp_attribute24,
995 p_ptp_attribute25,
996 p_ptp_attribute26,
997 p_ptp_attribute27,
998 p_ptp_attribute28,
999 p_ptp_attribute29,
1000 p_ptp_attribute30,
1001 p_short_name, --FHR
1002 p_short_code, --FHR
1003 p_legislation_code,
1004 p_legislation_subgroup,
1005 p_object_version_number
1006 );
1007 --
1008 -- Having converted the arguments into the
1009 -- plsql record structure we call the corresponding record
1010 -- business process.
1011 --
1012 upd(l_rec, p_effective_date, p_datetrack_mode);
1013 p_object_version_number := l_rec.object_version_number;
1014 p_effective_start_date := l_rec.effective_start_date;
1015 p_effective_end_date := l_rec.effective_end_date;
1016 --
1017 --
1018 hr_utility.set_location(' Leaving:'||l_proc, 10);
1019 End upd;
1020 --
1021 end ben_ptp_upd;