DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_ECR_UPD

Source


1 Package Body ben_ecr_upd as
2 /* $Header: beecrrhi.pkb 115.21 2002/12/27 20:59:56 pabodla ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ecr_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_ecr_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_ecr_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_enrt_rt Row
68   --
69   update ben_enrt_rt
70   set
71   enrt_rt_id                   = p_rec.enrt_rt_id,
72 --  ordr_num		       = p_rec.ordr_num,
73   acty_typ_cd                  = p_rec.acty_typ_cd,
74   tx_typ_cd                    = p_rec.tx_typ_cd,
75   ctfn_rqd_flag                = p_rec.ctfn_rqd_flag,
76   dflt_flag                    = p_rec.dflt_flag,
77   dflt_pndg_ctfn_flag          = p_rec.dflt_pndg_ctfn_flag,
78   dsply_on_enrt_flag           = p_rec.dsply_on_enrt_flag,
79   use_to_calc_net_flx_cr_flag  = p_rec.use_to_calc_net_flx_cr_flag,
80   entr_val_at_enrt_flag        = p_rec.entr_val_at_enrt_flag,
81   asn_on_enrt_flag             = p_rec.asn_on_enrt_flag,
82   rl_crs_only_flag             = p_rec.rl_crs_only_flag,
83   dflt_val                     = p_rec.dflt_val,
84   ann_val                      = p_rec.ann_val,
85   ann_mn_elcn_val              = p_rec.ann_mn_elcn_val,
86   ann_mx_elcn_val              = p_rec.ann_mx_elcn_val,
87   val                          = p_rec.val,
88   nnmntry_uom                  = p_rec.nnmntry_uom,
89   mx_elcn_val                  = p_rec.mx_elcn_val,
90   mn_elcn_val                  = p_rec.mn_elcn_val,
91   incrmt_elcn_val              = p_rec.incrmt_elcn_val,
92   cmcd_acty_ref_perd_cd        = p_rec.cmcd_acty_ref_perd_cd,
93   cmcd_mn_elcn_val             = p_rec.cmcd_mn_elcn_val,
94   cmcd_mx_elcn_val             = p_rec.cmcd_mx_elcn_val,
95   cmcd_val                     = p_rec.cmcd_val,
96   cmcd_dflt_val                = p_rec.cmcd_dflt_val,
97   rt_usg_cd                    = p_rec.rt_usg_cd,
98   ann_dflt_val                 = p_rec.ann_dflt_val,
99   bnft_rt_typ_cd               = p_rec.bnft_rt_typ_cd,
100   rt_mlt_cd                    = p_rec.rt_mlt_cd,
101   dsply_mn_elcn_val            = p_rec.dsply_mn_elcn_val,
102   dsply_mx_elcn_val            = p_rec.dsply_mx_elcn_val,
103   entr_ann_val_flag            = p_rec.entr_ann_val_flag,
104   rt_strt_dt                   = p_rec.rt_strt_dt,
105   rt_strt_dt_cd                = p_rec.rt_strt_dt_cd,
106   rt_strt_dt_rl                = p_rec.rt_strt_dt_rl,
107   rt_typ_cd                    = p_rec.rt_typ_cd,
108   elig_per_elctbl_chc_id       = p_rec.elig_per_elctbl_chc_id,
109   acty_base_rt_id              = p_rec.acty_base_rt_id,
110   spcl_rt_enrt_rt_id           = p_rec.spcl_rt_enrt_rt_id,
111   enrt_bnft_id                 = p_rec.enrt_bnft_id,
112   prtt_rt_val_id               = p_rec.prtt_rt_val_id,
113   decr_bnft_prvdr_pool_id      = p_rec.decr_bnft_prvdr_pool_id,
114   cvg_amt_calc_mthd_id         = p_rec.cvg_amt_calc_mthd_id,
115   actl_prem_id                 = p_rec.actl_prem_id,
116   comp_lvl_fctr_id             = p_rec.comp_lvl_fctr_id,
117   ptd_comp_lvl_fctr_id         = p_rec.ptd_comp_lvl_fctr_id,
118   clm_comp_lvl_fctr_id         = p_rec.clm_comp_lvl_fctr_id,
119   business_group_id            = p_rec.business_group_id,
120    --cwb
121   iss_val                      = p_rec.iss_val ,
122   val_last_upd_date            = p_rec.val_last_upd_date ,
123   val_last_upd_person_id       = p_rec.val_last_upd_person_id,
124    --cwb
125   pp_in_yr_used_num            = p_rec.pp_in_yr_used_num,
126   ecr_attribute_category       = p_rec.ecr_attribute_category,
127   ecr_attribute1               = p_rec.ecr_attribute1,
128   ecr_attribute2               = p_rec.ecr_attribute2,
129   ecr_attribute3               = p_rec.ecr_attribute3,
130   ecr_attribute4               = p_rec.ecr_attribute4,
131   ecr_attribute5               = p_rec.ecr_attribute5,
132   ecr_attribute6               = p_rec.ecr_attribute6,
133   ecr_attribute7               = p_rec.ecr_attribute7,
134   ecr_attribute8               = p_rec.ecr_attribute8,
135   ecr_attribute9               = p_rec.ecr_attribute9,
136   ecr_attribute10              = p_rec.ecr_attribute10,
137   ecr_attribute11              = p_rec.ecr_attribute11,
138   ecr_attribute12              = p_rec.ecr_attribute12,
139   ecr_attribute13              = p_rec.ecr_attribute13,
140   ecr_attribute14              = p_rec.ecr_attribute14,
141   ecr_attribute15              = p_rec.ecr_attribute15,
142   ecr_attribute16              = p_rec.ecr_attribute16,
143   ecr_attribute17              = p_rec.ecr_attribute17,
144   ecr_attribute18              = p_rec.ecr_attribute18,
145   ecr_attribute19              = p_rec.ecr_attribute19,
146   ecr_attribute20              = p_rec.ecr_attribute20,
147   ecr_attribute21              = p_rec.ecr_attribute21,
148   ecr_attribute22              = p_rec.ecr_attribute22,
149   ecr_attribute23              = p_rec.ecr_attribute23,
150   ecr_attribute24              = p_rec.ecr_attribute24,
151   ecr_attribute25              = p_rec.ecr_attribute25,
152   ecr_attribute26              = p_rec.ecr_attribute26,
153   ecr_attribute27              = p_rec.ecr_attribute27,
154   ecr_attribute28              = p_rec.ecr_attribute28,
155   ecr_attribute29              = p_rec.ecr_attribute29,
156   ecr_attribute30              = p_rec.ecr_attribute30,
157   last_update_login            = p_rec.last_update_login,
158   created_by                   = p_rec.created_by,
159   creation_date                = p_rec.creation_date,
160   last_updated_by              = p_rec.last_updated_by,
161   last_update_date             = p_rec.last_update_date,
162   request_id                   = p_rec.request_id,
163   program_application_id       = p_rec.program_application_id,
164   program_id                   = p_rec.program_id,
165   program_update_date          = p_rec.program_update_date,
166   object_version_number        = p_rec.object_version_number
167   where enrt_rt_id = p_rec.enrt_rt_id;
168   --
169   ben_ecr_shd.g_api_dml := false;   -- Unset the api dml status
170   --
171   hr_utility.set_location(' Leaving:'||l_proc, 10);
172 --
173 Exception
174   When hr_api.check_integrity_violated Then
175     -- A check constraint has been violated
176     ben_ecr_shd.g_api_dml := false;   -- Unset the api dml status
177     ben_ecr_shd.constraint_error
178       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
179   When hr_api.parent_integrity_violated Then
180     -- Parent integrity has been violated
181     ben_ecr_shd.g_api_dml := false;   -- Unset the api dml status
182     ben_ecr_shd.constraint_error
183       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
184   When hr_api.unique_integrity_violated Then
185     -- Unique integrity has been violated
186     ben_ecr_shd.g_api_dml := false;   -- Unset the api dml status
187     ben_ecr_shd.constraint_error
188       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
189   When Others Then
190     ben_ecr_shd.g_api_dml := false;   -- Unset the api dml status
191     Raise;
192 End update_dml;
193 --
194 -- ----------------------------------------------------------------------------
195 -- |------------------------------< pre_update >------------------------------|
196 -- ----------------------------------------------------------------------------
197 -- {Start Of Comments}
198 --
199 -- Description:
200 --   This private procedure contains any processing which is required before
201 --   the update dml.
202 --
203 -- Prerequisites:
204 --   This is an internal procedure which is called from the upd procedure.
205 --
206 -- In Parameters:
207 --   A Pl/Sql record structre.
208 --
209 -- Post Success:
210 --   Processing continues.
211 --
212 -- Post Failure:
213 --   If an error has occurred, an error message and exception will be raised
214 --   but not handled.
215 --
216 -- Developer Implementation Notes:
217 --   Any pre-processing required before the update dml is issued should be
218 --   coded within this procedure. It is important to note that any 3rd party
219 --   maintenance should be reviewed before placing in this procedure.
220 --
221 -- Access Status:
222 --   Internal Row Handler Use Only.
223 --
224 -- {End Of Comments}
225 -- ----------------------------------------------------------------------------
226 Procedure pre_update(p_rec in ben_ecr_shd.g_rec_type) is
227 --
228   l_proc  varchar2(72) := g_package||'pre_update';
229 --
230 Begin
231   hr_utility.set_location('Entering:'||l_proc, 5);
232   --
233   hr_utility.set_location(' Leaving:'||l_proc, 10);
234 End pre_update;
235 --
236 -- ----------------------------------------------------------------------------
237 -- |-----------------------------< post_update >------------------------------|
238 -- ----------------------------------------------------------------------------
239 -- {Start Of Comments}
240 --
241 -- Description:
242 --   This private procedure contains any processing which is required after the
243 --   update dml.
244 --
245 -- Prerequisites:
246 --   This is an internal procedure which is called from the upd procedure.
247 --
248 -- In Parameters:
249 --   A Pl/Sql record structre.
250 --
251 -- Post Success:
252 --   Processing continues.
253 --
254 -- Post Failure:
255 --   If an error has occurred, an error message and exception will be raised
256 --   but not handled.
257 --
258 -- Developer Implementation Notes:
259 --   Any post-processing required after the update dml is issued should be
260 --   coded within this procedure. It is important to note that any 3rd party
261 --   maintenance should be reviewed before placing in this procedure.
262 --
263 -- Access Status:
264 --   Internal Row Handler Use Only.
265 --
266 -- {End Of Comments}
267 -- ----------------------------------------------------------------------------
268 Procedure post_update(p_rec            in ben_ecr_shd.g_rec_type,
269                       p_effective_date in date) is
270 --
271   l_proc  varchar2(72) := g_package||'post_update';
272 --
273 Begin
274   hr_utility.set_location('Entering:'||l_proc, 5);
275   --
276   hr_utility.set_location(' Leaving:'||l_proc, 10);
277 End post_update;
278 --
279 -- ----------------------------------------------------------------------------
280 -- |-----------------------------< convert_defs >-----------------------------|
281 -- ----------------------------------------------------------------------------
282 -- {Start Of Comments}
283 --
284 -- Description:
285 --   The Convert_Defs procedure has one very important function:
286 --   It must return the record structure for the row with all system defaulted
287 --   values converted into its corresponding parameter value for update. When
288 --   we attempt to update a row through the Upd process , certain
289 --   parameters can be defaulted which enables flexibility in the calling of
290 --   the upd process (e.g. only attributes which need to be updated need to be
291 --   specified). For the upd process to determine which attributes
292 --   have NOT been specified we need to check if the parameter has a reserved
293 --   system default value. Therefore, for all parameters which have a
294 --   corresponding reserved system default mechanism specified we need to
295 --   check if a system default is being used. If a system default is being
296 --   used then we convert the defaulted value into its corresponding attribute
297 --   value held in the g_old_rec data structure.
298 --
299 -- Prerequisites:
300 --   This private function can only be called from the upd process.
301 --
302 -- In Parameters:
303 --   A Pl/Sql record structre.
304 --
305 -- Post Success:
306 --   The record structure will be returned with all system defaulted parameter
307 --   values converted into its current row attribute value.
308 --
309 -- Post Failure:
310 --   No direct error handling is required within this function. Any possible
311 --   errors within this procedure will be a PL/SQL value error due to conversion
312 
313 --   of datatypes or data lengths.
314 --
315 -- Developer Implementation Notes:
316 --   None.
317 --
318 -- Access Status:
319 --   Internal Row Handler Use Only.
320 --
321 -- {End Of Comments}
322 -- ----------------------------------------------------------------------------
323 Procedure convert_defs(p_rec in out nocopy ben_ecr_shd.g_rec_type) is
324 --
325   l_proc  varchar2(72) := g_package||'convert_defs';
326 --
327 Begin
328   --
329   hr_utility.set_location('Entering:'||l_proc, 5);
330   --
331   -- We must now examine each argument value in the
332   -- p_rec plsql record structure
333   -- to see if a system default is being used. If a system default
334   -- is being used then we must set to the 'current' argument value.
335   --
336   If (p_rec.ordr_num = hr_api.g_number) then
337           p_rec.ordr_num :=
338           ben_abr_shd.g_old_rec.ordr_num;
339   End If;
340   If (p_rec.acty_typ_cd = hr_api.g_varchar2) then
341     p_rec.acty_typ_cd :=
342     ben_ecr_shd.g_old_rec.acty_typ_cd;
343   End If;
344   If (p_rec.tx_typ_cd = hr_api.g_varchar2) then
345     p_rec.tx_typ_cd :=
346     ben_ecr_shd.g_old_rec.tx_typ_cd;
347   End If;
348   If (p_rec.ctfn_rqd_flag = hr_api.g_varchar2) then
349     p_rec.ctfn_rqd_flag :=
350     ben_ecr_shd.g_old_rec.ctfn_rqd_flag;
351   End If;
352   If (p_rec.dflt_flag = hr_api.g_varchar2) then
353     p_rec.dflt_flag :=
354     ben_ecr_shd.g_old_rec.dflt_flag;
355   End If;
356   If (p_rec.dflt_pndg_ctfn_flag = hr_api.g_varchar2) then
357     p_rec.dflt_pndg_ctfn_flag :=
358     ben_ecr_shd.g_old_rec.dflt_pndg_ctfn_flag;
359   End If;
360   If (p_rec.dsply_on_enrt_flag = hr_api.g_varchar2) then
361     p_rec.dsply_on_enrt_flag :=
362     ben_ecr_shd.g_old_rec.dsply_on_enrt_flag;
363   End If;
364   If (p_rec.use_to_calc_net_flx_cr_flag = hr_api.g_varchar2) then
365     p_rec.use_to_calc_net_flx_cr_flag :=
366     ben_ecr_shd.g_old_rec.use_to_calc_net_flx_cr_flag;
367   End If;
368   If (p_rec.entr_val_at_enrt_flag = hr_api.g_varchar2) then
369     p_rec.entr_val_at_enrt_flag :=
370     ben_ecr_shd.g_old_rec.entr_val_at_enrt_flag;
371   End If;
372   If (p_rec.asn_on_enrt_flag = hr_api.g_varchar2) then
373     p_rec.asn_on_enrt_flag :=
374     ben_ecr_shd.g_old_rec.asn_on_enrt_flag;
375   End If;
376   If (p_rec.rl_crs_only_flag = hr_api.g_varchar2) then
377     p_rec.rl_crs_only_flag :=
378     ben_ecr_shd.g_old_rec.rl_crs_only_flag;
379   End If;
380   If (p_rec.dflt_val = hr_api.g_number) then
381     p_rec.dflt_val :=
382     ben_ecr_shd.g_old_rec.dflt_val;
383   End If;
384   If (p_rec.ann_val = hr_api.g_number) then
385     p_rec.ann_val :=
386     ben_ecr_shd.g_old_rec.ann_val;
387   End If;
388   If (p_rec.ann_mn_elcn_val = hr_api.g_number) then
389     p_rec.ann_mn_elcn_val :=
390     ben_ecr_shd.g_old_rec.ann_mn_elcn_val;
391   End If;
392   If (p_rec.ann_mx_elcn_val = hr_api.g_number) then
393     p_rec.ann_mx_elcn_val :=
394     ben_ecr_shd.g_old_rec.ann_mx_elcn_val;
395   End If;
396   If (p_rec.val = hr_api.g_number) then
397     p_rec.val :=
398     ben_ecr_shd.g_old_rec.val;
399   End If;
400   If (p_rec.nnmntry_uom = hr_api.g_varchar2) then
401     p_rec.nnmntry_uom :=
402     ben_ecr_shd.g_old_rec.nnmntry_uom;
403   End If;
404   If (p_rec.mx_elcn_val = hr_api.g_number) then
405     p_rec.mx_elcn_val :=
406     ben_ecr_shd.g_old_rec.mx_elcn_val;
407   End If;
408   If (p_rec.mn_elcn_val = hr_api.g_number) then
409     p_rec.mn_elcn_val :=
410     ben_ecr_shd.g_old_rec.mn_elcn_val;
411   End If;
412   If (p_rec.incrmt_elcn_val = hr_api.g_number) then
413     p_rec.incrmt_elcn_val :=
414     ben_ecr_shd.g_old_rec.incrmt_elcn_val;
415   End If;
416   If (p_rec.cmcd_acty_ref_perd_cd = hr_api.g_varchar2) then
417     p_rec.cmcd_acty_ref_perd_cd :=
418     ben_ecr_shd.g_old_rec.cmcd_acty_ref_perd_cd;
419   End If;
420   If (p_rec.cmcd_mn_elcn_val = hr_api.g_number) then
421     p_rec.cmcd_mn_elcn_val :=
422     ben_ecr_shd.g_old_rec.cmcd_mn_elcn_val;
423   End If;
424   If (p_rec.cmcd_mx_elcn_val = hr_api.g_number) then
425     p_rec.cmcd_mx_elcn_val :=
426     ben_ecr_shd.g_old_rec.cmcd_mx_elcn_val;
427   End If;
428   If (p_rec.cmcd_val = hr_api.g_number) then
429     p_rec.cmcd_val :=
430     ben_ecr_shd.g_old_rec.cmcd_val;
431   End If;
432   If (p_rec.cmcd_dflt_val = hr_api.g_number) then
433     p_rec.cmcd_dflt_val :=
434     ben_ecr_shd.g_old_rec.cmcd_dflt_val;
435   End If;
436   If (p_rec.elig_per_elctbl_chc_id = hr_api.g_number) then
437     p_rec.elig_per_elctbl_chc_id :=
438     ben_ecr_shd.g_old_rec.elig_per_elctbl_chc_id;
439   End If;
440   If (p_rec.acty_base_rt_id = hr_api.g_number) then
441     p_rec.acty_base_rt_id :=
442     ben_ecr_shd.g_old_rec.acty_base_rt_id;
443   End If;
444   If (p_rec.spcl_rt_enrt_rt_id = hr_api.g_number) then
445     p_rec.spcl_rt_enrt_rt_id :=
446     ben_ecr_shd.g_old_rec.spcl_rt_enrt_rt_id;
447   End If;
448   If (p_rec.enrt_bnft_id = hr_api.g_number) then
449     p_rec.enrt_bnft_id :=
450     ben_ecr_shd.g_old_rec.enrt_bnft_id;
451   End If;
452   If (p_rec.business_group_id = hr_api.g_number) then
453     p_rec.business_group_id :=
454     ben_ecr_shd.g_old_rec.business_group_id;
455   End If;
456   --cwb
457   If (p_rec.iss_val = hr_api.g_number) then
458     p_rec.iss_val :=
459     ben_ecr_shd.g_old_rec.iss_val;
460   End If;
461   If (p_rec.val_last_upd_person_id = hr_api.g_number) then
462     p_rec.val_last_upd_person_id :=
463     ben_ecr_shd.g_old_rec.val_last_upd_person_id;
464   End If;
465   If (p_rec.val_last_upd_date = hr_api.g_date) then
466     p_rec.val_last_upd_date :=
467     ben_ecr_shd.g_old_rec.val_last_upd_date;
468   End If;
469   --cwb
470   If (p_rec.pp_in_yr_used_num = hr_api.g_number) then
471     p_rec.pp_in_yr_used_num :=
472     ben_ecr_shd.g_old_rec.pp_in_yr_used_num;
473   End If;
474   If (p_rec.ecr_attribute_category = hr_api.g_varchar2) then
475     p_rec.ecr_attribute_category :=
476     ben_ecr_shd.g_old_rec.ecr_attribute_category;
477   End If;
478   If (p_rec.ecr_attribute1 = hr_api.g_varchar2) then
479     p_rec.ecr_attribute1 :=
480     ben_ecr_shd.g_old_rec.ecr_attribute1;
481   End If;
482   If (p_rec.ecr_attribute2 = hr_api.g_varchar2) then
483     p_rec.ecr_attribute2 :=
484     ben_ecr_shd.g_old_rec.ecr_attribute2;
485   End If;
486   If (p_rec.ecr_attribute3 = hr_api.g_varchar2) then
487     p_rec.ecr_attribute3 :=
488     ben_ecr_shd.g_old_rec.ecr_attribute3;
489   End If;
490   If (p_rec.ecr_attribute4 = hr_api.g_varchar2) then
491     p_rec.ecr_attribute4 :=
492     ben_ecr_shd.g_old_rec.ecr_attribute4;
493   End If;
494   If (p_rec.ecr_attribute5 = hr_api.g_varchar2) then
495     p_rec.ecr_attribute5 :=
496     ben_ecr_shd.g_old_rec.ecr_attribute5;
497   End If;
498   If (p_rec.ecr_attribute6 = hr_api.g_varchar2) then
499     p_rec.ecr_attribute6 :=
500     ben_ecr_shd.g_old_rec.ecr_attribute6;
501   End If;
502   If (p_rec.ecr_attribute7 = hr_api.g_varchar2) then
503     p_rec.ecr_attribute7 :=
504     ben_ecr_shd.g_old_rec.ecr_attribute7;
505   End If;
506   If (p_rec.ecr_attribute8 = hr_api.g_varchar2) then
507     p_rec.ecr_attribute8 :=
508     ben_ecr_shd.g_old_rec.ecr_attribute8;
509   End If;
510   If (p_rec.ecr_attribute9 = hr_api.g_varchar2) then
511     p_rec.ecr_attribute9 :=
512     ben_ecr_shd.g_old_rec.ecr_attribute9;
513   End If;
514   If (p_rec.ecr_attribute10 = hr_api.g_varchar2) then
515     p_rec.ecr_attribute10 :=
516     ben_ecr_shd.g_old_rec.ecr_attribute10;
517   End If;
518   If (p_rec.ecr_attribute11 = hr_api.g_varchar2) then
519     p_rec.ecr_attribute11 :=
520     ben_ecr_shd.g_old_rec.ecr_attribute11;
521   End If;
522   If (p_rec.ecr_attribute12 = hr_api.g_varchar2) then
523     p_rec.ecr_attribute12 :=
524     ben_ecr_shd.g_old_rec.ecr_attribute12;
525   End If;
526   If (p_rec.ecr_attribute13 = hr_api.g_varchar2) then
527     p_rec.ecr_attribute13 :=
528     ben_ecr_shd.g_old_rec.ecr_attribute13;
529   End If;
530   If (p_rec.ecr_attribute14 = hr_api.g_varchar2) then
531     p_rec.ecr_attribute14 :=
532     ben_ecr_shd.g_old_rec.ecr_attribute14;
533   End If;
534   If (p_rec.ecr_attribute15 = hr_api.g_varchar2) then
535     p_rec.ecr_attribute15 :=
536     ben_ecr_shd.g_old_rec.ecr_attribute15;
537   End If;
538   If (p_rec.ecr_attribute16 = hr_api.g_varchar2) then
539     p_rec.ecr_attribute16 :=
540     ben_ecr_shd.g_old_rec.ecr_attribute16;
541   End If;
542   If (p_rec.ecr_attribute17 = hr_api.g_varchar2) then
543     p_rec.ecr_attribute17 :=
544     ben_ecr_shd.g_old_rec.ecr_attribute17;
545   End If;
546   If (p_rec.ecr_attribute18 = hr_api.g_varchar2) then
547     p_rec.ecr_attribute18 :=
548     ben_ecr_shd.g_old_rec.ecr_attribute18;
549   End If;
550   If (p_rec.ecr_attribute19 = hr_api.g_varchar2) then
551     p_rec.ecr_attribute19 :=
552     ben_ecr_shd.g_old_rec.ecr_attribute19;
553   End If;
554   If (p_rec.ecr_attribute20 = hr_api.g_varchar2) then
555     p_rec.ecr_attribute20 :=
556     ben_ecr_shd.g_old_rec.ecr_attribute20;
557   End If;
558   If (p_rec.ecr_attribute21 = hr_api.g_varchar2) then
559     p_rec.ecr_attribute21 :=
560     ben_ecr_shd.g_old_rec.ecr_attribute21;
561   End If;
562   If (p_rec.ecr_attribute22 = hr_api.g_varchar2) then
563     p_rec.ecr_attribute22 :=
564     ben_ecr_shd.g_old_rec.ecr_attribute22;
565   End If;
566   If (p_rec.ecr_attribute23 = hr_api.g_varchar2) then
567     p_rec.ecr_attribute23 :=
568     ben_ecr_shd.g_old_rec.ecr_attribute23;
569   End If;
570   If (p_rec.ecr_attribute24 = hr_api.g_varchar2) then
571     p_rec.ecr_attribute24 :=
572     ben_ecr_shd.g_old_rec.ecr_attribute24;
573   End If;
574   If (p_rec.ecr_attribute25 = hr_api.g_varchar2) then
575     p_rec.ecr_attribute25 :=
576     ben_ecr_shd.g_old_rec.ecr_attribute25;
577   End If;
578   If (p_rec.ecr_attribute26 = hr_api.g_varchar2) then
579     p_rec.ecr_attribute26 :=
580     ben_ecr_shd.g_old_rec.ecr_attribute26;
581   End If;
582   If (p_rec.ecr_attribute27 = hr_api.g_varchar2) then
583     p_rec.ecr_attribute27 :=
584     ben_ecr_shd.g_old_rec.ecr_attribute27;
585   End If;
586   If (p_rec.ecr_attribute28 = hr_api.g_varchar2) then
587     p_rec.ecr_attribute28 :=
588     ben_ecr_shd.g_old_rec.ecr_attribute28;
589   End If;
590   If (p_rec.ecr_attribute29 = hr_api.g_varchar2) then
591     p_rec.ecr_attribute29 :=
592     ben_ecr_shd.g_old_rec.ecr_attribute29;
593   End If;
594   If (p_rec.ecr_attribute30 = hr_api.g_varchar2) then
595     p_rec.ecr_attribute30 :=
596     ben_ecr_shd.g_old_rec.ecr_attribute30;
597   End If;
598   If (p_rec.request_id = hr_api.g_number) then
599     p_rec.request_id :=
600     ben_ecr_shd.g_old_rec.request_id;
601   End If;
602   If (p_rec.program_application_id = hr_api.g_number) then
603     p_rec.program_application_id :=
604     ben_ecr_shd.g_old_rec.program_application_id;
605   End If;
606   If (p_rec.program_id = hr_api.g_number) then
607     p_rec.program_id :=
608     ben_ecr_shd.g_old_rec.program_id;
609   End If;
610   If (p_rec.program_update_date = hr_api.g_date) then
611     p_rec.program_update_date :=
612     ben_ecr_shd.g_old_rec.program_update_date;
613   End If;
614   If (p_rec.prtt_rt_val_id = hr_api.g_number) then
615     p_rec.prtt_rt_val_id :=
616     ben_ecr_shd.g_old_rec.prtt_rt_val_id;
617   End If;
618   If (p_rec.rt_usg_cd = hr_api.g_varchar2) then
619     p_rec.rt_usg_cd :=
620     ben_ecr_shd.g_old_rec.rt_usg_cd;
621   End If;
622   If (p_rec.decr_bnft_prvdr_pool_id = hr_api.g_number) then
623     p_rec.decr_bnft_prvdr_pool_id :=
624     ben_ecr_shd.g_old_rec.decr_bnft_prvdr_pool_id;
625   End If;
626   If (p_rec.ann_dflt_val = hr_api.g_number) then
627     p_rec.ann_dflt_val :=
628     ben_ecr_shd.g_old_rec.ann_dflt_val;
629   End If;
630   If (p_rec.bnft_rt_typ_cd = hr_api.g_varchar2) then
631     p_rec.bnft_rt_typ_cd :=
632     ben_ecr_shd.g_old_rec.bnft_rt_typ_cd;
633   End If;
634   If (p_rec.rt_mlt_cd = hr_api.g_varchar2) then
635     p_rec.rt_mlt_cd :=
636     ben_ecr_shd.g_old_rec.rt_mlt_cd;
637   End If;
638   If (p_rec.dsply_mn_elcn_val = hr_api.g_number) then
639     p_rec.dsply_mn_elcn_val :=
640     ben_ecr_shd.g_old_rec.dsply_mn_elcn_val;
641   End If;
642   If (p_rec.dsply_mx_elcn_val = hr_api.g_number) then
643     p_rec.dsply_mx_elcn_val :=
644     ben_ecr_shd.g_old_rec.dsply_mx_elcn_val;
645   End If;
646   If (p_rec.entr_ann_val_flag = hr_api.g_varchar2) then
647     p_rec.entr_ann_val_flag :=
648     ben_ecr_shd.g_old_rec.entr_ann_val_flag;
649   End If;
650   If (p_rec.rt_strt_dt = hr_api.g_date) then
651     p_rec.rt_strt_dt :=
652     ben_ecr_shd.g_old_rec.rt_strt_dt;
653   End If;
654   If (p_rec.rt_strt_dt_cd = hr_api.g_varchar2) then
655     p_rec.rt_strt_dt_cd :=
656     ben_ecr_shd.g_old_rec.rt_strt_dt_cd;
657   End If;
658   If (p_rec.rt_strt_dt_rl = hr_api.g_number) then
659     p_rec.rt_strt_dt_rl :=
660     ben_ecr_shd.g_old_rec.rt_strt_dt_rl;
661   End If;
662   If (p_rec.rt_typ_cd = hr_api.g_varchar2) then
663     p_rec.rt_typ_cd :=
664     ben_ecr_shd.g_old_rec.rt_typ_cd;
665   End If;
666   If (p_rec.cvg_amt_calc_mthd_id = hr_api.g_number) then
667     p_rec.cvg_amt_calc_mthd_id :=
668     ben_ecr_shd.g_old_rec.cvg_amt_calc_mthd_id;
669   End If;
670   If (p_rec.actl_prem_id = hr_api.g_number) then
671     p_rec.actl_prem_id :=
672     ben_ecr_shd.g_old_rec.actl_prem_id;
673   End If;
674   If (p_rec.comp_lvl_fctr_id = hr_api.g_number) then
675     p_rec.comp_lvl_fctr_id :=
676     ben_ecr_shd.g_old_rec.comp_lvl_fctr_id;
677   End If;
678   If (p_rec.ptd_comp_lvl_fctr_id = hr_api.g_number) then
679     p_rec.ptd_comp_lvl_fctr_id :=
680     ben_ecr_shd.g_old_rec.ptd_comp_lvl_fctr_id;
681   End If;
682   If (p_rec.clm_comp_lvl_fctr_id = hr_api.g_number) then
683     p_rec.clm_comp_lvl_fctr_id :=
684     ben_ecr_shd.g_old_rec.clm_comp_lvl_fctr_id;
685   End If;
686   --
687   hr_utility.set_location(' Leaving:'||l_proc, 10);
688 --
689 End convert_defs;
690 --
691 -- ----------------------------------------------------------------------------
692 -- |---------------------------------< upd >----------------------------------|
693 -- ----------------------------------------------------------------------------
694 Procedure upd
695   (p_rec            in out nocopy ben_ecr_shd.g_rec_type,
696    p_effective_date in date) is
697 --
698   l_proc  varchar2(72) := g_package||'upd';
699 --
700 Begin
701   hr_utility.set_location('Entering:'||l_proc, 5);
702   --
703   -- We must lock the row which we need to update.
704   --
705   ben_ecr_shd.lck
706 	(p_rec.enrt_rt_id,
707 	 p_rec.object_version_number);
708   --
709   -- 1. During an update system defaults are used to determine if
710   --    arguments have been defaulted or not. We must therefore
711   --    derive the full record structure values to be updated.
712   --
713   -- 2. Call the supporting update validate operations.
714   --
715   convert_defs(p_rec);
716   ben_ecr_bus.update_validate(p_rec,p_effective_date);
717   --
718   -- Call the supporting pre-update operation
719   --
720   pre_update(p_rec);
721   --
722   -- Update the row.
723   --
724   update_dml(p_rec);
725   --
726   -- Call the supporting post-update operation
727   --
728   post_update(p_rec,p_effective_date);
729 End upd;
730 --
731 -- ----------------------------------------------------------------------------
732 -- |---------------------------------< upd >----------------------------------|
733 -- ----------------------------------------------------------------------------
734 Procedure upd
735   (
736     p_effective_date              in  date,
737   	p_enrt_rt_id                  in  NUMBER,
738   	p_ordr_num			 in number           default hr_api.g_number,
739   	p_acty_typ_cd                 in  VARCHAR2  DEFAULT hr_api.g_varchar2,
740   	p_tx_typ_cd                   in  VARCHAR2  DEFAULT hr_api.g_varchar2,
741   	p_ctfn_rqd_flag               in  VARCHAR2  DEFAULT hr_api.g_varchar2,
742   	p_dflt_flag                   in  VARCHAR2  DEFAULT hr_api.g_varchar2,
743   	p_dflt_pndg_ctfn_flag         in  VARCHAR2  DEFAULT hr_api.g_varchar2,
744   	p_dsply_on_enrt_flag          in  VARCHAR2  DEFAULT hr_api.g_varchar2,
745   	p_use_to_calc_net_flx_cr_flag in  VARCHAR2  DEFAULT hr_api.g_varchar2,
746   	p_entr_val_at_enrt_flag       in  VARCHAR2  DEFAULT hr_api.g_varchar2,
747   	p_asn_on_enrt_flag            in  VARCHAR2  DEFAULT hr_api.g_varchar2,
748   	p_rl_crs_only_flag            in  VARCHAR2  DEFAULT hr_api.g_varchar2,
749   	p_dflt_val                    in  NUMBER    DEFAULT hr_api.g_number,
750   	p_ann_val                     in  NUMBER    DEFAULT hr_api.g_number,
751   	p_ann_mn_elcn_val             in  NUMBER    DEFAULT hr_api.g_number,
752   	p_ann_mx_elcn_val             in  NUMBER    DEFAULT hr_api.g_number,
753   	p_val                         in  NUMBER    DEFAULT hr_api.g_number,
754   	p_nnmntry_uom                 in  VARCHAR2  DEFAULT hr_api.g_varchar2,
755   	p_mx_elcn_val                 in  NUMBER    DEFAULT hr_api.g_number,
756   	p_mn_elcn_val                 in  NUMBER    DEFAULT hr_api.g_number,
757   	p_incrmt_elcn_val             in  NUMBER    DEFAULT hr_api.g_number,
758   	p_cmcd_acty_ref_perd_cd       in  VARCHAR2  DEFAULT hr_api.g_varchar2,
759   	p_cmcd_mn_elcn_val            in  NUMBER    DEFAULT hr_api.g_number,
760   	p_cmcd_mx_elcn_val            in  NUMBER    DEFAULT hr_api.g_number,
761   	p_cmcd_val                    in  NUMBER    DEFAULT hr_api.g_number,
762   	p_cmcd_dflt_val               in  NUMBER    DEFAULT hr_api.g_number,
763   	p_rt_usg_cd                   in  VARCHAR2  DEFAULT hr_api.g_varchar2,
764   	p_ann_dflt_val                in  NUMBER    DEFAULT hr_api.g_number,
765   	p_bnft_rt_typ_cd              in  VARCHAR2  DEFAULT hr_api.g_varchar2,
766   	p_rt_mlt_cd                   in  VARCHAR2  DEFAULT hr_api.g_varchar2,
767   	p_dsply_mn_elcn_val           in  NUMBER    DEFAULT hr_api.g_number,
768   	p_dsply_mx_elcn_val           in  NUMBER    DEFAULT hr_api.g_number,
769   	p_entr_ann_val_flag           in  VARCHAR2  DEFAULT hr_api.g_varchar2,
770   	p_rt_strt_dt                  in  DATE      DEFAULT hr_api.g_date,
771   	p_rt_strt_dt_cd               in  VARCHAR2  DEFAULT hr_api.g_varchar2,
772   	p_rt_strt_dt_rl               in  NUMBER    DEFAULT hr_api.g_number,
773   	p_rt_typ_cd                   in  VARCHAR2  DEFAULT hr_api.g_varchar2,
774   	p_elig_per_elctbl_chc_id      in  NUMBER    DEFAULT hr_api.g_number,
775   	p_acty_base_rt_id             in  NUMBER    DEFAULT hr_api.g_number,
776   	p_spcl_rt_enrt_rt_id          in  NUMBER    DEFAULT hr_api.g_number,
777   	p_enrt_bnft_id                in  NUMBER    DEFAULT hr_api.g_number,
778   	p_prtt_rt_val_id              in  NUMBER    DEFAULT hr_api.g_number,
779   	p_decr_bnft_prvdr_pool_id     in  NUMBER    DEFAULT hr_api.g_number,
780   	p_cvg_amt_calc_mthd_id        in  NUMBER    DEFAULT hr_api.g_number,
781   	p_actl_prem_id                in  NUMBER    DEFAULT hr_api.g_number,
782   	p_comp_lvl_fctr_id            in  NUMBER    DEFAULT hr_api.g_number,
783   	p_ptd_comp_lvl_fctr_id        in  NUMBER    DEFAULT hr_api.g_number,
784   	p_clm_comp_lvl_fctr_id        in  NUMBER    DEFAULT hr_api.g_number,
785   	p_business_group_id           in  NUMBER    DEFAULT hr_api.g_number,
786         --cwb
787         p_iss_val                     in  number    DEFAULT hr_api.g_number,
788         p_val_last_upd_date           in  date      DEFAULT hr_api.g_date,
789         p_val_last_upd_person_id      in  number    DEFAULT hr_api.g_number,
790         --cwb
791         p_pp_in_yr_used_num           in  number    default hr_api.g_number,
792   	p_ecr_attribute_category      in  VARCHAR2  DEFAULT hr_api.g_varchar2,
793   	p_ecr_attribute1              in  VARCHAR2  DEFAULT hr_api.g_varchar2,
794   	p_ecr_attribute2              in  VARCHAR2  DEFAULT hr_api.g_varchar2,
795   	p_ecr_attribute3              in  VARCHAR2  DEFAULT hr_api.g_varchar2,
796   	p_ecr_attribute4              in  VARCHAR2  DEFAULT hr_api.g_varchar2,
797   	p_ecr_attribute5              in  VARCHAR2  DEFAULT hr_api.g_varchar2,
798   	p_ecr_attribute6              in  VARCHAR2  DEFAULT hr_api.g_varchar2,
799   	p_ecr_attribute7              in  VARCHAR2  DEFAULT hr_api.g_varchar2,
800   	p_ecr_attribute8              in  VARCHAR2  DEFAULT hr_api.g_varchar2,
801   	p_ecr_attribute9              in  VARCHAR2  DEFAULT hr_api.g_varchar2,
802   	p_ecr_attribute10             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
803   	p_ecr_attribute11             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
804   	p_ecr_attribute12             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
805   	p_ecr_attribute13             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
806   	p_ecr_attribute14             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
807   	p_ecr_attribute15             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
808   	p_ecr_attribute16             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
809   	p_ecr_attribute17             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
810   	p_ecr_attribute18             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
811   	p_ecr_attribute19             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
812   	p_ecr_attribute20             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
813   	p_ecr_attribute21             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
814   	p_ecr_attribute22             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
815     p_ecr_attribute23             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
816     p_ecr_attribute24             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
817     p_ecr_attribute25             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
818     p_ecr_attribute26             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
819     p_ecr_attribute27             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
820     p_ecr_attribute28             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
821     p_ecr_attribute29             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
822     p_ecr_attribute30             in  VARCHAR2  DEFAULT hr_api.g_varchar2,
823     p_last_update_login           in  NUMBER    DEFAULT hr_api.g_number,
824     p_created_by                  in  NUMBER    DEFAULT hr_api.g_number,
825     p_creation_date               in  DATE      DEFAULT hr_api.g_date,
826     p_last_updated_by             in  NUMBER    DEFAULT hr_api.g_number,
827     p_last_update_date            in  DATE      DEFAULT hr_api.g_date,
828     p_request_id                  in  NUMBER    DEFAULT hr_api.g_number,
829     p_program_application_id      in  NUMBER    DEFAULT hr_api.g_number,
830     p_program_id                  in  NUMBER    DEFAULT hr_api.g_number,
831     p_program_update_date         in  DATE      DEFAULT hr_api.g_date,
832     p_object_version_number       in out nocopy NUMBER
833   ) is
834 --
835   l_rec	  ben_ecr_shd.g_rec_type;
836   l_proc  varchar2(72) := g_package||'upd';
837 --
838 Begin
839   hr_utility.set_location('Entering:'||l_proc, 5);
840   --
841   -- Call conversion function to turn arguments into the
842   -- l_rec structure.
843   --
844   l_rec :=
845   ben_ecr_shd.convert_args
846   (
847   p_enrt_rt_id,
848   p_ordr_num,
849   p_acty_typ_cd,
850   p_tx_typ_cd,
851   p_ctfn_rqd_flag,
852   p_dflt_flag,
853   p_dflt_pndg_ctfn_flag,
854   p_dsply_on_enrt_flag,
855   p_use_to_calc_net_flx_cr_flag,
856   p_entr_val_at_enrt_flag,
857   p_asn_on_enrt_flag,
858   p_rl_crs_only_flag,
859   p_dflt_val,
860   p_ann_val,
861   p_ann_mn_elcn_val,
862   p_ann_mx_elcn_val,
863   p_val,
864   p_nnmntry_uom,
865   p_mx_elcn_val,
866   p_mn_elcn_val,
867   p_incrmt_elcn_val,
868   p_cmcd_acty_ref_perd_cd,
869   p_cmcd_mn_elcn_val,
870   p_cmcd_mx_elcn_val,
871   p_cmcd_val,
872   p_cmcd_dflt_val,
873   p_rt_usg_cd,
874   p_ann_dflt_val,
875   p_bnft_rt_typ_cd,
876   p_rt_mlt_cd,
877   p_dsply_mn_elcn_val,
878   p_dsply_mx_elcn_val,
879   p_entr_ann_val_flag,
880   p_rt_strt_dt,
881   p_rt_strt_dt_cd,
882   p_rt_strt_dt_rl,
883   p_rt_typ_cd,
884   p_elig_per_elctbl_chc_id,
885   p_acty_base_rt_id,
886   p_spcl_rt_enrt_rt_id,
887   p_enrt_bnft_id,
888   p_prtt_rt_val_id,
889   p_decr_bnft_prvdr_pool_id,
890   p_cvg_amt_calc_mthd_id,
891   p_actl_prem_id,
892   p_comp_lvl_fctr_id,
893   p_ptd_comp_lvl_fctr_id,
894   p_clm_comp_lvl_fctr_id,
895   p_business_group_id,
896   --cwb
897   p_iss_val               ,
898   p_val_last_upd_date     ,
899   p_val_last_upd_person_id,
900   --cwb
901   p_pp_in_yr_used_num,
902   p_ecr_attribute_category,
903   p_ecr_attribute1,
904   p_ecr_attribute2,
905   p_ecr_attribute3,
906   p_ecr_attribute4,
907   p_ecr_attribute5,
908   p_ecr_attribute6,
909   p_ecr_attribute7,
910   p_ecr_attribute8,
911   p_ecr_attribute9,
912   p_ecr_attribute10,
913   p_ecr_attribute11,
914   p_ecr_attribute12,
915   p_ecr_attribute13,
916   p_ecr_attribute14,
917   p_ecr_attribute15,
918   p_ecr_attribute16,
919   p_ecr_attribute17,
920   p_ecr_attribute18,
921   p_ecr_attribute19,
922   p_ecr_attribute20,
923   p_ecr_attribute21,
924   p_ecr_attribute22,
925   p_ecr_attribute23,
926   p_ecr_attribute24,
927   p_ecr_attribute25,
928   p_ecr_attribute26,
929   p_ecr_attribute27,
930   p_ecr_attribute28,
931   p_ecr_attribute29,
932   p_ecr_attribute30,
933   p_last_update_login,
934   p_created_by,
935   p_creation_date,
936   p_last_updated_by,
937   p_last_update_date,
938   p_request_id,
939   p_program_application_id,
940   p_program_id,
941   p_program_update_date,
942   p_object_version_number
943   );
944   --
945   -- Having converted the arguments into the
946   -- plsql record structure we call the corresponding record
947   -- business process.
948   --
949     upd(l_rec,p_effective_date);
950   p_object_version_number := l_rec.object_version_number;
951   --
952   hr_utility.set_location(' Leaving:'||l_proc, 10);
953 End upd;
954 --
955 end ben_ecr_upd;