DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_ETC_UPD

Source


1 Package Body ben_etc_upd as
2 /* $Header: beetcrhi.pkb 120.0 2005/05/28 03:00:47 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_etc_upd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_update_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the execution of dml from the datetrack mode
17 --   of CORRECTION only. It is important to note that the object version
18 --   number is only increment by 1 because the datetrack correction is
19 --   soley for one datetracked row.
20 --   This procedure controls the actual dml update logic. The functions of this
21 --   procedure are as follows:
22 --   1) Get the next object_version_number.
23 --   2) To set and unset the g_api_dml status as required (as we are about to
24 --      perform dml).
25 --   3) To update the specified row in the schema using the primary key in
26 --      the predicates.
27 --   4) To trap any constraint violations that may have occurred.
28 --   5) To raise any other errors.
29 --
30 -- Prerequisites:
31 --   This is an internal private procedure which must be called from the
32 --   update_dml procedure.
33 --
34 -- In Parameters:
35 --   A Pl/Sql record structre.
36 --
37 -- Post Success:
38 --   The specified row will be updated in the schema.
39 --
40 -- Post Failure:
41 --   On the update dml failure it is important to note that we always reset the
42 --   g_api_dml status to false.
43 --   If a check or unique integrity constraint violation is raised the
44 --   constraint_error procedure will be called.
45 --   If any other error is reported, the error will be raised after the
46 --   g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 --   The update 'set' arguments list should be modified if any of your
50 --   attributes are not updateable.
51 --
52 -- Access Status:
53 --   Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_update_dml
58 	(p_rec 			 in out nocopy ben_etc_shd.g_rec_type,
59 	 p_effective_date	 in	date,
60 	 p_datetrack_mode	 in	varchar2,
61 	 p_validation_start_date in	date,
62 	 p_validation_end_date	 in	date) is
63 --
64   l_proc	varchar2(72) := g_package||'dt_update_dml';
65 --
66 Begin
67   hr_utility.set_location('Entering:'||l_proc, 5);
68   --
69   If (p_datetrack_mode = 'CORRECTION') then
70     hr_utility.set_location(l_proc, 10);
71     --
72     -- Because we are updating a row we must get the next object
73     -- version number.
74     --
75     p_rec.object_version_number :=
76       dt_api.get_object_version_number
77 	  (p_base_table_name	=> 'ben_elig_ttl_cvg_vol_prte_f',
78 	   p_base_key_column	=> 'elig_ttl_cvg_vol_prte_id',
79 	   p_base_key_value	=> p_rec.elig_ttl_cvg_vol_prte_id);
80     --
81     ben_etc_shd.g_api_dml := true;  -- Set the api dml status
82     --
83     -- Update the ben_elig_ttl_cvg_vol_prte_f Row
84     --
85     update  ben_elig_ttl_cvg_vol_prte_f
86     set
87         elig_ttl_cvg_vol_prte_id    = p_rec.elig_ttl_cvg_vol_prte_id,
88     business_group_id               = p_rec.business_group_id,
89     excld_flag                      = p_rec.excld_flag,
90     no_mn_cvg_vol_amt_apls_flag     = p_rec.no_mn_cvg_vol_amt_apls_flag,
91     no_mx_cvg_vol_amt_apls_flag     = p_rec.no_mx_cvg_vol_amt_apls_flag,
92     ordr_num                        = p_rec.ordr_num,
93     mn_cvg_vol_amt                  = p_rec.mn_cvg_vol_amt,
94     mx_cvg_vol_amt                  = p_rec.mx_cvg_vol_amt,
95     cvg_vol_det_cd                  = p_rec.cvg_vol_det_cd,
96     cvg_vol_det_rl                  = p_rec.cvg_vol_det_rl,
97     eligy_prfl_id                   = p_rec.eligy_prfl_id,
98     etc_attribute_category          = p_rec.etc_attribute_category,
99     etc_attribute1                  = p_rec.etc_attribute1,
100     etc_attribute2                  = p_rec.etc_attribute2,
101     etc_attribute3                  = p_rec.etc_attribute3,
102     etc_attribute4                  = p_rec.etc_attribute4,
103     etc_attribute5                  = p_rec.etc_attribute5,
104     etc_attribute6                  = p_rec.etc_attribute6,
105     etc_attribute7                  = p_rec.etc_attribute7,
106     etc_attribute8                  = p_rec.etc_attribute8,
107     etc_attribute9                  = p_rec.etc_attribute9,
108     etc_attribute10                 = p_rec.etc_attribute10,
109     etc_attribute11                 = p_rec.etc_attribute11,
110     etc_attribute12                 = p_rec.etc_attribute12,
111     etc_attribute13                 = p_rec.etc_attribute13,
112     etc_attribute14                 = p_rec.etc_attribute14,
113     etc_attribute15                 = p_rec.etc_attribute15,
114     etc_attribute16                 = p_rec.etc_attribute16,
115     etc_attribute17                 = p_rec.etc_attribute17,
116     etc_attribute18                 = p_rec.etc_attribute18,
117     etc_attribute19                 = p_rec.etc_attribute19,
118     etc_attribute20                 = p_rec.etc_attribute20,
119     etc_attribute21                 = p_rec.etc_attribute21,
120     etc_attribute22                 = p_rec.etc_attribute22,
121     etc_attribute23                 = p_rec.etc_attribute23,
122     etc_attribute24                 = p_rec.etc_attribute24,
123     etc_attribute25                 = p_rec.etc_attribute25,
124     etc_attribute26                 = p_rec.etc_attribute26,
125     etc_attribute27                 = p_rec.etc_attribute27,
126     etc_attribute28                 = p_rec.etc_attribute28,
127     etc_attribute29                 = p_rec.etc_attribute29,
128     etc_attribute30                 = p_rec.etc_attribute30,
129     object_version_number           = p_rec.object_version_number
130     where   elig_ttl_cvg_vol_prte_id = p_rec.elig_ttl_cvg_vol_prte_id
131     and     effective_start_date     = p_validation_start_date
132     and     effective_end_date       = p_validation_end_date;
133     --
134     ben_etc_shd.g_api_dml := false;   -- Unset the api dml status
135     --
136     -- Set the effective start and end dates
137     --
138     p_rec.effective_start_date := p_validation_start_date;
139     p_rec.effective_end_date   := p_validation_end_date;
140   End If;
141 --
142 hr_utility.set_location(' Leaving:'||l_proc, 15);
143 Exception
144   When hr_api.check_integrity_violated Then
145     -- A check constraint has been violated
146     ben_etc_shd.g_api_dml := false;   -- Unset the api dml status
147     ben_etc_shd.constraint_error
148       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
149   When hr_api.unique_integrity_violated Then
150     -- Unique integrity has been violated
151     ben_etc_shd.g_api_dml := false;   -- Unset the api dml status
152     ben_etc_shd.constraint_error
153       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
154   When Others Then
155     ben_etc_shd.g_api_dml := false;   -- Unset the api dml status
156     Raise;
157 End dt_update_dml;
158 --
159 -- ----------------------------------------------------------------------------
160 -- |------------------------------< update_dml >------------------------------|
161 -- ----------------------------------------------------------------------------
162 -- {Start Of Comments}
163 --
164 -- Description:
165 --   This procedure calls the dt_update_dml control logic which handles
166 --   the actual datetrack dml.
167 --
168 -- Prerequisites:
169 --   This is an internal private procedure which must be called from the upd
170 --   procedure.
171 --
172 -- In Parameters:
173 --   A Pl/Sql record structre.
174 --
175 -- Post Success:
176 --   Processing contines.
177 --
178 -- Post Failure:
179 --   No specific error handling is required within this procedure.
180 --
181 -- Developer Implementation Notes:
182 --   The update 'set' arguments list should be modified if any of your
183 --   attributes are not updateable.
184 --
185 -- Access Status:
186 --   Internal Row Handler Use Only.
187 --
188 -- {End Of Comments}
189 -- ----------------------------------------------------------------------------
190 Procedure update_dml
191 	(p_rec 			 in out nocopy ben_etc_shd.g_rec_type,
192 	 p_effective_date	 in	date,
193 	 p_datetrack_mode	 in	varchar2,
194 	 p_validation_start_date in	date,
195 	 p_validation_end_date	 in	date) is
196 --
197   l_proc	varchar2(72) := g_package||'update_dml';
198 --
199 Begin
200   hr_utility.set_location('Entering:'||l_proc, 5);
201   --
202   dt_update_dml(p_rec			=> p_rec,
203 		p_effective_date	=> p_effective_date,
204 		p_datetrack_mode	=> p_datetrack_mode,
205        		p_validation_start_date	=> p_validation_start_date,
206 		p_validation_end_date	=> p_validation_end_date);
207   --
208   hr_utility.set_location(' Leaving:'||l_proc, 10);
209 End update_dml;
210 --
211 -- ----------------------------------------------------------------------------
212 -- |----------------------------< dt_pre_update >-----------------------------|
213 -- ----------------------------------------------------------------------------
214 -- {Start Of Comments}
215 --
216 -- Description:
217 --   The dt_pre_update procedure controls the execution
218 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
219 --   and UPDATE_CHANGE_INSERT only. The execution required is as
220 --   follows:
221 --
222 --   1) Providing the datetrack update mode is not 'CORRECTION'
223 --      then set the effective end date of the current row (this
224 --      will be the validation_start_date - 1).
225 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
226 --      corresponding delete_dml process to delete any future rows
227 --      where the effective_start_date is greater than or equal to
228 --	the validation_start_date.
229 --   3) Call the insert_dml process to insert the new updated row
230 --      details..
231 --
232 -- Prerequisites:
233 --   This is an internal procedure which is called from the
234 --   pre_update procedure.
235 --
236 -- In Parameters:
237 --
238 -- Post Success:
239 --   Processing continues.
240 --
241 -- Post Failure:
242 --   If an error has occurred, an error message and exception will be raised
243 --   but not handled.
244 --
245 -- Developer Implementation Notes:
246 --   This is an internal procedure which is required by Datetrack. Don't
247 --   remove or modify.
248 --
249 -- Access Status:
250 --   Internal Row Handler Use Only.
251 --
252 -- {End Of Comments}
253 -- ----------------------------------------------------------------------------
254 Procedure dt_pre_update
255 	(p_rec 			 in out nocopy ben_etc_shd.g_rec_type,
256 	 p_effective_date	 in	date,
257 	 p_datetrack_mode	 in	varchar2,
258 	 p_validation_start_date in	date,
259 	 p_validation_end_date	 in	date) is
260 --
261   l_proc	         varchar2(72) := g_package||'dt_pre_update';
262   l_dummy_version_number number;
263 --
264 Begin
265   hr_utility.set_location('Entering:'||l_proc, 5);
266   If (p_datetrack_mode <> 'CORRECTION') then
267     hr_utility.set_location(l_proc, 10);
268     --
269     -- Update the current effective end date
270     --
271     ben_etc_shd.upd_effective_end_date
272      (p_effective_date	       => p_effective_date,
273       p_base_key_value	       => p_rec.elig_ttl_cvg_vol_prte_id,
274       p_new_effective_end_date => (p_validation_start_date - 1),
275       p_validation_start_date  => p_validation_start_date,
276       p_validation_end_date    => p_validation_end_date,
277       p_object_version_number  => l_dummy_version_number);
278     --
279     If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
280       hr_utility.set_location(l_proc, 15);
281       --
282       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
283       -- delete any future rows
284       --
285       ben_etc_del.delete_dml
286         (p_rec			 => p_rec,
287 	 p_effective_date	 => p_effective_date,
288 	 p_datetrack_mode	 => p_datetrack_mode,
289 	 p_validation_start_date => p_validation_start_date,
290 	 p_validation_end_date   => p_validation_end_date);
291     End If;
292     hr_utility.set_location(l_proc, 20);
293     --
294     -- We must now insert the updated row
295     --
296     ben_etc_ins.insert_dml
297       (p_rec			=> p_rec,
298        p_effective_date		=> p_effective_date,
299        p_datetrack_mode		=> p_datetrack_mode,
300        p_validation_start_date	=> p_validation_start_date,
301        p_validation_end_date	=> p_validation_end_date);
302   End If;
303   hr_utility.set_location(' Leaving:'||l_proc, 20);
304 End dt_pre_update;
305 --
306 -- ----------------------------------------------------------------------------
307 -- |------------------------------< pre_update >------------------------------|
308 -- ----------------------------------------------------------------------------
309 -- {Start Of Comments}
310 --
311 -- Description:
312 --   This private procedure contains any processing which is required before
313 --   the update dml.
314 --
315 -- Prerequisites:
316 --   This is an internal procedure which is called from the upd procedure.
317 --
318 -- In Parameters:
319 --   A Pl/Sql record structre.
320 --
321 -- Post Success:
322 --   Processing continues.
323 --
324 -- Post Failure:
325 --   If an error has occurred, an error message and exception will be raised
326 --   but not handled.
327 --
328 -- Developer Implementation Notes:
329 --   Any pre-processing required before the update dml is issued should be
330 --   coded within this procedure. It is important to note that any 3rd party
331 --   maintenance should be reviewed before placing in this procedure. The call
332 --   to the dt_update_dml procedure should NOT be removed.
333 --
334 -- Access Status:
335 --   Internal Row Handler Use Only.
336 --
337 -- {End Of Comments}
338 -- ----------------------------------------------------------------------------
339 Procedure pre_update
340 	(p_rec 			 in out nocopy ben_etc_shd.g_rec_type,
341 	 p_effective_date	 in	date,
342 	 p_datetrack_mode	 in	varchar2,
343 	 p_validation_start_date in	date,
344 	 p_validation_end_date	 in	date) is
345 --
346   l_proc	varchar2(72) := g_package||'pre_update';
347 --
348 Begin
349   hr_utility.set_location('Entering:'||l_proc, 5);
350   --
351   --
352   --
353   dt_pre_update
354     (p_rec 		     => p_rec,
355      p_effective_date	     => p_effective_date,
356      p_datetrack_mode	     => p_datetrack_mode,
357      p_validation_start_date => p_validation_start_date,
358      p_validation_end_date   => p_validation_end_date);
359   --
360   hr_utility.set_location(' Leaving:'||l_proc, 10);
361 End pre_update;
362 --
363 -- ----------------------------------------------------------------------------
364 -- |-----------------------------< post_update >------------------------------|
365 -- ----------------------------------------------------------------------------
366 -- {Start Of Comments}
367 --
368 -- Description:
369 --   This private procedure contains any processing which is required after the
370 --   update dml.
371 --
372 -- Prerequisites:
373 --   This is an internal procedure which is called from the upd procedure.
374 --
375 -- In Parameters:
376 --   A Pl/Sql record structre.
377 --
378 -- Post Success:
379 --   Processing continues.
380 --
381 -- Post Failure:
382 --   If an error has occurred, an error message and exception will be raised
383 --   but not handled.
384 --
385 -- Developer Implementation Notes:
386 --   Any post-processing required after the update dml is issued should be
387 --   coded within this procedure. It is important to note that any 3rd party
388 --   maintenance should be reviewed before placing in this procedure.
389 --
390 -- Access Status:
391 --   Internal Row Handler Use Only.
392 --
393 -- {End Of Comments}
394 -- ----------------------------------------------------------------------------
395 Procedure post_update
396 	(p_rec 			 in ben_etc_shd.g_rec_type,
397 	 p_effective_date	 in date,
398 	 p_datetrack_mode	 in varchar2,
399 	 p_validation_start_date in date,
400 	 p_validation_end_date	 in date) is
401 --
402   l_proc	varchar2(72) := g_package||'post_update';
403 --
404 Begin
405   hr_utility.set_location('Entering:'||l_proc, 5);
406 --
407   --
408   -- Start of API User Hook for post_update.
409   --
410   begin
411     --
412     ben_etc_rku.after_update
413       (
414   p_elig_ttl_cvg_vol_prte_id      =>p_rec.elig_ttl_cvg_vol_prte_id
415  ,p_effective_start_date          =>p_rec.effective_start_date
416  ,p_effective_end_date            =>p_rec.effective_end_date
417  ,p_business_group_id             =>p_rec.business_group_id
418  ,p_excld_flag                    =>p_rec.excld_flag
419  ,p_no_mn_cvg_vol_amt_apls_flag   =>p_rec.no_mn_cvg_vol_amt_apls_flag
420  ,p_no_mx_cvg_vol_amt_apls_flag   =>p_rec.no_mx_cvg_vol_amt_apls_flag
421  ,p_ordr_num                      =>p_rec.ordr_num
422  ,p_mn_cvg_vol_amt                =>p_rec.mn_cvg_vol_amt
423  ,p_mx_cvg_vol_amt                =>p_rec.mx_cvg_vol_amt
424  ,p_cvg_vol_det_cd                =>p_rec.cvg_vol_det_cd
425  ,p_cvg_vol_det_rl                =>p_rec.cvg_vol_det_rl
426  ,p_eligy_prfl_id                 =>p_rec.eligy_prfl_id
427  ,p_etc_attribute_category        =>p_rec.etc_attribute_category
428  ,p_etc_attribute1                =>p_rec.etc_attribute1
429  ,p_etc_attribute2                =>p_rec.etc_attribute2
430  ,p_etc_attribute3                =>p_rec.etc_attribute3
431  ,p_etc_attribute4                =>p_rec.etc_attribute4
432  ,p_etc_attribute5                =>p_rec.etc_attribute5
433  ,p_etc_attribute6                =>p_rec.etc_attribute6
434  ,p_etc_attribute7                =>p_rec.etc_attribute7
435  ,p_etc_attribute8                =>p_rec.etc_attribute8
436  ,p_etc_attribute9                =>p_rec.etc_attribute9
437  ,p_etc_attribute10               =>p_rec.etc_attribute10
438  ,p_etc_attribute11               =>p_rec.etc_attribute11
439  ,p_etc_attribute12               =>p_rec.etc_attribute12
440  ,p_etc_attribute13               =>p_rec.etc_attribute13
441  ,p_etc_attribute14               =>p_rec.etc_attribute14
442  ,p_etc_attribute15               =>p_rec.etc_attribute15
443  ,p_etc_attribute16               =>p_rec.etc_attribute16
444  ,p_etc_attribute17               =>p_rec.etc_attribute17
445  ,p_etc_attribute18               =>p_rec.etc_attribute18
446  ,p_etc_attribute19               =>p_rec.etc_attribute19
447  ,p_etc_attribute20               =>p_rec.etc_attribute20
448  ,p_etc_attribute21               =>p_rec.etc_attribute21
449  ,p_etc_attribute22               =>p_rec.etc_attribute22
450  ,p_etc_attribute23               =>p_rec.etc_attribute23
451  ,p_etc_attribute24               =>p_rec.etc_attribute24
452  ,p_etc_attribute25               =>p_rec.etc_attribute25
453  ,p_etc_attribute26               =>p_rec.etc_attribute26
454  ,p_etc_attribute27               =>p_rec.etc_attribute27
455  ,p_etc_attribute28               =>p_rec.etc_attribute28
456  ,p_etc_attribute29               =>p_rec.etc_attribute29
457  ,p_etc_attribute30               =>p_rec.etc_attribute30
458  ,p_object_version_number         =>p_rec.object_version_number
459  ,p_effective_date                =>p_effective_date
460  ,p_datetrack_mode                =>p_datetrack_mode
461  ,p_validation_start_date         =>p_validation_start_date
462  ,p_validation_end_date           =>p_validation_end_date
463  ,p_effective_start_date_o        =>ben_etc_shd.g_old_rec.effective_start_date
464  ,p_effective_end_date_o          =>ben_etc_shd.g_old_rec.effective_end_date
465  ,p_business_group_id_o           =>ben_etc_shd.g_old_rec.business_group_id
466  ,p_excld_flag_o                  =>ben_etc_shd.g_old_rec.excld_flag
467  ,p_no_mn_cvg_vol_amt_apls_fla_o  =>ben_etc_shd.g_old_rec.no_mn_cvg_vol_amt_apls_flag
468  ,p_no_mx_cvg_vol_amt_apls_fla_o  =>ben_etc_shd.g_old_rec.no_mx_cvg_vol_amt_apls_flag
469  ,p_ordr_num_o                    =>ben_etc_shd.g_old_rec.ordr_num
470  ,p_mn_cvg_vol_amt_o              =>ben_etc_shd.g_old_rec.mn_cvg_vol_amt
471  ,p_mx_cvg_vol_amt_o              =>ben_etc_shd.g_old_rec.mx_cvg_vol_amt
472  ,p_cvg_vol_det_cd_o              =>ben_etc_shd.g_old_rec.cvg_vol_det_cd
473  ,p_cvg_vol_det_rl_o              =>ben_etc_shd.g_old_rec.cvg_vol_det_rl
474  ,p_eligy_prfl_id_o               =>ben_etc_shd.g_old_rec.eligy_prfl_id
475  ,p_etc_attribute_category_o      =>ben_etc_shd.g_old_rec.etc_attribute_category
476  ,p_etc_attribute1_o              =>ben_etc_shd.g_old_rec.etc_attribute1
477  ,p_etc_attribute2_o              =>ben_etc_shd.g_old_rec.etc_attribute2
478  ,p_etc_attribute3_o              =>ben_etc_shd.g_old_rec.etc_attribute3
479  ,p_etc_attribute4_o              =>ben_etc_shd.g_old_rec.etc_attribute4
480  ,p_etc_attribute5_o              =>ben_etc_shd.g_old_rec.etc_attribute5
481  ,p_etc_attribute6_o              =>ben_etc_shd.g_old_rec.etc_attribute6
482  ,p_etc_attribute7_o              =>ben_etc_shd.g_old_rec.etc_attribute7
483  ,p_etc_attribute8_o              =>ben_etc_shd.g_old_rec.etc_attribute8
484  ,p_etc_attribute9_o              =>ben_etc_shd.g_old_rec.etc_attribute9
485  ,p_etc_attribute10_o             =>ben_etc_shd.g_old_rec.etc_attribute10
486  ,p_etc_attribute11_o             =>ben_etc_shd.g_old_rec.etc_attribute11
487  ,p_etc_attribute12_o             =>ben_etc_shd.g_old_rec.etc_attribute12
488  ,p_etc_attribute13_o             =>ben_etc_shd.g_old_rec.etc_attribute13
489  ,p_etc_attribute14_o             =>ben_etc_shd.g_old_rec.etc_attribute14
490  ,p_etc_attribute15_o             =>ben_etc_shd.g_old_rec.etc_attribute15
491  ,p_etc_attribute16_o             =>ben_etc_shd.g_old_rec.etc_attribute16
492  ,p_etc_attribute17_o             =>ben_etc_shd.g_old_rec.etc_attribute17
493  ,p_etc_attribute18_o             =>ben_etc_shd.g_old_rec.etc_attribute18
494  ,p_etc_attribute19_o             =>ben_etc_shd.g_old_rec.etc_attribute19
495  ,p_etc_attribute20_o             =>ben_etc_shd.g_old_rec.etc_attribute20
496  ,p_etc_attribute21_o             =>ben_etc_shd.g_old_rec.etc_attribute21
497  ,p_etc_attribute22_o             =>ben_etc_shd.g_old_rec.etc_attribute22
498  ,p_etc_attribute23_o             =>ben_etc_shd.g_old_rec.etc_attribute23
499  ,p_etc_attribute24_o             =>ben_etc_shd.g_old_rec.etc_attribute24
500  ,p_etc_attribute25_o             =>ben_etc_shd.g_old_rec.etc_attribute25
501  ,p_etc_attribute26_o             =>ben_etc_shd.g_old_rec.etc_attribute26
502  ,p_etc_attribute27_o             =>ben_etc_shd.g_old_rec.etc_attribute27
503  ,p_etc_attribute28_o             =>ben_etc_shd.g_old_rec.etc_attribute28
504  ,p_etc_attribute29_o             =>ben_etc_shd.g_old_rec.etc_attribute29
505  ,p_etc_attribute30_o             =>ben_etc_shd.g_old_rec.etc_attribute30
506  ,p_object_version_number_o       =>ben_etc_shd.g_old_rec.object_version_number
507       );
508     --
509   exception
510     --
511     when hr_api.cannot_find_prog_unit then
512       --
513       hr_api.cannot_find_prog_unit_error
514         (p_module_name => 'ben_elig_ttl_cvg_vol_prte_f'
515         ,p_hook_type   => 'AU');
516       --
517   end;
518   --
519   -- End of API User Hook for post_update.
520   --
521   --
522   hr_utility.set_location(' Leaving:'||l_proc, 10);
523 End post_update;
524 --
525 -- ----------------------------------------------------------------------------
526 -- |-----------------------------< convert_defs >-----------------------------|
527 -- ----------------------------------------------------------------------------
528 -- {Start Of Comments}
529 --
530 -- Description:
531 --   The Convert_Defs procedure has one very important function:
532 --   It must return the record structure for the row with all system defaulted
533 --   values converted into its corresponding parameter value for update. When
534 --   we attempt to update a row through the Upd process , certain
535 --   parameters can be defaulted which enables flexibility in the calling of
536 --   the upd process (e.g. only attributes which need to be updated need to be
537 --   specified). For the upd process to determine which attributes
538 --   have NOT been specified we need to check if the parameter has a reserved
539 --   system default value. Therefore, for all parameters which have a
540 --   corresponding reserved system default mechanism specified we need to
541 --   check if a system default is being used. If a system default is being
542 --   used then we convert the defaulted value into its corresponding attribute
543 --   value held in the g_old_rec data structure.
544 --
545 -- Prerequisites:
546 --   This private function can only be called from the upd process.
547 --
548 -- In Parameters:
549 --   A Pl/Sql record structre.
550 --
551 -- Post Success:
552 --   The record structure will be returned with all system defaulted parameter
553 --   values converted into its current row attribute value.
554 --
555 -- Post Failure:
556 --   No direct error handling is required within this function. Any possible
557 --   errors within this procedure will be a PL/SQL value error due to conversion
558 --   of datatypes or data lengths.
559 --
560 -- Developer Implementation Notes:
561 --   None.
562 --
563 -- Access Status:
564 --   Internal Row Handler Use Only.
565 --
566 -- {End Of Comments}
567 -- ----------------------------------------------------------------------------
568 Procedure convert_defs(p_rec in out nocopy ben_etc_shd.g_rec_type) is
569 --
570   l_proc  varchar2(72) := g_package||'convert_defs';
571 --
572 Begin
573   --
574   hr_utility.set_location('Entering:'||l_proc, 5);
575   --
576   -- We must now examine each argument value in the
577   -- p_rec plsql record structure
578   -- to see if a system default is being used. If a system default
579   -- is being used then we must set to the 'current' argument value.
580   --
581   If (p_rec.business_group_id = hr_api.g_number) then
582     p_rec.business_group_id :=
583     ben_etc_shd.g_old_rec.business_group_id;
584   End If;
585   If (p_rec.excld_flag = hr_api.g_varchar2) then
586     p_rec.excld_flag :=
587     ben_etc_shd.g_old_rec.excld_flag;
588   End If;
589   If (p_rec.no_mn_cvg_vol_amt_apls_flag = hr_api.g_varchar2) then
590     p_rec.no_mn_cvg_vol_amt_apls_flag :=
591     ben_etc_shd.g_old_rec.no_mn_cvg_vol_amt_apls_flag;
592   End If;
593   If (p_rec.no_mx_cvg_vol_amt_apls_flag = hr_api.g_varchar2) then
594     p_rec.no_mx_cvg_vol_amt_apls_flag :=
595     ben_etc_shd.g_old_rec.no_mx_cvg_vol_amt_apls_flag;
596   End If;
597   If (p_rec.ordr_num = hr_api.g_number) then
598     p_rec.ordr_num :=
599     ben_etc_shd.g_old_rec.ordr_num;
600   End If;
601   If (p_rec.mn_cvg_vol_amt = hr_api.g_number) then
602     p_rec.mn_cvg_vol_amt :=
603     ben_etc_shd.g_old_rec.mn_cvg_vol_amt;
604   End If;
605   If (p_rec.mx_cvg_vol_amt = hr_api.g_number) then
606     p_rec.mx_cvg_vol_amt :=
607     ben_etc_shd.g_old_rec.mx_cvg_vol_amt;
608   End If;
609   If (p_rec.cvg_vol_det_cd = hr_api.g_varchar2) then
610     p_rec.cvg_vol_det_cd :=
611     ben_etc_shd.g_old_rec.cvg_vol_det_cd;
612   End If;
613   If (p_rec.cvg_vol_det_rl = hr_api.g_number) then
614     p_rec.cvg_vol_det_rl :=
615     ben_etc_shd.g_old_rec.cvg_vol_det_rl;
616   End If;
617   If (p_rec.eligy_prfl_id = hr_api.g_number) then
618     p_rec.eligy_prfl_id :=
619     ben_etc_shd.g_old_rec.eligy_prfl_id;
620   End If;
621   If (p_rec.etc_attribute_category = hr_api.g_varchar2) then
622     p_rec.etc_attribute_category :=
623     ben_etc_shd.g_old_rec.etc_attribute_category;
624   End If;
625   If (p_rec.etc_attribute1 = hr_api.g_varchar2) then
626     p_rec.etc_attribute1 :=
627     ben_etc_shd.g_old_rec.etc_attribute1;
628   End If;
629   If (p_rec.etc_attribute2 = hr_api.g_varchar2) then
630     p_rec.etc_attribute2 :=
631     ben_etc_shd.g_old_rec.etc_attribute2;
632   End If;
633   If (p_rec.etc_attribute3 = hr_api.g_varchar2) then
634     p_rec.etc_attribute3 :=
635     ben_etc_shd.g_old_rec.etc_attribute3;
636   End If;
637   If (p_rec.etc_attribute4 = hr_api.g_varchar2) then
638     p_rec.etc_attribute4 :=
639     ben_etc_shd.g_old_rec.etc_attribute4;
640   End If;
641   If (p_rec.etc_attribute5 = hr_api.g_varchar2) then
642     p_rec.etc_attribute5 :=
643     ben_etc_shd.g_old_rec.etc_attribute5;
644   End If;
645   If (p_rec.etc_attribute6 = hr_api.g_varchar2) then
646     p_rec.etc_attribute6 :=
647     ben_etc_shd.g_old_rec.etc_attribute6;
648   End If;
649   If (p_rec.etc_attribute7 = hr_api.g_varchar2) then
650     p_rec.etc_attribute7 :=
651     ben_etc_shd.g_old_rec.etc_attribute7;
652   End If;
653   If (p_rec.etc_attribute8 = hr_api.g_varchar2) then
654     p_rec.etc_attribute8 :=
655     ben_etc_shd.g_old_rec.etc_attribute8;
656   End If;
657   If (p_rec.etc_attribute9 = hr_api.g_varchar2) then
658     p_rec.etc_attribute9 :=
659     ben_etc_shd.g_old_rec.etc_attribute9;
660   End If;
661   If (p_rec.etc_attribute10 = hr_api.g_varchar2) then
662     p_rec.etc_attribute10 :=
663     ben_etc_shd.g_old_rec.etc_attribute10;
664   End If;
665   If (p_rec.etc_attribute11 = hr_api.g_varchar2) then
666     p_rec.etc_attribute11 :=
667     ben_etc_shd.g_old_rec.etc_attribute11;
668   End If;
669   If (p_rec.etc_attribute12 = hr_api.g_varchar2) then
670     p_rec.etc_attribute12 :=
671     ben_etc_shd.g_old_rec.etc_attribute12;
672   End If;
673   If (p_rec.etc_attribute13 = hr_api.g_varchar2) then
674     p_rec.etc_attribute13 :=
675     ben_etc_shd.g_old_rec.etc_attribute13;
676   End If;
677   If (p_rec.etc_attribute14 = hr_api.g_varchar2) then
678     p_rec.etc_attribute14 :=
679     ben_etc_shd.g_old_rec.etc_attribute14;
680   End If;
681   If (p_rec.etc_attribute15 = hr_api.g_varchar2) then
682     p_rec.etc_attribute15 :=
683     ben_etc_shd.g_old_rec.etc_attribute15;
684   End If;
685   If (p_rec.etc_attribute16 = hr_api.g_varchar2) then
686     p_rec.etc_attribute16 :=
687     ben_etc_shd.g_old_rec.etc_attribute16;
688   End If;
689   If (p_rec.etc_attribute17 = hr_api.g_varchar2) then
690     p_rec.etc_attribute17 :=
691     ben_etc_shd.g_old_rec.etc_attribute17;
692   End If;
693   If (p_rec.etc_attribute18 = hr_api.g_varchar2) then
694     p_rec.etc_attribute18 :=
695     ben_etc_shd.g_old_rec.etc_attribute18;
696   End If;
697   If (p_rec.etc_attribute19 = hr_api.g_varchar2) then
698     p_rec.etc_attribute19 :=
699     ben_etc_shd.g_old_rec.etc_attribute19;
700   End If;
701   If (p_rec.etc_attribute20 = hr_api.g_varchar2) then
702     p_rec.etc_attribute20 :=
703     ben_etc_shd.g_old_rec.etc_attribute20;
704   End If;
705   If (p_rec.etc_attribute21 = hr_api.g_varchar2) then
706     p_rec.etc_attribute21 :=
707     ben_etc_shd.g_old_rec.etc_attribute21;
708   End If;
709   If (p_rec.etc_attribute22 = hr_api.g_varchar2) then
710     p_rec.etc_attribute22 :=
711     ben_etc_shd.g_old_rec.etc_attribute22;
712   End If;
713   If (p_rec.etc_attribute23 = hr_api.g_varchar2) then
714     p_rec.etc_attribute23 :=
715     ben_etc_shd.g_old_rec.etc_attribute23;
716   End If;
717   If (p_rec.etc_attribute24 = hr_api.g_varchar2) then
718     p_rec.etc_attribute24 :=
719     ben_etc_shd.g_old_rec.etc_attribute24;
720   End If;
721   If (p_rec.etc_attribute25 = hr_api.g_varchar2) then
722     p_rec.etc_attribute25 :=
723     ben_etc_shd.g_old_rec.etc_attribute25;
724   End If;
725   If (p_rec.etc_attribute26 = hr_api.g_varchar2) then
726     p_rec.etc_attribute26 :=
727     ben_etc_shd.g_old_rec.etc_attribute26;
728   End If;
729   If (p_rec.etc_attribute27 = hr_api.g_varchar2) then
730     p_rec.etc_attribute27 :=
731     ben_etc_shd.g_old_rec.etc_attribute27;
732   End If;
733   If (p_rec.etc_attribute28 = hr_api.g_varchar2) then
734     p_rec.etc_attribute28 :=
735     ben_etc_shd.g_old_rec.etc_attribute28;
736   End If;
737   If (p_rec.etc_attribute29 = hr_api.g_varchar2) then
738     p_rec.etc_attribute29 :=
739     ben_etc_shd.g_old_rec.etc_attribute29;
740   End If;
741   If (p_rec.etc_attribute30 = hr_api.g_varchar2) then
742     p_rec.etc_attribute30 :=
743     ben_etc_shd.g_old_rec.etc_attribute30;
744   End If;
745 
746   --
747   hr_utility.set_location(' Leaving:'||l_proc, 10);
748 --
749 End convert_defs;
750 --
751 -- ----------------------------------------------------------------------------
752 -- |---------------------------------< upd >----------------------------------|
753 -- ----------------------------------------------------------------------------
754 Procedure upd
755   (
756   p_rec			in out nocopy 	ben_etc_shd.g_rec_type,
757   p_effective_date	in 	date,
758   p_datetrack_mode	in 	varchar2
759   ) is
760 --
761   l_proc			varchar2(72) := g_package||'upd';
762   l_validation_start_date	date;
763   l_validation_end_date		date;
764 --
765 Begin
766   hr_utility.set_location('Entering:'||l_proc, 5);
767   --
768   -- Ensure that the DateTrack update mode is valid
769   --
770   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
771   --
772   -- We must lock the row which we need to update.
773   --
774   ben_etc_shd.lck
775 	(p_effective_date	 => p_effective_date,
776       	 p_datetrack_mode	 => p_datetrack_mode,
777       	 p_elig_ttl_cvg_vol_prte_id => p_rec.elig_ttl_cvg_vol_prte_id,
778       	 p_object_version_number => p_rec.object_version_number,
779       	 p_validation_start_date => l_validation_start_date,
780       	 p_validation_end_date	 => l_validation_end_date);
781   --
782   -- 1. During an update system defaults are used to determine if
783   --    arguments have been defaulted or not. We must therefore
784   --    derive the full record structure values to be updated.
785   --
786   -- 2. Call the supporting update validate operations.
787   --
788   convert_defs(p_rec);
789   ben_etc_bus.update_validate
790 	(p_rec			 => p_rec,
791 	 p_effective_date	 => p_effective_date,
792 	 p_datetrack_mode  	 => p_datetrack_mode,
793 	 p_validation_start_date => l_validation_start_date,
794 	 p_validation_end_date	 => l_validation_end_date);
795   --
796   -- Call the supporting pre-update operation
797   --
798   pre_update
799 	(p_rec			 => p_rec,
800 	 p_effective_date	 => p_effective_date,
801 	 p_datetrack_mode	 => p_datetrack_mode,
802 	 p_validation_start_date => l_validation_start_date,
803 	 p_validation_end_date	 => l_validation_end_date);
804   --
805   -- Update the row.
806   --
807   update_dml
808 	(p_rec			 => p_rec,
809 	 p_effective_date	 => p_effective_date,
810 	 p_datetrack_mode	 => p_datetrack_mode,
811 	 p_validation_start_date => l_validation_start_date,
812 	 p_validation_end_date	 => l_validation_end_date);
813   --
814   -- Call the supporting post-update operation
815   --
816   post_update
817 	(p_rec			 => p_rec,
818 	 p_effective_date	 => p_effective_date,
819 	 p_datetrack_mode	 => p_datetrack_mode,
820 	 p_validation_start_date => l_validation_start_date,
821 	 p_validation_end_date	 => l_validation_end_date);
822 End upd;
823 --
824 -- ----------------------------------------------------------------------------
825 -- |---------------------------------< upd >----------------------------------|
826 -- ----------------------------------------------------------------------------
827 Procedure upd
828   (
829   p_elig_ttl_cvg_vol_prte_id     in number,
830   p_effective_start_date         out nocopy date,
831   p_effective_end_date           out nocopy date,
832   p_business_group_id            in number           default hr_api.g_number,
833   p_excld_flag                   in varchar2         default hr_api.g_varchar2,
834   p_no_mn_cvg_vol_amt_apls_flag  in varchar2         default hr_api.g_varchar2,
835   p_no_mx_cvg_vol_amt_apls_flag  in varchar2         default hr_api.g_varchar2,
836   p_ordr_num                     in number           default hr_api.g_number,
837   p_mn_cvg_vol_amt               in number           default hr_api.g_number,
838   p_mx_cvg_vol_amt               in number           default hr_api.g_number,
839   p_cvg_vol_det_cd               in varchar2         default hr_api.g_varchar2,
840   p_cvg_vol_det_rl               in number           default hr_api.g_number,
841   p_eligy_prfl_id                in number           default hr_api.g_number,
842   p_etc_attribute_category       in varchar2         default hr_api.g_varchar2,
843   p_etc_attribute1               in varchar2         default hr_api.g_varchar2,
844   p_etc_attribute2               in varchar2         default hr_api.g_varchar2,
845   p_etc_attribute3               in varchar2         default hr_api.g_varchar2,
846   p_etc_attribute4               in varchar2         default hr_api.g_varchar2,
847   p_etc_attribute5               in varchar2         default hr_api.g_varchar2,
848   p_etc_attribute6               in varchar2         default hr_api.g_varchar2,
849   p_etc_attribute7               in varchar2         default hr_api.g_varchar2,
850   p_etc_attribute8               in varchar2         default hr_api.g_varchar2,
851   p_etc_attribute9               in varchar2         default hr_api.g_varchar2,
852   p_etc_attribute10              in varchar2         default hr_api.g_varchar2,
853   p_etc_attribute11              in varchar2         default hr_api.g_varchar2,
854   p_etc_attribute12              in varchar2         default hr_api.g_varchar2,
855   p_etc_attribute13              in varchar2         default hr_api.g_varchar2,
856   p_etc_attribute14              in varchar2         default hr_api.g_varchar2,
857   p_etc_attribute15              in varchar2         default hr_api.g_varchar2,
858   p_etc_attribute16              in varchar2         default hr_api.g_varchar2,
859   p_etc_attribute17              in varchar2         default hr_api.g_varchar2,
860   p_etc_attribute18              in varchar2         default hr_api.g_varchar2,
861   p_etc_attribute19              in varchar2         default hr_api.g_varchar2,
862   p_etc_attribute20              in varchar2         default hr_api.g_varchar2,
863   p_etc_attribute21              in varchar2         default hr_api.g_varchar2,
864   p_etc_attribute22              in varchar2         default hr_api.g_varchar2,
865   p_etc_attribute23              in varchar2         default hr_api.g_varchar2,
866   p_etc_attribute24              in varchar2         default hr_api.g_varchar2,
867   p_etc_attribute25              in varchar2         default hr_api.g_varchar2,
868   p_etc_attribute26              in varchar2         default hr_api.g_varchar2,
869   p_etc_attribute27              in varchar2         default hr_api.g_varchar2,
870   p_etc_attribute28              in varchar2         default hr_api.g_varchar2,
871   p_etc_attribute29              in varchar2         default hr_api.g_varchar2,
872   p_etc_attribute30              in varchar2         default hr_api.g_varchar2,
873   p_object_version_number        in out nocopy number,
874   p_effective_date		 in date,
875   p_datetrack_mode		 in varchar2
876   ) is
877 --
878   l_rec		ben_etc_shd.g_rec_type;
879   l_proc	varchar2(72) := g_package||'upd';
880 --
881 Begin
882   hr_utility.set_location('Entering:'||l_proc, 5);
883   --
884   -- Call conversion function to turn arguments into the
885   -- l_rec structure.
886   --
887   l_rec :=
888   ben_etc_shd.convert_args
889   (
890   p_elig_ttl_cvg_vol_prte_id,
891   null,
892   null,
893   p_business_group_id,
894   p_excld_flag,
895   p_no_mn_cvg_vol_amt_apls_flag,
896   p_no_mx_cvg_vol_amt_apls_flag,
897   p_ordr_num,
898   p_mn_cvg_vol_amt,
899   p_mx_cvg_vol_amt,
900   p_cvg_vol_det_cd,
901   p_cvg_vol_det_rl,
902   p_eligy_prfl_id,
903   p_etc_attribute_category,
904   p_etc_attribute1,
905   p_etc_attribute2,
906   p_etc_attribute3,
907   p_etc_attribute4,
908   p_etc_attribute5,
909   p_etc_attribute6,
910   p_etc_attribute7,
911   p_etc_attribute8,
912   p_etc_attribute9,
913   p_etc_attribute10,
914   p_etc_attribute11,
915   p_etc_attribute12,
916   p_etc_attribute13,
917   p_etc_attribute14,
918   p_etc_attribute15,
919   p_etc_attribute16,
920   p_etc_attribute17,
921   p_etc_attribute18,
922   p_etc_attribute19,
923   p_etc_attribute20,
924   p_etc_attribute21,
925   p_etc_attribute22,
926   p_etc_attribute23,
927   p_etc_attribute24,
928   p_etc_attribute25,
929   p_etc_attribute26,
930   p_etc_attribute27,
931   p_etc_attribute28,
932   p_etc_attribute29,
933   p_etc_attribute30,
934   p_object_version_number
935   );
936   --
937   -- Having converted the arguments into the
938   -- plsql record structure we call the corresponding record
939   -- business process.
940   --
941   upd(l_rec, p_effective_date, p_datetrack_mode);
942   p_object_version_number       := l_rec.object_version_number;
943   p_effective_start_date        := l_rec.effective_start_date;
944   p_effective_end_date          := l_rec.effective_end_date;
945   --
946   --
947   hr_utility.set_location(' Leaving:'||l_proc, 10);
948 End upd;
949 --
950 end ben_etc_upd;