DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CLF_UPD

Source


1 Package Body ben_clf_upd as
2 /* $Header: beclfrhi.pkb 120.0 2005/05/28 01:04:10 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_clf_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_clf_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_clf_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_comp_lvl_fctr Row
68   --
69   update ben_comp_lvl_fctr
70   set
71   comp_lvl_fctr_id                  = p_rec.comp_lvl_fctr_id,
72   business_group_id                 = p_rec.business_group_id,
73   name                              = p_rec.name,
74   comp_lvl_det_cd                   = p_rec.comp_lvl_det_cd,
75   comp_lvl_det_rl                   = p_rec.comp_lvl_det_rl,
76   comp_lvl_uom                      = p_rec.comp_lvl_uom,
77   comp_src_cd                       = p_rec.comp_src_cd,
78   defined_balance_id                = p_rec.defined_balance_id,
79   no_mn_comp_flag                   = p_rec.no_mn_comp_flag,
80   no_mx_comp_flag                   = p_rec.no_mx_comp_flag,
81   mx_comp_val                       = p_rec.mx_comp_val,
82   mn_comp_val                       = p_rec.mn_comp_val,
83   rndg_cd                           = p_rec.rndg_cd,
84   rndg_rl                           = p_rec.rndg_rl,
85   bnfts_bal_id                      = p_rec.bnfts_bal_id,
86   comp_alt_val_to_use_cd            = p_rec.comp_alt_val_to_use_cd,
87   comp_calc_rl                      = p_rec.comp_calc_rl,
88   proration_flag          = p_rec.proration_flag ,
89   start_day_mo            = p_rec.start_day_mo,
90   end_day_mo              = p_rec.end_day_mo,
91   start_year              = p_rec.start_year,
92   end_year                = p_rec.end_year,
93   clf_attribute_category            = p_rec.clf_attribute_category,
94   clf_attribute1                    = p_rec.clf_attribute1,
95   clf_attribute2                    = p_rec.clf_attribute2,
96   clf_attribute3                    = p_rec.clf_attribute3,
100   clf_attribute7                    = p_rec.clf_attribute7,
97   clf_attribute4                    = p_rec.clf_attribute4,
98   clf_attribute5                    = p_rec.clf_attribute5,
99   clf_attribute6                    = p_rec.clf_attribute6,
101   clf_attribute8                    = p_rec.clf_attribute8,
102   clf_attribute9                    = p_rec.clf_attribute9,
103   clf_attribute10                   = p_rec.clf_attribute10,
104   clf_attribute11                   = p_rec.clf_attribute11,
105   clf_attribute12                   = p_rec.clf_attribute12,
106   clf_attribute13                   = p_rec.clf_attribute13,
107   clf_attribute14                   = p_rec.clf_attribute14,
108   clf_attribute15                   = p_rec.clf_attribute15,
109   clf_attribute16                   = p_rec.clf_attribute16,
110   clf_attribute17                   = p_rec.clf_attribute17,
111   clf_attribute18                   = p_rec.clf_attribute18,
112   clf_attribute19                   = p_rec.clf_attribute19,
113   clf_attribute20                   = p_rec.clf_attribute20,
114   clf_attribute21                   = p_rec.clf_attribute21,
115   clf_attribute22                   = p_rec.clf_attribute22,
116   clf_attribute23                   = p_rec.clf_attribute23,
117   clf_attribute24                   = p_rec.clf_attribute24,
118   clf_attribute25                   = p_rec.clf_attribute25,
119   clf_attribute26                   = p_rec.clf_attribute26,
120   clf_attribute27                   = p_rec.clf_attribute27,
121   clf_attribute28                   = p_rec.clf_attribute28,
122   clf_attribute29                   = p_rec.clf_attribute29,
123   clf_attribute30                   = p_rec.clf_attribute30,
124   object_version_number             = p_rec.object_version_number,
125   sttd_sal_prdcty_cd                = p_rec.sttd_sal_prdcty_cd
126   where comp_lvl_fctr_id = p_rec.comp_lvl_fctr_id;
127   --
128   ben_clf_shd.g_api_dml := false;   -- Unset the api dml status
129   --
130   hr_utility.set_location(' Leaving:'||l_proc, 10);
131 --
132 Exception
133   When hr_api.check_integrity_violated Then
134     -- A check constraint has been violated
135     ben_clf_shd.g_api_dml := false;   -- Unset the api dml status
136     ben_clf_shd.constraint_error
137       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
138   When hr_api.parent_integrity_violated Then
139     -- Parent integrity has been violated
140     ben_clf_shd.g_api_dml := false;   -- Unset the api dml status
144     -- Unique integrity has been violated
141     ben_clf_shd.constraint_error
142       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
143   When hr_api.unique_integrity_violated Then
145     ben_clf_shd.g_api_dml := false;   -- Unset the api dml status
146     ben_clf_shd.constraint_error
147       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
148   When Others Then
149     ben_clf_shd.g_api_dml := false;   -- Unset the api dml status
150     Raise;
151 End update_dml;
152 --
153 -- ----------------------------------------------------------------------------
154 -- |------------------------------< pre_update >------------------------------|
155 -- ----------------------------------------------------------------------------
156 -- {Start Of Comments}
157 --
158 -- Description:
159 --   This private procedure contains any processing which is required before
160 --   the update dml.
161 --
162 -- Prerequisites:
163 --   This is an internal procedure which is called from the upd procedure.
164 --
165 -- In Parameters:
166 --   A Pl/Sql record structre.
167 --
168 -- Post Success:
169 --   Processing continues.
170 --
171 -- Post Failure:
172 --   If an error has occurred, an error message and exception will be raised
173 --   but not handled.
174 --
175 -- Developer Implementation Notes:
176 --   Any pre-processing required before the update dml is issued should be
177 --   coded within this procedure. It is important to note that any 3rd party
178 --   maintenance should be reviewed before placing in this procedure.
179 --
180 -- Access Status:
181 --   Internal Row Handler Use Only.
182 --
183 -- {End Of Comments}
184 -- ----------------------------------------------------------------------------
185 Procedure pre_update(p_rec in ben_clf_shd.g_rec_type) is
186 --
187   l_proc  varchar2(72) := g_package||'pre_update';
188 --
189 Begin
190   hr_utility.set_location('Entering:'||l_proc, 5);
191   --
192   hr_utility.set_location(' Leaving:'||l_proc, 10);
193 End pre_update;
194 --
195 -- ----------------------------------------------------------------------------
196 -- |-----------------------------< post_update >------------------------------|
197 -- ----------------------------------------------------------------------------
198 -- {Start Of Comments}
202 --   update dml.
199 --
200 -- Description:
201 --   This private procedure contains any processing which is required after the
203 --
204 -- Prerequisites:
205 --   This is an internal procedure which is called from the upd procedure.
206 --
207 -- In Parameters:
208 --   A Pl/Sql record structre.
209 --
210 -- Post Success:
211 --   Processing continues.
212 --
213 -- Post Failure:
214 --   If an error has occurred, an error message and exception will be raised
215 --   but not handled.
216 --
217 -- Developer Implementation Notes:
218 --   Any post-processing required after the update dml is issued should be
219 --   coded within this procedure. It is important to note that any 3rd party
220 --   maintenance should be reviewed before placing in this procedure.
221 --
222 -- Access Status:
223 --   Internal Row Handler Use Only.
224 --
225 -- {End Of Comments}
226 -- ----------------------------------------------------------------------------
227 Procedure post_update(
228 p_effective_date in date,p_rec in ben_clf_shd.g_rec_type) is
229 --
230   l_proc  varchar2(72) := g_package||'post_update';
231 --
232 Begin
233   hr_utility.set_location('Entering:'||l_proc, 5);
234 --
235   --
236   -- Start of API User Hook for post_update.
237   --
238   begin
239     --
240     ben_clf_rku.after_update
241       (
242   p_comp_lvl_fctr_id              =>p_rec.comp_lvl_fctr_id
243  ,p_business_group_id             =>p_rec.business_group_id
244  ,p_name                          =>p_rec.name
245  ,p_comp_lvl_det_cd               =>p_rec.comp_lvl_det_cd
246  ,p_comp_lvl_det_rl               =>p_rec.comp_lvl_det_rl
247  ,p_comp_lvl_uom                  =>p_rec.comp_lvl_uom
248  ,p_comp_src_cd                   =>p_rec.comp_src_cd
249  ,p_defined_balance_id            =>p_rec.defined_balance_id
250  ,p_no_mn_comp_flag               =>p_rec.no_mn_comp_flag
251  ,p_no_mx_comp_flag               =>p_rec.no_mx_comp_flag
252  ,p_mx_comp_val                   =>p_rec.mx_comp_val
253  ,p_mn_comp_val                   =>p_rec.mn_comp_val
254  ,p_rndg_cd                       =>p_rec.rndg_cd
255  ,p_rndg_rl                       =>p_rec.rndg_rl
256  ,p_bnfts_bal_id                  =>p_rec.bnfts_bal_id
257  ,p_comp_alt_val_to_use_cd        =>p_rec.comp_alt_val_to_use_cd
258  ,p_comp_calc_rl                  =>p_rec.comp_calc_rl
259  , p_proration_flag               =>p_rec.proration_flag
260  , p_start_day_mo                 =>p_rec.start_day_mo
261  , p_end_day_mo                  =>p_rec.end_day_mo
262  , p_start_year                  =>p_rec.start_year
263  , p_end_year                    =>p_rec.end_year
264  ,p_clf_attribute_category        =>p_rec.clf_attribute_category
265  ,p_clf_attribute1                =>p_rec.clf_attribute1
266  ,p_clf_attribute2                =>p_rec.clf_attribute2
267  ,p_clf_attribute3                =>p_rec.clf_attribute3
268  ,p_clf_attribute4                =>p_rec.clf_attribute4
269  ,p_clf_attribute5                =>p_rec.clf_attribute5
270  ,p_clf_attribute6                =>p_rec.clf_attribute6
271  ,p_clf_attribute7                =>p_rec.clf_attribute7
272  ,p_clf_attribute8                =>p_rec.clf_attribute8
273  ,p_clf_attribute9                =>p_rec.clf_attribute9
274  ,p_clf_attribute10               =>p_rec.clf_attribute10
275  ,p_clf_attribute11               =>p_rec.clf_attribute11
276  ,p_clf_attribute12               =>p_rec.clf_attribute12
277  ,p_clf_attribute13               =>p_rec.clf_attribute13
278  ,p_clf_attribute14               =>p_rec.clf_attribute14
279  ,p_clf_attribute15               =>p_rec.clf_attribute15
280  ,p_clf_attribute16               =>p_rec.clf_attribute16
281  ,p_clf_attribute17               =>p_rec.clf_attribute17
282  ,p_clf_attribute18               =>p_rec.clf_attribute18
283  ,p_clf_attribute19               =>p_rec.clf_attribute19
284  ,p_clf_attribute20               =>p_rec.clf_attribute20
285  ,p_clf_attribute21               =>p_rec.clf_attribute21
286  ,p_clf_attribute22               =>p_rec.clf_attribute22
287  ,p_clf_attribute23               =>p_rec.clf_attribute23
288  ,p_clf_attribute24               =>p_rec.clf_attribute24
289  ,p_clf_attribute25               =>p_rec.clf_attribute25
290  ,p_clf_attribute26               =>p_rec.clf_attribute26
291  ,p_clf_attribute27               =>p_rec.clf_attribute27
292  ,p_clf_attribute28               =>p_rec.clf_attribute28
296  ,p_effective_date                =>p_effective_date
293  ,p_clf_attribute29               =>p_rec.clf_attribute29
294  ,p_clf_attribute30               =>p_rec.clf_attribute30
295  ,p_object_version_number         =>p_rec.object_version_number
297  ,p_sttd_sal_prdcty_cd            =>p_rec.sttd_sal_prdcty_cd
298  ,p_business_group_id_o           =>ben_clf_shd.g_old_rec.business_group_id
302  ,p_comp_lvl_uom_o                =>ben_clf_shd.g_old_rec.comp_lvl_uom
299  ,p_name_o                        =>ben_clf_shd.g_old_rec.name
300  ,p_comp_lvl_det_cd_o             =>ben_clf_shd.g_old_rec.comp_lvl_det_cd
301  ,p_comp_lvl_det_rl_o             =>ben_clf_shd.g_old_rec.comp_lvl_det_rl
303  ,p_comp_src_cd_o                 =>ben_clf_shd.g_old_rec.comp_src_cd
304  ,p_defined_balance_id_o          =>ben_clf_shd.g_old_rec.defined_balance_id
305  ,p_no_mn_comp_flag_o             =>ben_clf_shd.g_old_rec.no_mn_comp_flag
306  ,p_no_mx_comp_flag_o             =>ben_clf_shd.g_old_rec.no_mx_comp_flag
307  ,p_mx_comp_val_o                 =>ben_clf_shd.g_old_rec.mx_comp_val
308  ,p_mn_comp_val_o                 =>ben_clf_shd.g_old_rec.mn_comp_val
309  ,p_rndg_cd_o                     =>ben_clf_shd.g_old_rec.rndg_cd
310  ,p_rndg_rl_o                     =>ben_clf_shd.g_old_rec.rndg_rl
311  ,p_bnfts_bal_id_o                =>ben_clf_shd.g_old_rec.bnfts_bal_id
312  ,p_comp_alt_val_to_use_cd_o      =>ben_clf_shd.g_old_rec.comp_alt_val_to_use_cd
313  ,p_comp_calc_rl_o                =>ben_clf_shd.g_old_rec.comp_calc_rl
314  , p_proration_flag_o             =>ben_clf_shd.g_old_rec.proration_flag
315  , p_start_day_mo_o               =>ben_clf_shd.g_old_rec.start_day_mo
316  , p_end_day_mo_o                 =>ben_clf_shd.g_old_rec.end_day_mo
317  , p_start_year_o                 =>ben_clf_shd.g_old_rec.start_year
318  , p_end_year_o                   =>ben_clf_shd.g_old_rec.end_year
319  ,p_clf_attribute_category_o      =>ben_clf_shd.g_old_rec.clf_attribute_category
320  ,p_clf_attribute1_o              =>ben_clf_shd.g_old_rec.clf_attribute1
321  ,p_clf_attribute2_o              =>ben_clf_shd.g_old_rec.clf_attribute2
322  ,p_clf_attribute3_o              =>ben_clf_shd.g_old_rec.clf_attribute3
323  ,p_clf_attribute4_o              =>ben_clf_shd.g_old_rec.clf_attribute4
324  ,p_clf_attribute5_o              =>ben_clf_shd.g_old_rec.clf_attribute5
325  ,p_clf_attribute6_o              =>ben_clf_shd.g_old_rec.clf_attribute6
326  ,p_clf_attribute7_o              =>ben_clf_shd.g_old_rec.clf_attribute7
327  ,p_clf_attribute8_o              =>ben_clf_shd.g_old_rec.clf_attribute8
328  ,p_clf_attribute9_o              =>ben_clf_shd.g_old_rec.clf_attribute9
329  ,p_clf_attribute10_o             =>ben_clf_shd.g_old_rec.clf_attribute10
330  ,p_clf_attribute11_o             =>ben_clf_shd.g_old_rec.clf_attribute11
331  ,p_clf_attribute12_o             =>ben_clf_shd.g_old_rec.clf_attribute12
332  ,p_clf_attribute13_o             =>ben_clf_shd.g_old_rec.clf_attribute13
333  ,p_clf_attribute14_o             =>ben_clf_shd.g_old_rec.clf_attribute14
334  ,p_clf_attribute15_o             =>ben_clf_shd.g_old_rec.clf_attribute15
335  ,p_clf_attribute16_o             =>ben_clf_shd.g_old_rec.clf_attribute16
336  ,p_clf_attribute17_o             =>ben_clf_shd.g_old_rec.clf_attribute17
337  ,p_clf_attribute18_o             =>ben_clf_shd.g_old_rec.clf_attribute18
338  ,p_clf_attribute19_o             =>ben_clf_shd.g_old_rec.clf_attribute19
339  ,p_clf_attribute20_o             =>ben_clf_shd.g_old_rec.clf_attribute20
340  ,p_clf_attribute21_o             =>ben_clf_shd.g_old_rec.clf_attribute21
341  ,p_clf_attribute22_o             =>ben_clf_shd.g_old_rec.clf_attribute22
342  ,p_clf_attribute23_o             =>ben_clf_shd.g_old_rec.clf_attribute23
343  ,p_clf_attribute24_o             =>ben_clf_shd.g_old_rec.clf_attribute24
344  ,p_clf_attribute25_o             =>ben_clf_shd.g_old_rec.clf_attribute25
345  ,p_clf_attribute26_o             =>ben_clf_shd.g_old_rec.clf_attribute26
346  ,p_clf_attribute27_o             =>ben_clf_shd.g_old_rec.clf_attribute27
347  ,p_clf_attribute28_o             =>ben_clf_shd.g_old_rec.clf_attribute28
348  ,p_clf_attribute29_o             =>ben_clf_shd.g_old_rec.clf_attribute29
349  ,p_clf_attribute30_o             =>ben_clf_shd.g_old_rec.clf_attribute30
350  ,p_object_version_number_o       =>ben_clf_shd.g_old_rec.object_version_number
351  ,p_sttd_sal_prdcty_cd_o          =>ben_clf_shd.g_old_rec.sttd_sal_prdcty_cd
352       );
353     --
354   exception
355     --
356     when hr_api.cannot_find_prog_unit then
357       --
358       hr_api.cannot_find_prog_unit_error
359         (p_module_name => 'ben_comp_lvl_fctr'
360         ,p_hook_type   => 'AU');
361       --
362   end;
363   --
364   -- End of API User Hook for post_update.
365   --
366   --
367   hr_utility.set_location(' Leaving:'||l_proc, 10);
368 End post_update;
369 --
370 -- ----------------------------------------------------------------------------
371 -- |-----------------------------< convert_defs >-----------------------------|
372 -- ----------------------------------------------------------------------------
373 -- {Start Of Comments}
374 --
375 -- Description:
376 --   The Convert_Defs procedure has one very important function:
377 --   It must return the record structure for the row with all system defaulted
378 --   values converted into its corresponding parameter value for update. When
379 --   we attempt to update a row through the Upd process , certain
380 --   parameters can be defaulted which enables flexibility in the calling of
381 --   the upd process (e.g. only attributes which need to be updated need to be
382 --   specified). For the upd process to determine which attributes
383 --   have NOT been specified we need to check if the parameter has a reserved
384 --   system default value. Therefore, for all parameters which have a
385 --   corresponding reserved system default mechanism specified we need to
386 --   check if a system default is being used. If a system default is being
387 --   used then we convert the defaulted value into its corresponding attribute
388 --   value held in the g_old_rec data structure.
389 --
390 -- Prerequisites:
391 --   This private function can only be called from the upd process.
392 --
393 -- In Parameters:
394 --   A Pl/Sql record structre.
395 --
396 -- Post Success:
397 --   The record structure will be returned with all system defaulted parameter
398 --   values converted into its current row attribute value.
399 --
400 -- Post Failure:
404 --
401 --   No direct error handling is required within this function. Any possible
402 --   errors within this procedure will be a PL/SQL value error due to conversion
403 --   of datatypes or data lengths.
405 -- Developer Implementation Notes:
406 --   None.
407 --
408 -- Access Status:
409 --   Internal Row Handler Use Only.
410 --
411 -- {End Of Comments}
412 -- ----------------------------------------------------------------------------
416 --
413 Procedure convert_defs(p_rec in out nocopy ben_clf_shd.g_rec_type) is
414 --
415   l_proc  varchar2(72) := g_package||'convert_defs';
417 Begin
418   --
419   hr_utility.set_location('Entering:'||l_proc, 5);
420   --
421   -- We must now examine each argument value in the
422   -- p_rec plsql record structure
423   -- to see if a system default is being used. If a system default
424   -- is being used then we must set to the 'current' argument value.
425   --
426   If (p_rec.business_group_id = hr_api.g_number) then
427     p_rec.business_group_id :=
428     ben_clf_shd.g_old_rec.business_group_id;
429   End If;
430   If (p_rec.name = hr_api.g_varchar2) then
431     p_rec.name :=
432     ben_clf_shd.g_old_rec.name;
433   End If;
434   If (p_rec.comp_lvl_det_cd = hr_api.g_varchar2) then
435     p_rec.comp_lvl_det_cd :=
436     ben_clf_shd.g_old_rec.comp_lvl_det_cd;
437   End If;
438   If (p_rec.comp_lvl_det_rl = hr_api.g_number) then
439     p_rec.comp_lvl_det_rl :=
440     ben_clf_shd.g_old_rec.comp_lvl_det_rl;
441   End If;
442   If (p_rec.comp_lvl_uom = hr_api.g_varchar2) then
443     p_rec.comp_lvl_uom :=
444     ben_clf_shd.g_old_rec.comp_lvl_uom;
445   End If;
446   If (p_rec.comp_src_cd = hr_api.g_varchar2) then
447     p_rec.comp_src_cd :=
448     ben_clf_shd.g_old_rec.comp_src_cd;
449   End If;
450   If (p_rec.defined_balance_id = hr_api.g_number) then
451     p_rec.defined_balance_id :=
452     ben_clf_shd.g_old_rec.defined_balance_id;
453   End If;
454   If (p_rec.no_mn_comp_flag = hr_api.g_varchar2) then
455     p_rec.no_mn_comp_flag :=
456     ben_clf_shd.g_old_rec.no_mn_comp_flag;
457   End If;
458   If (p_rec.no_mx_comp_flag = hr_api.g_varchar2) then
459     p_rec.no_mx_comp_flag :=
460     ben_clf_shd.g_old_rec.no_mx_comp_flag;
461   End If;
462   If (p_rec.mx_comp_val = hr_api.g_number) then
463     p_rec.mx_comp_val :=
464     ben_clf_shd.g_old_rec.mx_comp_val;
465   End If;
466   If (p_rec.mn_comp_val = hr_api.g_number) then
467     p_rec.mn_comp_val :=
468     ben_clf_shd.g_old_rec.mn_comp_val;
469   End If;
470   If (p_rec.rndg_cd = hr_api.g_varchar2) then
471     p_rec.rndg_cd :=
472     ben_clf_shd.g_old_rec.rndg_cd;
473   End If;
474   If (p_rec.rndg_rl = hr_api.g_number) then
475     p_rec.rndg_rl :=
476     ben_clf_shd.g_old_rec.rndg_rl;
477   End If;
478   If (p_rec.bnfts_bal_id = hr_api.g_number) then
479     p_rec.bnfts_bal_id :=
480     ben_clf_shd.g_old_rec.bnfts_bal_id;
481   End If;
482   If (p_rec.comp_alt_val_to_use_cd = hr_api.g_varchar2) then
483     p_rec.comp_alt_val_to_use_cd :=
484     ben_clf_shd.g_old_rec.comp_alt_val_to_use_cd;
485   End If;
486   If (p_rec.comp_calc_rl = hr_api.g_number) then
487     p_rec.comp_calc_rl :=
488     ben_clf_shd.g_old_rec.comp_calc_rl;
489   End If;
490 
491   If (p_rec.proration_flag = hr_api.g_varchar2) then
492     p_rec.proration_flag :=
493     ben_clf_shd.g_old_rec.proration_flag;
494   End If;
495   If (p_rec.start_day_mo = hr_api.g_varchar2) then
496     p_rec.start_day_mo :=
497     ben_clf_shd.g_old_rec.start_day_mo;
498   End If;
499   If (p_rec.end_day_mo = hr_api.g_varchar2) then
500     p_rec.end_day_mo :=
501     ben_clf_shd.g_old_rec.end_day_mo;
502   End If;
503   If (p_rec.start_year = hr_api.g_varchar2) then
504     p_rec.start_year :=
505     ben_clf_shd.g_old_rec.start_year;
506   End If;
507   If (p_rec.end_year = hr_api.g_varchar2) then
508     p_rec.end_year :=
509     ben_clf_shd.g_old_rec.end_year;
510   End If;
511 
512   If (p_rec.clf_attribute_category = hr_api.g_varchar2) then
513     p_rec.clf_attribute_category :=
514     ben_clf_shd.g_old_rec.clf_attribute_category;
515   End If;
516   If (p_rec.clf_attribute1 = hr_api.g_varchar2) then
517     p_rec.clf_attribute1 :=
518     ben_clf_shd.g_old_rec.clf_attribute1;
519   End If;
520   If (p_rec.clf_attribute2 = hr_api.g_varchar2) then
521     p_rec.clf_attribute2 :=
522     ben_clf_shd.g_old_rec.clf_attribute2;
523   End If;
524   If (p_rec.clf_attribute3 = hr_api.g_varchar2) then
525     p_rec.clf_attribute3 :=
526     ben_clf_shd.g_old_rec.clf_attribute3;
527   End If;
528   If (p_rec.clf_attribute4 = hr_api.g_varchar2) then
529     p_rec.clf_attribute4 :=
533     p_rec.clf_attribute5 :=
530     ben_clf_shd.g_old_rec.clf_attribute4;
531   End If;
532   If (p_rec.clf_attribute5 = hr_api.g_varchar2) then
534     ben_clf_shd.g_old_rec.clf_attribute5;
535   End If;
536   If (p_rec.clf_attribute6 = hr_api.g_varchar2) then
537     p_rec.clf_attribute6 :=
538     ben_clf_shd.g_old_rec.clf_attribute6;
539   End If;
540   If (p_rec.clf_attribute7 = hr_api.g_varchar2) then
541     p_rec.clf_attribute7 :=
542     ben_clf_shd.g_old_rec.clf_attribute7;
543   End If;
544   If (p_rec.clf_attribute8 = hr_api.g_varchar2) then
545     p_rec.clf_attribute8 :=
546     ben_clf_shd.g_old_rec.clf_attribute8;
547   End If;
548   If (p_rec.clf_attribute9 = hr_api.g_varchar2) then
549     p_rec.clf_attribute9 :=
550     ben_clf_shd.g_old_rec.clf_attribute9;
551   End If;
552   If (p_rec.clf_attribute10 = hr_api.g_varchar2) then
553     p_rec.clf_attribute10 :=
554     ben_clf_shd.g_old_rec.clf_attribute10;
555   End If;
556   If (p_rec.clf_attribute11 = hr_api.g_varchar2) then
557     p_rec.clf_attribute11 :=
558     ben_clf_shd.g_old_rec.clf_attribute11;
559   End If;
560   If (p_rec.clf_attribute12 = hr_api.g_varchar2) then
561     p_rec.clf_attribute12 :=
562     ben_clf_shd.g_old_rec.clf_attribute12;
563   End If;
564   If (p_rec.clf_attribute13 = hr_api.g_varchar2) then
565     p_rec.clf_attribute13 :=
566     ben_clf_shd.g_old_rec.clf_attribute13;
567   End If;
568   If (p_rec.clf_attribute14 = hr_api.g_varchar2) then
569     p_rec.clf_attribute14 :=
570     ben_clf_shd.g_old_rec.clf_attribute14;
571   End If;
572   If (p_rec.clf_attribute15 = hr_api.g_varchar2) then
573     p_rec.clf_attribute15 :=
574     ben_clf_shd.g_old_rec.clf_attribute15;
575   End If;
576   If (p_rec.clf_attribute16 = hr_api.g_varchar2) then
577     p_rec.clf_attribute16 :=
578     ben_clf_shd.g_old_rec.clf_attribute16;
579   End If;
580   If (p_rec.clf_attribute17 = hr_api.g_varchar2) then
581     p_rec.clf_attribute17 :=
582     ben_clf_shd.g_old_rec.clf_attribute17;
583   End If;
584   If (p_rec.clf_attribute18 = hr_api.g_varchar2) then
585     p_rec.clf_attribute18 :=
586     ben_clf_shd.g_old_rec.clf_attribute18;
587   End If;
588   If (p_rec.clf_attribute19 = hr_api.g_varchar2) then
589     p_rec.clf_attribute19 :=
590     ben_clf_shd.g_old_rec.clf_attribute19;
591   End If;
592   If (p_rec.clf_attribute20 = hr_api.g_varchar2) then
593     p_rec.clf_attribute20 :=
594     ben_clf_shd.g_old_rec.clf_attribute20;
595   End If;
596   If (p_rec.clf_attribute21 = hr_api.g_varchar2) then
597     p_rec.clf_attribute21 :=
598     ben_clf_shd.g_old_rec.clf_attribute21;
602     ben_clf_shd.g_old_rec.clf_attribute22;
599   End If;
600   If (p_rec.clf_attribute22 = hr_api.g_varchar2) then
601     p_rec.clf_attribute22 :=
603   End If;
604   If (p_rec.clf_attribute23 = hr_api.g_varchar2) then
605     p_rec.clf_attribute23 :=
606     ben_clf_shd.g_old_rec.clf_attribute23;
607   End If;
608   If (p_rec.clf_attribute24 = hr_api.g_varchar2) then
609     p_rec.clf_attribute24 :=
610     ben_clf_shd.g_old_rec.clf_attribute24;
611   End If;
612   If (p_rec.clf_attribute25 = hr_api.g_varchar2) then
613     p_rec.clf_attribute25 :=
614     ben_clf_shd.g_old_rec.clf_attribute25;
615   End If;
616   If (p_rec.clf_attribute26 = hr_api.g_varchar2) then
617     p_rec.clf_attribute26 :=
618     ben_clf_shd.g_old_rec.clf_attribute26;
619   End If;
620   If (p_rec.clf_attribute27 = hr_api.g_varchar2) then
621     p_rec.clf_attribute27 :=
622     ben_clf_shd.g_old_rec.clf_attribute27;
623   End If;
624   If (p_rec.clf_attribute28 = hr_api.g_varchar2) then
625     p_rec.clf_attribute28 :=
626     ben_clf_shd.g_old_rec.clf_attribute28;
627   End If;
628   If (p_rec.clf_attribute29 = hr_api.g_varchar2) then
629     p_rec.clf_attribute29 :=
630     ben_clf_shd.g_old_rec.clf_attribute29;
631   End If;
632   If (p_rec.clf_attribute30 = hr_api.g_varchar2) then
633     p_rec.clf_attribute30 :=
634     ben_clf_shd.g_old_rec.clf_attribute30;
635   End If;
636   If (p_rec.sttd_sal_prdcty_cd = hr_api.g_varchar2) then
637     p_rec.sttd_sal_prdcty_cd :=
638     ben_clf_shd.g_old_rec.sttd_sal_prdcty_cd;
639   End If;
640   --
641   hr_utility.set_location(' Leaving:'||l_proc, 10);
642 --
643 End convert_defs;
644 --
645 -- ----------------------------------------------------------------------------
646 -- |---------------------------------< upd >----------------------------------|
647 -- ----------------------------------------------------------------------------
648 Procedure upd
649   (
650   p_effective_date in date,
651   p_rec        in out nocopy ben_clf_shd.g_rec_type
652   ) is
653 --
654   l_proc  varchar2(72) := g_package||'upd';
655 --
656 Begin
657   hr_utility.set_location('Entering:'||l_proc, 5);
658   --
659   -- We must lock the row which we need to update.
660   --
661   ben_clf_shd.lck
662 	(
663 	p_rec.comp_lvl_fctr_id,
664 	p_rec.object_version_number
665 	);
666   --
667   -- 1. During an update system defaults are used to determine if
668   --    arguments have been defaulted or not. We must therefore
669   --    derive the full record structure values to be updated.
670   --
671   -- 2. Call the supporting update validate operations.
672   --
673   convert_defs(p_rec);
674   ben_clf_bus.update_validate(p_rec
675   ,p_effective_date);
676   --
677   -- Call the supporting pre-update operation
678   --
679   pre_update(p_rec);
680   --
681   -- Update the row.
682   --
683   update_dml(p_rec);
684   --
685   -- Call the supporting post-update operation
686   --
687   post_update(
688 p_effective_date,p_rec);
689 End upd;
690 --
691 -- ----------------------------------------------------------------------------
692 -- |---------------------------------< upd >----------------------------------|
693 -- ----------------------------------------------------------------------------
694 Procedure upd
695   (
696   p_effective_date in date,
697   p_comp_lvl_fctr_id             in number,
698   p_business_group_id            in number           default hr_api.g_number,
699   p_name                         in varchar2         default hr_api.g_varchar2,
700   p_comp_lvl_det_cd              in varchar2         default hr_api.g_varchar2,
701   p_comp_lvl_det_rl              in number           default hr_api.g_number,
702   p_comp_lvl_uom                 in varchar2         default hr_api.g_varchar2,
703   p_comp_src_cd                  in varchar2         default hr_api.g_varchar2,
704   p_defined_balance_id           in number           default hr_api.g_number,
705   p_no_mn_comp_flag              in varchar2         default hr_api.g_varchar2,
706   p_no_mx_comp_flag              in varchar2         default hr_api.g_varchar2,
707   p_mx_comp_val                  in number           default hr_api.g_number,
708   p_mn_comp_val                  in number           default hr_api.g_number,
709   p_rndg_cd                      in varchar2         default hr_api.g_varchar2,
710   p_rndg_rl                      in number           default hr_api.g_number,
711   p_bnfts_bal_id                 in number           default hr_api.g_number,
712   p_comp_alt_val_to_use_cd       in varchar2         default hr_api.g_varchar2,
713   p_comp_calc_rl                 in number           default hr_api.g_number,
714   p_proration_flag               in Varchar2         default hr_api.g_varchar2,
715   p_start_day_mo                 in Varchar2         default hr_api.g_varchar2,
716   p_end_day_mo                   in Varchar2         default hr_api.g_varchar2,
717   p_start_year                   in Varchar2         default hr_api.g_varchar2,
718   p_end_year                     in Varchar2         default hr_api.g_varchar2,
719   p_clf_attribute_category       in varchar2         default hr_api.g_varchar2,
720   p_clf_attribute1               in varchar2         default hr_api.g_varchar2,
721   p_clf_attribute2               in varchar2         default hr_api.g_varchar2,
722   p_clf_attribute3               in varchar2         default hr_api.g_varchar2,
723   p_clf_attribute4               in varchar2         default hr_api.g_varchar2,
724   p_clf_attribute5               in varchar2         default hr_api.g_varchar2,
725   p_clf_attribute6               in varchar2         default hr_api.g_varchar2,
726   p_clf_attribute7               in varchar2         default hr_api.g_varchar2,
727   p_clf_attribute8               in varchar2         default hr_api.g_varchar2,
728   p_clf_attribute9               in varchar2         default hr_api.g_varchar2,
729   p_clf_attribute10              in varchar2         default hr_api.g_varchar2,
730   p_clf_attribute11              in varchar2         default hr_api.g_varchar2,
731   p_clf_attribute12              in varchar2         default hr_api.g_varchar2,
732   p_clf_attribute13              in varchar2         default hr_api.g_varchar2,
733   p_clf_attribute14              in varchar2         default hr_api.g_varchar2,
734   p_clf_attribute15              in varchar2         default hr_api.g_varchar2,
735   p_clf_attribute16              in varchar2         default hr_api.g_varchar2,
736   p_clf_attribute17              in varchar2         default hr_api.g_varchar2,
737   p_clf_attribute18              in varchar2         default hr_api.g_varchar2,
738   p_clf_attribute19              in varchar2         default hr_api.g_varchar2,
739   p_clf_attribute20              in varchar2         default hr_api.g_varchar2,
740   p_clf_attribute21              in varchar2         default hr_api.g_varchar2,
741   p_clf_attribute22              in varchar2         default hr_api.g_varchar2,
742   p_clf_attribute23              in varchar2         default hr_api.g_varchar2,
743   p_clf_attribute24              in varchar2         default hr_api.g_varchar2,
744   p_clf_attribute25              in varchar2         default hr_api.g_varchar2,
745   p_clf_attribute26              in varchar2         default hr_api.g_varchar2,
746   p_clf_attribute27              in varchar2         default hr_api.g_varchar2,
747   p_clf_attribute28              in varchar2         default hr_api.g_varchar2,
748   p_clf_attribute29              in varchar2         default hr_api.g_varchar2,
749   p_clf_attribute30              in varchar2         default hr_api.g_varchar2,
750   p_object_version_number        in out nocopy number,
751   p_sttd_sal_prdcty_cd           in varchar2         default hr_api.g_varchar2
752 
753   ) is
754 --
755   l_rec	  ben_clf_shd.g_rec_type;
756   l_proc  varchar2(72) := g_package||'upd';
757 --
758 Begin
759   hr_utility.set_location('Entering:'||l_proc, 5);
760   --
761   -- Call conversion function to turn arguments into the
762   -- l_rec structure.
763   --
764   l_rec :=
765   ben_clf_shd.convert_args
766   (
767   p_comp_lvl_fctr_id,
768   p_business_group_id,
769   p_name,
770   p_comp_lvl_det_cd,
771   p_comp_lvl_det_rl,
772   p_comp_lvl_uom,
773   p_comp_src_cd,
774   p_defined_balance_id,
775   p_no_mn_comp_flag,
776   p_no_mx_comp_flag,
777   p_mx_comp_val,
778   p_mn_comp_val,
779   p_rndg_cd,
780   p_rndg_rl,
781   p_bnfts_bal_id,
782   p_comp_alt_val_to_use_cd,
783   p_comp_calc_rl,
784   p_proration_flag,
785   p_start_day_mo,
786   p_end_day_mo,
787   p_start_year,
788   p_end_year,
789   p_clf_attribute_category,
790   p_clf_attribute1,
791   p_clf_attribute2,
792   p_clf_attribute3,
793   p_clf_attribute4,
794   p_clf_attribute5,
795   p_clf_attribute6,
796   p_clf_attribute7,
797   p_clf_attribute8,
798   p_clf_attribute9,
799   p_clf_attribute10,
800   p_clf_attribute11,
801   p_clf_attribute12,
802   p_clf_attribute13,
803   p_clf_attribute14,
804   p_clf_attribute15,
805   p_clf_attribute16,
806   p_clf_attribute17,
807   p_clf_attribute18,
808   p_clf_attribute19,
809   p_clf_attribute20,
810   p_clf_attribute21,
811   p_clf_attribute22,
812   p_clf_attribute23,
813   p_clf_attribute24,
814   p_clf_attribute25,
815   p_clf_attribute26,
816   p_clf_attribute27,
817   p_clf_attribute28,
818   p_clf_attribute29,
819   p_clf_attribute30,
820   p_object_version_number,
821   p_sttd_sal_prdcty_cd
822   );
823   --
824   -- Having converted the arguments into the
825   -- plsql record structure we call the corresponding record
826   -- business process.
827   --
828   upd(
829     p_effective_date,l_rec);
830   p_object_version_number := l_rec.object_version_number;
831   --
832   hr_utility.set_location(' Leaving:'||l_proc, 10);
833 End upd;
834 --
835 end ben_clf_upd;