1 Package Body per_bba_upd as
2 /* $Header: pebbarhi.pkb 115.8 2002/12/02 13:03:45 apholt noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' per_bba_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 per_bba_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 p_rec.object_version_number := p_rec.object_version_number + 1;
63 --
64 --
65 -- Update the per_bf_balance_amounts Row
66 --
67 update per_bf_balance_amounts
68 set
69 balance_amount_id = p_rec.balance_amount_id,
70 ytd_amount = p_rec.ytd_amount,
71 fytd_amount = p_rec.fytd_amount,
72 ptd_amount = p_rec.ptd_amount,
73 mtd_amount = p_rec.mtd_amount,
74 qtd_amount = p_rec.qtd_amount,
75 run_amount = p_rec.run_amount,
76 object_version_number = p_rec.object_version_number,
77 bba_attribute_category = p_rec.bba_attribute_category,
78 bba_attribute1 = p_rec.bba_attribute1,
79 bba_attribute2 = p_rec.bba_attribute2,
80 bba_attribute3 = p_rec.bba_attribute3,
81 bba_attribute4 = p_rec.bba_attribute4,
82 bba_attribute5 = p_rec.bba_attribute5,
83 bba_attribute6 = p_rec.bba_attribute6,
84 bba_attribute7 = p_rec.bba_attribute7,
85 bba_attribute8 = p_rec.bba_attribute8,
86 bba_attribute9 = p_rec.bba_attribute9,
87 bba_attribute10 = p_rec.bba_attribute10,
88 bba_attribute11 = p_rec.bba_attribute11,
89 bba_attribute12 = p_rec.bba_attribute12,
90 bba_attribute13 = p_rec.bba_attribute13,
91 bba_attribute14 = p_rec.bba_attribute14,
92 bba_attribute15 = p_rec.bba_attribute15,
93 bba_attribute16 = p_rec.bba_attribute16,
94 bba_attribute17 = p_rec.bba_attribute17,
95 bba_attribute18 = p_rec.bba_attribute18,
96 bba_attribute19 = p_rec.bba_attribute19,
97 bba_attribute20 = p_rec.bba_attribute20,
98 bba_attribute21 = p_rec.bba_attribute21,
99 bba_attribute22 = p_rec.bba_attribute22,
100 bba_attribute23 = p_rec.bba_attribute23,
101 bba_attribute24 = p_rec.bba_attribute24,
102 bba_attribute25 = p_rec.bba_attribute25,
103 bba_attribute26 = p_rec.bba_attribute26,
104 bba_attribute27 = p_rec.bba_attribute27,
105 bba_attribute28 = p_rec.bba_attribute28,
106 bba_attribute29 = p_rec.bba_attribute29,
107 bba_attribute30 = p_rec.bba_attribute30
108 where balance_amount_id = p_rec.balance_amount_id;
109 --
110 --
111 hr_utility.set_location(' Leaving:'||l_proc, 10);
112 --
113 Exception
114 When hr_api.check_integrity_violated Then
115 -- A check constraint has been violated
116 per_bba_shd.constraint_error
117 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
118 When hr_api.parent_integrity_violated Then
119 -- Parent integrity has been violated
120 per_bba_shd.constraint_error
121 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
122 When hr_api.unique_integrity_violated Then
123 -- Unique integrity has been violated
124 per_bba_shd.constraint_error
125 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
126 When Others Then
127 Raise;
128 End update_dml;
129 --
130 -- ----------------------------------------------------------------------------
131 -- |------------------------------< pre_update >------------------------------|
132 -- ----------------------------------------------------------------------------
133 -- {Start Of Comments}
134 --
135 -- Description:
136 -- This private procedure contains any processing which is required before
137 -- the update dml.
138 --
139 -- Prerequisites:
140 -- This is an internal procedure which is called from the upd procedure.
141 --
142 -- In Parameters:
143 -- A Pl/Sql record structure.
144 --
145 -- Post Success:
146 -- Processing continues.
147 --
148 -- Post Failure:
149 -- If an error has occurred, an error message and exception wil be raised
150 -- but not handled.
151 --
152 -- Developer Implementation Notes:
153 -- Any pre-processing required before the update dml is issued should be
154 -- coded within this procedure. It is important to note that any 3rd party
155 -- maintenance should be reviewed before placing in this procedure.
156 --
157 -- Access Status:
158 -- Internal Row Handler Use Only.
159 --
160 -- {End Of Comments}
161 -- ----------------------------------------------------------------------------
162 Procedure pre_update(p_rec in per_bba_shd.g_rec_type) is
163 --
164 l_proc varchar2(72) := g_package||'pre_update';
165 --
166 Begin
167 hr_utility.set_location('Entering:'||l_proc, 5);
168 --
169 hr_utility.set_location(' Leaving:'||l_proc, 10);
170 End pre_update;
171 --
172 -- ----------------------------------------------------------------------------
173 -- |-----------------------------< post_update >------------------------------|
174 -- ----------------------------------------------------------------------------
175 -- {Start Of Comments}
176 --
177 -- Description:
178 -- This private procedure contains any processing which is required after the
179 -- update dml.
180 --
181 -- Prerequisites:
182 -- This is an internal procedure which is called from the upd procedure.
183 --
184 -- In Parameters:
185 -- A Pl/Sql record structre.
186 --
187 -- Post Success:
188 -- Processing continues.
189 --
190 -- Post Failure:
191 -- If an error has occurred, an error message and exception will be raised
192 -- but not handled.
193 --
194 -- Developer Implementation Notes:
195 -- Any post-processing required after the update dml is issued should be
196 -- coded within this procedure. It is important to note that any 3rd party
197 -- maintenance should be reviewed before placing in this procedure.
198 --
199 -- Access Status:
200 -- Internal Row Handler Use Only.
201 --
202 -- {End Of Comments}
203 -- ----------------------------------------------------------------------------
204 Procedure post_update(p_effective_date in date,
205 p_rec in per_bba_shd.g_rec_type) is
206 --
207 l_proc varchar2(72) := g_package||'post_update';
208 --
209 Begin
210 hr_utility.set_location('Entering:'||l_proc, 5);
211 begin
212 --
213 per_bba_rku.after_update
214 (p_effective_date => p_effective_date,
215 p_balance_amount_id => p_rec.balance_amount_id,
216 p_ytd_amount => p_rec.ytd_amount,
217 p_fytd_amount => p_rec.fytd_amount,
218 p_ptd_amount => p_rec.ptd_amount,
219 p_mtd_amount => p_rec.mtd_amount,
220 p_qtd_amount => p_rec.qtd_amount,
221 p_run_amount => p_rec.run_amount,
222 p_object_version_number => p_rec.object_version_number,
223 p_bba_attribute_category => p_rec.bba_attribute_category,
224 p_bba_attribute1 => p_rec.bba_attribute1,
225 p_bba_attribute2 => p_rec.bba_attribute2,
226 p_bba_attribute3 => p_rec.bba_attribute3,
227 p_bba_attribute4 => p_rec.bba_attribute4,
228 p_bba_attribute5 => p_rec.bba_attribute5,
229 p_bba_attribute6 => p_rec.bba_attribute6,
230 p_bba_attribute7 => p_rec.bba_attribute7,
231 p_bba_attribute8 => p_rec.bba_attribute8,
232 p_bba_attribute9 => p_rec.bba_attribute9,
233 p_bba_attribute10 => p_rec.bba_attribute10,
234 p_bba_attribute11 => p_rec.bba_attribute11,
235 p_bba_attribute12 => p_rec.bba_attribute12,
236 p_bba_attribute13 => p_rec.bba_attribute13,
237 p_bba_attribute14 => p_rec.bba_attribute14,
238 p_bba_attribute15 => p_rec.bba_attribute15,
239 p_bba_attribute16 => p_rec.bba_attribute16,
240 p_bba_attribute17 => p_rec.bba_attribute17,
241 p_bba_attribute18 => p_rec.bba_attribute18,
242 p_bba_attribute19 => p_rec.bba_attribute19,
243 p_bba_attribute20 => p_rec.bba_attribute20,
244 p_bba_attribute21 => p_rec.bba_attribute21,
245 p_bba_attribute22 => p_rec.bba_attribute22,
246 p_bba_attribute23 => p_rec.bba_attribute23,
247 p_bba_attribute24 => p_rec.bba_attribute24,
248 p_bba_attribute25 => p_rec.bba_attribute25,
249 p_bba_attribute26 => p_rec.bba_attribute26,
250 p_bba_attribute27 => p_rec.bba_attribute27,
251 p_bba_attribute28 => p_rec.bba_attribute28,
252 p_bba_attribute29 => p_rec.bba_attribute29,
253 p_bba_attribute30 => p_rec.bba_attribute30,
254 p_balance_type_id_o
255 => per_bba_shd.g_old_rec.balance_type_id,
256 p_processed_assignment_id_o
257 => per_bba_shd.g_old_rec.processed_assignment_id,
258 p_business_group_id_o
259 => per_bba_shd.g_old_rec.business_group_id,
260 p_ytd_amount_o
261 => per_bba_shd.g_old_rec.ytd_amount,
262 p_fytd_amount_o
263 => per_bba_shd.g_old_rec.fytd_amount,
264 p_ptd_amount_o
265 => per_bba_shd.g_old_rec.ptd_amount,
266 p_mtd_amount_o
267 => per_bba_shd.g_old_rec.mtd_amount,
268 p_qtd_amount_o
269 => per_bba_shd.g_old_rec.qtd_amount,
270 p_run_amount_o
271 => per_bba_shd.g_old_rec.run_amount,
272 p_object_version_number_o
273 => per_bba_shd.g_old_rec.object_version_number,
274 p_bba_attribute_category_o
275 => per_bba_shd.g_old_rec.bba_attribute_category,
276 p_bba_attribute1_o
277 => per_bba_shd.g_old_rec.bba_attribute1,
278 p_bba_attribute2_o
279 => per_bba_shd.g_old_rec.bba_attribute2,
280 p_bba_attribute3_o
281 => per_bba_shd.g_old_rec.bba_attribute3,
282 p_bba_attribute4_o
283 => per_bba_shd.g_old_rec.bba_attribute4,
284 p_bba_attribute5_o
285 => per_bba_shd.g_old_rec.bba_attribute5,
286 p_bba_attribute6_o
287 => per_bba_shd.g_old_rec.bba_attribute6,
288 p_bba_attribute7_o
289 => per_bba_shd.g_old_rec.bba_attribute7,
290 p_bba_attribute8_o
291 => per_bba_shd.g_old_rec.bba_attribute8,
292 p_bba_attribute9_o
293 => per_bba_shd.g_old_rec.bba_attribute9,
294 p_bba_attribute10_o
295 => per_bba_shd.g_old_rec.bba_attribute10,
296 p_bba_attribute11_o
297 => per_bba_shd.g_old_rec.bba_attribute11,
298 p_bba_attribute12_o
299 => per_bba_shd.g_old_rec.bba_attribute12,
300 p_bba_attribute13_o
301 => per_bba_shd.g_old_rec.bba_attribute13,
302 p_bba_attribute14_o
303 => per_bba_shd.g_old_rec.bba_attribute14,
304 p_bba_attribute15_o
305 => per_bba_shd.g_old_rec.bba_attribute15,
306 p_bba_attribute16_o
307 => per_bba_shd.g_old_rec.bba_attribute16,
308 p_bba_attribute17_o
309 => per_bba_shd.g_old_rec.bba_attribute17,
310 p_bba_attribute18_o
311 => per_bba_shd.g_old_rec.bba_attribute18,
312 p_bba_attribute19_o
313 => per_bba_shd.g_old_rec.bba_attribute19,
314 p_bba_attribute20_o
315 => per_bba_shd.g_old_rec.bba_attribute20,
316 p_bba_attribute21_o
317 => per_bba_shd.g_old_rec.bba_attribute21,
318 p_bba_attribute22_o
319 => per_bba_shd.g_old_rec.bba_attribute22,
320 p_bba_attribute23_o
321 => per_bba_shd.g_old_rec.bba_attribute23,
322 p_bba_attribute24_o
323 => per_bba_shd.g_old_rec.bba_attribute24,
324 p_bba_attribute25_o
325 => per_bba_shd.g_old_rec.bba_attribute25,
326 p_bba_attribute26_o
327 => per_bba_shd.g_old_rec.bba_attribute26,
328 p_bba_attribute27_o
329 => per_bba_shd.g_old_rec.bba_attribute27,
330 p_bba_attribute28_o
331 => per_bba_shd.g_old_rec.bba_attribute28,
332 p_bba_attribute29_o
333 => per_bba_shd.g_old_rec.bba_attribute29,
334 p_bba_attribute30_o
335 => per_bba_shd.g_old_rec.bba_attribute30
336 );
337 --
338 exception
339 --
340 when hr_api.cannot_find_prog_unit then
341 --
342 hr_api.cannot_find_prog_unit_error
343 (p_module_name => 'PER_BF_BALANCE_AMOUNTS'
344 ,p_hook_type => 'AU');
345 --
346 end;
347 --
348 hr_utility.set_location(' Leaving:'||l_proc, 10);
349 End post_update;
350 --
351 -- ----------------------------------------------------------------------------
352 -- |-----------------------------< convert_defs >-----------------------------|
353 -- ----------------------------------------------------------------------------
354 -- {Start Of Comments}
355 --
356 -- Description:
357 -- The Convert_Defs procedure has one very important function:
358 -- It must return the record structure for the row with all system defaulted
359 -- values converted into its corresponding parameter value for update. When
360 -- we attempt to update a row through the Upd process , certain
361 -- parameters can be defaulted which enables flexibility in the calling of
362 -- the upd process (e.g. only attributes which need to be updated need to be
363 -- specified). For the upd process to determine which attributes
364 -- have NOT been specified we need to check if the parameter has a reserved
365 -- system default value. Therefore, for all parameters which have a
366 -- corresponding reserved system default mechanism specified we need to
367 -- check if a system default is being used. If a system default is being
368 -- used then we convert the defaulted value into its corresponding attribute
369 -- value held in the g_old_rec data structure.
370 --
371 -- Prerequisites:
372 -- This private function can only be called from the upd process.
373 --
374 -- In Parameters:
375 -- A Pl/Sql record structre.
376 --
377 -- Post Success:
378 -- The record structure will be returned with all system defaulted parameter
379 -- values converted into its current row attribute value.
380 --
381 -- Post Failure:
382 -- No direct error handling is required within this function. Any possible
383 -- errors within this procedure will be a PL/SQL value error due to
384 -- conversion of datatypes or data lengths.
385 --
386 -- Developer Implementation Notes:
387 -- None.
388 --
389 -- Access Status:
390 -- Internal Row Handler Use Only.
391 --
392 -- {End Of Comments}
393 -- ----------------------------------------------------------------------------
394 Procedure convert_defs(p_rec in out nocopy per_bba_shd.g_rec_type) is
395 --
396 l_proc varchar2(72) := g_package||'convert_defs';
397 --
398 Begin
399 --
400 hr_utility.set_location('Entering:'||l_proc, 5);
401 --
402 -- We must now examine each argument value in the
403 -- p_rec plsql record structure
404 -- to see if a system default is being used. If a system default
405 -- is being used then we must set to the 'current' argument value.
406 --
407 If (p_rec.balance_type_id = hr_api.g_number) then
408 p_rec.balance_type_id :=
409 per_bba_shd.g_old_rec.balance_type_id;
410 End If;
411 If (p_rec.processed_assignment_id = hr_api.g_number) then
412 p_rec.processed_assignment_id :=
413 per_bba_shd.g_old_rec.processed_assignment_id;
414 End If;
415 If (p_rec.business_group_id = hr_api.g_number) then
416 p_rec.business_group_id :=
417 per_bba_shd.g_old_rec.business_group_id;
418 End If;
419 If (p_rec.ytd_amount = hr_api.g_number) then
420 p_rec.ytd_amount :=
421 per_bba_shd.g_old_rec.ytd_amount;
422 End If;
423 If (p_rec.fytd_amount = hr_api.g_number) then
424 p_rec.fytd_amount :=
425 per_bba_shd.g_old_rec.fytd_amount;
426 End If;
427 If (p_rec.ptd_amount = hr_api.g_number) then
428 p_rec.ptd_amount :=
429 per_bba_shd.g_old_rec.ptd_amount;
430 End If;
431 If (p_rec.mtd_amount = hr_api.g_number) then
432 p_rec.mtd_amount :=
433 per_bba_shd.g_old_rec.mtd_amount;
434 End If;
435 If (p_rec.qtd_amount = hr_api.g_number) then
436 p_rec.qtd_amount :=
437 per_bba_shd.g_old_rec.qtd_amount;
438 End If;
439 If (p_rec.run_amount = hr_api.g_number) then
440 p_rec.run_amount :=
441 per_bba_shd.g_old_rec.run_amount;
442 End If;
443 If (p_rec.bba_attribute_category = hr_api.g_varchar2) then
444 p_rec.bba_attribute_category :=
445 per_bba_shd.g_old_rec.bba_attribute_category;
446 End If;
447 If (p_rec.bba_attribute1 = hr_api.g_varchar2) then
448 p_rec.bba_attribute1:=
449 per_bba_shd.g_old_rec.bba_attribute1;
450 End If;
451 If (p_rec.bba_attribute2 = hr_api.g_varchar2) then
452 p_rec.bba_attribute2:=
453 per_bba_shd.g_old_rec.bba_attribute2;
454 End If;
455 If (p_rec.bba_attribute3 = hr_api.g_varchar2) then
456 p_rec.bba_attribute3:=
457 per_bba_shd.g_old_rec.bba_attribute3;
458 End If;
459 If (p_rec.bba_attribute4 = hr_api.g_varchar2) then
460 p_rec.bba_attribute4:=
461 per_bba_shd.g_old_rec.bba_attribute4;
462 End If;
463 If (p_rec.bba_attribute5 = hr_api.g_varchar2) then
464 p_rec.bba_attribute5:=
465 per_bba_shd.g_old_rec.bba_attribute5;
466 End If;
467 If (p_rec.bba_attribute6 = hr_api.g_varchar2) then
468 p_rec.bba_attribute6:=
469 per_bba_shd.g_old_rec.bba_attribute6;
470 End If;
471 If (p_rec.bba_attribute7 = hr_api.g_varchar2) then
472 p_rec.bba_attribute7:=
473 per_bba_shd.g_old_rec.bba_attribute7;
474 End If;
475 If (p_rec.bba_attribute8 = hr_api.g_varchar2) then
476 p_rec.bba_attribute8:=
477 per_bba_shd.g_old_rec.bba_attribute8;
478 End If;
479 If (p_rec.bba_attribute9 = hr_api.g_varchar2) then
480 p_rec.bba_attribute9:=
481 per_bba_shd.g_old_rec.bba_attribute9;
482 End If;
483 If (p_rec.bba_attribute10 = hr_api.g_varchar2) then
484 p_rec.bba_attribute10:=
485 per_bba_shd.g_old_rec.bba_attribute10;
486 End If;
487 If (p_rec.bba_attribute11 = hr_api.g_varchar2) then
488 p_rec.bba_attribute11:=
489 per_bba_shd.g_old_rec.bba_attribute11;
490 End If;
491 If (p_rec.bba_attribute12 = hr_api.g_varchar2) then
492 p_rec.bba_attribute12:=
493 per_bba_shd.g_old_rec.bba_attribute12;
494 End If;
495 If (p_rec.bba_attribute13 = hr_api.g_varchar2) then
496 p_rec.bba_attribute13:=
497 per_bba_shd.g_old_rec.bba_attribute13;
498 End If;
499 If (p_rec.bba_attribute14 = hr_api.g_varchar2) then
500 p_rec.bba_attribute14:=
501 per_bba_shd.g_old_rec.bba_attribute14;
502 End If;
503 If (p_rec.bba_attribute15 = hr_api.g_varchar2) then
504 p_rec.bba_attribute15:=
505 per_bba_shd.g_old_rec.bba_attribute15;
506 End If;
507 If (p_rec.bba_attribute16 = hr_api.g_varchar2) then
508 p_rec.bba_attribute16:=
509 per_bba_shd.g_old_rec.bba_attribute16;
510 End If;
511 If (p_rec.bba_attribute17 = hr_api.g_varchar2) then
512 p_rec.bba_attribute17:=
513 per_bba_shd.g_old_rec.bba_attribute17;
514 End If;
515 If (p_rec.bba_attribute18 = hr_api.g_varchar2) then
516 p_rec.bba_attribute18:=
517 per_bba_shd.g_old_rec.bba_attribute18;
518 End If;
519 If (p_rec.bba_attribute19 = hr_api.g_varchar2) then
520 p_rec.bba_attribute19:=
521 per_bba_shd.g_old_rec.bba_attribute19;
522 End If;
523 If (p_rec.bba_attribute20 = hr_api.g_varchar2) then
524 p_rec.bba_attribute20:=
525 per_bba_shd.g_old_rec.bba_attribute20;
526 End If;
527 If (p_rec.bba_attribute21 = hr_api.g_varchar2) then
528 p_rec.bba_attribute21:=
529 per_bba_shd.g_old_rec.bba_attribute21;
530 End If;
531 If (p_rec.bba_attribute22 = hr_api.g_varchar2) then
532 p_rec.bba_attribute22:=
533 per_bba_shd.g_old_rec.bba_attribute22;
534 End If;
535 If (p_rec.bba_attribute23 = hr_api.g_varchar2) then
536 p_rec.bba_attribute23:=
537 per_bba_shd.g_old_rec.bba_attribute23;
538 End If;
539 If (p_rec.bba_attribute24 = hr_api.g_varchar2) then
540 p_rec.bba_attribute24:=
541 per_bba_shd.g_old_rec.bba_attribute24;
542 End If;
543 If (p_rec.bba_attribute25 = hr_api.g_varchar2) then
544 p_rec.bba_attribute25:=
545 per_bba_shd.g_old_rec.bba_attribute25;
546 End If;
547 If (p_rec.bba_attribute26 = hr_api.g_varchar2) then
548 p_rec.bba_attribute26:=
549 per_bba_shd.g_old_rec.bba_attribute26;
550 End If;
551 If (p_rec.bba_attribute27 = hr_api.g_varchar2) then
552 p_rec.bba_attribute27:=
553 per_bba_shd.g_old_rec.bba_attribute27;
554 End If;
555 If (p_rec.bba_attribute28 = hr_api.g_varchar2) then
556 p_rec.bba_attribute28:=
557 per_bba_shd.g_old_rec.bba_attribute28;
558 End If;
559 If (p_rec.bba_attribute29 = hr_api.g_varchar2) then
560 p_rec.bba_attribute29:=
561 per_bba_shd.g_old_rec.bba_attribute29;
562 End If;
563 If (p_rec.bba_attribute30 = hr_api.g_varchar2) then
564 p_rec.bba_attribute30:=
565 per_bba_shd.g_old_rec.bba_attribute30;
566 End If;
567 --
568 hr_utility.set_location(' Leaving:'||l_proc, 10);
569 --
570 End convert_defs;
571 --
572 -- ----------------------------------------------------------------------------
573 -- |---------------------------------< upd >----------------------------------|
574 -- ----------------------------------------------------------------------------
575 Procedure upd
576 (
577 p_effective_date in date,
578 p_rec in out nocopy per_bba_shd.g_rec_type
579 ) is
580 --
581 l_proc varchar2(72) := g_package||'upd';
582 --
583 Begin
584 hr_utility.set_location('Entering:'||l_proc, 5);
585 --
586 -- We must lock the row which we need to update.
587 --
588 per_bba_shd.lck
589 (
590 p_rec.balance_amount_id,
591 p_rec.object_version_number
592 );
593 --
594 -- 1. During an update system defaults are used to determine if
595 -- arguments have been defaulted or not. We must therefore
596 -- derive the full record structure values to be updated.
597 --
598 -- 2. Call the supporting update validate operations.
599 --
600 convert_defs(p_rec);
601 per_bba_bus.update_validate(p_effective_date,
602 p_rec
603 );
604 --
605 -- Call the supporting pre-update operation
606 --
607 pre_update(p_rec);
608 --
609 -- Update the row.
610 --
611 update_dml(p_rec);
612 --
613 -- Call the supporting post-update operation
614 --
615 post_update(p_effective_date,
616 p_rec);
617 End upd;
618 --
619 -- ----------------------------------------------------------------------------
620 -- |---------------------------------< upd >----------------------------------|
621 -- ----------------------------------------------------------------------------
622 Procedure upd
623 (
624 p_effective_date in date,
625 p_balance_amount_id in number,
626 p_ytd_amount in number default hr_api.g_number,
627 p_fytd_amount in number default hr_api.g_number,
628 p_ptd_amount in number default hr_api.g_number,
629 p_mtd_amount in number default hr_api.g_number,
630 p_qtd_amount in number default hr_api.g_number,
631 p_run_amount in number default hr_api.g_number,
632 p_object_version_number in out nocopy number,
633 p_bba_attribute_category in varchar2 default hr_api.g_varchar2,
634 p_bba_attribute1 in varchar2 default hr_api.g_varchar2,
635 p_bba_attribute2 in varchar2 default hr_api.g_varchar2,
636 p_bba_attribute3 in varchar2 default hr_api.g_varchar2,
637 p_bba_attribute4 in varchar2 default hr_api.g_varchar2,
638 p_bba_attribute5 in varchar2 default hr_api.g_varchar2,
639 p_bba_attribute6 in varchar2 default hr_api.g_varchar2,
640 p_bba_attribute7 in varchar2 default hr_api.g_varchar2,
641 p_bba_attribute8 in varchar2 default hr_api.g_varchar2,
642 p_bba_attribute9 in varchar2 default hr_api.g_varchar2,
643 p_bba_attribute10 in varchar2 default hr_api.g_varchar2,
644 p_bba_attribute11 in varchar2 default hr_api.g_varchar2,
645 p_bba_attribute12 in varchar2 default hr_api.g_varchar2,
646 p_bba_attribute13 in varchar2 default hr_api.g_varchar2,
647 p_bba_attribute14 in varchar2 default hr_api.g_varchar2,
648 p_bba_attribute15 in varchar2 default hr_api.g_varchar2,
649 p_bba_attribute16 in varchar2 default hr_api.g_varchar2,
650 p_bba_attribute17 in varchar2 default hr_api.g_varchar2,
651 p_bba_attribute18 in varchar2 default hr_api.g_varchar2,
652 p_bba_attribute19 in varchar2 default hr_api.g_varchar2,
653 p_bba_attribute20 in varchar2 default hr_api.g_varchar2,
654 p_bba_attribute21 in varchar2 default hr_api.g_varchar2,
655 p_bba_attribute22 in varchar2 default hr_api.g_varchar2,
656 p_bba_attribute23 in varchar2 default hr_api.g_varchar2,
657 p_bba_attribute24 in varchar2 default hr_api.g_varchar2,
658 p_bba_attribute25 in varchar2 default hr_api.g_varchar2,
659 p_bba_attribute26 in varchar2 default hr_api.g_varchar2,
660 p_bba_attribute27 in varchar2 default hr_api.g_varchar2,
661 p_bba_attribute28 in varchar2 default hr_api.g_varchar2,
662 p_bba_attribute29 in varchar2 default hr_api.g_varchar2,
663 p_bba_attribute30 in varchar2 default hr_api.g_varchar2
664 ) is
665 --
666 l_rec per_bba_shd.g_rec_type;
667 l_proc varchar2(72) := g_package||'upd';
668 --
669 Begin
670 hr_utility.set_location('Entering:'||l_proc, 5);
671 --
672 -- Call conversion function to turn arguments into the
673 -- l_rec structure.
674 --
675 l_rec :=
676 per_bba_shd.convert_args
677 (
678 p_balance_amount_id,
679 hr_api.g_number,
680 hr_api.g_number,
681 hr_api.g_number,
682 p_ytd_amount,
683 p_fytd_amount,
684 p_ptd_amount,
685 p_mtd_amount,
686 p_qtd_amount,
687 p_run_amount,
688 p_object_version_number,
689 p_bba_attribute_category,
690 p_bba_attribute1,
691 p_bba_attribute2,
692 p_bba_attribute3,
693 p_bba_attribute4,
694 p_bba_attribute5,
695 p_bba_attribute6,
696 p_bba_attribute7,
697 p_bba_attribute8,
698 p_bba_attribute9,
699 p_bba_attribute10,
700 p_bba_attribute11,
701 p_bba_attribute12,
702 p_bba_attribute13,
703 p_bba_attribute14,
704 p_bba_attribute15,
705 p_bba_attribute16,
706 p_bba_attribute17,
707 p_bba_attribute18,
708 p_bba_attribute19,
709 p_bba_attribute20,
710 p_bba_attribute21,
711 p_bba_attribute22,
712 p_bba_attribute23,
713 p_bba_attribute24,
714 p_bba_attribute25,
715 p_bba_attribute26,
716 p_bba_attribute27,
717 p_bba_attribute28,
718 p_bba_attribute29,
719 p_bba_attribute30
720 );
721 --
722 -- Having converted the arguments into the
723 -- plsql record structure we call the corresponding record
724 -- business process.
725 --
726 upd(p_effective_date,
727 l_rec
728 );
729 p_object_version_number := l_rec.object_version_number;
730 --
731 hr_utility.set_location(' Leaving:'||l_proc, 10);
732 End upd;
733 --
734 end per_bba_upd;