1 Package Body ben_bnr_upd as
2 /* $Header: bebnrrhi.pkb 120.0 2005/05/28 00:46:03 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_bnr_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_bnr_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_bnr_shd.g_api_dml := true; -- Set the api dml status
66 --
67 -- Update the ben_rptg_grp Row
68 --
69 update ben_rptg_grp
70 set
71 rptg_grp_id = p_rec.rptg_grp_id,
72 name = p_rec.name,
73 business_group_id = p_rec.business_group_id,
74 rptg_prps_cd = p_rec.rptg_prps_cd,
75 rpg_desc = p_rec.rpg_desc,
76 bnr_attribute_category = p_rec.bnr_attribute_category,
77 bnr_attribute1 = p_rec.bnr_attribute1,
78 bnr_attribute2 = p_rec.bnr_attribute2,
79 bnr_attribute3 = p_rec.bnr_attribute3,
80 bnr_attribute4 = p_rec.bnr_attribute4,
81 bnr_attribute5 = p_rec.bnr_attribute5,
82 bnr_attribute6 = p_rec.bnr_attribute6,
83 bnr_attribute7 = p_rec.bnr_attribute7,
84 bnr_attribute8 = p_rec.bnr_attribute8,
85 bnr_attribute9 = p_rec.bnr_attribute9,
86 bnr_attribute10 = p_rec.bnr_attribute10,
87 bnr_attribute11 = p_rec.bnr_attribute11,
88 bnr_attribute12 = p_rec.bnr_attribute12,
89 bnr_attribute13 = p_rec.bnr_attribute13,
90 bnr_attribute14 = p_rec.bnr_attribute14,
91 bnr_attribute15 = p_rec.bnr_attribute15,
92 bnr_attribute16 = p_rec.bnr_attribute16,
93 bnr_attribute17 = p_rec.bnr_attribute17,
94 bnr_attribute18 = p_rec.bnr_attribute18,
95 bnr_attribute19 = p_rec.bnr_attribute19,
96 bnr_attribute20 = p_rec.bnr_attribute20,
97 bnr_attribute21 = p_rec.bnr_attribute21,
98 bnr_attribute22 = p_rec.bnr_attribute22,
99 bnr_attribute23 = p_rec.bnr_attribute23,
100 bnr_attribute24 = p_rec.bnr_attribute24,
101 bnr_attribute25 = p_rec.bnr_attribute25,
102 bnr_attribute26 = p_rec.bnr_attribute26,
103 bnr_attribute27 = p_rec.bnr_attribute27,
104 bnr_attribute28 = p_rec.bnr_attribute28,
105 bnr_attribute29 = p_rec.bnr_attribute29,
106 bnr_attribute30 = p_rec.bnr_attribute30,
107 function_code = p_rec.function_code,
108 legislation_code = p_rec.legislation_code,
109 object_version_number = p_rec.object_version_number,
110 ordr_num = p_rec.ordr_num --iRec
111 where rptg_grp_id = p_rec.rptg_grp_id;
112 --
113 -- Update MLS table.
114 --
115 update ben_rptg_grp_tl
116 set name = p_rec.name,
117 function_code = p_rec.function_code,
118 last_update_date = sysdate,
119 last_updated_by = fnd_global.user_id,
120 last_update_login = fnd_global.login_id,
121 source_lang = userenv('LANG')
122 where rptg_grp_id = p_rec.rptg_grp_id
123 and userenv('LANG') in (language, source_lang);
124
125 ben_bnr_shd.g_api_dml := false; -- Unset the api dml status
126 --
127 hr_utility.set_location(' Leaving:'||l_proc, 10);
128 --
129 Exception
130 When hr_api.check_integrity_violated Then
131 -- A check constraint has been violated
132 ben_bnr_shd.g_api_dml := false; -- Unset the api dml status
133 ben_bnr_shd.constraint_error
134 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
135 When hr_api.parent_integrity_violated Then
136 -- Parent integrity has been violated
137 ben_bnr_shd.g_api_dml := false; -- Unset the api dml status
138 ben_bnr_shd.constraint_error
139 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
140 When hr_api.unique_integrity_violated Then
141 -- Unique integrity has been violated
142 ben_bnr_shd.g_api_dml := false; -- Unset the api dml status
143 ben_bnr_shd.constraint_error
144 (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
145 When Others Then
146 ben_bnr_shd.g_api_dml := false; -- Unset the api dml status
147 Raise;
148 End update_dml;
149 --
150 -- ----------------------------------------------------------------------------
151 -- |------------------------------< pre_update >------------------------------|
152 -- ----------------------------------------------------------------------------
153 -- {Start Of Comments}
154 --
155 -- Description:
156 -- This private procedure contains any processing which is required before
157 -- the update dml.
158 --
159 -- Prerequisites:
160 -- This is an internal procedure which is called from the upd procedure.
161 --
162 -- In Parameters:
163 -- A Pl/Sql record structre.
164 --
165 -- Post Success:
166 -- Processing continues.
167 --
168 -- Post Failure:
169 -- If an error has occurred, an error message and exception will be raised
170 -- but not handled.
171 --
172 -- Developer Implementation Notes:
173 -- Any pre-processing required before the update dml is issued should be
174 -- coded within this procedure. It is important to note that any 3rd party
175 -- maintenance should be reviewed before placing in this procedure.
176 --
177 -- Access Status:
178 -- Internal Row Handler Use Only.
179 --
180 -- {End Of Comments}
181 -- ----------------------------------------------------------------------------
182 Procedure pre_update(p_rec in ben_bnr_shd.g_rec_type) is
183 --
184 l_proc varchar2(72) := g_package||'pre_update';
185 --
186 Begin
187 hr_utility.set_location('Entering:'||l_proc, 5);
188 --
189 hr_utility.set_location(' Leaving:'||l_proc, 10);
190 End pre_update;
191 --
192 -- ----------------------------------------------------------------------------
193 -- |-----------------------------< post_update >------------------------------|
194 -- ----------------------------------------------------------------------------
195 -- {Start Of Comments}
196 --
197 -- Description:
198 -- This private procedure contains any processing which is required after the
199 -- update dml.
200 --
201 -- Prerequisites:
202 -- This is an internal procedure which is called from the upd procedure.
203 --
204 -- In Parameters:
205 -- A Pl/Sql record structre.
206 --
207 -- Post Success:
208 -- Processing continues.
209 --
210 -- Post Failure:
211 -- If an error has occurred, an error message and exception will be raised
212 -- but not handled.
213 --
214 -- Developer Implementation Notes:
215 -- Any post-processing required after the update dml is issued should be
216 -- coded within this procedure. It is important to note that any 3rd party
217 -- maintenance should be reviewed before placing in this procedure.
218 --
219 -- Access Status:
220 -- Internal Row Handler Use Only.
221 --
222 -- {End Of Comments}
223 -- ----------------------------------------------------------------------------
224 Procedure post_update(
225 p_effective_date in date,p_rec in ben_bnr_shd.g_rec_type) is
226 --
227 l_proc varchar2(72) := g_package||'post_update';
228 --
229 Begin
230 hr_utility.set_location('Entering:'||l_proc, 5);
231 --
232 --
233 -- Start of API User Hook for post_update.
234 --
235 begin
236 --
237 ben_bnr_rku.after_update
238 (
239 p_rptg_grp_id =>p_rec.rptg_grp_id
240 ,p_name =>p_rec.name
241 ,p_business_group_id =>p_rec.business_group_id
242 ,p_rptg_prps_cd =>p_rec.rptg_prps_cd
243 ,p_rpg_desc =>p_rec.rpg_desc
244 ,p_bnr_attribute_category =>p_rec.bnr_attribute_category
245 ,p_bnr_attribute1 =>p_rec.bnr_attribute1
246 ,p_bnr_attribute2 =>p_rec.bnr_attribute2
247 ,p_bnr_attribute3 =>p_rec.bnr_attribute3
248 ,p_bnr_attribute4 =>p_rec.bnr_attribute4
249 ,p_bnr_attribute5 =>p_rec.bnr_attribute5
250 ,p_bnr_attribute6 =>p_rec.bnr_attribute6
251 ,p_bnr_attribute7 =>p_rec.bnr_attribute7
252 ,p_bnr_attribute8 =>p_rec.bnr_attribute8
253 ,p_bnr_attribute9 =>p_rec.bnr_attribute9
254 ,p_bnr_attribute10 =>p_rec.bnr_attribute10
255 ,p_bnr_attribute11 =>p_rec.bnr_attribute11
256 ,p_bnr_attribute12 =>p_rec.bnr_attribute12
257 ,p_bnr_attribute13 =>p_rec.bnr_attribute13
258 ,p_bnr_attribute14 =>p_rec.bnr_attribute14
259 ,p_bnr_attribute15 =>p_rec.bnr_attribute15
260 ,p_bnr_attribute16 =>p_rec.bnr_attribute16
261 ,p_bnr_attribute17 =>p_rec.bnr_attribute17
262 ,p_bnr_attribute18 =>p_rec.bnr_attribute18
263 ,p_bnr_attribute19 =>p_rec.bnr_attribute19
264 ,p_bnr_attribute20 =>p_rec.bnr_attribute20
265 ,p_bnr_attribute21 =>p_rec.bnr_attribute21
266 ,p_bnr_attribute22 =>p_rec.bnr_attribute22
267 ,p_bnr_attribute23 =>p_rec.bnr_attribute23
268 ,p_bnr_attribute24 =>p_rec.bnr_attribute24
269 ,p_bnr_attribute25 =>p_rec.bnr_attribute25
270 ,p_bnr_attribute26 =>p_rec.bnr_attribute26
271 ,p_bnr_attribute27 =>p_rec.bnr_attribute27
272 ,p_bnr_attribute28 =>p_rec.bnr_attribute28
273 ,p_bnr_attribute29 =>p_rec.bnr_attribute29
274 ,p_bnr_attribute30 =>p_rec.bnr_attribute30
275 ,p_function_code =>p_rec.function_code
276 ,p_legislation_code =>p_rec.legislation_code
277 ,p_object_version_number =>p_rec.object_version_number
278 ,p_ordr_num =>p_rec.ordr_num --iRec
279 ,p_effective_date =>p_effective_date
280 ,p_name_o =>ben_bnr_shd.g_old_rec.name
281 ,p_business_group_id_o =>ben_bnr_shd.g_old_rec.business_group_id
282 ,p_rptg_prps_cd_o =>ben_bnr_shd.g_old_rec.rptg_prps_cd
283 ,p_rpg_desc_o =>ben_bnr_shd.g_old_rec.rpg_desc
284 ,p_bnr_attribute_category_o =>ben_bnr_shd.g_old_rec.bnr_attribute_category
285 ,p_bnr_attribute1_o =>ben_bnr_shd.g_old_rec.bnr_attribute1
286 ,p_bnr_attribute2_o =>ben_bnr_shd.g_old_rec.bnr_attribute2
287 ,p_bnr_attribute3_o =>ben_bnr_shd.g_old_rec.bnr_attribute3
288 ,p_bnr_attribute4_o =>ben_bnr_shd.g_old_rec.bnr_attribute4
289 ,p_bnr_attribute5_o =>ben_bnr_shd.g_old_rec.bnr_attribute5
290 ,p_bnr_attribute6_o =>ben_bnr_shd.g_old_rec.bnr_attribute6
291 ,p_bnr_attribute7_o =>ben_bnr_shd.g_old_rec.bnr_attribute7
292 ,p_bnr_attribute8_o =>ben_bnr_shd.g_old_rec.bnr_attribute8
293 ,p_bnr_attribute9_o =>ben_bnr_shd.g_old_rec.bnr_attribute9
294 ,p_bnr_attribute10_o =>ben_bnr_shd.g_old_rec.bnr_attribute10
295 ,p_bnr_attribute11_o =>ben_bnr_shd.g_old_rec.bnr_attribute11
296 ,p_bnr_attribute12_o =>ben_bnr_shd.g_old_rec.bnr_attribute12
297 ,p_bnr_attribute13_o =>ben_bnr_shd.g_old_rec.bnr_attribute13
298 ,p_bnr_attribute14_o =>ben_bnr_shd.g_old_rec.bnr_attribute14
299 ,p_bnr_attribute15_o =>ben_bnr_shd.g_old_rec.bnr_attribute15
300 ,p_bnr_attribute16_o =>ben_bnr_shd.g_old_rec.bnr_attribute16
301 ,p_bnr_attribute17_o =>ben_bnr_shd.g_old_rec.bnr_attribute17
302 ,p_bnr_attribute18_o =>ben_bnr_shd.g_old_rec.bnr_attribute18
303 ,p_bnr_attribute19_o =>ben_bnr_shd.g_old_rec.bnr_attribute19
304 ,p_bnr_attribute20_o =>ben_bnr_shd.g_old_rec.bnr_attribute20
305 ,p_bnr_attribute21_o =>ben_bnr_shd.g_old_rec.bnr_attribute21
306 ,p_bnr_attribute22_o =>ben_bnr_shd.g_old_rec.bnr_attribute22
307 ,p_bnr_attribute23_o =>ben_bnr_shd.g_old_rec.bnr_attribute23
308 ,p_bnr_attribute24_o =>ben_bnr_shd.g_old_rec.bnr_attribute24
309 ,p_bnr_attribute25_o =>ben_bnr_shd.g_old_rec.bnr_attribute25
310 ,p_bnr_attribute26_o =>ben_bnr_shd.g_old_rec.bnr_attribute26
311 ,p_bnr_attribute27_o =>ben_bnr_shd.g_old_rec.bnr_attribute27
312 ,p_bnr_attribute28_o =>ben_bnr_shd.g_old_rec.bnr_attribute28
313 ,p_bnr_attribute29_o =>ben_bnr_shd.g_old_rec.bnr_attribute29
314 ,p_bnr_attribute30_o =>ben_bnr_shd.g_old_rec.bnr_attribute30
315 ,p_function_code_o =>ben_bnr_shd.g_old_rec.function_code
316 ,p_legislation_code_o =>ben_bnr_shd.g_old_rec.legislation_code
317 ,p_object_version_number_o =>ben_bnr_shd.g_old_rec.object_version_number
318 ,p_ordr_num_o =>ben_bnr_shd.g_old_rec.ordr_num --iRec
319 );
320 --
321 exception
322 --
323 when hr_api.cannot_find_prog_unit then
324 --
325 hr_api.cannot_find_prog_unit_error
326 (p_module_name => 'ben_rptg_grp'
327 ,p_hook_type => 'AU');
328 --
329 end;
330 --
331 -- End of API User Hook for post_update.
332 --
333 --
334 hr_utility.set_location(' Leaving:'||l_proc, 10);
335 End post_update;
336 --
337 -- ----------------------------------------------------------------------------
338 -- |-----------------------------< convert_defs >-----------------------------|
339 -- ----------------------------------------------------------------------------
340 -- {Start Of Comments}
341 --
342 -- Description:
343 -- The Convert_Defs procedure has one very important function:
344 -- It must return the record structure for the row with all system defaulted
345 -- values converted into its corresponding parameter value for update. When
346 -- we attempt to update a row through the Upd process , certain
347 -- parameters can be defaulted which enables flexibility in the calling of
348 -- the upd process (e.g. only attributes which need to be updated need to be
349 -- specified). For the upd process to determine which attributes
350 -- have NOT been specified we need to check if the parameter has a reserved
351 -- system default value. Therefore, for all parameters which have a
352 -- corresponding reserved system default mechanism specified we need to
353 -- check if a system default is being used. If a system default is being
354 -- used then we convert the defaulted value into its corresponding attribute
355 -- value held in the g_old_rec data structure.
356 --
357 -- Prerequisites:
358 -- This private function can only be called from the upd process.
359 --
360 -- In Parameters:
361 -- A Pl/Sql record structre.
362 --
363 -- Post Success:
364 -- The record structure will be returned with all system defaulted parameter
365 -- values converted into its current row attribute value.
366 --
367 -- Post Failure:
368 -- No direct error handling is required within this function. Any possible
369 -- errors within this procedure will be a PL/SQL value error due to conversion
370 -- of datatypes or data lengths.
371 --
372 -- Developer Implementation Notes:
373 -- None.
374 --
375 -- Access Status:
376 -- Internal Row Handler Use Only.
377 --
378 -- {End Of Comments}
379 -- ----------------------------------------------------------------------------
380 Procedure convert_defs(p_rec in out nocopy ben_bnr_shd.g_rec_type) is
381 --
382 l_proc varchar2(72) := g_package||'convert_defs';
383 --
384 Begin
385 --
386 hr_utility.set_location('Entering:'||l_proc, 5);
387 --
388 -- We must now examine each argument value in the
389 -- p_rec plsql record structure
390 -- to see if a system default is being used. If a system default
391 -- is being used then we must set to the 'current' argument value.
392 --
393 If (p_rec.name = hr_api.g_varchar2) then
394 p_rec.name :=
395 ben_bnr_shd.g_old_rec.name;
396 End If;
397 If (p_rec.business_group_id = hr_api.g_number) then
398 p_rec.business_group_id :=
399 ben_bnr_shd.g_old_rec.business_group_id;
400 End If;
401 If (p_rec.rptg_prps_cd = hr_api.g_varchar2) then
402 p_rec.rptg_prps_cd :=
403 ben_bnr_shd.g_old_rec.rptg_prps_cd;
404 End If;
405 If (p_rec.rpg_desc = hr_api.g_varchar2) then
406 p_rec.rpg_desc :=
407 ben_bnr_shd.g_old_rec.rpg_desc;
408 End If;
409 If (p_rec.bnr_attribute_category = hr_api.g_varchar2) then
410 p_rec.bnr_attribute_category :=
411 ben_bnr_shd.g_old_rec.bnr_attribute_category;
412 End If;
413 If (p_rec.bnr_attribute1 = hr_api.g_varchar2) then
414 p_rec.bnr_attribute1 :=
415 ben_bnr_shd.g_old_rec.bnr_attribute1;
416 End If;
417 If (p_rec.bnr_attribute2 = hr_api.g_varchar2) then
418 p_rec.bnr_attribute2 :=
419 ben_bnr_shd.g_old_rec.bnr_attribute2;
420 End If;
421 If (p_rec.bnr_attribute3 = hr_api.g_varchar2) then
422 p_rec.bnr_attribute3 :=
423 ben_bnr_shd.g_old_rec.bnr_attribute3;
424 End If;
425 If (p_rec.bnr_attribute4 = hr_api.g_varchar2) then
426 p_rec.bnr_attribute4 :=
427 ben_bnr_shd.g_old_rec.bnr_attribute4;
428 End If;
429 If (p_rec.bnr_attribute5 = hr_api.g_varchar2) then
430 p_rec.bnr_attribute5 :=
431 ben_bnr_shd.g_old_rec.bnr_attribute5;
432 End If;
433 If (p_rec.bnr_attribute6 = hr_api.g_varchar2) then
434 p_rec.bnr_attribute6 :=
435 ben_bnr_shd.g_old_rec.bnr_attribute6;
436 End If;
437 If (p_rec.bnr_attribute7 = hr_api.g_varchar2) then
438 p_rec.bnr_attribute7 :=
439 ben_bnr_shd.g_old_rec.bnr_attribute7;
440 End If;
441 If (p_rec.bnr_attribute8 = hr_api.g_varchar2) then
442 p_rec.bnr_attribute8 :=
443 ben_bnr_shd.g_old_rec.bnr_attribute8;
444 End If;
445 If (p_rec.bnr_attribute9 = hr_api.g_varchar2) then
446 p_rec.bnr_attribute9 :=
447 ben_bnr_shd.g_old_rec.bnr_attribute9;
448 End If;
449 If (p_rec.bnr_attribute10 = hr_api.g_varchar2) then
450 p_rec.bnr_attribute10 :=
451 ben_bnr_shd.g_old_rec.bnr_attribute10;
452 End If;
453 If (p_rec.bnr_attribute11 = hr_api.g_varchar2) then
454 p_rec.bnr_attribute11 :=
455 ben_bnr_shd.g_old_rec.bnr_attribute11;
456 End If;
457 If (p_rec.bnr_attribute12 = hr_api.g_varchar2) then
458 p_rec.bnr_attribute12 :=
459 ben_bnr_shd.g_old_rec.bnr_attribute12;
460 End If;
461 If (p_rec.bnr_attribute13 = hr_api.g_varchar2) then
462 p_rec.bnr_attribute13 :=
463 ben_bnr_shd.g_old_rec.bnr_attribute13;
464 End If;
465 If (p_rec.bnr_attribute14 = hr_api.g_varchar2) then
466 p_rec.bnr_attribute14 :=
467 ben_bnr_shd.g_old_rec.bnr_attribute14;
468 End If;
469 If (p_rec.bnr_attribute15 = hr_api.g_varchar2) then
470 p_rec.bnr_attribute15 :=
471 ben_bnr_shd.g_old_rec.bnr_attribute15;
472 End If;
473 If (p_rec.bnr_attribute16 = hr_api.g_varchar2) then
474 p_rec.bnr_attribute16 :=
475 ben_bnr_shd.g_old_rec.bnr_attribute16;
476 End If;
477 If (p_rec.bnr_attribute17 = hr_api.g_varchar2) then
478 p_rec.bnr_attribute17 :=
479 ben_bnr_shd.g_old_rec.bnr_attribute17;
480 End If;
481 If (p_rec.bnr_attribute18 = hr_api.g_varchar2) then
482 p_rec.bnr_attribute18 :=
483 ben_bnr_shd.g_old_rec.bnr_attribute18;
484 End If;
485 If (p_rec.bnr_attribute19 = hr_api.g_varchar2) then
486 p_rec.bnr_attribute19 :=
487 ben_bnr_shd.g_old_rec.bnr_attribute19;
488 End If;
489 If (p_rec.bnr_attribute20 = hr_api.g_varchar2) then
490 p_rec.bnr_attribute20 :=
491 ben_bnr_shd.g_old_rec.bnr_attribute20;
492 End If;
493 If (p_rec.bnr_attribute21 = hr_api.g_varchar2) then
494 p_rec.bnr_attribute21 :=
495 ben_bnr_shd.g_old_rec.bnr_attribute21;
496 End If;
497 If (p_rec.bnr_attribute22 = hr_api.g_varchar2) then
498 p_rec.bnr_attribute22 :=
499 ben_bnr_shd.g_old_rec.bnr_attribute22;
500 End If;
501 If (p_rec.bnr_attribute23 = hr_api.g_varchar2) then
502 p_rec.bnr_attribute23 :=
503 ben_bnr_shd.g_old_rec.bnr_attribute23;
504 End If;
505 If (p_rec.bnr_attribute24 = hr_api.g_varchar2) then
506 p_rec.bnr_attribute24 :=
507 ben_bnr_shd.g_old_rec.bnr_attribute24;
508 End If;
509 If (p_rec.bnr_attribute25 = hr_api.g_varchar2) then
510 p_rec.bnr_attribute25 :=
511 ben_bnr_shd.g_old_rec.bnr_attribute25;
512 End If;
513 If (p_rec.bnr_attribute26 = hr_api.g_varchar2) then
514 p_rec.bnr_attribute26 :=
515 ben_bnr_shd.g_old_rec.bnr_attribute26;
516 End If;
517 If (p_rec.bnr_attribute27 = hr_api.g_varchar2) then
518 p_rec.bnr_attribute27 :=
519 ben_bnr_shd.g_old_rec.bnr_attribute27;
520 End If;
521 If (p_rec.bnr_attribute28 = hr_api.g_varchar2) then
522 p_rec.bnr_attribute28 :=
523 ben_bnr_shd.g_old_rec.bnr_attribute28;
524 End If;
525 If (p_rec.bnr_attribute29 = hr_api.g_varchar2) then
526 p_rec.bnr_attribute29 :=
527 ben_bnr_shd.g_old_rec.bnr_attribute29;
528 End If;
529 If (p_rec.bnr_attribute30 = hr_api.g_varchar2) then
530 p_rec.bnr_attribute30 :=
531 ben_bnr_shd.g_old_rec.bnr_attribute30;
532 End If;
533 --iRec
534 If (p_rec.ordr_num = hr_api.g_number) then
535 p_rec.ordr_num :=
536 ben_bnr_shd.g_old_rec.ordr_num;
537 End If;
538 --iRec
539 --
540 hr_utility.set_location(' Leaving:'||l_proc, 10);
541 --
542 End convert_defs;
543 --
544 -- ----------------------------------------------------------------------------
545 -- |---------------------------------< upd >----------------------------------|
546 -- ----------------------------------------------------------------------------
547 Procedure upd
548 (
549 p_effective_date in date,
550 p_rec in out nocopy ben_bnr_shd.g_rec_type
551 ) is
552 --
553 l_proc varchar2(72) := g_package||'upd';
554 --
555 Begin
556 hr_utility.set_location('Entering:'||l_proc, 5);
557 --
558 -- We must lock the row which we need to update.
559 --
560 ben_bnr_shd.lck
561 (
562 p_rec.rptg_grp_id,
563 p_rec.object_version_number
564 );
565 --
566 -- 1. During an update system defaults are used to determine if
567 -- arguments have been defaulted or not. We must therefore
568 -- derive the full record structure values to be updated.
569 --
570 -- 2. Call the supporting update validate operations.
571 --
572 convert_defs(p_rec);
573 ben_bnr_bus.update_validate(p_rec
574 ,p_effective_date);
575 --
576 -- Call the supporting pre-update operation
577 --
578 pre_update(p_rec);
579 --
580 -- Update the row.
581 --
582 update_dml(p_rec);
583 --
584 -- Call the supporting post-update operation
585 --
586 post_update(
587 p_effective_date,p_rec);
588 End upd;
589 --
590 -- ----------------------------------------------------------------------------
591 -- |---------------------------------< upd >----------------------------------|
592 -- ----------------------------------------------------------------------------
593 Procedure upd
594 (
595 p_effective_date in date,
596 p_rptg_grp_id in number,
597 p_name in varchar2 default hr_api.g_varchar2,
598 p_business_group_id in number default hr_api.g_number,
599 p_rptg_prps_cd in varchar2 default hr_api.g_varchar2,
600 p_rpg_desc in varchar2 default hr_api.g_varchar2,
601 p_bnr_attribute_category in varchar2 default hr_api.g_varchar2,
602 p_bnr_attribute1 in varchar2 default hr_api.g_varchar2,
603 p_bnr_attribute2 in varchar2 default hr_api.g_varchar2,
604 p_bnr_attribute3 in varchar2 default hr_api.g_varchar2,
605 p_bnr_attribute4 in varchar2 default hr_api.g_varchar2,
606 p_bnr_attribute5 in varchar2 default hr_api.g_varchar2,
607 p_bnr_attribute6 in varchar2 default hr_api.g_varchar2,
608 p_bnr_attribute7 in varchar2 default hr_api.g_varchar2,
609 p_bnr_attribute8 in varchar2 default hr_api.g_varchar2,
610 p_bnr_attribute9 in varchar2 default hr_api.g_varchar2,
611 p_bnr_attribute10 in varchar2 default hr_api.g_varchar2,
612 p_bnr_attribute11 in varchar2 default hr_api.g_varchar2,
613 p_bnr_attribute12 in varchar2 default hr_api.g_varchar2,
614 p_bnr_attribute13 in varchar2 default hr_api.g_varchar2,
615 p_bnr_attribute14 in varchar2 default hr_api.g_varchar2,
616 p_bnr_attribute15 in varchar2 default hr_api.g_varchar2,
617 p_bnr_attribute16 in varchar2 default hr_api.g_varchar2,
618 p_bnr_attribute17 in varchar2 default hr_api.g_varchar2,
619 p_bnr_attribute18 in varchar2 default hr_api.g_varchar2,
620 p_bnr_attribute19 in varchar2 default hr_api.g_varchar2,
621 p_bnr_attribute20 in varchar2 default hr_api.g_varchar2,
622 p_bnr_attribute21 in varchar2 default hr_api.g_varchar2,
623 p_bnr_attribute22 in varchar2 default hr_api.g_varchar2,
624 p_bnr_attribute23 in varchar2 default hr_api.g_varchar2,
625 p_bnr_attribute24 in varchar2 default hr_api.g_varchar2,
626 p_bnr_attribute25 in varchar2 default hr_api.g_varchar2,
627 p_bnr_attribute26 in varchar2 default hr_api.g_varchar2,
628 p_bnr_attribute27 in varchar2 default hr_api.g_varchar2,
629 p_bnr_attribute28 in varchar2 default hr_api.g_varchar2,
630 p_bnr_attribute29 in varchar2 default hr_api.g_varchar2,
631 p_bnr_attribute30 in varchar2 default hr_api.g_varchar2,
632 p_function_code in varchar2 default hr_api.g_varchar2,
633 p_legislation_code in varchar2 default hr_api.g_varchar2,
634 p_object_version_number in out nocopy number,
635 p_ordr_num in number default hr_api.g_number --iRec
636 ) is
637 --
638 l_rec ben_bnr_shd.g_rec_type;
639 l_proc varchar2(72) := g_package||'upd';
640 --
641 Begin
642 hr_utility.set_location('Entering:'||l_proc, 5);
643 --
644 -- Call conversion function to turn arguments into the
645 -- l_rec structure.
646 --
647 l_rec :=
648 ben_bnr_shd.convert_args
649 (
650 p_rptg_grp_id,
651 p_name,
652 p_business_group_id,
653 p_rptg_prps_cd,
654 p_rpg_desc,
655 p_bnr_attribute_category,
656 p_bnr_attribute1,
657 p_bnr_attribute2,
658 p_bnr_attribute3,
659 p_bnr_attribute4,
660 p_bnr_attribute5,
661 p_bnr_attribute6,
662 p_bnr_attribute7,
663 p_bnr_attribute8,
664 p_bnr_attribute9,
665 p_bnr_attribute10,
666 p_bnr_attribute11,
667 p_bnr_attribute12,
668 p_bnr_attribute13,
669 p_bnr_attribute14,
670 p_bnr_attribute15,
671 p_bnr_attribute16,
672 p_bnr_attribute17,
673 p_bnr_attribute18,
674 p_bnr_attribute19,
675 p_bnr_attribute20,
676 p_bnr_attribute21,
677 p_bnr_attribute22,
678 p_bnr_attribute23,
679 p_bnr_attribute24,
680 p_bnr_attribute25,
681 p_bnr_attribute26,
682 p_bnr_attribute27,
683 p_bnr_attribute28,
684 p_bnr_attribute29,
685 p_bnr_attribute30,
686 p_function_code,
687 p_legislation_code,
688 p_object_version_number,
689 p_ordr_num --iRec
690 );
691 --
692 -- Having converted the arguments into the
693 -- plsql record structure we call the corresponding record
694 -- business process.
695 --
696 upd(
697 p_effective_date,l_rec);
698 p_object_version_number := l_rec.object_version_number;
699 --
700 hr_utility.set_location(' Leaving:'||l_proc, 10);
701 End upd;
702 --
703 end ben_bnr_upd;