DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_HWF_UPD

Source


1 Package Body ben_hwf_upd as
2 /* $Header: behwfrhi.pkb 120.0 2005/05/28 03:12:16 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_hwf_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_hwf_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_hwf_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_hrs_wkd_in_perd_fctr Row
68   --
69   update ben_hrs_wkd_in_perd_fctr
70   set
71   hrs_wkd_in_perd_fctr_id           = p_rec.hrs_wkd_in_perd_fctr_id,
72   name                              = p_rec.name,
73   business_group_id                 = p_rec.business_group_id,
74   hrs_src_cd                        = p_rec.hrs_src_cd,
75   rndg_cd                           = p_rec.rndg_cd,
76   rndg_rl                           = p_rec.rndg_rl,
77   hrs_wkd_det_cd                    = p_rec.hrs_wkd_det_cd,
78   hrs_wkd_det_rl                    = p_rec.hrs_wkd_det_rl,
79   no_mn_hrs_wkd_flag                = p_rec.no_mn_hrs_wkd_flag,
80   mx_hrs_num                        = p_rec.mx_hrs_num,
81   no_mx_hrs_wkd_flag                = p_rec.no_mx_hrs_wkd_flag,
82   once_r_cntug_cd                   = p_rec.once_r_cntug_cd,
83   mn_hrs_num                        = p_rec.mn_hrs_num,
84   hrs_alt_val_to_use_cd             = p_rec.hrs_alt_val_to_use_cd,
85   pyrl_freq_cd                      = p_rec.pyrl_freq_cd,
86   hrs_wkd_calc_rl                   = p_rec.hrs_wkd_calc_rl,
87   defined_balance_id                = p_rec.defined_balance_id,
88   bnfts_bal_id                      = p_rec.bnfts_bal_id,
89   hwf_attribute_category            = p_rec.hwf_attribute_category,
90   hwf_attribute1                    = p_rec.hwf_attribute1,
91   hwf_attribute2                    = p_rec.hwf_attribute2,
92   hwf_attribute3                    = p_rec.hwf_attribute3,
93   hwf_attribute4                    = p_rec.hwf_attribute4,
94   hwf_attribute5                    = p_rec.hwf_attribute5,
95   hwf_attribute6                    = p_rec.hwf_attribute6,
96   hwf_attribute7                    = p_rec.hwf_attribute7,
97   hwf_attribute8                    = p_rec.hwf_attribute8,
98   hwf_attribute9                    = p_rec.hwf_attribute9,
99   hwf_attribute10                   = p_rec.hwf_attribute10,
100   hwf_attribute11                   = p_rec.hwf_attribute11,
101   hwf_attribute12                   = p_rec.hwf_attribute12,
102   hwf_attribute13                   = p_rec.hwf_attribute13,
103   hwf_attribute14                   = p_rec.hwf_attribute14,
104   hwf_attribute15                   = p_rec.hwf_attribute15,
105   hwf_attribute16                   = p_rec.hwf_attribute16,
106   hwf_attribute17                   = p_rec.hwf_attribute17,
107   hwf_attribute18                   = p_rec.hwf_attribute18,
108   hwf_attribute19                   = p_rec.hwf_attribute19,
109   hwf_attribute20                   = p_rec.hwf_attribute20,
110   hwf_attribute21                   = p_rec.hwf_attribute21,
111   hwf_attribute22                   = p_rec.hwf_attribute22,
112   hwf_attribute23                   = p_rec.hwf_attribute23,
113   hwf_attribute24                   = p_rec.hwf_attribute24,
114   hwf_attribute25                   = p_rec.hwf_attribute25,
115   hwf_attribute26                   = p_rec.hwf_attribute26,
116   hwf_attribute27                   = p_rec.hwf_attribute27,
117   hwf_attribute28                   = p_rec.hwf_attribute28,
118   hwf_attribute29                   = p_rec.hwf_attribute29,
119   hwf_attribute30                   = p_rec.hwf_attribute30,
120   object_version_number             = p_rec.object_version_number
121   where hrs_wkd_in_perd_fctr_id = p_rec.hrs_wkd_in_perd_fctr_id;
122   --
123   ben_hwf_shd.g_api_dml := false;   -- Unset the api dml status
124   --
125   hr_utility.set_location(' Leaving:'||l_proc, 10);
126 --
127 Exception
128   When hr_api.check_integrity_violated Then
129     -- A check constraint has been violated
130     ben_hwf_shd.g_api_dml := false;   -- Unset the api dml status
131     ben_hwf_shd.constraint_error
132       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
133   When hr_api.parent_integrity_violated Then
134     -- Parent integrity has been violated
135     ben_hwf_shd.g_api_dml := false;   -- Unset the api dml status
136     ben_hwf_shd.constraint_error
137       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
138   When hr_api.unique_integrity_violated Then
139     -- Unique integrity has been violated
140     ben_hwf_shd.g_api_dml := false;   -- Unset the api dml status
141     ben_hwf_shd.constraint_error
142       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
143   When Others Then
144     ben_hwf_shd.g_api_dml := false;   -- Unset the api dml status
145     Raise;
146 End update_dml;
147 --
148 -- ----------------------------------------------------------------------------
149 -- |------------------------------< pre_update >------------------------------|
150 -- ----------------------------------------------------------------------------
151 -- {Start Of Comments}
152 --
153 -- Description:
154 --   This private procedure contains any processing which is required before
155 --   the update dml.
156 --
157 -- Prerequisites:
158 --   This is an internal procedure which is called from the upd procedure.
159 --
160 -- In Parameters:
161 --   A Pl/Sql record structre.
162 --
163 -- Post Success:
164 --   Processing continues.
165 --
166 -- Post Failure:
167 --   If an error has occurred, an error message and exception will be raised
168 --   but not handled.
169 --
170 -- Developer Implementation Notes:
171 --   Any pre-processing required before the update dml is issued should be
172 --   coded within this procedure. It is important to note that any 3rd party
173 --   maintenance should be reviewed before placing in this procedure.
174 --
175 -- Access Status:
176 --   Internal Row Handler Use Only.
177 --
178 -- {End Of Comments}
179 -- ----------------------------------------------------------------------------
180 Procedure pre_update(p_rec in ben_hwf_shd.g_rec_type) is
181 --
182   l_proc  varchar2(72) := g_package||'pre_update';
183 --
184 Begin
185   hr_utility.set_location('Entering:'||l_proc, 5);
186   --
187   hr_utility.set_location(' Leaving:'||l_proc, 10);
188 End pre_update;
189 --
190 -- ----------------------------------------------------------------------------
191 -- |-----------------------------< post_update >------------------------------|
192 -- ----------------------------------------------------------------------------
193 -- {Start Of Comments}
194 --
195 -- Description:
196 --   This private procedure contains any processing which is required after the
197 --   update dml.
198 --
199 -- Prerequisites:
200 --   This is an internal procedure which is called from the upd procedure.
201 --
202 -- In Parameters:
203 --   A Pl/Sql record structre.
204 --
205 -- Post Success:
206 --   Processing continues.
207 --
208 -- Post Failure:
209 --   If an error has occurred, an error message and exception will be raised
210 --   but not handled.
211 --
212 -- Developer Implementation Notes:
213 --   Any post-processing required after the update dml is issued should be
214 --   coded within this procedure. It is important to note that any 3rd party
215 --   maintenance should be reviewed before placing in this procedure.
216 --
217 -- Access Status:
218 --   Internal Row Handler Use Only.
219 --
220 -- {End Of Comments}
221 -- ----------------------------------------------------------------------------
222 Procedure post_update(
223 p_effective_date in date,p_rec in ben_hwf_shd.g_rec_type) is
224 --
225   l_proc  varchar2(72) := g_package||'post_update';
226 --
227 Begin
228   hr_utility.set_location('Entering:'||l_proc, 5);
229 --
230   --
231   -- Start of API User Hook for post_update.
232   --
233   begin
234     --
235     ben_hwf_rku.after_update
236       (
237   p_hrs_wkd_in_perd_fctr_id       =>p_rec.hrs_wkd_in_perd_fctr_id
238  ,p_name                          =>p_rec.name
239  ,p_business_group_id             =>p_rec.business_group_id
240  ,p_hrs_src_cd                    =>p_rec.hrs_src_cd
241  ,p_rndg_cd                       =>p_rec.rndg_cd
242  ,p_rndg_rl                       =>p_rec.rndg_rl
243  ,p_hrs_wkd_det_cd                =>p_rec.hrs_wkd_det_cd
244  ,p_hrs_wkd_det_rl                =>p_rec.hrs_wkd_det_rl
245  ,p_no_mn_hrs_wkd_flag            =>p_rec.no_mn_hrs_wkd_flag
246  ,p_mx_hrs_num                    =>p_rec.mx_hrs_num
247  ,p_no_mx_hrs_wkd_flag            =>p_rec.no_mx_hrs_wkd_flag
248  ,p_once_r_cntug_cd               =>p_rec.once_r_cntug_cd
249  ,p_mn_hrs_num                    =>p_rec.mn_hrs_num
250  ,p_hrs_alt_val_to_use_cd         =>p_rec.hrs_alt_val_to_use_cd
251  ,p_pyrl_freq_cd                  =>p_rec.pyrl_freq_cd
252  ,p_hrs_wkd_calc_rl               =>p_rec.hrs_wkd_calc_rl
253  ,p_defined_balance_id            =>p_rec.defined_balance_id
254  ,p_bnfts_bal_id                  =>p_rec.bnfts_bal_id
255  ,p_hwf_attribute_category        =>p_rec.hwf_attribute_category
256  ,p_hwf_attribute1                =>p_rec.hwf_attribute1
257  ,p_hwf_attribute2                =>p_rec.hwf_attribute2
258  ,p_hwf_attribute3                =>p_rec.hwf_attribute3
259  ,p_hwf_attribute4                =>p_rec.hwf_attribute4
260  ,p_hwf_attribute5                =>p_rec.hwf_attribute5
261  ,p_hwf_attribute6                =>p_rec.hwf_attribute6
262  ,p_hwf_attribute7                =>p_rec.hwf_attribute7
263  ,p_hwf_attribute8                =>p_rec.hwf_attribute8
264  ,p_hwf_attribute9                =>p_rec.hwf_attribute9
265  ,p_hwf_attribute10               =>p_rec.hwf_attribute10
266  ,p_hwf_attribute11               =>p_rec.hwf_attribute11
267  ,p_hwf_attribute12               =>p_rec.hwf_attribute12
268  ,p_hwf_attribute13               =>p_rec.hwf_attribute13
269  ,p_hwf_attribute14               =>p_rec.hwf_attribute14
270  ,p_hwf_attribute15               =>p_rec.hwf_attribute15
271  ,p_hwf_attribute16               =>p_rec.hwf_attribute16
272  ,p_hwf_attribute17               =>p_rec.hwf_attribute17
273  ,p_hwf_attribute18               =>p_rec.hwf_attribute18
274  ,p_hwf_attribute19               =>p_rec.hwf_attribute19
275  ,p_hwf_attribute20               =>p_rec.hwf_attribute20
276  ,p_hwf_attribute21               =>p_rec.hwf_attribute21
277  ,p_hwf_attribute22               =>p_rec.hwf_attribute22
278  ,p_hwf_attribute23               =>p_rec.hwf_attribute23
279  ,p_hwf_attribute24               =>p_rec.hwf_attribute24
280  ,p_hwf_attribute25               =>p_rec.hwf_attribute25
281  ,p_hwf_attribute26               =>p_rec.hwf_attribute26
282  ,p_hwf_attribute27               =>p_rec.hwf_attribute27
283  ,p_hwf_attribute28               =>p_rec.hwf_attribute28
284  ,p_hwf_attribute29               =>p_rec.hwf_attribute29
285  ,p_hwf_attribute30               =>p_rec.hwf_attribute30
286  ,p_object_version_number         =>p_rec.object_version_number
287  ,p_effective_date                =>p_effective_date
288  ,p_name_o                        =>ben_hwf_shd.g_old_rec.name
289  ,p_business_group_id_o           =>ben_hwf_shd.g_old_rec.business_group_id
290  ,p_hrs_src_cd_o                  =>ben_hwf_shd.g_old_rec.hrs_src_cd
291  ,p_rndg_cd_o                     =>ben_hwf_shd.g_old_rec.rndg_cd
292  ,p_rndg_rl_o                     =>ben_hwf_shd.g_old_rec.rndg_rl
293  ,p_hrs_wkd_det_cd_o              =>ben_hwf_shd.g_old_rec.hrs_wkd_det_cd
294  ,p_hrs_wkd_det_rl_o              =>ben_hwf_shd.g_old_rec.hrs_wkd_det_rl
295  ,p_no_mn_hrs_wkd_flag_o          =>ben_hwf_shd.g_old_rec.no_mn_hrs_wkd_flag
296  ,p_mx_hrs_num_o                  =>ben_hwf_shd.g_old_rec.mx_hrs_num
297  ,p_no_mx_hrs_wkd_flag_o          =>ben_hwf_shd.g_old_rec.no_mx_hrs_wkd_flag
298  ,p_once_r_cntug_cd_o             =>ben_hwf_shd.g_old_rec.once_r_cntug_cd
299  ,p_mn_hrs_num_o                  =>ben_hwf_shd.g_old_rec.mn_hrs_num
300  ,p_hrs_alt_val_to_use_cd_o       =>ben_hwf_shd.g_old_rec.hrs_alt_val_to_use_cd
301  ,p_pyrl_freq_cd_o                =>ben_hwf_shd.g_old_rec.pyrl_freq_cd
302  ,p_hrs_wkd_calc_rl_o             =>ben_hwf_shd.g_old_rec.hrs_wkd_calc_rl
303  ,p_defined_balance_id_o          =>ben_hwf_shd.g_old_rec.defined_balance_id
304  ,p_bnfts_bal_id_o                =>ben_hwf_shd.g_old_rec.bnfts_bal_id
305  ,p_hwf_attribute_category_o      =>ben_hwf_shd.g_old_rec.hwf_attribute_category
306  ,p_hwf_attribute1_o              =>ben_hwf_shd.g_old_rec.hwf_attribute1
307  ,p_hwf_attribute2_o              =>ben_hwf_shd.g_old_rec.hwf_attribute2
308  ,p_hwf_attribute3_o              =>ben_hwf_shd.g_old_rec.hwf_attribute3
309  ,p_hwf_attribute4_o              =>ben_hwf_shd.g_old_rec.hwf_attribute4
310  ,p_hwf_attribute5_o              =>ben_hwf_shd.g_old_rec.hwf_attribute5
311  ,p_hwf_attribute6_o              =>ben_hwf_shd.g_old_rec.hwf_attribute6
312  ,p_hwf_attribute7_o              =>ben_hwf_shd.g_old_rec.hwf_attribute7
313  ,p_hwf_attribute8_o              =>ben_hwf_shd.g_old_rec.hwf_attribute8
314  ,p_hwf_attribute9_o              =>ben_hwf_shd.g_old_rec.hwf_attribute9
315  ,p_hwf_attribute10_o             =>ben_hwf_shd.g_old_rec.hwf_attribute10
316  ,p_hwf_attribute11_o             =>ben_hwf_shd.g_old_rec.hwf_attribute11
317  ,p_hwf_attribute12_o             =>ben_hwf_shd.g_old_rec.hwf_attribute12
318  ,p_hwf_attribute13_o             =>ben_hwf_shd.g_old_rec.hwf_attribute13
319  ,p_hwf_attribute14_o             =>ben_hwf_shd.g_old_rec.hwf_attribute14
320  ,p_hwf_attribute15_o             =>ben_hwf_shd.g_old_rec.hwf_attribute15
321  ,p_hwf_attribute16_o             =>ben_hwf_shd.g_old_rec.hwf_attribute16
322  ,p_hwf_attribute17_o             =>ben_hwf_shd.g_old_rec.hwf_attribute17
323  ,p_hwf_attribute18_o             =>ben_hwf_shd.g_old_rec.hwf_attribute18
324  ,p_hwf_attribute19_o             =>ben_hwf_shd.g_old_rec.hwf_attribute19
325  ,p_hwf_attribute20_o             =>ben_hwf_shd.g_old_rec.hwf_attribute20
326  ,p_hwf_attribute21_o             =>ben_hwf_shd.g_old_rec.hwf_attribute21
327  ,p_hwf_attribute22_o             =>ben_hwf_shd.g_old_rec.hwf_attribute22
328  ,p_hwf_attribute23_o             =>ben_hwf_shd.g_old_rec.hwf_attribute23
329  ,p_hwf_attribute24_o             =>ben_hwf_shd.g_old_rec.hwf_attribute24
330  ,p_hwf_attribute25_o             =>ben_hwf_shd.g_old_rec.hwf_attribute25
331  ,p_hwf_attribute26_o             =>ben_hwf_shd.g_old_rec.hwf_attribute26
332  ,p_hwf_attribute27_o             =>ben_hwf_shd.g_old_rec.hwf_attribute27
333  ,p_hwf_attribute28_o             =>ben_hwf_shd.g_old_rec.hwf_attribute28
334  ,p_hwf_attribute29_o             =>ben_hwf_shd.g_old_rec.hwf_attribute29
335  ,p_hwf_attribute30_o             =>ben_hwf_shd.g_old_rec.hwf_attribute30
336  ,p_object_version_number_o       =>ben_hwf_shd.g_old_rec.object_version_number
337       );
338     --
339   exception
340     --
341     when hr_api.cannot_find_prog_unit then
342       --
343       hr_api.cannot_find_prog_unit_error
344         (p_module_name => 'ben_hrs_wkd_in_perd_fctr'
345         ,p_hook_type   => 'AU');
346       --
347   end;
348   --
349   -- End of API User Hook for post_update.
350   --
351   --
352   hr_utility.set_location(' Leaving:'||l_proc, 10);
353 End post_update;
354 --
355 -- ----------------------------------------------------------------------------
356 -- |-----------------------------< convert_defs >-----------------------------|
357 -- ----------------------------------------------------------------------------
358 -- {Start Of Comments}
359 --
360 -- Description:
361 --   The Convert_Defs procedure has one very important function:
362 --   It must return the record structure for the row with all system defaulted
363 --   values converted into its corresponding parameter value for update. When
364 --   we attempt to update a row through the Upd process , certain
365 --   parameters can be defaulted which enables flexibility in the calling of
366 --   the upd process (e.g. only attributes which need to be updated need to be
367 --   specified). For the upd process to determine which attributes
368 --   have NOT been specified we need to check if the parameter has a reserved
369 --   system default value. Therefore, for all parameters which have a
370 --   corresponding reserved system default mechanism specified we need to
371 --   check if a system default is being used. If a system default is being
372 --   used then we convert the defaulted value into its corresponding attribute
373 --   value held in the g_old_rec data structure.
374 --
375 -- Prerequisites:
376 --   This private function can only be called from the upd process.
377 --
378 -- In Parameters:
379 --   A Pl/Sql record structre.
380 --
381 -- Post Success:
382 --   The record structure will be returned with all system defaulted parameter
383 --   values converted into its current row attribute value.
384 --
385 -- Post Failure:
386 --   No direct error handling is required within this function. Any possible
387 --   errors within this procedure will be a PL/SQL value error due to conversion
388 --   of datatypes or data lengths.
389 --
390 -- Developer Implementation Notes:
391 --   None.
392 --
393 -- Access Status:
394 --   Internal Row Handler Use Only.
395 --
396 -- {End Of Comments}
397 -- ----------------------------------------------------------------------------
398 Procedure convert_defs(p_rec in out nocopy ben_hwf_shd.g_rec_type) is
399 --
400   l_proc  varchar2(72) := g_package||'convert_defs';
401 --
402 Begin
403   --
404   hr_utility.set_location('Entering:'||l_proc, 5);
405   --
406   -- We must now examine each argument value in the
407   -- p_rec plsql record structure
408   -- to see if a system default is being used. If a system default
409   -- is being used then we must set to the 'current' argument value.
410   --
411   If (p_rec.name = hr_api.g_varchar2) then
412     p_rec.name :=
413     ben_hwf_shd.g_old_rec.name;
414   End If;
415   If (p_rec.business_group_id = hr_api.g_number) then
416     p_rec.business_group_id :=
417     ben_hwf_shd.g_old_rec.business_group_id;
418   End If;
419   If (p_rec.hrs_src_cd = hr_api.g_varchar2) then
420     p_rec.hrs_src_cd :=
421     ben_hwf_shd.g_old_rec.hrs_src_cd;
422   End If;
423   If (p_rec.rndg_cd = hr_api.g_varchar2) then
424     p_rec.rndg_cd :=
425     ben_hwf_shd.g_old_rec.rndg_cd;
426   End If;
427   If (p_rec.rndg_rl = hr_api.g_number) then
428     p_rec.rndg_rl :=
429     ben_hwf_shd.g_old_rec.rndg_rl;
430   End If;
431   If (p_rec.hrs_wkd_det_cd = hr_api.g_varchar2) then
432     p_rec.hrs_wkd_det_cd :=
433     ben_hwf_shd.g_old_rec.hrs_wkd_det_cd;
434   End If;
435   If (p_rec.hrs_wkd_det_rl = hr_api.g_number) then
436     p_rec.hrs_wkd_det_rl :=
437     ben_hwf_shd.g_old_rec.hrs_wkd_det_rl;
438   End If;
439   If (p_rec.no_mn_hrs_wkd_flag = hr_api.g_varchar2) then
440     p_rec.no_mn_hrs_wkd_flag :=
441     ben_hwf_shd.g_old_rec.no_mn_hrs_wkd_flag;
442   End If;
443   If (p_rec.mx_hrs_num = hr_api.g_number) then
444     p_rec.mx_hrs_num :=
445     ben_hwf_shd.g_old_rec.mx_hrs_num;
446   End If;
447   If (p_rec.no_mx_hrs_wkd_flag = hr_api.g_varchar2) then
448     p_rec.no_mx_hrs_wkd_flag :=
449     ben_hwf_shd.g_old_rec.no_mx_hrs_wkd_flag;
450   End If;
451   If (p_rec.once_r_cntug_cd = hr_api.g_varchar2) then
452     p_rec.once_r_cntug_cd :=
453     ben_hwf_shd.g_old_rec.once_r_cntug_cd;
454   End If;
455   If (p_rec.mn_hrs_num = hr_api.g_number) then
456     p_rec.mn_hrs_num :=
457     ben_hwf_shd.g_old_rec.mn_hrs_num;
458   End If;
459   If (p_rec.hrs_alt_val_to_use_cd = hr_api.g_varchar2) then
460     p_rec.hrs_alt_val_to_use_cd :=
461     ben_hwf_shd.g_old_rec.hrs_alt_val_to_use_cd;
462   End If;
463   If (p_rec.pyrl_freq_cd = hr_api.g_varchar2) then
464     p_rec.pyrl_freq_cd :=
465     ben_hwf_shd.g_old_rec.pyrl_freq_cd;
466   End If;
467   If (p_rec.hrs_wkd_calc_rl = hr_api.g_number) then
468     p_rec.hrs_wkd_calc_rl :=
469     ben_hwf_shd.g_old_rec.hrs_wkd_calc_rl;
470   End If;
471   If (p_rec.defined_balance_id = hr_api.g_number) then
472     p_rec.defined_balance_id :=
473     ben_hwf_shd.g_old_rec.defined_balance_id;
474   End If;
475   If (p_rec.bnfts_bal_id = hr_api.g_number) then
476     p_rec.bnfts_bal_id :=
477     ben_hwf_shd.g_old_rec.bnfts_bal_id;
478   End If;
479   If (p_rec.hwf_attribute_category = hr_api.g_varchar2) then
480     p_rec.hwf_attribute_category :=
481     ben_hwf_shd.g_old_rec.hwf_attribute_category;
482   End If;
483   If (p_rec.hwf_attribute1 = hr_api.g_varchar2) then
484     p_rec.hwf_attribute1 :=
485     ben_hwf_shd.g_old_rec.hwf_attribute1;
486   End If;
487   If (p_rec.hwf_attribute2 = hr_api.g_varchar2) then
488     p_rec.hwf_attribute2 :=
489     ben_hwf_shd.g_old_rec.hwf_attribute2;
490   End If;
491   If (p_rec.hwf_attribute3 = hr_api.g_varchar2) then
492     p_rec.hwf_attribute3 :=
493     ben_hwf_shd.g_old_rec.hwf_attribute3;
494   End If;
495   If (p_rec.hwf_attribute4 = hr_api.g_varchar2) then
496     p_rec.hwf_attribute4 :=
497     ben_hwf_shd.g_old_rec.hwf_attribute4;
498   End If;
499   If (p_rec.hwf_attribute5 = hr_api.g_varchar2) then
500     p_rec.hwf_attribute5 :=
501     ben_hwf_shd.g_old_rec.hwf_attribute5;
502   End If;
503   If (p_rec.hwf_attribute6 = hr_api.g_varchar2) then
504     p_rec.hwf_attribute6 :=
505     ben_hwf_shd.g_old_rec.hwf_attribute6;
506   End If;
507   If (p_rec.hwf_attribute7 = hr_api.g_varchar2) then
508     p_rec.hwf_attribute7 :=
509     ben_hwf_shd.g_old_rec.hwf_attribute7;
510   End If;
511   If (p_rec.hwf_attribute8 = hr_api.g_varchar2) then
512     p_rec.hwf_attribute8 :=
513     ben_hwf_shd.g_old_rec.hwf_attribute8;
514   End If;
515   If (p_rec.hwf_attribute9 = hr_api.g_varchar2) then
516     p_rec.hwf_attribute9 :=
517     ben_hwf_shd.g_old_rec.hwf_attribute9;
518   End If;
519   If (p_rec.hwf_attribute10 = hr_api.g_varchar2) then
520     p_rec.hwf_attribute10 :=
521     ben_hwf_shd.g_old_rec.hwf_attribute10;
522   End If;
523   If (p_rec.hwf_attribute11 = hr_api.g_varchar2) then
524     p_rec.hwf_attribute11 :=
525     ben_hwf_shd.g_old_rec.hwf_attribute11;
526   End If;
527   If (p_rec.hwf_attribute12 = hr_api.g_varchar2) then
528     p_rec.hwf_attribute12 :=
529     ben_hwf_shd.g_old_rec.hwf_attribute12;
530   End If;
531   If (p_rec.hwf_attribute13 = hr_api.g_varchar2) then
532     p_rec.hwf_attribute13 :=
533     ben_hwf_shd.g_old_rec.hwf_attribute13;
534   End If;
535   If (p_rec.hwf_attribute14 = hr_api.g_varchar2) then
536     p_rec.hwf_attribute14 :=
537     ben_hwf_shd.g_old_rec.hwf_attribute14;
538   End If;
539   If (p_rec.hwf_attribute15 = hr_api.g_varchar2) then
540     p_rec.hwf_attribute15 :=
541     ben_hwf_shd.g_old_rec.hwf_attribute15;
542   End If;
543   If (p_rec.hwf_attribute16 = hr_api.g_varchar2) then
544     p_rec.hwf_attribute16 :=
545     ben_hwf_shd.g_old_rec.hwf_attribute16;
546   End If;
547   If (p_rec.hwf_attribute17 = hr_api.g_varchar2) then
548     p_rec.hwf_attribute17 :=
549     ben_hwf_shd.g_old_rec.hwf_attribute17;
550   End If;
551   If (p_rec.hwf_attribute18 = hr_api.g_varchar2) then
552     p_rec.hwf_attribute18 :=
553     ben_hwf_shd.g_old_rec.hwf_attribute18;
554   End If;
555   If (p_rec.hwf_attribute19 = hr_api.g_varchar2) then
556     p_rec.hwf_attribute19 :=
557     ben_hwf_shd.g_old_rec.hwf_attribute19;
558   End If;
559   If (p_rec.hwf_attribute20 = hr_api.g_varchar2) then
560     p_rec.hwf_attribute20 :=
561     ben_hwf_shd.g_old_rec.hwf_attribute20;
562   End If;
563   If (p_rec.hwf_attribute21 = hr_api.g_varchar2) then
564     p_rec.hwf_attribute21 :=
565     ben_hwf_shd.g_old_rec.hwf_attribute21;
566   End If;
567   If (p_rec.hwf_attribute22 = hr_api.g_varchar2) then
568     p_rec.hwf_attribute22 :=
569     ben_hwf_shd.g_old_rec.hwf_attribute22;
570   End If;
571   If (p_rec.hwf_attribute23 = hr_api.g_varchar2) then
572     p_rec.hwf_attribute23 :=
573     ben_hwf_shd.g_old_rec.hwf_attribute23;
574   End If;
575   If (p_rec.hwf_attribute24 = hr_api.g_varchar2) then
576     p_rec.hwf_attribute24 :=
577     ben_hwf_shd.g_old_rec.hwf_attribute24;
578   End If;
579   If (p_rec.hwf_attribute25 = hr_api.g_varchar2) then
580     p_rec.hwf_attribute25 :=
581     ben_hwf_shd.g_old_rec.hwf_attribute25;
582   End If;
583   If (p_rec.hwf_attribute26 = hr_api.g_varchar2) then
584     p_rec.hwf_attribute26 :=
585     ben_hwf_shd.g_old_rec.hwf_attribute26;
586   End If;
587   If (p_rec.hwf_attribute27 = hr_api.g_varchar2) then
588     p_rec.hwf_attribute27 :=
589     ben_hwf_shd.g_old_rec.hwf_attribute27;
590   End If;
591   If (p_rec.hwf_attribute28 = hr_api.g_varchar2) then
592     p_rec.hwf_attribute28 :=
593     ben_hwf_shd.g_old_rec.hwf_attribute28;
594   End If;
595   If (p_rec.hwf_attribute29 = hr_api.g_varchar2) then
596     p_rec.hwf_attribute29 :=
597     ben_hwf_shd.g_old_rec.hwf_attribute29;
598   End If;
599   If (p_rec.hwf_attribute30 = hr_api.g_varchar2) then
600     p_rec.hwf_attribute30 :=
601     ben_hwf_shd.g_old_rec.hwf_attribute30;
602   End If;
603 
604   --
605   hr_utility.set_location(' Leaving:'||l_proc, 10);
606 --
607 End convert_defs;
608 --
609 -- ----------------------------------------------------------------------------
610 -- |---------------------------------< upd >----------------------------------|
611 -- ----------------------------------------------------------------------------
612 Procedure upd
613   (
614   p_effective_date in date,
615   p_rec        in out nocopy ben_hwf_shd.g_rec_type
616   ) is
617 --
618   l_proc  varchar2(72) := g_package||'upd';
619 --
620 Begin
621   hr_utility.set_location('Entering:'||l_proc, 5);
622   --
623   -- We must lock the row which we need to update.
624   --
625   ben_hwf_shd.lck
626 	(
627 	p_rec.hrs_wkd_in_perd_fctr_id,
628 	p_rec.object_version_number
629 	);
630   --
631   -- 1. During an update system defaults are used to determine if
632   --    arguments have been defaulted or not. We must therefore
633   --    derive the full record structure values to be updated.
634   --
635   -- 2. Call the supporting update validate operations.
636   --
637   convert_defs(p_rec);
638   ben_hwf_bus.update_validate(p_rec
639   ,p_effective_date);
640   --
641   -- Call the supporting pre-update operation
642   --
643   pre_update(p_rec);
644   --
645   -- Update the row.
646   --
647   update_dml(p_rec);
648   --
649   -- Call the supporting post-update operation
650   --
651   post_update(
652 p_effective_date,p_rec);
653 End upd;
654 --
655 -- ----------------------------------------------------------------------------
656 -- |---------------------------------< upd >----------------------------------|
657 -- ----------------------------------------------------------------------------
658 Procedure upd
659   (
660   p_effective_date in date,
661   p_hrs_wkd_in_perd_fctr_id      in number,
662   p_name                         in varchar2         default hr_api.g_varchar2,
663   p_business_group_id            in number           default hr_api.g_number,
664   p_hrs_src_cd                   in varchar2         default hr_api.g_varchar2,
665   p_rndg_cd                      in varchar2         default hr_api.g_varchar2,
666   p_rndg_rl                      in number           default hr_api.g_number,
667   p_hrs_wkd_det_cd               in varchar2         default hr_api.g_varchar2,
668   p_hrs_wkd_det_rl               in number           default hr_api.g_number,
669   p_no_mn_hrs_wkd_flag           in varchar2         default hr_api.g_varchar2,
670   p_mx_hrs_num                   in number           default hr_api.g_number,
671   p_no_mx_hrs_wkd_flag           in varchar2         default hr_api.g_varchar2,
672   p_once_r_cntug_cd              in varchar2         default hr_api.g_varchar2,
673   p_mn_hrs_num                   in number           default hr_api.g_number,
674   p_hrs_alt_val_to_use_cd        in varchar2         default hr_api.g_varchar2,
675   p_pyrl_freq_cd                 in varchar2         default hr_api.g_varchar2,
676   p_hrs_wkd_calc_rl              in number           default hr_api.g_number,
677   p_defined_balance_id           in number           default hr_api.g_number,
678   p_bnfts_bal_id                 in number           default hr_api.g_number,
679   p_hwf_attribute_category       in varchar2         default hr_api.g_varchar2,
680   p_hwf_attribute1               in varchar2         default hr_api.g_varchar2,
681   p_hwf_attribute2               in varchar2         default hr_api.g_varchar2,
682   p_hwf_attribute3               in varchar2         default hr_api.g_varchar2,
683   p_hwf_attribute4               in varchar2         default hr_api.g_varchar2,
684   p_hwf_attribute5               in varchar2         default hr_api.g_varchar2,
685   p_hwf_attribute6               in varchar2         default hr_api.g_varchar2,
686   p_hwf_attribute7               in varchar2         default hr_api.g_varchar2,
687   p_hwf_attribute8               in varchar2         default hr_api.g_varchar2,
688   p_hwf_attribute9               in varchar2         default hr_api.g_varchar2,
689   p_hwf_attribute10              in varchar2         default hr_api.g_varchar2,
690   p_hwf_attribute11              in varchar2         default hr_api.g_varchar2,
691   p_hwf_attribute12              in varchar2         default hr_api.g_varchar2,
692   p_hwf_attribute13              in varchar2         default hr_api.g_varchar2,
693   p_hwf_attribute14              in varchar2         default hr_api.g_varchar2,
694   p_hwf_attribute15              in varchar2         default hr_api.g_varchar2,
695   p_hwf_attribute16              in varchar2         default hr_api.g_varchar2,
696   p_hwf_attribute17              in varchar2         default hr_api.g_varchar2,
697   p_hwf_attribute18              in varchar2         default hr_api.g_varchar2,
698   p_hwf_attribute19              in varchar2         default hr_api.g_varchar2,
699   p_hwf_attribute20              in varchar2         default hr_api.g_varchar2,
700   p_hwf_attribute21              in varchar2         default hr_api.g_varchar2,
701   p_hwf_attribute22              in varchar2         default hr_api.g_varchar2,
702   p_hwf_attribute23              in varchar2         default hr_api.g_varchar2,
703   p_hwf_attribute24              in varchar2         default hr_api.g_varchar2,
704   p_hwf_attribute25              in varchar2         default hr_api.g_varchar2,
705   p_hwf_attribute26              in varchar2         default hr_api.g_varchar2,
706   p_hwf_attribute27              in varchar2         default hr_api.g_varchar2,
707   p_hwf_attribute28              in varchar2         default hr_api.g_varchar2,
708   p_hwf_attribute29              in varchar2         default hr_api.g_varchar2,
709   p_hwf_attribute30              in varchar2         default hr_api.g_varchar2,
710   p_object_version_number        in out nocopy number
711   ) is
712 --
713   l_rec	  ben_hwf_shd.g_rec_type;
714   l_proc  varchar2(72) := g_package||'upd';
715 --
716 Begin
717   hr_utility.set_location('Entering:'||l_proc, 5);
718   --
719   -- Call conversion function to turn arguments into the
720   -- l_rec structure.
721   --
722   l_rec :=
723   ben_hwf_shd.convert_args
724   (
725   p_hrs_wkd_in_perd_fctr_id,
726   p_name,
727   p_business_group_id,
728   p_hrs_src_cd,
729   p_rndg_cd,
730   p_rndg_rl,
731   p_hrs_wkd_det_cd,
732   p_hrs_wkd_det_rl,
733   p_no_mn_hrs_wkd_flag,
734   p_mx_hrs_num,
735   p_no_mx_hrs_wkd_flag,
736   p_once_r_cntug_cd,
737   p_mn_hrs_num,
738   p_hrs_alt_val_to_use_cd,
739   p_pyrl_freq_cd,
740   p_hrs_wkd_calc_rl,
741   p_defined_balance_id,
742   p_bnfts_bal_id,
743   p_hwf_attribute_category,
744   p_hwf_attribute1,
745   p_hwf_attribute2,
746   p_hwf_attribute3,
747   p_hwf_attribute4,
748   p_hwf_attribute5,
749   p_hwf_attribute6,
750   p_hwf_attribute7,
751   p_hwf_attribute8,
752   p_hwf_attribute9,
753   p_hwf_attribute10,
754   p_hwf_attribute11,
755   p_hwf_attribute12,
756   p_hwf_attribute13,
757   p_hwf_attribute14,
758   p_hwf_attribute15,
759   p_hwf_attribute16,
760   p_hwf_attribute17,
761   p_hwf_attribute18,
762   p_hwf_attribute19,
763   p_hwf_attribute20,
764   p_hwf_attribute21,
765   p_hwf_attribute22,
766   p_hwf_attribute23,
767   p_hwf_attribute24,
768   p_hwf_attribute25,
769   p_hwf_attribute26,
770   p_hwf_attribute27,
771   p_hwf_attribute28,
772   p_hwf_attribute29,
773   p_hwf_attribute30,
774   p_object_version_number
775   );
776   --
777   -- Having converted the arguments into the
778   -- plsql record structure we call the corresponding record
779   -- business process.
780   --
781   upd(
782     p_effective_date,l_rec);
783   p_object_version_number := l_rec.object_version_number;
784   --
785   hr_utility.set_location(' Leaving:'||l_proc, 10);
786 End upd;
787 --
788 end ben_hwf_upd;