DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CRP_UPD

Source


1 Package Body ben_crp_upd as
2 /* $Header: becrprhi.pkb 115.4 2002/12/16 11:04:00 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_crp_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_crp_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_crp_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_cbr_per_in_ler Row
68   --
69   update ben_cbr_per_in_ler
70   set
71   cbr_per_in_ler_id                 = p_rec.cbr_per_in_ler_id,
72   init_evt_flag                     = p_rec.init_evt_flag,
73   cnt_num                           = p_rec.cnt_num,
74   per_in_ler_id                     = p_rec.per_in_ler_id,
75   cbr_quald_bnf_id                  = p_rec.cbr_quald_bnf_id,
76   prvs_elig_perd_end_dt             = p_rec.prvs_elig_perd_end_dt,
77   business_group_id                 = p_rec.business_group_id,
78   crp_attribute_category            = p_rec.crp_attribute_category,
79   crp_attribute1                    = p_rec.crp_attribute1,
80   crp_attribute2                    = p_rec.crp_attribute2,
81   crp_attribute3                    = p_rec.crp_attribute3,
82   crp_attribute4                    = p_rec.crp_attribute4,
83   crp_attribute5                    = p_rec.crp_attribute5,
84   crp_attribute6                    = p_rec.crp_attribute6,
85   crp_attribute7                    = p_rec.crp_attribute7,
86   crp_attribute8                    = p_rec.crp_attribute8,
87   crp_attribute9                    = p_rec.crp_attribute9,
88   crp_attribute10                   = p_rec.crp_attribute10,
89   crp_attribute11                   = p_rec.crp_attribute11,
90   crp_attribute12                   = p_rec.crp_attribute12,
91   crp_attribute13                   = p_rec.crp_attribute13,
92   crp_attribute14                   = p_rec.crp_attribute14,
93   crp_attribute15                   = p_rec.crp_attribute15,
94   crp_attribute16                   = p_rec.crp_attribute16,
95   crp_attribute17                   = p_rec.crp_attribute17,
96   crp_attribute18                   = p_rec.crp_attribute18,
97   crp_attribute19                   = p_rec.crp_attribute19,
98   crp_attribute20                   = p_rec.crp_attribute20,
99   crp_attribute21                   = p_rec.crp_attribute21,
100   crp_attribute22                   = p_rec.crp_attribute22,
101   crp_attribute23                   = p_rec.crp_attribute23,
102   crp_attribute24                   = p_rec.crp_attribute24,
103   crp_attribute25                   = p_rec.crp_attribute25,
104   crp_attribute26                   = p_rec.crp_attribute26,
105   crp_attribute27                   = p_rec.crp_attribute27,
106   crp_attribute28                   = p_rec.crp_attribute28,
107   crp_attribute29                   = p_rec.crp_attribute29,
108   crp_attribute30                   = p_rec.crp_attribute30,
109   object_version_number             = p_rec.object_version_number
110   where cbr_per_in_ler_id = p_rec.cbr_per_in_ler_id;
111   --
112   ben_crp_shd.g_api_dml := false;   -- Unset the api dml status
113   --
114   hr_utility.set_location(' Leaving:'||l_proc, 10);
115 --
116 Exception
117   When hr_api.check_integrity_violated Then
118     -- A check constraint has been violated
119     ben_crp_shd.g_api_dml := false;   -- Unset the api dml status
120     ben_crp_shd.constraint_error
121       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
122   When hr_api.parent_integrity_violated Then
123     -- Parent integrity has been violated
124     ben_crp_shd.g_api_dml := false;   -- Unset the api dml status
125     ben_crp_shd.constraint_error
126       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
127   When hr_api.unique_integrity_violated Then
128     -- Unique integrity has been violated
129     ben_crp_shd.g_api_dml := false;   -- Unset the api dml status
130     ben_crp_shd.constraint_error
131       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
132   When Others Then
133     ben_crp_shd.g_api_dml := false;   -- Unset the api dml status
134     Raise;
135 End update_dml;
136 --
137 -- ----------------------------------------------------------------------------
138 -- |------------------------------< pre_update >------------------------------|
139 -- ----------------------------------------------------------------------------
140 -- {Start Of Comments}
141 --
142 -- Description:
143 --   This private procedure contains any processing which is required before
144 --   the update dml.
145 --
146 -- Prerequisites:
147 --   This is an internal procedure which is called from the upd procedure.
148 --
149 -- In Parameters:
150 --   A Pl/Sql record structre.
151 --
152 -- Post Success:
153 --   Processing continues.
154 --
155 -- Post Failure:
156 --   If an error has occurred, an error message and exception will be raised
157 --   but not handled.
158 --
159 -- Developer Implementation Notes:
160 --   Any pre-processing required before the update dml is issued should be
161 --   coded within this procedure. It is important to note that any 3rd party
162 --   maintenance should be reviewed before placing in this procedure.
163 --
164 -- Access Status:
165 --   Internal Row Handler Use Only.
166 --
167 -- {End Of Comments}
168 -- ----------------------------------------------------------------------------
169 Procedure pre_update(p_rec in ben_crp_shd.g_rec_type) is
170 --
171   l_proc  varchar2(72) := g_package||'pre_update';
172 --
173 Begin
174   hr_utility.set_location('Entering:'||l_proc, 5);
175   --
176   hr_utility.set_location(' Leaving:'||l_proc, 10);
177 End pre_update;
178 --
179 -- ----------------------------------------------------------------------------
180 -- |-----------------------------< post_update >------------------------------|
181 -- ----------------------------------------------------------------------------
182 -- {Start Of Comments}
183 --
184 -- Description:
185 --   This private procedure contains any processing which is required after the
186 --   update dml.
187 --
188 -- Prerequisites:
189 --   This is an internal procedure which is called from the upd procedure.
190 --
191 -- In Parameters:
192 --   A Pl/Sql record structre.
193 --
194 -- Post Success:
195 --   Processing continues.
196 --
197 -- Post Failure:
198 --   If an error has occurred, an error message and exception will be raised
199 --   but not handled.
200 --
201 -- Developer Implementation Notes:
202 --   Any post-processing required after the update dml is issued should be
203 --   coded within this procedure. It is important to note that any 3rd party
204 --   maintenance should be reviewed before placing in this procedure.
205 --
206 -- Access Status:
207 --   Internal Row Handler Use Only.
208 --
209 -- {End Of Comments}
210 -- ----------------------------------------------------------------------------
211 Procedure post_update(
212 p_effective_date in date,p_rec in ben_crp_shd.g_rec_type) is
213 --
214   l_proc  varchar2(72) := g_package||'post_update';
215 --
216 Begin
217   hr_utility.set_location('Entering:'||l_proc, 5);
218 --
219   --
220   -- Start of API User Hook for post_update.
221   --
222   begin
223     --
224     ben_crp_rku.after_update
225       (
226   p_cbr_per_in_ler_id             =>p_rec.cbr_per_in_ler_id
227  ,p_init_evt_flag                 =>p_rec.init_evt_flag
228  ,p_cnt_num                       =>p_rec.cnt_num
229  ,p_per_in_ler_id                 =>p_rec.per_in_ler_id
230  ,p_cbr_quald_bnf_id              =>p_rec.cbr_quald_bnf_id
231  ,p_prvs_elig_perd_end_dt         =>p_rec.prvs_elig_perd_end_dt
232  ,p_business_group_id             =>p_rec.business_group_id
233  ,p_crp_attribute_category        =>p_rec.crp_attribute_category
234  ,p_crp_attribute1                =>p_rec.crp_attribute1
235  ,p_crp_attribute2                =>p_rec.crp_attribute2
236  ,p_crp_attribute3                =>p_rec.crp_attribute3
237  ,p_crp_attribute4                =>p_rec.crp_attribute4
238  ,p_crp_attribute5                =>p_rec.crp_attribute5
239  ,p_crp_attribute6                =>p_rec.crp_attribute6
240  ,p_crp_attribute7                =>p_rec.crp_attribute7
241  ,p_crp_attribute8                =>p_rec.crp_attribute8
242  ,p_crp_attribute9                =>p_rec.crp_attribute9
243  ,p_crp_attribute10               =>p_rec.crp_attribute10
244  ,p_crp_attribute11               =>p_rec.crp_attribute11
245  ,p_crp_attribute12               =>p_rec.crp_attribute12
246  ,p_crp_attribute13               =>p_rec.crp_attribute13
247  ,p_crp_attribute14               =>p_rec.crp_attribute14
248  ,p_crp_attribute15               =>p_rec.crp_attribute15
249  ,p_crp_attribute16               =>p_rec.crp_attribute16
250  ,p_crp_attribute17               =>p_rec.crp_attribute17
251  ,p_crp_attribute18               =>p_rec.crp_attribute18
252  ,p_crp_attribute19               =>p_rec.crp_attribute19
253  ,p_crp_attribute20               =>p_rec.crp_attribute20
254  ,p_crp_attribute21               =>p_rec.crp_attribute21
255  ,p_crp_attribute22               =>p_rec.crp_attribute22
256  ,p_crp_attribute23               =>p_rec.crp_attribute23
257  ,p_crp_attribute24               =>p_rec.crp_attribute24
258  ,p_crp_attribute25               =>p_rec.crp_attribute25
259  ,p_crp_attribute26               =>p_rec.crp_attribute26
260  ,p_crp_attribute27               =>p_rec.crp_attribute27
261  ,p_crp_attribute28               =>p_rec.crp_attribute28
262  ,p_crp_attribute29               =>p_rec.crp_attribute29
263  ,p_crp_attribute30               =>p_rec.crp_attribute30
264  ,p_object_version_number         =>p_rec.object_version_number
265  ,p_effective_date                =>p_effective_date
266  ,p_init_evt_flag_o               =>ben_crp_shd.g_old_rec.init_evt_flag
267  ,p_cnt_num_o                     =>ben_crp_shd.g_old_rec.cnt_num
268  ,p_per_in_ler_id_o               =>ben_crp_shd.g_old_rec.per_in_ler_id
269  ,p_cbr_quald_bnf_id_o            =>ben_crp_shd.g_old_rec.cbr_quald_bnf_id
270  ,p_prvs_elig_perd_end_dt_o       =>ben_crp_shd.g_old_rec.prvs_elig_perd_end_dt
271  ,p_business_group_id_o           =>ben_crp_shd.g_old_rec.business_group_id
272  ,p_crp_attribute_category_o      =>ben_crp_shd.g_old_rec.crp_attribute_category
273  ,p_crp_attribute1_o              =>ben_crp_shd.g_old_rec.crp_attribute1
274  ,p_crp_attribute2_o              =>ben_crp_shd.g_old_rec.crp_attribute2
275  ,p_crp_attribute3_o              =>ben_crp_shd.g_old_rec.crp_attribute3
276  ,p_crp_attribute4_o              =>ben_crp_shd.g_old_rec.crp_attribute4
277  ,p_crp_attribute5_o              =>ben_crp_shd.g_old_rec.crp_attribute5
278  ,p_crp_attribute6_o              =>ben_crp_shd.g_old_rec.crp_attribute6
279  ,p_crp_attribute7_o              =>ben_crp_shd.g_old_rec.crp_attribute7
280  ,p_crp_attribute8_o              =>ben_crp_shd.g_old_rec.crp_attribute8
281  ,p_crp_attribute9_o              =>ben_crp_shd.g_old_rec.crp_attribute9
282  ,p_crp_attribute10_o             =>ben_crp_shd.g_old_rec.crp_attribute10
283  ,p_crp_attribute11_o             =>ben_crp_shd.g_old_rec.crp_attribute11
284  ,p_crp_attribute12_o             =>ben_crp_shd.g_old_rec.crp_attribute12
285  ,p_crp_attribute13_o             =>ben_crp_shd.g_old_rec.crp_attribute13
286  ,p_crp_attribute14_o             =>ben_crp_shd.g_old_rec.crp_attribute14
287  ,p_crp_attribute15_o             =>ben_crp_shd.g_old_rec.crp_attribute15
288  ,p_crp_attribute16_o             =>ben_crp_shd.g_old_rec.crp_attribute16
289  ,p_crp_attribute17_o             =>ben_crp_shd.g_old_rec.crp_attribute17
290  ,p_crp_attribute18_o             =>ben_crp_shd.g_old_rec.crp_attribute18
291  ,p_crp_attribute19_o             =>ben_crp_shd.g_old_rec.crp_attribute19
292  ,p_crp_attribute20_o             =>ben_crp_shd.g_old_rec.crp_attribute20
293  ,p_crp_attribute21_o             =>ben_crp_shd.g_old_rec.crp_attribute21
294  ,p_crp_attribute22_o             =>ben_crp_shd.g_old_rec.crp_attribute22
295  ,p_crp_attribute23_o             =>ben_crp_shd.g_old_rec.crp_attribute23
296  ,p_crp_attribute24_o             =>ben_crp_shd.g_old_rec.crp_attribute24
297  ,p_crp_attribute25_o             =>ben_crp_shd.g_old_rec.crp_attribute25
298  ,p_crp_attribute26_o             =>ben_crp_shd.g_old_rec.crp_attribute26
299  ,p_crp_attribute27_o             =>ben_crp_shd.g_old_rec.crp_attribute27
300  ,p_crp_attribute28_o             =>ben_crp_shd.g_old_rec.crp_attribute28
301  ,p_crp_attribute29_o             =>ben_crp_shd.g_old_rec.crp_attribute29
302  ,p_crp_attribute30_o             =>ben_crp_shd.g_old_rec.crp_attribute30
303  ,p_object_version_number_o       =>ben_crp_shd.g_old_rec.object_version_number
304       );
305     --
306   exception
307     --
308     when hr_api.cannot_find_prog_unit then
309       --
310       hr_api.cannot_find_prog_unit_error
311         (p_module_name => 'ben_cbr_per_in_ler'
312         ,p_hook_type   => 'AU');
313       --
314   end;
315   --
316   -- End of API User Hook for post_update.
317   --
318   --
319   hr_utility.set_location(' Leaving:'||l_proc, 10);
320 End post_update;
321 --
322 -- ----------------------------------------------------------------------------
323 -- |-----------------------------< convert_defs >-----------------------------|
324 -- ----------------------------------------------------------------------------
325 -- {Start Of Comments}
326 --
327 -- Description:
328 --   The Convert_Defs procedure has one very important function:
329 --   It must return the record structure for the row with all system defaulted
330 --   values converted into its corresponding parameter value for update. When
331 --   we attempt to update a row through the Upd process , certain
332 --   parameters can be defaulted which enables flexibility in the calling of
333 --   the upd process (e.g. only attributes which need to be updated need to be
334 --   specified). For the upd process to determine which attributes
335 --   have NOT been specified we need to check if the parameter has a reserved
336 --   system default value. Therefore, for all parameters which have a
337 --   corresponding reserved system default mechanism specified we need to
338 --   check if a system default is being used. If a system default is being
339 --   used then we convert the defaulted value into its corresponding attribute
340 --   value held in the g_old_rec data structure.
341 --
342 -- Prerequisites:
343 --   This private function can only be called from the upd process.
344 --
345 -- In Parameters:
346 --   A Pl/Sql record structre.
347 --
348 -- Post Success:
349 --   The record structure will be returned with all system defaulted parameter
350 --   values converted into its current row attribute value.
351 --
352 -- Post Failure:
353 --   No direct error handling is required within this function. Any possible
354 --   errors within this procedure will be a PL/SQL value error due to conversion
355 --   of datatypes or data lengths.
356 --
357 -- Developer Implementation Notes:
358 --   None.
359 --
360 -- Access Status:
361 --   Internal Row Handler Use Only.
362 --
363 -- {End Of Comments}
364 -- ----------------------------------------------------------------------------
365 Procedure convert_defs(p_rec in out nocopy ben_crp_shd.g_rec_type) is
366 --
367   l_proc  varchar2(72) := g_package||'convert_defs';
368 --
369 Begin
370   --
371   hr_utility.set_location('Entering:'||l_proc, 5);
372   --
373   -- We must now examine each argument value in the
374   -- p_rec plsql record structure
375   -- to see if a system default is being used. If a system default
376   -- is being used then we must set to the 'current' argument value.
377   --
378   If (p_rec.init_evt_flag = hr_api.g_varchar2) then
379     p_rec.init_evt_flag :=
380     ben_crp_shd.g_old_rec.init_evt_flag;
381   End If;
382   If (p_rec.cnt_num = hr_api.g_number) then
383     p_rec.cnt_num :=
384     ben_crp_shd.g_old_rec.cnt_num;
385   End If;
386   If (p_rec.per_in_ler_id = hr_api.g_number) then
387     p_rec.per_in_ler_id :=
388     ben_crp_shd.g_old_rec.per_in_ler_id;
389   End If;
390   If (p_rec.cbr_quald_bnf_id = hr_api.g_number) then
391     p_rec.cbr_quald_bnf_id :=
392     ben_crp_shd.g_old_rec.cbr_quald_bnf_id;
393   End If;
394   If (p_rec.prvs_elig_perd_end_dt = hr_api.g_date) then
395     p_rec.prvs_elig_perd_end_dt :=
396     ben_crp_shd.g_old_rec.prvs_elig_perd_end_dt;
397   End If;
398   If (p_rec.business_group_id = hr_api.g_number) then
399     p_rec.business_group_id :=
400     ben_crp_shd.g_old_rec.business_group_id;
401   End If;
402   If (p_rec.crp_attribute_category = hr_api.g_varchar2) then
403     p_rec.crp_attribute_category :=
404     ben_crp_shd.g_old_rec.crp_attribute_category;
405   End If;
406   If (p_rec.crp_attribute1 = hr_api.g_varchar2) then
407     p_rec.crp_attribute1 :=
408     ben_crp_shd.g_old_rec.crp_attribute1;
409   End If;
410   If (p_rec.crp_attribute2 = hr_api.g_varchar2) then
411     p_rec.crp_attribute2 :=
412     ben_crp_shd.g_old_rec.crp_attribute2;
413   End If;
414   If (p_rec.crp_attribute3 = hr_api.g_varchar2) then
415     p_rec.crp_attribute3 :=
416     ben_crp_shd.g_old_rec.crp_attribute3;
417   End If;
418   If (p_rec.crp_attribute4 = hr_api.g_varchar2) then
419     p_rec.crp_attribute4 :=
420     ben_crp_shd.g_old_rec.crp_attribute4;
421   End If;
422   If (p_rec.crp_attribute5 = hr_api.g_varchar2) then
423     p_rec.crp_attribute5 :=
424     ben_crp_shd.g_old_rec.crp_attribute5;
425   End If;
426   If (p_rec.crp_attribute6 = hr_api.g_varchar2) then
427     p_rec.crp_attribute6 :=
428     ben_crp_shd.g_old_rec.crp_attribute6;
429   End If;
430   If (p_rec.crp_attribute7 = hr_api.g_varchar2) then
431     p_rec.crp_attribute7 :=
432     ben_crp_shd.g_old_rec.crp_attribute7;
433   End If;
434   If (p_rec.crp_attribute8 = hr_api.g_varchar2) then
435     p_rec.crp_attribute8 :=
436     ben_crp_shd.g_old_rec.crp_attribute8;
437   End If;
438   If (p_rec.crp_attribute9 = hr_api.g_varchar2) then
439     p_rec.crp_attribute9 :=
440     ben_crp_shd.g_old_rec.crp_attribute9;
441   End If;
442   If (p_rec.crp_attribute10 = hr_api.g_varchar2) then
443     p_rec.crp_attribute10 :=
444     ben_crp_shd.g_old_rec.crp_attribute10;
445   End If;
446   If (p_rec.crp_attribute11 = hr_api.g_varchar2) then
447     p_rec.crp_attribute11 :=
448     ben_crp_shd.g_old_rec.crp_attribute11;
449   End If;
450   If (p_rec.crp_attribute12 = hr_api.g_varchar2) then
451     p_rec.crp_attribute12 :=
452     ben_crp_shd.g_old_rec.crp_attribute12;
453   End If;
454   If (p_rec.crp_attribute13 = hr_api.g_varchar2) then
455     p_rec.crp_attribute13 :=
456     ben_crp_shd.g_old_rec.crp_attribute13;
457   End If;
458   If (p_rec.crp_attribute14 = hr_api.g_varchar2) then
459     p_rec.crp_attribute14 :=
460     ben_crp_shd.g_old_rec.crp_attribute14;
461   End If;
462   If (p_rec.crp_attribute15 = hr_api.g_varchar2) then
463     p_rec.crp_attribute15 :=
464     ben_crp_shd.g_old_rec.crp_attribute15;
465   End If;
466   If (p_rec.crp_attribute16 = hr_api.g_varchar2) then
467     p_rec.crp_attribute16 :=
468     ben_crp_shd.g_old_rec.crp_attribute16;
469   End If;
470   If (p_rec.crp_attribute17 = hr_api.g_varchar2) then
471     p_rec.crp_attribute17 :=
472     ben_crp_shd.g_old_rec.crp_attribute17;
473   End If;
474   If (p_rec.crp_attribute18 = hr_api.g_varchar2) then
475     p_rec.crp_attribute18 :=
476     ben_crp_shd.g_old_rec.crp_attribute18;
477   End If;
478   If (p_rec.crp_attribute19 = hr_api.g_varchar2) then
479     p_rec.crp_attribute19 :=
480     ben_crp_shd.g_old_rec.crp_attribute19;
481   End If;
482   If (p_rec.crp_attribute20 = hr_api.g_varchar2) then
483     p_rec.crp_attribute20 :=
484     ben_crp_shd.g_old_rec.crp_attribute20;
485   End If;
486   If (p_rec.crp_attribute21 = hr_api.g_varchar2) then
487     p_rec.crp_attribute21 :=
488     ben_crp_shd.g_old_rec.crp_attribute21;
489   End If;
490   If (p_rec.crp_attribute22 = hr_api.g_varchar2) then
491     p_rec.crp_attribute22 :=
492     ben_crp_shd.g_old_rec.crp_attribute22;
493   End If;
494   If (p_rec.crp_attribute23 = hr_api.g_varchar2) then
495     p_rec.crp_attribute23 :=
496     ben_crp_shd.g_old_rec.crp_attribute23;
497   End If;
498   If (p_rec.crp_attribute24 = hr_api.g_varchar2) then
499     p_rec.crp_attribute24 :=
500     ben_crp_shd.g_old_rec.crp_attribute24;
501   End If;
502   If (p_rec.crp_attribute25 = hr_api.g_varchar2) then
503     p_rec.crp_attribute25 :=
504     ben_crp_shd.g_old_rec.crp_attribute25;
505   End If;
506   If (p_rec.crp_attribute26 = hr_api.g_varchar2) then
507     p_rec.crp_attribute26 :=
508     ben_crp_shd.g_old_rec.crp_attribute26;
509   End If;
510   If (p_rec.crp_attribute27 = hr_api.g_varchar2) then
511     p_rec.crp_attribute27 :=
512     ben_crp_shd.g_old_rec.crp_attribute27;
513   End If;
514   If (p_rec.crp_attribute28 = hr_api.g_varchar2) then
515     p_rec.crp_attribute28 :=
516     ben_crp_shd.g_old_rec.crp_attribute28;
517   End If;
518   If (p_rec.crp_attribute29 = hr_api.g_varchar2) then
519     p_rec.crp_attribute29 :=
520     ben_crp_shd.g_old_rec.crp_attribute29;
521   End If;
522   If (p_rec.crp_attribute30 = hr_api.g_varchar2) then
523     p_rec.crp_attribute30 :=
524     ben_crp_shd.g_old_rec.crp_attribute30;
525   End If;
526 
527   --
528   hr_utility.set_location(' Leaving:'||l_proc, 10);
529 --
530 End convert_defs;
531 --
532 -- ----------------------------------------------------------------------------
533 -- |---------------------------------< upd >----------------------------------|
534 -- ----------------------------------------------------------------------------
535 Procedure upd
536   (
537   p_effective_date in date,
538   p_rec        in out nocopy ben_crp_shd.g_rec_type
539   ) is
540 --
541   l_proc  varchar2(72) := g_package||'upd';
542 --
543 Begin
544   hr_utility.set_location('Entering:'||l_proc, 5);
545   --
546   -- We must lock the row which we need to update.
547   --
548   ben_crp_shd.lck
549 	(
550 	p_rec.cbr_per_in_ler_id,
551 	p_rec.object_version_number
552 	);
553   --
554   -- 1. During an update system defaults are used to determine if
555   --    arguments have been defaulted or not. We must therefore
556   --    derive the full record structure values to be updated.
557   --
558   -- 2. Call the supporting update validate operations.
559   --
560   convert_defs(p_rec);
561   ben_crp_bus.update_validate(p_rec
562   ,p_effective_date);
563   --
564   -- Call the supporting pre-update operation
565   --
566   pre_update(p_rec);
567   --
568   -- Update the row.
569   --
570   update_dml(p_rec);
571   --
572   -- Call the supporting post-update operation
573   --
574   post_update(
575 p_effective_date,p_rec);
576 End upd;
577 --
578 -- ----------------------------------------------------------------------------
579 -- |---------------------------------< upd >----------------------------------|
580 -- ----------------------------------------------------------------------------
581 Procedure upd
582   (
583   p_effective_date in date,
584   p_cbr_per_in_ler_id            in number,
585   p_init_evt_flag                in varchar2         default hr_api.g_varchar2,
586   p_cnt_num                      in number           default hr_api.g_number,
587   p_per_in_ler_id                in number           default hr_api.g_number,
588   p_cbr_quald_bnf_id             in number           default hr_api.g_number,
589   p_prvs_elig_perd_end_dt        in date             default hr_api.g_date,
590   p_business_group_id            in number           default hr_api.g_number,
591   p_crp_attribute_category       in varchar2         default hr_api.g_varchar2,
592   p_crp_attribute1               in varchar2         default hr_api.g_varchar2,
593   p_crp_attribute2               in varchar2         default hr_api.g_varchar2,
594   p_crp_attribute3               in varchar2         default hr_api.g_varchar2,
595   p_crp_attribute4               in varchar2         default hr_api.g_varchar2,
596   p_crp_attribute5               in varchar2         default hr_api.g_varchar2,
597   p_crp_attribute6               in varchar2         default hr_api.g_varchar2,
598   p_crp_attribute7               in varchar2         default hr_api.g_varchar2,
599   p_crp_attribute8               in varchar2         default hr_api.g_varchar2,
600   p_crp_attribute9               in varchar2         default hr_api.g_varchar2,
601   p_crp_attribute10              in varchar2         default hr_api.g_varchar2,
602   p_crp_attribute11              in varchar2         default hr_api.g_varchar2,
603   p_crp_attribute12              in varchar2         default hr_api.g_varchar2,
604   p_crp_attribute13              in varchar2         default hr_api.g_varchar2,
605   p_crp_attribute14              in varchar2         default hr_api.g_varchar2,
606   p_crp_attribute15              in varchar2         default hr_api.g_varchar2,
607   p_crp_attribute16              in varchar2         default hr_api.g_varchar2,
608   p_crp_attribute17              in varchar2         default hr_api.g_varchar2,
609   p_crp_attribute18              in varchar2         default hr_api.g_varchar2,
610   p_crp_attribute19              in varchar2         default hr_api.g_varchar2,
611   p_crp_attribute20              in varchar2         default hr_api.g_varchar2,
612   p_crp_attribute21              in varchar2         default hr_api.g_varchar2,
613   p_crp_attribute22              in varchar2         default hr_api.g_varchar2,
614   p_crp_attribute23              in varchar2         default hr_api.g_varchar2,
615   p_crp_attribute24              in varchar2         default hr_api.g_varchar2,
616   p_crp_attribute25              in varchar2         default hr_api.g_varchar2,
617   p_crp_attribute26              in varchar2         default hr_api.g_varchar2,
618   p_crp_attribute27              in varchar2         default hr_api.g_varchar2,
619   p_crp_attribute28              in varchar2         default hr_api.g_varchar2,
620   p_crp_attribute29              in varchar2         default hr_api.g_varchar2,
621   p_crp_attribute30              in varchar2         default hr_api.g_varchar2,
622   p_object_version_number        in out nocopy number
623   ) is
624 --
625   l_rec	  ben_crp_shd.g_rec_type;
626   l_proc  varchar2(72) := g_package||'upd';
627 --
628 Begin
629   hr_utility.set_location('Entering:'||l_proc, 5);
630   --
631   -- Call conversion function to turn arguments into the
632   -- l_rec structure.
633   --
634   l_rec :=
635   ben_crp_shd.convert_args
636   (
637   p_cbr_per_in_ler_id,
638   p_init_evt_flag,
639   p_cnt_num,
640   p_per_in_ler_id,
641   p_cbr_quald_bnf_id,
642   p_prvs_elig_perd_end_dt,
643   p_business_group_id,
644   p_crp_attribute_category,
645   p_crp_attribute1,
646   p_crp_attribute2,
647   p_crp_attribute3,
648   p_crp_attribute4,
649   p_crp_attribute5,
650   p_crp_attribute6,
651   p_crp_attribute7,
652   p_crp_attribute8,
653   p_crp_attribute9,
654   p_crp_attribute10,
655   p_crp_attribute11,
656   p_crp_attribute12,
657   p_crp_attribute13,
658   p_crp_attribute14,
659   p_crp_attribute15,
660   p_crp_attribute16,
661   p_crp_attribute17,
662   p_crp_attribute18,
663   p_crp_attribute19,
664   p_crp_attribute20,
665   p_crp_attribute21,
666   p_crp_attribute22,
667   p_crp_attribute23,
668   p_crp_attribute24,
669   p_crp_attribute25,
670   p_crp_attribute26,
671   p_crp_attribute27,
672   p_crp_attribute28,
673   p_crp_attribute29,
674   p_crp_attribute30,
675   p_object_version_number
676   );
677   --
678   -- Having converted the arguments into the
679   -- plsql record structure we call the corresponding record
680   -- business process.
681   --
682   upd(
683     p_effective_date,l_rec);
684   p_object_version_number := l_rec.object_version_number;
685   --
686   hr_utility.set_location(' Leaving:'||l_proc, 10);
687 End upd;
688 --
689 end ben_crp_upd;