1 Package Body ben_yrp_upd as
2 /* $Header: beyrprhi.pkb 120.0 2005/05/28 12:44:45 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_yrp_upd.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< update_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 -- This procedure controls the actual dml update logic. The processing of
17 -- this procedure is:
18 -- 1) Increment the object_version_number by 1 if the object_version_number
19 -- is defined as an attribute for this entity.
20 -- 2) To set and unset the g_api_dml status as required (as we are about to
21 -- perform dml).
22 -- 3) To update the specified row in the schema using the primary key in
23 -- the predicates.
24 -- 4) To trap any constraint violations that may have occurred.
25 -- 5) To raise any other errors.
26 --
27 -- Prerequisites:
28 -- This is an internal private procedure which must be called from the upd
29 -- procedure.
30 --
31 -- In Parameters:
32 -- A Pl/Sql record structre.
33 --
34 -- Post Success:
35 -- The specified row will be updated in the schema.
36 --
37 -- Post Failure:
38 -- On the update dml failure it is important to note that we always reset the
39 -- g_api_dml status to false.
40 -- If a check, unique or parent integrity constraint violation is raised the
41 -- constraint_error procedure will be called.
42 -- If any other error is reported, the error will be raised after the
43 -- g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 -- The update 'set' attribute list should be modified if any of your
47 -- attributes are not updateable.
48 --
49 -- Access Status:
50 -- Internal Row Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml(p_rec in out nocopy ben_yrp_shd.g_rec_type) is
55 --
56 l_proc varchar2(72) := g_package||'update_dml';
57 --
58 Begin
59 hr_utility.set_location('Entering:'||l_proc, 5);
60 --
61 -- Increment the object version
62 --
63 p_rec.object_version_number := p_rec.object_version_number + 1;
64 --
65 ben_yrp_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the ben_yr_perd Row
68 --
69 update ben_yr_perd
70 set
71 yr_perd_id = p_rec.yr_perd_id,
72 perds_in_yr_num = p_rec.perds_in_yr_num,
73 perd_tm_uom_cd = p_rec.perd_tm_uom_cd,
74 perd_typ_cd = p_rec.perd_typ_cd,
75 end_date = p_rec.end_date,
76 start_date = p_rec.start_date,
77 lmtn_yr_strt_dt = p_rec.lmtn_yr_strt_dt,
78 lmtn_yr_end_dt = p_rec.lmtn_yr_end_dt,
79 business_group_id = p_rec.business_group_id,
80 yrp_attribute_category = p_rec.yrp_attribute_category,
81 yrp_attribute1 = p_rec.yrp_attribute1,
82 yrp_attribute2 = p_rec.yrp_attribute2,
83 yrp_attribute3 = p_rec.yrp_attribute3,
84 yrp_attribute4 = p_rec.yrp_attribute4,
85 yrp_attribute5 = p_rec.yrp_attribute5,
86 yrp_attribute6 = p_rec.yrp_attribute6,
87 yrp_attribute7 = p_rec.yrp_attribute7,
88 yrp_attribute8 = p_rec.yrp_attribute8,
89 yrp_attribute9 = p_rec.yrp_attribute9,
90 yrp_attribute10 = p_rec.yrp_attribute10,
91 yrp_attribute11 = p_rec.yrp_attribute11,
92 yrp_attribute12 = p_rec.yrp_attribute12,
93 yrp_attribute13 = p_rec.yrp_attribute13,
94 yrp_attribute14 = p_rec.yrp_attribute14,
95 yrp_attribute15 = p_rec.yrp_attribute15,
96 yrp_attribute16 = p_rec.yrp_attribute16,
97 yrp_attribute17 = p_rec.yrp_attribute17,
98 yrp_attribute18 = p_rec.yrp_attribute18,
99 yrp_attribute19 = p_rec.yrp_attribute19,
100 yrp_attribute20 = p_rec.yrp_attribute20,
101 yrp_attribute21 = p_rec.yrp_attribute21,
102 yrp_attribute22 = p_rec.yrp_attribute22,
103 yrp_attribute23 = p_rec.yrp_attribute23,
104 yrp_attribute24 = p_rec.yrp_attribute24,
105 yrp_attribute25 = p_rec.yrp_attribute25,
106 yrp_attribute26 = p_rec.yrp_attribute26,
107 yrp_attribute27 = p_rec.yrp_attribute27,
108 yrp_attribute28 = p_rec.yrp_attribute28,
109 yrp_attribute29 = p_rec.yrp_attribute29,
110 yrp_attribute30 = p_rec.yrp_attribute30,
111 object_version_number = p_rec.object_version_number
112 where yr_perd_id = p_rec.yr_perd_id;
113 --
114 ben_yrp_shd.g_api_dml := false; -- Unset the api dml status
115 --
116 hr_utility.set_location(' Leaving:'||l_proc, 10);
117 --
118 Exception
119 When hr_api.check_integrity_violated Then
120 -- A check constraint has been violated
121 ben_yrp_shd.g_api_dml := false; -- Unset the api dml status
122 ben_yrp_shd.constraint_error
123 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
124 When hr_api.parent_integrity_violated Then
125 -- Parent integrity has been violated
126 ben_yrp_shd.g_api_dml := false; -- Unset the api dml status
127 ben_yrp_shd.constraint_error
128 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
129 When hr_api.unique_integrity_violated Then
130 -- Unique integrity has been violated
131 ben_yrp_shd.g_api_dml := false; -- Unset the api dml status
132 ben_yrp_shd.constraint_error
133 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
134 When Others Then
135 ben_yrp_shd.g_api_dml := false; -- Unset the api dml status
136 Raise;
137 End update_dml;
138 --
139 -- ----------------------------------------------------------------------------
140 -- |------------------------------< pre_update >------------------------------|
141 -- ----------------------------------------------------------------------------
142 -- {Start Of Comments}
143 --
144 -- Description:
145 -- This private procedure contains any processing which is required before
146 -- the update dml.
147 --
148 -- Prerequisites:
149 -- This is an internal procedure which is called from the upd procedure.
150 --
151 -- In Parameters:
152 -- A Pl/Sql record structre.
153 --
154 -- Post Success:
155 -- Processing continues.
156 --
157 -- Post Failure:
158 -- If an error has occurred, an error message and exception will be raised
159 -- but not handled.
160 --
161 -- Developer Implementation Notes:
162 -- Any pre-processing required before the update dml is issued should be
163 -- coded within this procedure. It is important to note that any 3rd party
164 -- maintenance should be reviewed before placing in this procedure.
165 --
166 -- Access Status:
167 -- Internal Row Handler Use Only.
168 --
169 -- {End Of Comments}
170 -- ----------------------------------------------------------------------------
171 Procedure pre_update(p_rec in ben_yrp_shd.g_rec_type) is
172 --
173 l_proc varchar2(72) := g_package||'pre_update';
174 --
175 Begin
176 hr_utility.set_location('Entering:'||l_proc, 5);
177 --
178 hr_utility.set_location(' Leaving:'||l_proc, 10);
179 End pre_update;
180 --
181 -- ----------------------------------------------------------------------------
182 -- |-----------------------------< post_update >------------------------------|
183 -- ----------------------------------------------------------------------------
184 -- {Start Of Comments}
185 --
186 -- Description:
187 -- This private procedure contains any processing which is required after the
188 -- update dml.
189 --
190 -- Prerequisites:
191 -- This is an internal procedure which is called from the upd procedure.
192 --
193 -- In Parameters:
194 -- A Pl/Sql record structre.
195 --
196 -- Post Success:
197 -- Processing continues.
198 --
199 -- Post Failure:
200 -- If an error has occurred, an error message and exception will be raised
201 -- but not handled.
202 --
203 -- Developer Implementation Notes:
204 -- Any post-processing required after the update dml is issued should be
205 -- coded within this procedure. It is important to note that any 3rd party
206 -- maintenance should be reviewed before placing in this procedure.
207 --
208 -- Access Status:
209 -- Internal Row Handler Use Only.
210 --
211 -- {End Of Comments}
212 -- ----------------------------------------------------------------------------
213 Procedure post_update(
214 p_effective_date in date,p_rec in ben_yrp_shd.g_rec_type) is
215 --
216 l_proc varchar2(72) := g_package||'post_update';
217 --
218 Begin
219 hr_utility.set_location('Entering:'||l_proc, 5);
220 --
221 --
222 -- Start of API User Hook for post_update.
223 --
224 begin
225 --
226 ben_yrp_rku.after_update
227 (
228 p_yr_perd_id =>p_rec.yr_perd_id
229 ,p_perds_in_yr_num =>p_rec.perds_in_yr_num
230 ,p_perd_tm_uom_cd =>p_rec.perd_tm_uom_cd
231 ,p_perd_typ_cd =>p_rec.perd_typ_cd
232 ,p_end_date =>p_rec.end_date
233 ,p_start_date =>p_rec.start_date
234 ,p_lmtn_yr_strt_dt =>p_rec.lmtn_yr_strt_dt
235 ,p_lmtn_yr_end_dt =>p_rec.lmtn_yr_end_dt
236 ,p_business_group_id =>p_rec.business_group_id
237 ,p_yrp_attribute_category =>p_rec.yrp_attribute_category
238 ,p_yrp_attribute1 =>p_rec.yrp_attribute1
239 ,p_yrp_attribute2 =>p_rec.yrp_attribute2
240 ,p_yrp_attribute3 =>p_rec.yrp_attribute3
241 ,p_yrp_attribute4 =>p_rec.yrp_attribute4
242 ,p_yrp_attribute5 =>p_rec.yrp_attribute5
243 ,p_yrp_attribute6 =>p_rec.yrp_attribute6
244 ,p_yrp_attribute7 =>p_rec.yrp_attribute7
245 ,p_yrp_attribute8 =>p_rec.yrp_attribute8
246 ,p_yrp_attribute9 =>p_rec.yrp_attribute9
247 ,p_yrp_attribute10 =>p_rec.yrp_attribute10
248 ,p_yrp_attribute11 =>p_rec.yrp_attribute11
249 ,p_yrp_attribute12 =>p_rec.yrp_attribute12
250 ,p_yrp_attribute13 =>p_rec.yrp_attribute13
251 ,p_yrp_attribute14 =>p_rec.yrp_attribute14
252 ,p_yrp_attribute15 =>p_rec.yrp_attribute15
253 ,p_yrp_attribute16 =>p_rec.yrp_attribute16
254 ,p_yrp_attribute17 =>p_rec.yrp_attribute17
255 ,p_yrp_attribute18 =>p_rec.yrp_attribute18
256 ,p_yrp_attribute19 =>p_rec.yrp_attribute19
257 ,p_yrp_attribute20 =>p_rec.yrp_attribute20
258 ,p_yrp_attribute21 =>p_rec.yrp_attribute21
259 ,p_yrp_attribute22 =>p_rec.yrp_attribute22
260 ,p_yrp_attribute23 =>p_rec.yrp_attribute23
261 ,p_yrp_attribute24 =>p_rec.yrp_attribute24
262 ,p_yrp_attribute25 =>p_rec.yrp_attribute25
263 ,p_yrp_attribute26 =>p_rec.yrp_attribute26
264 ,p_yrp_attribute27 =>p_rec.yrp_attribute27
265 ,p_yrp_attribute28 =>p_rec.yrp_attribute28
266 ,p_yrp_attribute29 =>p_rec.yrp_attribute29
267 ,p_yrp_attribute30 =>p_rec.yrp_attribute30
268 ,p_object_version_number =>p_rec.object_version_number
269 ,p_effective_date =>p_effective_date
270 ,p_perds_in_yr_num_o =>ben_yrp_shd.g_old_rec.perds_in_yr_num
271 ,p_perd_tm_uom_cd_o =>ben_yrp_shd.g_old_rec.perd_tm_uom_cd
272 ,p_perd_typ_cd_o =>ben_yrp_shd.g_old_rec.perd_typ_cd
273 ,p_end_date_o =>ben_yrp_shd.g_old_rec.end_date
274 ,p_start_date_o =>ben_yrp_shd.g_old_rec.start_date
275 ,p_lmtn_yr_strt_dt_o =>ben_yrp_shd.g_old_rec.lmtn_yr_strt_dt
276 ,p_lmtn_yr_end_dt_o =>ben_yrp_shd.g_old_rec.lmtn_yr_end_dt
277 ,p_business_group_id_o =>ben_yrp_shd.g_old_rec.business_group_id
278 ,p_yrp_attribute_category_o =>ben_yrp_shd.g_old_rec.yrp_attribute_category
279 ,p_yrp_attribute1_o =>ben_yrp_shd.g_old_rec.yrp_attribute1
280 ,p_yrp_attribute2_o =>ben_yrp_shd.g_old_rec.yrp_attribute2
281 ,p_yrp_attribute3_o =>ben_yrp_shd.g_old_rec.yrp_attribute3
282 ,p_yrp_attribute4_o =>ben_yrp_shd.g_old_rec.yrp_attribute4
283 ,p_yrp_attribute5_o =>ben_yrp_shd.g_old_rec.yrp_attribute5
284 ,p_yrp_attribute6_o =>ben_yrp_shd.g_old_rec.yrp_attribute6
285 ,p_yrp_attribute7_o =>ben_yrp_shd.g_old_rec.yrp_attribute7
286 ,p_yrp_attribute8_o =>ben_yrp_shd.g_old_rec.yrp_attribute8
287 ,p_yrp_attribute9_o =>ben_yrp_shd.g_old_rec.yrp_attribute9
288 ,p_yrp_attribute10_o =>ben_yrp_shd.g_old_rec.yrp_attribute10
289 ,p_yrp_attribute11_o =>ben_yrp_shd.g_old_rec.yrp_attribute11
290 ,p_yrp_attribute12_o =>ben_yrp_shd.g_old_rec.yrp_attribute12
291 ,p_yrp_attribute13_o =>ben_yrp_shd.g_old_rec.yrp_attribute13
292 ,p_yrp_attribute14_o =>ben_yrp_shd.g_old_rec.yrp_attribute14
293 ,p_yrp_attribute15_o =>ben_yrp_shd.g_old_rec.yrp_attribute15
294 ,p_yrp_attribute16_o =>ben_yrp_shd.g_old_rec.yrp_attribute16
295 ,p_yrp_attribute17_o =>ben_yrp_shd.g_old_rec.yrp_attribute17
296 ,p_yrp_attribute18_o =>ben_yrp_shd.g_old_rec.yrp_attribute18
297 ,p_yrp_attribute19_o =>ben_yrp_shd.g_old_rec.yrp_attribute19
298 ,p_yrp_attribute20_o =>ben_yrp_shd.g_old_rec.yrp_attribute20
299 ,p_yrp_attribute21_o =>ben_yrp_shd.g_old_rec.yrp_attribute21
300 ,p_yrp_attribute22_o =>ben_yrp_shd.g_old_rec.yrp_attribute22
301 ,p_yrp_attribute23_o =>ben_yrp_shd.g_old_rec.yrp_attribute23
302 ,p_yrp_attribute24_o =>ben_yrp_shd.g_old_rec.yrp_attribute24
303 ,p_yrp_attribute25_o =>ben_yrp_shd.g_old_rec.yrp_attribute25
304 ,p_yrp_attribute26_o =>ben_yrp_shd.g_old_rec.yrp_attribute26
305 ,p_yrp_attribute27_o =>ben_yrp_shd.g_old_rec.yrp_attribute27
306 ,p_yrp_attribute28_o =>ben_yrp_shd.g_old_rec.yrp_attribute28
307 ,p_yrp_attribute29_o =>ben_yrp_shd.g_old_rec.yrp_attribute29
308 ,p_yrp_attribute30_o =>ben_yrp_shd.g_old_rec.yrp_attribute30
309 ,p_object_version_number_o =>ben_yrp_shd.g_old_rec.object_version_number
310 );
311 --
312 exception
313 --
314 when hr_api.cannot_find_prog_unit then
315 --
316 hr_api.cannot_find_prog_unit_error
317 (p_module_name => 'ben_yr_perd'
318 ,p_hook_type => 'AU');
319 --
320 end;
321 --
322 -- End of API User Hook for post_update.
323 --
324 --
325 hr_utility.set_location(' Leaving:'||l_proc, 10);
326 End post_update;
327 --
328 -- ----------------------------------------------------------------------------
329 -- |-----------------------------< convert_defs >-----------------------------|
330 -- ----------------------------------------------------------------------------
331 -- {Start Of Comments}
332 --
333 -- Description:
334 -- The Convert_Defs procedure has one very important function:
335 -- It must return the record structure for the row with all system defaulted
336 -- values converted into its corresponding parameter value for update. When
337 -- we attempt to update a row through the Upd process , certain
338 -- parameters can be defaulted which enables flexibility in the calling of
339 -- the upd process (e.g. only attributes which need to be updated need to be
340 -- specified). For the upd process to determine which attributes
341 -- have NOT been specified we need to check if the parameter has a reserved
342 -- system default value. Therefore, for all parameters which have a
343 -- corresponding reserved system default mechanism specified we need to
344 -- check if a system default is being used. If a system default is being
345 -- used then we convert the defaulted value into its corresponding attribute
346 -- value held in the g_old_rec data structure.
347 --
348 -- Prerequisites:
349 -- This private function can only be called from the upd process.
350 --
351 -- In Parameters:
352 -- A Pl/Sql record structre.
353 --
354 -- Post Success:
355 -- The record structure will be returned with all system defaulted parameter
356 -- values converted into its current row attribute value.
357 --
358 -- Post Failure:
359 -- No direct error handling is required within this function. Any possible
360 -- errors within this procedure will be a PL/SQL value error due to conversion
361 -- of datatypes or data lengths.
362 --
363 -- Developer Implementation Notes:
364 -- None.
365 --
366 -- Access Status:
367 -- Internal Row Handler Use Only.
368 --
369 -- {End Of Comments}
370 -- ----------------------------------------------------------------------------
371 Procedure convert_defs(p_rec in out nocopy ben_yrp_shd.g_rec_type) is
372 --
373 l_proc varchar2(72) := g_package||'convert_defs';
374 --
375 Begin
376 --
377 hr_utility.set_location('Entering:'||l_proc, 5);
378 --
379 -- We must now examine each argument value in the
380 -- p_rec plsql record structure
381 -- to see if a system default is being used. If a system default
382 -- is being used then we must set to the 'current' argument value.
383 --
384 If (p_rec.perds_in_yr_num = hr_api.g_number) then
385 p_rec.perds_in_yr_num :=
386 ben_yrp_shd.g_old_rec.perds_in_yr_num;
387 End If;
388 If (p_rec.perd_tm_uom_cd = hr_api.g_varchar2) then
389 p_rec.perd_tm_uom_cd :=
390 ben_yrp_shd.g_old_rec.perd_tm_uom_cd;
391 End If;
392 If (p_rec.perd_typ_cd = hr_api.g_varchar2) then
393 p_rec.perd_typ_cd :=
394 ben_yrp_shd.g_old_rec.perd_typ_cd;
395 End If;
396 If (p_rec.end_date = hr_api.g_date) then
397 p_rec.end_date :=
398 ben_yrp_shd.g_old_rec.end_date;
399 End If;
400 If (p_rec.start_date = hr_api.g_date) then
401 p_rec.start_date :=
402 ben_yrp_shd.g_old_rec.start_date;
403 End If;
404 If (p_rec.lmtn_yr_strt_dt = hr_api.g_date) then
405 p_rec.lmtn_yr_strt_dt :=
406 ben_yrp_shd.g_old_rec.lmtn_yr_strt_dt;
407 End If;
408 If (p_rec.lmtn_yr_end_dt = hr_api.g_date) then
409 p_rec.lmtn_yr_end_dt :=
410 ben_yrp_shd.g_old_rec.lmtn_yr_end_dt;
411 End If;
412 If (p_rec.business_group_id = hr_api.g_number) then
413 p_rec.business_group_id :=
414 ben_yrp_shd.g_old_rec.business_group_id;
415 End If;
416 If (p_rec.yrp_attribute_category = hr_api.g_varchar2) then
417 p_rec.yrp_attribute_category :=
418 ben_yrp_shd.g_old_rec.yrp_attribute_category;
419 End If;
420 If (p_rec.yrp_attribute1 = hr_api.g_varchar2) then
421 p_rec.yrp_attribute1 :=
422 ben_yrp_shd.g_old_rec.yrp_attribute1;
423 End If;
424 If (p_rec.yrp_attribute2 = hr_api.g_varchar2) then
425 p_rec.yrp_attribute2 :=
426 ben_yrp_shd.g_old_rec.yrp_attribute2;
427 End If;
428 If (p_rec.yrp_attribute3 = hr_api.g_varchar2) then
429 p_rec.yrp_attribute3 :=
430 ben_yrp_shd.g_old_rec.yrp_attribute3;
431 End If;
432 If (p_rec.yrp_attribute4 = hr_api.g_varchar2) then
433 p_rec.yrp_attribute4 :=
434 ben_yrp_shd.g_old_rec.yrp_attribute4;
435 End If;
436 If (p_rec.yrp_attribute5 = hr_api.g_varchar2) then
437 p_rec.yrp_attribute5 :=
438 ben_yrp_shd.g_old_rec.yrp_attribute5;
439 End If;
440 If (p_rec.yrp_attribute6 = hr_api.g_varchar2) then
441 p_rec.yrp_attribute6 :=
442 ben_yrp_shd.g_old_rec.yrp_attribute6;
443 End If;
444 If (p_rec.yrp_attribute7 = hr_api.g_varchar2) then
445 p_rec.yrp_attribute7 :=
446 ben_yrp_shd.g_old_rec.yrp_attribute7;
447 End If;
448 If (p_rec.yrp_attribute8 = hr_api.g_varchar2) then
449 p_rec.yrp_attribute8 :=
450 ben_yrp_shd.g_old_rec.yrp_attribute8;
451 End If;
452 If (p_rec.yrp_attribute9 = hr_api.g_varchar2) then
453 p_rec.yrp_attribute9 :=
454 ben_yrp_shd.g_old_rec.yrp_attribute9;
455 End If;
456 If (p_rec.yrp_attribute10 = hr_api.g_varchar2) then
457 p_rec.yrp_attribute10 :=
458 ben_yrp_shd.g_old_rec.yrp_attribute10;
459 End If;
460 If (p_rec.yrp_attribute11 = hr_api.g_varchar2) then
461 p_rec.yrp_attribute11 :=
462 ben_yrp_shd.g_old_rec.yrp_attribute11;
463 End If;
464 If (p_rec.yrp_attribute12 = hr_api.g_varchar2) then
465 p_rec.yrp_attribute12 :=
466 ben_yrp_shd.g_old_rec.yrp_attribute12;
467 End If;
468 If (p_rec.yrp_attribute13 = hr_api.g_varchar2) then
469 p_rec.yrp_attribute13 :=
470 ben_yrp_shd.g_old_rec.yrp_attribute13;
471 End If;
472 If (p_rec.yrp_attribute14 = hr_api.g_varchar2) then
473 p_rec.yrp_attribute14 :=
474 ben_yrp_shd.g_old_rec.yrp_attribute14;
475 End If;
476 If (p_rec.yrp_attribute15 = hr_api.g_varchar2) then
477 p_rec.yrp_attribute15 :=
478 ben_yrp_shd.g_old_rec.yrp_attribute15;
479 End If;
480 If (p_rec.yrp_attribute16 = hr_api.g_varchar2) then
481 p_rec.yrp_attribute16 :=
482 ben_yrp_shd.g_old_rec.yrp_attribute16;
483 End If;
484 If (p_rec.yrp_attribute17 = hr_api.g_varchar2) then
485 p_rec.yrp_attribute17 :=
486 ben_yrp_shd.g_old_rec.yrp_attribute17;
487 End If;
488 If (p_rec.yrp_attribute18 = hr_api.g_varchar2) then
489 p_rec.yrp_attribute18 :=
490 ben_yrp_shd.g_old_rec.yrp_attribute18;
491 End If;
492 If (p_rec.yrp_attribute19 = hr_api.g_varchar2) then
493 p_rec.yrp_attribute19 :=
494 ben_yrp_shd.g_old_rec.yrp_attribute19;
495 End If;
496 If (p_rec.yrp_attribute20 = hr_api.g_varchar2) then
497 p_rec.yrp_attribute20 :=
498 ben_yrp_shd.g_old_rec.yrp_attribute20;
499 End If;
500 If (p_rec.yrp_attribute21 = hr_api.g_varchar2) then
501 p_rec.yrp_attribute21 :=
502 ben_yrp_shd.g_old_rec.yrp_attribute21;
503 End If;
504 If (p_rec.yrp_attribute22 = hr_api.g_varchar2) then
505 p_rec.yrp_attribute22 :=
506 ben_yrp_shd.g_old_rec.yrp_attribute22;
507 End If;
508 If (p_rec.yrp_attribute23 = hr_api.g_varchar2) then
509 p_rec.yrp_attribute23 :=
510 ben_yrp_shd.g_old_rec.yrp_attribute23;
511 End If;
512 If (p_rec.yrp_attribute24 = hr_api.g_varchar2) then
513 p_rec.yrp_attribute24 :=
514 ben_yrp_shd.g_old_rec.yrp_attribute24;
515 End If;
516 If (p_rec.yrp_attribute25 = hr_api.g_varchar2) then
517 p_rec.yrp_attribute25 :=
518 ben_yrp_shd.g_old_rec.yrp_attribute25;
519 End If;
520 If (p_rec.yrp_attribute26 = hr_api.g_varchar2) then
521 p_rec.yrp_attribute26 :=
522 ben_yrp_shd.g_old_rec.yrp_attribute26;
523 End If;
524 If (p_rec.yrp_attribute27 = hr_api.g_varchar2) then
525 p_rec.yrp_attribute27 :=
526 ben_yrp_shd.g_old_rec.yrp_attribute27;
527 End If;
528 If (p_rec.yrp_attribute28 = hr_api.g_varchar2) then
529 p_rec.yrp_attribute28 :=
530 ben_yrp_shd.g_old_rec.yrp_attribute28;
531 End If;
532 If (p_rec.yrp_attribute29 = hr_api.g_varchar2) then
533 p_rec.yrp_attribute29 :=
534 ben_yrp_shd.g_old_rec.yrp_attribute29;
535 End If;
536 If (p_rec.yrp_attribute30 = hr_api.g_varchar2) then
537 p_rec.yrp_attribute30 :=
538 ben_yrp_shd.g_old_rec.yrp_attribute30;
539 End If;
540
541 --
542 hr_utility.set_location(' Leaving:'||l_proc, 10);
543 --
544 End convert_defs;
545 --
546 -- ----------------------------------------------------------------------------
547 -- |---------------------------------< upd >----------------------------------|
548 -- ----------------------------------------------------------------------------
549 Procedure upd
550 (
551 p_effective_date in date,
552 p_rec in out nocopy ben_yrp_shd.g_rec_type
553 ) is
554 --
555 l_proc varchar2(72) := g_package||'upd';
556 --
557 Begin
558 hr_utility.set_location('Entering:'||l_proc, 5);
559 --
560 -- We must lock the row which we need to update.
561 --
562 ben_yrp_shd.lck
563 (
564 p_rec.yr_perd_id,
565 p_rec.object_version_number
566 );
567 --
568 -- 1. During an update system defaults are used to determine if
569 -- arguments have been defaulted or not. We must therefore
570 -- derive the full record structure values to be updated.
571 --
572 -- 2. Call the supporting update validate operations.
573 --
574 convert_defs(p_rec);
575 ben_yrp_bus.update_validate(p_rec
576 ,p_effective_date);
577 --
578 -- Call the supporting pre-update operation
579 --
580 pre_update(p_rec);
581 --
582 -- Update the row.
583 --
584 update_dml(p_rec);
585 --
586 -- Call the supporting post-update operation
587 --
588 post_update(
589 p_effective_date,p_rec);
590 End upd;
591 --
592 -- ----------------------------------------------------------------------------
593 -- |---------------------------------< upd >----------------------------------|
594 -- ----------------------------------------------------------------------------
595 Procedure upd
596 (
597 p_effective_date in date,
598 p_yr_perd_id in number,
599 p_perds_in_yr_num in number default hr_api.g_number,
600 p_perd_tm_uom_cd in varchar2 default hr_api.g_varchar2,
601 p_perd_typ_cd in varchar2 default hr_api.g_varchar2,
602 p_end_date in date default hr_api.g_date,
603 p_start_date in date default hr_api.g_date,
604 p_lmtn_yr_strt_dt in date default hr_api.g_date,
605 p_lmtn_yr_end_dt in date default hr_api.g_date,
606 p_business_group_id in number default hr_api.g_number,
607 p_yrp_attribute_category in varchar2 default hr_api.g_varchar2,
608 p_yrp_attribute1 in varchar2 default hr_api.g_varchar2,
609 p_yrp_attribute2 in varchar2 default hr_api.g_varchar2,
610 p_yrp_attribute3 in varchar2 default hr_api.g_varchar2,
611 p_yrp_attribute4 in varchar2 default hr_api.g_varchar2,
612 p_yrp_attribute5 in varchar2 default hr_api.g_varchar2,
613 p_yrp_attribute6 in varchar2 default hr_api.g_varchar2,
614 p_yrp_attribute7 in varchar2 default hr_api.g_varchar2,
615 p_yrp_attribute8 in varchar2 default hr_api.g_varchar2,
616 p_yrp_attribute9 in varchar2 default hr_api.g_varchar2,
617 p_yrp_attribute10 in varchar2 default hr_api.g_varchar2,
618 p_yrp_attribute11 in varchar2 default hr_api.g_varchar2,
619 p_yrp_attribute12 in varchar2 default hr_api.g_varchar2,
620 p_yrp_attribute13 in varchar2 default hr_api.g_varchar2,
621 p_yrp_attribute14 in varchar2 default hr_api.g_varchar2,
622 p_yrp_attribute15 in varchar2 default hr_api.g_varchar2,
623 p_yrp_attribute16 in varchar2 default hr_api.g_varchar2,
624 p_yrp_attribute17 in varchar2 default hr_api.g_varchar2,
625 p_yrp_attribute18 in varchar2 default hr_api.g_varchar2,
626 p_yrp_attribute19 in varchar2 default hr_api.g_varchar2,
627 p_yrp_attribute20 in varchar2 default hr_api.g_varchar2,
628 p_yrp_attribute21 in varchar2 default hr_api.g_varchar2,
629 p_yrp_attribute22 in varchar2 default hr_api.g_varchar2,
630 p_yrp_attribute23 in varchar2 default hr_api.g_varchar2,
631 p_yrp_attribute24 in varchar2 default hr_api.g_varchar2,
632 p_yrp_attribute25 in varchar2 default hr_api.g_varchar2,
633 p_yrp_attribute26 in varchar2 default hr_api.g_varchar2,
634 p_yrp_attribute27 in varchar2 default hr_api.g_varchar2,
635 p_yrp_attribute28 in varchar2 default hr_api.g_varchar2,
636 p_yrp_attribute29 in varchar2 default hr_api.g_varchar2,
637 p_yrp_attribute30 in varchar2 default hr_api.g_varchar2,
638 p_object_version_number in out nocopy number
639 ) is
640 --
641 l_rec ben_yrp_shd.g_rec_type;
642 l_proc varchar2(72) := g_package||'upd';
643 --
644 Begin
645 hr_utility.set_location('Entering:'||l_proc, 5);
646 --
647 -- Call conversion function to turn arguments into the
648 -- l_rec structure.
649 --
650 l_rec :=
651 ben_yrp_shd.convert_args
652 (
653 p_yr_perd_id,
654 p_perds_in_yr_num,
655 p_perd_tm_uom_cd,
656 p_perd_typ_cd,
657 p_end_date,
658 p_start_date,
659 p_lmtn_yr_strt_dt,
660 p_lmtn_yr_end_dt,
661 p_business_group_id,
662 p_yrp_attribute_category,
663 p_yrp_attribute1,
664 p_yrp_attribute2,
665 p_yrp_attribute3,
666 p_yrp_attribute4,
667 p_yrp_attribute5,
668 p_yrp_attribute6,
669 p_yrp_attribute7,
670 p_yrp_attribute8,
671 p_yrp_attribute9,
672 p_yrp_attribute10,
673 p_yrp_attribute11,
674 p_yrp_attribute12,
675 p_yrp_attribute13,
676 p_yrp_attribute14,
677 p_yrp_attribute15,
678 p_yrp_attribute16,
679 p_yrp_attribute17,
680 p_yrp_attribute18,
681 p_yrp_attribute19,
682 p_yrp_attribute20,
683 p_yrp_attribute21,
684 p_yrp_attribute22,
685 p_yrp_attribute23,
686 p_yrp_attribute24,
687 p_yrp_attribute25,
688 p_yrp_attribute26,
689 p_yrp_attribute27,
690 p_yrp_attribute28,
691 p_yrp_attribute29,
692 p_yrp_attribute30,
693 p_object_version_number
694 );
695 --
696 -- Having converted the arguments into the
697 -- plsql record structure we call the corresponding record
698 -- business process.
699 --
700 upd(
701 p_effective_date,l_rec);
702 p_object_version_number := l_rec.object_version_number;
703 --
704 hr_utility.set_location(' Leaving:'||l_proc, 10);
705 End upd;
706 --
707 end ben_yrp_upd;