DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_VMR_UPD

Source


1 Package Body ben_vmr_upd as
2 /* $Header: bevmrrhi.pkb 120.1 2008/02/05 08:16:03 rtagarra noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_vmr_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_vmr_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_vrbl_mtchg_rt_f',
78 	   p_base_key_column	=> 'vrbl_mtchg_rt_id',
79 	   p_base_key_value	=> p_rec.vrbl_mtchg_rt_id);
80     --
81     ben_vmr_shd.g_api_dml := true;  -- Set the api dml status
82     --
83     -- Update the ben_vrbl_mtchg_rt_f Row
84     --
85     update  ben_vrbl_mtchg_rt_f
86     set
87         vrbl_mtchg_rt_id                = p_rec.vrbl_mtchg_rt_id,
88     no_mx_pct_of_py_num_flag        = p_rec.no_mx_pct_of_py_num_flag,
89     to_pct_val                      = p_rec.to_pct_val,
90     no_mx_amt_of_py_num_flag        = p_rec.no_mx_amt_of_py_num_flag,
91     mx_pct_of_py_num                = p_rec.mx_pct_of_py_num,
92     no_mx_mtch_amt_flag             = p_rec.no_mx_mtch_amt_flag,
93     ordr_num                        = p_rec.ordr_num,
94     pct_val                         = p_rec.pct_val,
95     mx_mtch_amt                     = p_rec.mx_mtch_amt,
96     mx_amt_of_py_num                = p_rec.mx_amt_of_py_num,
97     mn_mtch_amt                     = p_rec.mn_mtch_amt,
98     mtchg_rt_calc_rl                = p_rec.mtchg_rt_calc_rl,
99     cntnu_mtch_aftr_max_rl_flag     = p_rec.cntnu_mtch_aftr_max_rl_flag,
100     from_pct_val                    = p_rec.from_pct_val,
101     vrbl_rt_prfl_id                 = p_rec.vrbl_rt_prfl_id,
102     business_group_id               = p_rec.business_group_id,
103     vmr_attribute_category          = p_rec.vmr_attribute_category,
104     vmr_attribute1                  = p_rec.vmr_attribute1,
105     vmr_attribute2                  = p_rec.vmr_attribute2,
106     vmr_attribute3                  = p_rec.vmr_attribute3,
107     vmr_attribute4                  = p_rec.vmr_attribute4,
108     vmr_attribute5                  = p_rec.vmr_attribute5,
109     vmr_attribute6                  = p_rec.vmr_attribute6,
110     vmr_attribute7                  = p_rec.vmr_attribute7,
111     vmr_attribute8                  = p_rec.vmr_attribute8,
112     vmr_attribute9                  = p_rec.vmr_attribute9,
113     vmr_attribute10                 = p_rec.vmr_attribute10,
114     vmr_attribute11                 = p_rec.vmr_attribute11,
115     vmr_attribute12                 = p_rec.vmr_attribute12,
116     vmr_attribute13                 = p_rec.vmr_attribute13,
117     vmr_attribute14                 = p_rec.vmr_attribute14,
118     vmr_attribute15                 = p_rec.vmr_attribute15,
119     vmr_attribute16                 = p_rec.vmr_attribute16,
120     vmr_attribute17                 = p_rec.vmr_attribute17,
121     vmr_attribute18                 = p_rec.vmr_attribute18,
122     vmr_attribute19                 = p_rec.vmr_attribute19,
123     vmr_attribute20                 = p_rec.vmr_attribute20,
124     vmr_attribute21                 = p_rec.vmr_attribute21,
125     vmr_attribute22                 = p_rec.vmr_attribute22,
126     vmr_attribute23                 = p_rec.vmr_attribute23,
127     vmr_attribute24                 = p_rec.vmr_attribute24,
128     vmr_attribute25                 = p_rec.vmr_attribute25,
129     vmr_attribute26                 = p_rec.vmr_attribute26,
130     vmr_attribute27                 = p_rec.vmr_attribute27,
131     vmr_attribute28                 = p_rec.vmr_attribute28,
132     vmr_attribute29                 = p_rec.vmr_attribute29,
133     vmr_attribute30                 = p_rec.vmr_attribute30,
134     object_version_number           = p_rec.object_version_number
135     where   vrbl_mtchg_rt_id = p_rec.vrbl_mtchg_rt_id
136     and     effective_start_date = p_validation_start_date
137     and     effective_end_date   = p_validation_end_date;
138     --
139     ben_vmr_shd.g_api_dml := false;   -- Unset the api dml status
140     --
141     -- Set the effective start and end dates
142     --
143     p_rec.effective_start_date := p_validation_start_date;
144     p_rec.effective_end_date   := p_validation_end_date;
145   End If;
146 --
147 hr_utility.set_location(' Leaving:'||l_proc, 15);
148 Exception
149   When hr_api.check_integrity_violated Then
150     -- A check constraint has been violated
151     ben_vmr_shd.g_api_dml := false;   -- Unset the api dml status
152     ben_vmr_shd.constraint_error
153       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
154   When hr_api.unique_integrity_violated Then
155     -- Unique integrity has been violated
156     ben_vmr_shd.g_api_dml := false;   -- Unset the api dml status
157     ben_vmr_shd.constraint_error
158       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
159   When Others Then
160     ben_vmr_shd.g_api_dml := false;   -- Unset the api dml status
161     Raise;
162 End dt_update_dml;
163 --
164 -- ----------------------------------------------------------------------------
165 -- |------------------------------< update_dml >------------------------------|
166 -- ----------------------------------------------------------------------------
167 -- {Start Of Comments}
168 --
169 -- Description:
170 --   This procedure calls the dt_update_dml control logic which handles
171 --   the actual datetrack dml.
172 --
173 -- Prerequisites:
174 --   This is an internal private procedure which must be called from the upd
175 --   procedure.
176 --
177 -- In Parameters:
178 --   A Pl/Sql record structre.
179 --
180 -- Post Success:
181 --   Processing contines.
182 --
183 -- Post Failure:
184 --   No specific error handling is required within this procedure.
185 --
186 -- Developer Implementation Notes:
187 --   The update 'set' arguments list should be modified if any of your
188 --   attributes are not updateable.
189 --
190 -- Access Status:
191 --   Internal Row Handler Use Only.
192 --
193 -- {End Of Comments}
194 -- ----------------------------------------------------------------------------
195 Procedure update_dml
196 	(p_rec 			 in out nocopy ben_vmr_shd.g_rec_type,
197 	 p_effective_date	 in	date,
198 	 p_datetrack_mode	 in	varchar2,
199 	 p_validation_start_date in	date,
200 	 p_validation_end_date	 in	date) is
201 --
202   l_proc	varchar2(72) := g_package||'update_dml';
203 --
204 Begin
205   hr_utility.set_location('Entering:'||l_proc, 5);
206   --
207   dt_update_dml(p_rec			=> p_rec,
208 		p_effective_date	=> p_effective_date,
209 		p_datetrack_mode	=> p_datetrack_mode,
210        		p_validation_start_date	=> p_validation_start_date,
211 		p_validation_end_date	=> p_validation_end_date);
212   --
213   hr_utility.set_location(' Leaving:'||l_proc, 10);
214 End update_dml;
215 --
216 -- ----------------------------------------------------------------------------
217 -- |----------------------------< dt_pre_update >-----------------------------|
218 -- ----------------------------------------------------------------------------
219 -- {Start Of Comments}
220 --
221 -- Description:
222 --   The dt_pre_update procedure controls the execution
223 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
224 --   and UPDATE_CHANGE_INSERT only. The execution required is as
225 --   follows:
226 --
227 --   1) Providing the datetrack update mode is not 'CORRECTION'
228 --      then set the effective end date of the current row (this
229 --      will be the validation_start_date - 1).
230 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
231 --      corresponding delete_dml process to delete any future rows
232 --      where the effective_start_date is greater than or equal to
233 --	the validation_start_date.
234 --   3) Call the insert_dml process to insert the new updated row
235 --      details..
236 --
237 -- Prerequisites:
238 --   This is an internal procedure which is called from the
239 --   pre_update procedure.
240 --
241 -- In Parameters:
242 --
243 -- Post Success:
244 --   Processing continues.
245 --
246 -- Post Failure:
247 --   If an error has occurred, an error message and exception will be raised
248 --   but not handled.
249 --
250 -- Developer Implementation Notes:
251 --   This is an internal procedure which is required by Datetrack. Don't
252 --   remove or modify.
253 --
254 -- Access Status:
255 --   Internal Row Handler Use Only.
256 --
257 -- {End Of Comments}
258 -- ----------------------------------------------------------------------------
259 Procedure dt_pre_update
260 	(p_rec 			 in out nocopy ben_vmr_shd.g_rec_type,
261 	 p_effective_date	 in	date,
262 	 p_datetrack_mode	 in	varchar2,
263 	 p_validation_start_date in	date,
264 	 p_validation_end_date	 in	date) is
265 --
266   l_proc	         varchar2(72) := g_package||'dt_pre_update';
267   l_dummy_version_number number;
268 --
269 Begin
270   hr_utility.set_location('Entering:'||l_proc, 5);
271   If (p_datetrack_mode <> 'CORRECTION') then
272     hr_utility.set_location(l_proc, 10);
273     --
274     -- Update the current effective end date
275     --
276     ben_vmr_shd.upd_effective_end_date
277      (p_effective_date	       => p_effective_date,
278       p_base_key_value	       => p_rec.vrbl_mtchg_rt_id,
279       p_new_effective_end_date => (p_validation_start_date - 1),
280       p_validation_start_date  => p_validation_start_date,
281       p_validation_end_date    => p_validation_end_date,
282       p_object_version_number  => l_dummy_version_number);
283     --
284     If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
285       hr_utility.set_location(l_proc, 15);
286       --
287       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
288       -- delete any future rows
289       --
290       ben_vmr_del.delete_dml
291         (p_rec			 => p_rec,
292 	 p_effective_date	 => p_effective_date,
293 	 p_datetrack_mode	 => p_datetrack_mode,
294 	 p_validation_start_date => p_validation_start_date,
295 	 p_validation_end_date   => p_validation_end_date);
296     End If;
297     hr_utility.set_location(l_proc, 20);
298     --
299     -- We must now insert the updated row
300     --
301     ben_vmr_ins.insert_dml
302       (p_rec			=> p_rec,
303        p_effective_date		=> p_effective_date,
304        p_datetrack_mode		=> p_datetrack_mode,
305        p_validation_start_date	=> p_validation_start_date,
306        p_validation_end_date	=> p_validation_end_date);
307   End If;
308   hr_utility.set_location(' Leaving:'||l_proc, 20);
309 End dt_pre_update;
310 --
311 -- ----------------------------------------------------------------------------
312 -- |------------------------------< pre_update >------------------------------|
313 -- ----------------------------------------------------------------------------
314 -- {Start Of Comments}
315 --
316 -- Description:
317 --   This private procedure contains any processing which is required before
318 --   the update dml.
319 --
320 -- Prerequisites:
321 --   This is an internal procedure which is called from the upd procedure.
322 --
323 -- In Parameters:
324 --   A Pl/Sql record structre.
325 --
326 -- Post Success:
327 --   Processing continues.
328 --
329 -- Post Failure:
330 --   If an error has occurred, an error message and exception will be raised
331 --   but not handled.
332 --
333 -- Developer Implementation Notes:
334 --   Any pre-processing required before the update dml is issued should be
335 --   coded within this procedure. It is important to note that any 3rd party
336 --   maintenance should be reviewed before placing in this procedure. The call
337 --   to the dt_update_dml procedure should NOT be removed.
338 --
339 -- Access Status:
340 --   Internal Row Handler Use Only.
341 --
342 -- {End Of Comments}
343 -- ----------------------------------------------------------------------------
344 Procedure pre_update
345 	(p_rec 			 in out nocopy ben_vmr_shd.g_rec_type,
346 	 p_effective_date	 in	date,
347 	 p_datetrack_mode	 in	varchar2,
348 	 p_validation_start_date in	date,
349 	 p_validation_end_date	 in	date) is
350 --
351   l_proc	varchar2(72) := g_package||'pre_update';
352 --
353 Begin
354   hr_utility.set_location('Entering:'||l_proc, 5);
355   --
356   --
357   --
358   dt_pre_update
359     (p_rec 		     => p_rec,
360      p_effective_date	     => p_effective_date,
361      p_datetrack_mode	     => p_datetrack_mode,
362      p_validation_start_date => p_validation_start_date,
363      p_validation_end_date   => p_validation_end_date);
364   --
365   hr_utility.set_location(' Leaving:'||l_proc, 10);
366 End pre_update;
367 --
368 -- ----------------------------------------------------------------------------
369 -- |-----------------------------< post_update >------------------------------|
370 -- ----------------------------------------------------------------------------
371 -- {Start Of Comments}
372 --
373 -- Description:
374 --   This private procedure contains any processing which is required after the
375 --   update dml.
376 --
377 -- Prerequisites:
378 --   This is an internal procedure which is called from the upd procedure.
379 --
380 -- In Parameters:
381 --   A Pl/Sql record structre.
382 --
383 -- Post Success:
384 --   Processing continues.
385 --
386 -- Post Failure:
387 --   If an error has occurred, an error message and exception will be raised
388 --   but not handled.
389 --
390 -- Developer Implementation Notes:
391 --   Any post-processing required after the update dml is issued should be
392 --   coded within this procedure. It is important to note that any 3rd party
393 --   maintenance should be reviewed before placing in this procedure.
394 --
395 -- Access Status:
396 --   Internal Row Handler Use Only.
397 --
398 -- {End Of Comments}
399 -- ----------------------------------------------------------------------------
400 Procedure post_update
401 	(p_rec 			 in ben_vmr_shd.g_rec_type,
402 	 p_effective_date	 in date,
403 	 p_datetrack_mode	 in varchar2,
404 	 p_validation_start_date in date,
405 	 p_validation_end_date	 in date) is
406 --
407   l_proc	varchar2(72) := g_package||'post_update';
408 --
409 Begin
410   hr_utility.set_location('Entering:'||l_proc, 5);
411 --
412   --
413   -- Start of API User Hook for post_update.
414   --
415   begin
416     --
417     ben_vmr_rku.after_update
418       (
419   p_vrbl_mtchg_rt_id              =>p_rec.vrbl_mtchg_rt_id
420  ,p_effective_end_date            =>p_rec.effective_end_date
421  ,p_effective_start_date          =>p_rec.effective_start_date
422  ,p_no_mx_pct_of_py_num_flag      =>p_rec.no_mx_pct_of_py_num_flag
423  ,p_to_pct_val                    =>p_rec.to_pct_val
424  ,p_no_mx_amt_of_py_num_flag      =>p_rec.no_mx_amt_of_py_num_flag
425  ,p_mx_pct_of_py_num              =>p_rec.mx_pct_of_py_num
426  ,p_no_mx_mtch_amt_flag           =>p_rec.no_mx_mtch_amt_flag
427  ,p_ordr_num                      =>p_rec.ordr_num
428  ,p_pct_val                       =>p_rec.pct_val
429  ,p_mx_mtch_amt                   =>p_rec.mx_mtch_amt
430  ,p_mx_amt_of_py_num              =>p_rec.mx_amt_of_py_num
431  ,p_mn_mtch_amt                   =>p_rec.mn_mtch_amt
432  ,p_mtchg_rt_calc_rl              =>p_rec.mtchg_rt_calc_rl
433  ,p_cntnu_mtch_aftr_max_rl_flag   =>p_rec.cntnu_mtch_aftr_max_rl_flag
434  ,p_from_pct_val                  =>p_rec.from_pct_val
435  ,p_vrbl_rt_prfl_id               =>p_rec.vrbl_rt_prfl_id
436  ,p_business_group_id             =>p_rec.business_group_id
437  ,p_vmr_attribute_category        =>p_rec.vmr_attribute_category
438  ,p_vmr_attribute1                =>p_rec.vmr_attribute1
439  ,p_vmr_attribute2                =>p_rec.vmr_attribute2
440  ,p_vmr_attribute3                =>p_rec.vmr_attribute3
441  ,p_vmr_attribute4                =>p_rec.vmr_attribute4
442  ,p_vmr_attribute5                =>p_rec.vmr_attribute5
443  ,p_vmr_attribute6                =>p_rec.vmr_attribute6
444  ,p_vmr_attribute7                =>p_rec.vmr_attribute7
445  ,p_vmr_attribute8                =>p_rec.vmr_attribute8
446  ,p_vmr_attribute9                =>p_rec.vmr_attribute9
447  ,p_vmr_attribute10               =>p_rec.vmr_attribute10
448  ,p_vmr_attribute11               =>p_rec.vmr_attribute11
449  ,p_vmr_attribute12               =>p_rec.vmr_attribute12
450  ,p_vmr_attribute13               =>p_rec.vmr_attribute13
451  ,p_vmr_attribute14               =>p_rec.vmr_attribute14
452  ,p_vmr_attribute15               =>p_rec.vmr_attribute15
453  ,p_vmr_attribute16               =>p_rec.vmr_attribute16
454  ,p_vmr_attribute17               =>p_rec.vmr_attribute17
455  ,p_vmr_attribute18               =>p_rec.vmr_attribute18
456  ,p_vmr_attribute19               =>p_rec.vmr_attribute19
457  ,p_vmr_attribute20               =>p_rec.vmr_attribute20
458  ,p_vmr_attribute21               =>p_rec.vmr_attribute21
459  ,p_vmr_attribute22               =>p_rec.vmr_attribute22
460  ,p_vmr_attribute23               =>p_rec.vmr_attribute23
461  ,p_vmr_attribute24               =>p_rec.vmr_attribute24
462  ,p_vmr_attribute25               =>p_rec.vmr_attribute25
463  ,p_vmr_attribute26               =>p_rec.vmr_attribute26
464  ,p_vmr_attribute27               =>p_rec.vmr_attribute27
465  ,p_vmr_attribute28               =>p_rec.vmr_attribute28
466  ,p_vmr_attribute29               =>p_rec.vmr_attribute29
467  ,p_vmr_attribute30               =>p_rec.vmr_attribute30
468  ,p_object_version_number         =>p_rec.object_version_number
469  ,p_effective_date                =>p_effective_date
470  ,p_datetrack_mode                =>p_datetrack_mode
471  ,p_validation_start_date         =>p_validation_start_date
472  ,p_validation_end_date           =>p_validation_end_date
473  ,p_effective_end_date_o          =>ben_vmr_shd.g_old_rec.effective_end_date
474  ,p_effective_start_date_o        =>ben_vmr_shd.g_old_rec.effective_start_date
475  ,p_no_mx_pct_of_py_num_flag_o    =>ben_vmr_shd.g_old_rec.no_mx_pct_of_py_num_flag
476  ,p_to_pct_val_o                  =>ben_vmr_shd.g_old_rec.to_pct_val
477  ,p_no_mx_amt_of_py_num_flag_o    =>ben_vmr_shd.g_old_rec.no_mx_amt_of_py_num_flag
478  ,p_mx_pct_of_py_num_o            =>ben_vmr_shd.g_old_rec.mx_pct_of_py_num
479  ,p_no_mx_mtch_amt_flag_o         =>ben_vmr_shd.g_old_rec.no_mx_mtch_amt_flag
480  ,p_ordr_num_o                    =>ben_vmr_shd.g_old_rec.ordr_num
481  ,p_pct_val_o                     =>ben_vmr_shd.g_old_rec.pct_val
482  ,p_mx_mtch_amt_o                 =>ben_vmr_shd.g_old_rec.mx_mtch_amt
483  ,p_mx_amt_of_py_num_o            =>ben_vmr_shd.g_old_rec.mx_amt_of_py_num
484  ,p_mn_mtch_amt_o                 =>ben_vmr_shd.g_old_rec.mn_mtch_amt
485  ,p_mtchg_rt_calc_rl_o            =>ben_vmr_shd.g_old_rec.mtchg_rt_calc_rl
486 ,p_cntnu_mtch_aftr_max_rl_fla_o =>ben_vmr_shd.g_old_rec.cntnu_mtch_aftr_max_rl_flag
487  ,p_from_pct_val_o                =>ben_vmr_shd.g_old_rec.from_pct_val
488  ,p_vrbl_rt_prfl_id_o             =>ben_vmr_shd.g_old_rec.vrbl_rt_prfl_id
489  ,p_business_group_id_o           =>ben_vmr_shd.g_old_rec.business_group_id
490  ,p_vmr_attribute_category_o      =>ben_vmr_shd.g_old_rec.vmr_attribute_category
491  ,p_vmr_attribute1_o              =>ben_vmr_shd.g_old_rec.vmr_attribute1
492  ,p_vmr_attribute2_o              =>ben_vmr_shd.g_old_rec.vmr_attribute2
493  ,p_vmr_attribute3_o              =>ben_vmr_shd.g_old_rec.vmr_attribute3
494  ,p_vmr_attribute4_o              =>ben_vmr_shd.g_old_rec.vmr_attribute4
495  ,p_vmr_attribute5_o              =>ben_vmr_shd.g_old_rec.vmr_attribute5
496  ,p_vmr_attribute6_o              =>ben_vmr_shd.g_old_rec.vmr_attribute6
497  ,p_vmr_attribute7_o              =>ben_vmr_shd.g_old_rec.vmr_attribute7
498  ,p_vmr_attribute8_o              =>ben_vmr_shd.g_old_rec.vmr_attribute8
499  ,p_vmr_attribute9_o              =>ben_vmr_shd.g_old_rec.vmr_attribute9
500  ,p_vmr_attribute10_o             =>ben_vmr_shd.g_old_rec.vmr_attribute10
501  ,p_vmr_attribute11_o             =>ben_vmr_shd.g_old_rec.vmr_attribute11
502  ,p_vmr_attribute12_o             =>ben_vmr_shd.g_old_rec.vmr_attribute12
503  ,p_vmr_attribute13_o             =>ben_vmr_shd.g_old_rec.vmr_attribute13
504  ,p_vmr_attribute14_o             =>ben_vmr_shd.g_old_rec.vmr_attribute14
505  ,p_vmr_attribute15_o             =>ben_vmr_shd.g_old_rec.vmr_attribute15
506  ,p_vmr_attribute16_o             =>ben_vmr_shd.g_old_rec.vmr_attribute16
507  ,p_vmr_attribute17_o             =>ben_vmr_shd.g_old_rec.vmr_attribute17
508  ,p_vmr_attribute18_o             =>ben_vmr_shd.g_old_rec.vmr_attribute18
509  ,p_vmr_attribute19_o             =>ben_vmr_shd.g_old_rec.vmr_attribute19
510  ,p_vmr_attribute20_o             =>ben_vmr_shd.g_old_rec.vmr_attribute20
511  ,p_vmr_attribute21_o             =>ben_vmr_shd.g_old_rec.vmr_attribute21
512  ,p_vmr_attribute22_o             =>ben_vmr_shd.g_old_rec.vmr_attribute22
513  ,p_vmr_attribute23_o             =>ben_vmr_shd.g_old_rec.vmr_attribute23
514  ,p_vmr_attribute24_o             =>ben_vmr_shd.g_old_rec.vmr_attribute24
515  ,p_vmr_attribute25_o             =>ben_vmr_shd.g_old_rec.vmr_attribute25
516  ,p_vmr_attribute26_o             =>ben_vmr_shd.g_old_rec.vmr_attribute26
517  ,p_vmr_attribute27_o             =>ben_vmr_shd.g_old_rec.vmr_attribute27
518  ,p_vmr_attribute28_o             =>ben_vmr_shd.g_old_rec.vmr_attribute28
519  ,p_vmr_attribute29_o             =>ben_vmr_shd.g_old_rec.vmr_attribute29
520  ,p_vmr_attribute30_o             =>ben_vmr_shd.g_old_rec.vmr_attribute30
521  ,p_object_version_number_o       =>ben_vmr_shd.g_old_rec.object_version_number
522       );
523     --
524   exception
525     --
526     when hr_api.cannot_find_prog_unit then
527       --
528       hr_api.cannot_find_prog_unit_error
529         (p_module_name => 'ben_vrbl_mtchg_rt_f'
530         ,p_hook_type   => 'AU');
531       --
532   end;
533   --
534   -- End of API User Hook for post_update.
535   --
536   --
537   hr_utility.set_location(' Leaving:'||l_proc, 10);
538 End post_update;
539 --
540 -- ----------------------------------------------------------------------------
541 -- |-----------------------------< convert_defs >-----------------------------|
542 -- ----------------------------------------------------------------------------
543 -- {Start Of Comments}
544 --
545 -- Description:
546 --   The Convert_Defs procedure has one very important function:
547 --   It must return the record structure for the row with all system defaulted
548 --   values converted into its corresponding parameter value for update. When
549 --   we attempt to update a row through the Upd process , certain
550 --   parameters can be defaulted which enables flexibility in the calling of
551 --   the upd process (e.g. only attributes which need to be updated need to be
552 --   specified). For the upd process to determine which attributes
553 --   have NOT been specified we need to check if the parameter has a reserved
554 --   system default value. Therefore, for all parameters which have a
555 --   corresponding reserved system default mechanism specified we need to
556 --   check if a system default is being used. If a system default is being
557 --   used then we convert the defaulted value into its corresponding attribute
558 --   value held in the g_old_rec data structure.
559 --
560 -- Prerequisites:
561 --   This private function can only be called from the upd process.
562 --
563 -- In Parameters:
564 --   A Pl/Sql record structre.
565 --
566 -- Post Success:
567 --   The record structure will be returned with all system defaulted parameter
568 --   values converted into its current row attribute value.
569 --
570 -- Post Failure:
571 --   No direct error handling is required within this function. Any possible
572 --   errors within this procedure will be a PL/SQL value error due to conversion
573 --   of datatypes or data lengths.
574 --
575 -- Developer Implementation Notes:
576 --   None.
577 --
578 -- Access Status:
579 --   Internal Row Handler Use Only.
580 --
581 -- {End Of Comments}
582 -- ----------------------------------------------------------------------------
583 Procedure convert_defs(p_rec in out nocopy ben_vmr_shd.g_rec_type) is
584 --
585   l_proc  varchar2(72) := g_package||'convert_defs';
586 --
587 Begin
588   --
589   hr_utility.set_location('Entering:'||l_proc, 5);
590   --
591   -- We must now examine each argument value in the
592   -- p_rec plsql record structure
593   -- to see if a system default is being used. If a system default
594   -- is being used then we must set to the 'current' argument value.
595   --
596   If (p_rec.no_mx_pct_of_py_num_flag = hr_api.g_varchar2) then
597     p_rec.no_mx_pct_of_py_num_flag :=
598     ben_vmr_shd.g_old_rec.no_mx_pct_of_py_num_flag;
599   End If;
600   If (p_rec.to_pct_val = hr_api.g_number) then
601     p_rec.to_pct_val :=
602     ben_vmr_shd.g_old_rec.to_pct_val;
603   End If;
604   If (p_rec.no_mx_amt_of_py_num_flag = hr_api.g_varchar2) then
605     p_rec.no_mx_amt_of_py_num_flag :=
606     ben_vmr_shd.g_old_rec.no_mx_amt_of_py_num_flag;
607   End If;
608   If (p_rec.mx_pct_of_py_num = hr_api.g_number) then
609     p_rec.mx_pct_of_py_num :=
610     ben_vmr_shd.g_old_rec.mx_pct_of_py_num;
611   End If;
612   If (p_rec.no_mx_mtch_amt_flag = hr_api.g_varchar2) then
613     p_rec.no_mx_mtch_amt_flag :=
614     ben_vmr_shd.g_old_rec.no_mx_mtch_amt_flag;
615   End If;
616   If (p_rec.ordr_num = hr_api.g_number) then
617     p_rec.ordr_num :=
618     ben_vmr_shd.g_old_rec.ordr_num;
619   End If;
620   If (p_rec.pct_val = hr_api.g_number) then
621     p_rec.pct_val :=
622     ben_vmr_shd.g_old_rec.pct_val;
623   End If;
624   If (p_rec.mx_mtch_amt = hr_api.g_number) then
625     p_rec.mx_mtch_amt :=
626     ben_vmr_shd.g_old_rec.mx_mtch_amt;
627   End If;
628   If (p_rec.mx_amt_of_py_num = hr_api.g_number) then
629     p_rec.mx_amt_of_py_num :=
630     ben_vmr_shd.g_old_rec.mx_amt_of_py_num;
631   End If;
632   If (p_rec.mn_mtch_amt = hr_api.g_number) then
633     p_rec.mn_mtch_amt :=
634     ben_vmr_shd.g_old_rec.mn_mtch_amt;
635   End If;
636   If (p_rec.mtchg_rt_calc_rl = hr_api.g_number) then
637     p_rec.mtchg_rt_calc_rl :=
638     ben_vmr_shd.g_old_rec.mtchg_rt_calc_rl;
639   End If;
640   If (p_rec.cntnu_mtch_aftr_max_rl_flag = hr_api.g_varchar2) then
641     p_rec.cntnu_mtch_aftr_max_rl_flag :=
642     ben_vmr_shd.g_old_rec.cntnu_mtch_aftr_max_rl_flag;
643   End If;
644   If (p_rec.from_pct_val = hr_api.g_number) then
645     p_rec.from_pct_val :=
646     ben_vmr_shd.g_old_rec.from_pct_val;
647   End If;
648   If (p_rec.vrbl_rt_prfl_id = hr_api.g_number) then
649     p_rec.vrbl_rt_prfl_id :=
650     ben_vmr_shd.g_old_rec.vrbl_rt_prfl_id;
651   End If;
652   If (p_rec.business_group_id = hr_api.g_number) then
653     p_rec.business_group_id :=
654     ben_vmr_shd.g_old_rec.business_group_id;
655   End If;
656   If (p_rec.vmr_attribute_category = hr_api.g_varchar2) then
657     p_rec.vmr_attribute_category :=
658     ben_vmr_shd.g_old_rec.vmr_attribute_category;
659   End If;
660   If (p_rec.vmr_attribute1 = hr_api.g_varchar2) then
661     p_rec.vmr_attribute1 :=
662     ben_vmr_shd.g_old_rec.vmr_attribute1;
663   End If;
664   If (p_rec.vmr_attribute2 = hr_api.g_varchar2) then
665     p_rec.vmr_attribute2 :=
666     ben_vmr_shd.g_old_rec.vmr_attribute2;
667   End If;
668   If (p_rec.vmr_attribute3 = hr_api.g_varchar2) then
669     p_rec.vmr_attribute3 :=
670     ben_vmr_shd.g_old_rec.vmr_attribute3;
671   End If;
672   If (p_rec.vmr_attribute4 = hr_api.g_varchar2) then
673     p_rec.vmr_attribute4 :=
674     ben_vmr_shd.g_old_rec.vmr_attribute4;
675   End If;
676   If (p_rec.vmr_attribute5 = hr_api.g_varchar2) then
677     p_rec.vmr_attribute5 :=
678     ben_vmr_shd.g_old_rec.vmr_attribute5;
679   End If;
680   If (p_rec.vmr_attribute6 = hr_api.g_varchar2) then
681     p_rec.vmr_attribute6 :=
682     ben_vmr_shd.g_old_rec.vmr_attribute6;
683   End If;
684   If (p_rec.vmr_attribute7 = hr_api.g_varchar2) then
685     p_rec.vmr_attribute7 :=
686     ben_vmr_shd.g_old_rec.vmr_attribute7;
687   End If;
688   If (p_rec.vmr_attribute8 = hr_api.g_varchar2) then
689     p_rec.vmr_attribute8 :=
690     ben_vmr_shd.g_old_rec.vmr_attribute8;
691   End If;
692   If (p_rec.vmr_attribute9 = hr_api.g_varchar2) then
693     p_rec.vmr_attribute9 :=
694     ben_vmr_shd.g_old_rec.vmr_attribute9;
695   End If;
696   If (p_rec.vmr_attribute10 = hr_api.g_varchar2) then
697     p_rec.vmr_attribute10 :=
698     ben_vmr_shd.g_old_rec.vmr_attribute10;
699   End If;
700   If (p_rec.vmr_attribute11 = hr_api.g_varchar2) then
701     p_rec.vmr_attribute11 :=
702     ben_vmr_shd.g_old_rec.vmr_attribute11;
703   End If;
704   If (p_rec.vmr_attribute12 = hr_api.g_varchar2) then
705     p_rec.vmr_attribute12 :=
706     ben_vmr_shd.g_old_rec.vmr_attribute12;
707   End If;
708   If (p_rec.vmr_attribute13 = hr_api.g_varchar2) then
709     p_rec.vmr_attribute13 :=
710     ben_vmr_shd.g_old_rec.vmr_attribute13;
711   End If;
712   If (p_rec.vmr_attribute14 = hr_api.g_varchar2) then
713     p_rec.vmr_attribute14 :=
714     ben_vmr_shd.g_old_rec.vmr_attribute14;
715   End If;
716   If (p_rec.vmr_attribute15 = hr_api.g_varchar2) then
717     p_rec.vmr_attribute15 :=
718     ben_vmr_shd.g_old_rec.vmr_attribute15;
719   End If;
720   If (p_rec.vmr_attribute16 = hr_api.g_varchar2) then
721     p_rec.vmr_attribute16 :=
722     ben_vmr_shd.g_old_rec.vmr_attribute16;
723   End If;
724   If (p_rec.vmr_attribute17 = hr_api.g_varchar2) then
725     p_rec.vmr_attribute17 :=
726     ben_vmr_shd.g_old_rec.vmr_attribute17;
727   End If;
728   If (p_rec.vmr_attribute18 = hr_api.g_varchar2) then
729     p_rec.vmr_attribute18 :=
730     ben_vmr_shd.g_old_rec.vmr_attribute18;
731   End If;
732   If (p_rec.vmr_attribute19 = hr_api.g_varchar2) then
733     p_rec.vmr_attribute19 :=
734     ben_vmr_shd.g_old_rec.vmr_attribute19;
735   End If;
736   If (p_rec.vmr_attribute20 = hr_api.g_varchar2) then
737     p_rec.vmr_attribute20 :=
738     ben_vmr_shd.g_old_rec.vmr_attribute20;
739   End If;
740   If (p_rec.vmr_attribute21 = hr_api.g_varchar2) then
741     p_rec.vmr_attribute21 :=
742     ben_vmr_shd.g_old_rec.vmr_attribute21;
743   End If;
744   If (p_rec.vmr_attribute22 = hr_api.g_varchar2) then
745     p_rec.vmr_attribute22 :=
746     ben_vmr_shd.g_old_rec.vmr_attribute22;
747   End If;
748   If (p_rec.vmr_attribute23 = hr_api.g_varchar2) then
749     p_rec.vmr_attribute23 :=
750     ben_vmr_shd.g_old_rec.vmr_attribute23;
751   End If;
752   If (p_rec.vmr_attribute24 = hr_api.g_varchar2) then
753     p_rec.vmr_attribute24 :=
754     ben_vmr_shd.g_old_rec.vmr_attribute24;
755   End If;
756   If (p_rec.vmr_attribute25 = hr_api.g_varchar2) then
757     p_rec.vmr_attribute25 :=
758     ben_vmr_shd.g_old_rec.vmr_attribute25;
759   End If;
760   If (p_rec.vmr_attribute26 = hr_api.g_varchar2) then
761     p_rec.vmr_attribute26 :=
762     ben_vmr_shd.g_old_rec.vmr_attribute26;
763   End If;
764   If (p_rec.vmr_attribute27 = hr_api.g_varchar2) then
765     p_rec.vmr_attribute27 :=
766     ben_vmr_shd.g_old_rec.vmr_attribute27;
767   End If;
768   If (p_rec.vmr_attribute28 = hr_api.g_varchar2) then
769     p_rec.vmr_attribute28 :=
770     ben_vmr_shd.g_old_rec.vmr_attribute28;
771   End If;
772   If (p_rec.vmr_attribute29 = hr_api.g_varchar2) then
773     p_rec.vmr_attribute29 :=
774     ben_vmr_shd.g_old_rec.vmr_attribute29;
775   End If;
776   If (p_rec.vmr_attribute30 = hr_api.g_varchar2) then
777     p_rec.vmr_attribute30 :=
778     ben_vmr_shd.g_old_rec.vmr_attribute30;
779   End If;
780 
781   --
782   hr_utility.set_location(' Leaving:'||l_proc, 10);
783 --
784 End convert_defs;
785 --
786 -- ----------------------------------------------------------------------------
787 -- |---------------------------------< upd >----------------------------------|
788 -- ----------------------------------------------------------------------------
789 Procedure upd
790   (
791   p_rec			in out nocopy 	ben_vmr_shd.g_rec_type,
792   p_effective_date	in 	date,
793   p_datetrack_mode	in 	varchar2
794   ) is
795 --
796   l_proc			varchar2(72) := g_package||'upd';
797   l_validation_start_date	date;
798   l_validation_end_date		date;
799 --
800 Begin
801   hr_utility.set_location('Entering:'||l_proc, 5);
802   --
803   -- Ensure that the DateTrack update mode is valid
804   --
805   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
806   --
807   -- We must lock the row which we need to update.
808   --
809   ben_vmr_shd.lck
810 	(p_effective_date	 => p_effective_date,
811       	 p_datetrack_mode	 => p_datetrack_mode,
812       	 p_vrbl_mtchg_rt_id	 => p_rec.vrbl_mtchg_rt_id,
813       	 p_object_version_number => p_rec.object_version_number,
814       	 p_validation_start_date => l_validation_start_date,
815       	 p_validation_end_date	 => l_validation_end_date);
816   --
817   -- 1. During an update system defaults are used to determine if
818   --    arguments have been defaulted or not. We must therefore
819   --    derive the full record structure values to be updated.
820   --
821   -- 2. Call the supporting update validate operations.
822   --
823   convert_defs(p_rec);
824   ben_vmr_bus.update_validate
825 	(p_rec			 => p_rec,
826 	 p_effective_date	 => p_effective_date,
827 	 p_datetrack_mode  	 => p_datetrack_mode,
828 	 p_validation_start_date => l_validation_start_date,
829 	 p_validation_end_date	 => l_validation_end_date);
830   --
831   -- Call the supporting pre-update operation
832   --
833   pre_update
834 	(p_rec			 => p_rec,
835 	 p_effective_date	 => p_effective_date,
836 	 p_datetrack_mode	 => p_datetrack_mode,
837 	 p_validation_start_date => l_validation_start_date,
838 	 p_validation_end_date	 => l_validation_end_date);
839   --
840   -- Update the row.
841   --
842   update_dml
843 	(p_rec			 => p_rec,
844 	 p_effective_date	 => p_effective_date,
845 	 p_datetrack_mode	 => p_datetrack_mode,
846 	 p_validation_start_date => l_validation_start_date,
847 	 p_validation_end_date	 => l_validation_end_date);
848   --
849   -- Call the supporting post-update operation
850   --
851   post_update
852 	(p_rec			 => p_rec,
853 	 p_effective_date	 => p_effective_date,
854 	 p_datetrack_mode	 => p_datetrack_mode,
855 	 p_validation_start_date => l_validation_start_date,
856 	 p_validation_end_date	 => l_validation_end_date);
857 End upd;
858 --
859 -- ----------------------------------------------------------------------------
860 -- |---------------------------------< upd >----------------------------------|
861 -- ----------------------------------------------------------------------------
862 Procedure upd
863   (
864   p_vrbl_mtchg_rt_id             in number,
865   p_effective_end_date           out nocopy date,
866   p_effective_start_date         out nocopy date,
867   p_no_mx_pct_of_py_num_flag     in varchar2         default hr_api.g_varchar2,
868   p_to_pct_val                   in number           default hr_api.g_number,
869   p_no_mx_amt_of_py_num_flag     in varchar2         default hr_api.g_varchar2,
870   p_mx_pct_of_py_num             in number           default hr_api.g_number,
871   p_no_mx_mtch_amt_flag          in varchar2         default hr_api.g_varchar2,
872   p_ordr_num                     in number           default hr_api.g_number,
873   p_pct_val                      in number           default hr_api.g_number,
874   p_mx_mtch_amt                  in number           default hr_api.g_number,
875   p_mx_amt_of_py_num             in number           default hr_api.g_number,
876   p_mn_mtch_amt                  in number           default hr_api.g_number,
877   p_mtchg_rt_calc_rl             in number           default hr_api.g_number,
878   p_cntnu_mtch_aftr_max_rl_flag  in varchar2         default hr_api.g_varchar2,
879   p_from_pct_val                 in number           default hr_api.g_number,
880   p_vrbl_rt_prfl_id              in number           default hr_api.g_number,
881   p_business_group_id            in number           default hr_api.g_number,
882   p_vmr_attribute_category       in varchar2         default hr_api.g_varchar2,
883   p_vmr_attribute1               in varchar2         default hr_api.g_varchar2,
884   p_vmr_attribute2               in varchar2         default hr_api.g_varchar2,
885   p_vmr_attribute3               in varchar2         default hr_api.g_varchar2,
886   p_vmr_attribute4               in varchar2         default hr_api.g_varchar2,
887   p_vmr_attribute5               in varchar2         default hr_api.g_varchar2,
888   p_vmr_attribute6               in varchar2         default hr_api.g_varchar2,
889   p_vmr_attribute7               in varchar2         default hr_api.g_varchar2,
890   p_vmr_attribute8               in varchar2         default hr_api.g_varchar2,
891   p_vmr_attribute9               in varchar2         default hr_api.g_varchar2,
892   p_vmr_attribute10              in varchar2         default hr_api.g_varchar2,
893   p_vmr_attribute11              in varchar2         default hr_api.g_varchar2,
894   p_vmr_attribute12              in varchar2         default hr_api.g_varchar2,
895   p_vmr_attribute13              in varchar2         default hr_api.g_varchar2,
896   p_vmr_attribute14              in varchar2         default hr_api.g_varchar2,
897   p_vmr_attribute15              in varchar2         default hr_api.g_varchar2,
898   p_vmr_attribute16              in varchar2         default hr_api.g_varchar2,
899   p_vmr_attribute17              in varchar2         default hr_api.g_varchar2,
900   p_vmr_attribute18              in varchar2         default hr_api.g_varchar2,
901   p_vmr_attribute19              in varchar2         default hr_api.g_varchar2,
902   p_vmr_attribute20              in varchar2         default hr_api.g_varchar2,
903   p_vmr_attribute21              in varchar2         default hr_api.g_varchar2,
904   p_vmr_attribute22              in varchar2         default hr_api.g_varchar2,
905   p_vmr_attribute23              in varchar2         default hr_api.g_varchar2,
906   p_vmr_attribute24              in varchar2         default hr_api.g_varchar2,
907   p_vmr_attribute25              in varchar2         default hr_api.g_varchar2,
908   p_vmr_attribute26              in varchar2         default hr_api.g_varchar2,
909   p_vmr_attribute27              in varchar2         default hr_api.g_varchar2,
910   p_vmr_attribute28              in varchar2         default hr_api.g_varchar2,
911   p_vmr_attribute29              in varchar2         default hr_api.g_varchar2,
912   p_vmr_attribute30              in varchar2         default hr_api.g_varchar2,
913   p_object_version_number        in out nocopy number,
914   p_effective_date		 in date,
915   p_datetrack_mode		 in varchar2
916   ) is
917 --
918   l_rec		ben_vmr_shd.g_rec_type;
919   l_proc	varchar2(72) := g_package||'upd';
920 --
921 Begin
922   hr_utility.set_location('Entering:'||l_proc, 5);
923   --
924   -- Call conversion function to turn arguments into the
925   -- l_rec structure.
926   --
927   l_rec :=
928   ben_vmr_shd.convert_args
929   (
930   p_vrbl_mtchg_rt_id,
931   null,
932   null,
933   p_no_mx_pct_of_py_num_flag,
934   p_to_pct_val,
935   p_no_mx_amt_of_py_num_flag,
936   p_mx_pct_of_py_num,
937   p_no_mx_mtch_amt_flag,
938   p_ordr_num,
939   p_pct_val,
940   p_mx_mtch_amt,
941   p_mx_amt_of_py_num,
942   p_mn_mtch_amt,
943   p_mtchg_rt_calc_rl,
944   p_cntnu_mtch_aftr_max_rl_flag,
945   p_from_pct_val,
946   p_vrbl_rt_prfl_id,
947   p_business_group_id,
948   p_vmr_attribute_category,
949   p_vmr_attribute1,
950   p_vmr_attribute2,
951   p_vmr_attribute3,
952   p_vmr_attribute4,
953   p_vmr_attribute5,
954   p_vmr_attribute6,
955   p_vmr_attribute7,
956   p_vmr_attribute8,
957   p_vmr_attribute9,
958   p_vmr_attribute10,
959   p_vmr_attribute11,
960   p_vmr_attribute12,
961   p_vmr_attribute13,
962   p_vmr_attribute14,
963   p_vmr_attribute15,
964   p_vmr_attribute16,
965   p_vmr_attribute17,
966   p_vmr_attribute18,
967   p_vmr_attribute19,
968   p_vmr_attribute20,
969   p_vmr_attribute21,
970   p_vmr_attribute22,
971   p_vmr_attribute23,
972   p_vmr_attribute24,
973   p_vmr_attribute25,
974   p_vmr_attribute26,
975   p_vmr_attribute27,
976   p_vmr_attribute28,
977   p_vmr_attribute29,
978   p_vmr_attribute30,
979   p_object_version_number
980   );
981   --
982   -- Having converted the arguments into the
983   -- plsql record structure we call the corresponding record
984   -- business process.
985   --
986   upd(l_rec, p_effective_date, p_datetrack_mode);
987   p_object_version_number       := l_rec.object_version_number;
988   p_effective_start_date        := l_rec.effective_start_date;
989   p_effective_end_date          := l_rec.effective_end_date;
990   --
991   --
992   hr_utility.set_location(' Leaving:'||l_proc, 10);
993 End upd;
994 --
995 end ben_vmr_upd;