DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_SHR_UPD

Source


1 Package Body ben_shr_upd as
2 /* $Header: beshrrhi.pkb 120.1 2008/02/05 08:25:20 rtagarra noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_shr_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_shr_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_schedd_hrs_rt_f',
78 	   p_base_key_column	=> 'schedd_hrs_rt_id',
79 	   p_base_key_value	=> p_rec.schedd_hrs_rt_id);
80     --
81     ben_shr_shd.g_api_dml := true;  -- Set the api dml status
82     --
83     -- Update the ben_schedd_hrs_rt_f Row
84     --
85     update  ben_schedd_hrs_rt_f
86     set
87     schedd_hrs_rt_id                = p_rec.schedd_hrs_rt_id,
88     vrbl_rt_prfl_id                 = p_rec.vrbl_rt_prfl_id,
89     excld_flag                      = p_rec.excld_flag,
90     ordr_num                        = p_rec.ordr_num,
91     freq_cd                         = p_rec.freq_cd,
92     hrs_num                         = p_rec.hrs_num,
93 	max_hrs_num					  	= p_rec.max_hrs_num,
94 	schedd_hrs_rl				  	= p_rec.schedd_hrs_rl,
95 	determination_cd		      	= p_rec.determination_cd,
96 	determination_rl			  	= p_rec.determination_rl,
97 	rounding_cd					  	= p_rec.rounding_cd,
98 	rounding_rl					  	= p_rec.rounding_rl,
99     business_group_id               = p_rec.business_group_id,
100     shr_attribute_category          = p_rec.shr_attribute_category,
101     shr_attribute1                  = p_rec.shr_attribute1,
102     shr_attribute2                  = p_rec.shr_attribute2,
103     shr_attribute3                  = p_rec.shr_attribute3,
104     shr_attribute4                  = p_rec.shr_attribute4,
105     shr_attribute5                  = p_rec.shr_attribute5,
106     shr_attribute6                  = p_rec.shr_attribute6,
107     shr_attribute7                  = p_rec.shr_attribute7,
108     shr_attribute8                  = p_rec.shr_attribute8,
109     shr_attribute9                  = p_rec.shr_attribute9,
110     shr_attribute10                 = p_rec.shr_attribute10,
111     shr_attribute11                 = p_rec.shr_attribute11,
112     shr_attribute12                 = p_rec.shr_attribute12,
113     shr_attribute13                 = p_rec.shr_attribute13,
114     shr_attribute14                 = p_rec.shr_attribute14,
115     shr_attribute15                 = p_rec.shr_attribute15,
116     shr_attribute16                 = p_rec.shr_attribute16,
117     shr_attribute17                 = p_rec.shr_attribute17,
118     shr_attribute18                 = p_rec.shr_attribute18,
119     shr_attribute19                 = p_rec.shr_attribute19,
120     shr_attribute20                 = p_rec.shr_attribute20,
121     shr_attribute21                 = p_rec.shr_attribute21,
122     shr_attribute22                 = p_rec.shr_attribute22,
123     shr_attribute23                 = p_rec.shr_attribute23,
124     shr_attribute24                 = p_rec.shr_attribute24,
125     shr_attribute25                 = p_rec.shr_attribute25,
126     shr_attribute26                 = p_rec.shr_attribute26,
127     shr_attribute27                 = p_rec.shr_attribute27,
128     shr_attribute28                 = p_rec.shr_attribute28,
129     shr_attribute29                 = p_rec.shr_attribute29,
130     shr_attribute30                 = p_rec.shr_attribute30,
131     object_version_number           = p_rec.object_version_number
132     where   schedd_hrs_rt_id = p_rec.schedd_hrs_rt_id
133     and     effective_start_date = p_validation_start_date
134     and     effective_end_date   = p_validation_end_date;
135     --
136     ben_shr_shd.g_api_dml := false;   -- Unset the api dml status
137     --
138     -- Set the effective start and end dates
139     --
140     p_rec.effective_start_date := p_validation_start_date;
141     p_rec.effective_end_date   := p_validation_end_date;
142   End If;
143 --
144 hr_utility.set_location(' Leaving:'||l_proc, 15);
145 Exception
146   When hr_api.check_integrity_violated Then
147     -- A check constraint has been violated
148     ben_shr_shd.g_api_dml := false;   -- Unset the api dml status
149     ben_shr_shd.constraint_error
150       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
151   When hr_api.unique_integrity_violated Then
152     -- Unique integrity has been violated
153     ben_shr_shd.g_api_dml := false;   -- Unset the api dml status
154     ben_shr_shd.constraint_error
155       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
156   When Others Then
157     ben_shr_shd.g_api_dml := false;   -- Unset the api dml status
158     Raise;
159 End dt_update_dml;
160 --
161 -- ----------------------------------------------------------------------------
162 -- |------------------------------< update_dml >------------------------------|
163 -- ----------------------------------------------------------------------------
164 -- {Start Of Comments}
165 --
166 -- Description:
167 --   This procedure calls the dt_update_dml control logic which handles
168 --   the actual datetrack dml.
169 --
170 -- Prerequisites:
171 --   This is an internal private procedure which must be called from the upd
172 --   procedure.
173 --
174 -- In Parameters:
175 --   A Pl/Sql record structre.
176 --
177 -- Post Success:
178 --   Processing contines.
179 --
180 -- Post Failure:
181 --   No specific error handling is required within this procedure.
182 --
183 -- Developer Implementation Notes:
184 --   The update 'set' arguments list should be modified if any of your
185 --   attributes are not updateable.
186 --
187 -- Access Status:
188 --   Internal Row Handler Use Only.
189 --
190 -- {End Of Comments}
191 -- ----------------------------------------------------------------------------
192 Procedure update_dml
193 	(p_rec 			 in out nocopy ben_shr_shd.g_rec_type,
194 	 p_effective_date	 in	date,
195 	 p_datetrack_mode	 in	varchar2,
196 	 p_validation_start_date in	date,
197 	 p_validation_end_date	 in	date) is
198 --
199   l_proc	varchar2(72) := g_package||'update_dml';
200 --
201 Begin
202   hr_utility.set_location('Entering:'||l_proc, 5);
203   --
204   dt_update_dml(p_rec			=> p_rec,
205 		p_effective_date	=> p_effective_date,
206 		p_datetrack_mode	=> p_datetrack_mode,
207        		p_validation_start_date	=> p_validation_start_date,
208 		p_validation_end_date	=> p_validation_end_date);
209   --
210   hr_utility.set_location(' Leaving:'||l_proc, 10);
211 End update_dml;
212 --
213 -- ----------------------------------------------------------------------------
214 -- |----------------------------< dt_pre_update >-----------------------------|
215 -- ----------------------------------------------------------------------------
216 -- {Start Of Comments}
217 --
218 -- Description:
219 --   The dt_pre_update procedure controls the execution
220 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
221 --   and UPDATE_CHANGE_INSERT only. The execution required is as
222 --   follows:
223 --
224 --   1) Providing the datetrack update mode is not 'CORRECTION'
225 --      then set the effective end date of the current row (this
226 --      will be the validation_start_date - 1).
227 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
228 --      corresponding delete_dml process to delete any future rows
229 --      where the effective_start_date is greater than or equal to
230 --	the validation_start_date.
231 --   3) Call the insert_dml process to insert the new updated row
232 --      details..
233 --
234 -- Prerequisites:
235 --   This is an internal procedure which is called from the
236 --   pre_update procedure.
237 --
238 -- In Parameters:
239 --
240 -- Post Success:
241 --   Processing continues.
242 --
243 -- Post Failure:
244 --   If an error has occurred, an error message and exception will be raised
245 --   but not handled.
246 --
247 -- Developer Implementation Notes:
248 --   This is an internal procedure which is required by Datetrack. Don't
249 --   remove or modify.
250 --
251 -- Access Status:
252 --   Internal Row Handler Use Only.
253 --
254 -- {End Of Comments}
255 -- ----------------------------------------------------------------------------
256 Procedure dt_pre_update
257 	(p_rec 			 in out nocopy ben_shr_shd.g_rec_type,
258 	 p_effective_date	 in	date,
259 	 p_datetrack_mode	 in	varchar2,
260 	 p_validation_start_date in	date,
261 	 p_validation_end_date	 in	date) is
262 --
263   l_proc	         varchar2(72) := g_package||'dt_pre_update';
264   l_dummy_version_number number;
265 --
266 Begin
267   hr_utility.set_location('Entering:'||l_proc, 5);
268   If (p_datetrack_mode <> 'CORRECTION') then
269     hr_utility.set_location(l_proc, 10);
270     --
271     -- Update the current effective end date
272     --
273     ben_shr_shd.upd_effective_end_date
274      (p_effective_date	       => p_effective_date,
275       p_base_key_value	       => p_rec.schedd_hrs_rt_id,
276       p_new_effective_end_date => (p_validation_start_date - 1),
277       p_validation_start_date  => p_validation_start_date,
278       p_validation_end_date    => p_validation_end_date,
279       p_object_version_number  => l_dummy_version_number);
280     --
281     If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
282       hr_utility.set_location(l_proc, 15);
283       --
284       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
285       -- delete any future rows
286       --
287       ben_shr_del.delete_dml
288         (p_rec			 => p_rec,
289 	 p_effective_date	 => p_effective_date,
290 	 p_datetrack_mode	 => p_datetrack_mode,
291 	 p_validation_start_date => p_validation_start_date,
292 	 p_validation_end_date   => p_validation_end_date);
293     End If;
294     hr_utility.set_location(l_proc, 20);
295     --
296     -- We must now insert the updated row
297     --
298     ben_shr_ins.insert_dml
299       (p_rec			=> p_rec,
300        p_effective_date		=> p_effective_date,
301        p_datetrack_mode		=> p_datetrack_mode,
302        p_validation_start_date	=> p_validation_start_date,
303        p_validation_end_date	=> p_validation_end_date);
304   End If;
305   hr_utility.set_location(' Leaving:'||l_proc, 20);
306 End dt_pre_update;
307 --
308 -- ----------------------------------------------------------------------------
309 -- |------------------------------< pre_update >------------------------------|
310 -- ----------------------------------------------------------------------------
311 -- {Start Of Comments}
312 --
313 -- Description:
314 --   This private procedure contains any processing which is required before
315 --   the update dml.
316 --
317 -- Prerequisites:
318 --   This is an internal procedure which is called from the upd procedure.
319 --
320 -- In Parameters:
321 --   A Pl/Sql record structre.
322 --
323 -- Post Success:
324 --   Processing continues.
325 --
326 -- Post Failure:
327 --   If an error has occurred, an error message and exception will be raised
328 --   but not handled.
329 --
330 -- Developer Implementation Notes:
331 --   Any pre-processing required before the update dml is issued should be
332 --   coded within this procedure. It is important to note that any 3rd party
333 --   maintenance should be reviewed before placing in this procedure. The call
334 --   to the dt_update_dml procedure should NOT be removed.
335 --
336 -- Access Status:
337 --   Internal Row Handler Use Only.
338 --
339 -- {End Of Comments}
340 -- ----------------------------------------------------------------------------
341 Procedure pre_update
342 	(p_rec 			 in out nocopy ben_shr_shd.g_rec_type,
343 	 p_effective_date	 in	date,
344 	 p_datetrack_mode	 in	varchar2,
345 	 p_validation_start_date in	date,
346 	 p_validation_end_date	 in	date) is
347 --
348   l_proc	varchar2(72) := g_package||'pre_update';
349 --
350 Begin
351   hr_utility.set_location('Entering:'||l_proc, 5);
352   --
353   --
354   --
355   dt_pre_update
356     (p_rec 		     => p_rec,
357      p_effective_date	     => p_effective_date,
358      p_datetrack_mode	     => p_datetrack_mode,
359      p_validation_start_date => p_validation_start_date,
360      p_validation_end_date   => p_validation_end_date);
361   --
362   hr_utility.set_location(' Leaving:'||l_proc, 10);
363 End pre_update;
364 --
365 -- ----------------------------------------------------------------------------
366 -- |-----------------------------< post_update >------------------------------|
367 -- ----------------------------------------------------------------------------
368 -- {Start Of Comments}
369 --
370 -- Description:
371 --   This private procedure contains any processing which is required after the
372 --   update dml.
373 --
374 -- Prerequisites:
375 --   This is an internal procedure which is called from the upd procedure.
376 --
377 -- In Parameters:
378 --   A Pl/Sql record structre.
379 --
380 -- Post Success:
381 --   Processing continues.
382 --
383 -- Post Failure:
384 --   If an error has occurred, an error message and exception will be raised
385 --   but not handled.
386 --
387 -- Developer Implementation Notes:
388 --   Any post-processing required after the update dml is issued should be
389 --   coded within this procedure. It is important to note that any 3rd party
390 --   maintenance should be reviewed before placing in this procedure.
391 --
392 -- Access Status:
393 --   Internal Row Handler Use Only.
394 --
395 -- {End Of Comments}
396 -- ----------------------------------------------------------------------------
397 Procedure post_update
398 	(p_rec 			 in ben_shr_shd.g_rec_type,
399 	 p_effective_date	 in date,
400 	 p_datetrack_mode	 in varchar2,
401 	 p_validation_start_date in date,
402 	 p_validation_end_date	 in date) is
403 --
404   l_proc	varchar2(72) := g_package||'post_update';
405 --
406 Begin
407   hr_utility.set_location('Entering:'||l_proc, 5);
408 --
409   --
410   -- Start of API User Hook for post_update.
411   --
412   begin
413     --
414     ben_shr_rku.after_update
415       (
416   p_schedd_hrs_rt_id              =>p_rec.schedd_hrs_rt_id
417  ,p_effective_start_date          =>p_rec.effective_start_date
418  ,p_effective_end_date            =>p_rec.effective_end_date
419  ,p_vrbl_rt_prfl_id               =>p_rec.vrbl_rt_prfl_id
420  ,p_excld_flag                    =>p_rec.excld_flag
421  ,p_ordr_num                      =>p_rec.ordr_num
422  ,p_freq_cd                       =>p_rec.freq_cd
423  ,p_hrs_num                       =>p_rec.hrs_num
424  ,p_max_hrs_num					  =>p_rec.max_hrs_num
425  ,p_schedd_hrs_rl				  =>p_rec.schedd_hrs_rl
426  ,p_determination_cd		      =>p_rec.determination_cd
427  ,p_determination_rl			  =>p_rec.determination_rl
428  ,p_rounding_cd					  =>p_rec.rounding_cd
429  ,p_rounding_rl					  =>p_rec.rounding_rl
430  ,p_business_group_id             =>p_rec.business_group_id
431  ,p_shr_attribute_category        =>p_rec.shr_attribute_category
432  ,p_shr_attribute1                =>p_rec.shr_attribute1
433  ,p_shr_attribute2                =>p_rec.shr_attribute2
434  ,p_shr_attribute3                =>p_rec.shr_attribute3
435  ,p_shr_attribute4                =>p_rec.shr_attribute4
436  ,p_shr_attribute5                =>p_rec.shr_attribute5
437  ,p_shr_attribute6                =>p_rec.shr_attribute6
438  ,p_shr_attribute7                =>p_rec.shr_attribute7
439  ,p_shr_attribute8                =>p_rec.shr_attribute8
440  ,p_shr_attribute9                =>p_rec.shr_attribute9
441  ,p_shr_attribute10               =>p_rec.shr_attribute10
442  ,p_shr_attribute11               =>p_rec.shr_attribute11
443  ,p_shr_attribute12               =>p_rec.shr_attribute12
444  ,p_shr_attribute13               =>p_rec.shr_attribute13
445  ,p_shr_attribute14               =>p_rec.shr_attribute14
446  ,p_shr_attribute15               =>p_rec.shr_attribute15
447  ,p_shr_attribute16               =>p_rec.shr_attribute16
448  ,p_shr_attribute17               =>p_rec.shr_attribute17
449  ,p_shr_attribute18               =>p_rec.shr_attribute18
450  ,p_shr_attribute19               =>p_rec.shr_attribute19
451  ,p_shr_attribute20               =>p_rec.shr_attribute20
452  ,p_shr_attribute21               =>p_rec.shr_attribute21
453  ,p_shr_attribute22               =>p_rec.shr_attribute22
454  ,p_shr_attribute23               =>p_rec.shr_attribute23
455  ,p_shr_attribute24               =>p_rec.shr_attribute24
456  ,p_shr_attribute25               =>p_rec.shr_attribute25
457  ,p_shr_attribute26               =>p_rec.shr_attribute26
458  ,p_shr_attribute27               =>p_rec.shr_attribute27
459  ,p_shr_attribute28               =>p_rec.shr_attribute28
460  ,p_shr_attribute29               =>p_rec.shr_attribute29
461  ,p_shr_attribute30               =>p_rec.shr_attribute30
462  ,p_object_version_number         =>p_rec.object_version_number
463  ,p_effective_date                =>p_effective_date
464  ,p_datetrack_mode                =>p_datetrack_mode
465  ,p_validation_start_date         =>p_validation_start_date
466  ,p_validation_end_date           =>p_validation_end_date
467  ,p_effective_start_date_o        =>ben_shr_shd.g_old_rec.effective_start_date
468  ,p_effective_end_date_o          =>ben_shr_shd.g_old_rec.effective_end_date
469  ,p_vrbl_rt_prfl_id_o             =>ben_shr_shd.g_old_rec.vrbl_rt_prfl_id
470  ,p_excld_flag_o                  =>ben_shr_shd.g_old_rec.excld_flag
471  ,p_ordr_num_o                    =>ben_shr_shd.g_old_rec.ordr_num
472  ,p_freq_cd_o                     =>ben_shr_shd.g_old_rec.freq_cd
473  ,p_hrs_num_o                     =>ben_shr_shd.g_old_rec.hrs_num
474  ,p_max_hrs_num_o				  =>ben_shr_shd.g_old_rec.max_hrs_num
475  ,p_schedd_hrs_rl_o				  =>ben_shr_shd.g_old_rec.schedd_hrs_rl
476  ,p_determination_cd_o		      =>ben_shr_shd.g_old_rec.determination_cd
477  ,p_determination_rl_o			  =>ben_shr_shd.g_old_rec.determination_rl
478  ,p_rounding_cd_o				  =>ben_shr_shd.g_old_rec.rounding_cd
479  ,p_rounding_rl_o				  =>ben_shr_shd.g_old_rec.rounding_rl
480  ,p_business_group_id_o           =>ben_shr_shd.g_old_rec.business_group_id
481  ,p_shr_attribute_category_o      =>ben_shr_shd.g_old_rec.shr_attribute_category
482  ,p_shr_attribute1_o              =>ben_shr_shd.g_old_rec.shr_attribute1
483  ,p_shr_attribute2_o              =>ben_shr_shd.g_old_rec.shr_attribute2
484  ,p_shr_attribute3_o              =>ben_shr_shd.g_old_rec.shr_attribute3
485  ,p_shr_attribute4_o              =>ben_shr_shd.g_old_rec.shr_attribute4
486  ,p_shr_attribute5_o              =>ben_shr_shd.g_old_rec.shr_attribute5
487  ,p_shr_attribute6_o              =>ben_shr_shd.g_old_rec.shr_attribute6
488  ,p_shr_attribute7_o              =>ben_shr_shd.g_old_rec.shr_attribute7
489  ,p_shr_attribute8_o              =>ben_shr_shd.g_old_rec.shr_attribute8
490  ,p_shr_attribute9_o              =>ben_shr_shd.g_old_rec.shr_attribute9
491  ,p_shr_attribute10_o             =>ben_shr_shd.g_old_rec.shr_attribute10
492  ,p_shr_attribute11_o             =>ben_shr_shd.g_old_rec.shr_attribute11
493  ,p_shr_attribute12_o             =>ben_shr_shd.g_old_rec.shr_attribute12
494  ,p_shr_attribute13_o             =>ben_shr_shd.g_old_rec.shr_attribute13
495  ,p_shr_attribute14_o             =>ben_shr_shd.g_old_rec.shr_attribute14
496  ,p_shr_attribute15_o             =>ben_shr_shd.g_old_rec.shr_attribute15
497  ,p_shr_attribute16_o             =>ben_shr_shd.g_old_rec.shr_attribute16
498  ,p_shr_attribute17_o             =>ben_shr_shd.g_old_rec.shr_attribute17
499  ,p_shr_attribute18_o             =>ben_shr_shd.g_old_rec.shr_attribute18
500  ,p_shr_attribute19_o             =>ben_shr_shd.g_old_rec.shr_attribute19
501  ,p_shr_attribute20_o             =>ben_shr_shd.g_old_rec.shr_attribute20
502  ,p_shr_attribute21_o             =>ben_shr_shd.g_old_rec.shr_attribute21
503  ,p_shr_attribute22_o             =>ben_shr_shd.g_old_rec.shr_attribute22
504  ,p_shr_attribute23_o             =>ben_shr_shd.g_old_rec.shr_attribute23
505  ,p_shr_attribute24_o             =>ben_shr_shd.g_old_rec.shr_attribute24
506  ,p_shr_attribute25_o             =>ben_shr_shd.g_old_rec.shr_attribute25
507  ,p_shr_attribute26_o             =>ben_shr_shd.g_old_rec.shr_attribute26
508  ,p_shr_attribute27_o             =>ben_shr_shd.g_old_rec.shr_attribute27
509  ,p_shr_attribute28_o             =>ben_shr_shd.g_old_rec.shr_attribute28
510  ,p_shr_attribute29_o             =>ben_shr_shd.g_old_rec.shr_attribute29
511  ,p_shr_attribute30_o             =>ben_shr_shd.g_old_rec.shr_attribute30
512  ,p_object_version_number_o       =>ben_shr_shd.g_old_rec.object_version_number
513       );
514     --
515   exception
516     --
517     when hr_api.cannot_find_prog_unit then
518       --
519       hr_api.cannot_find_prog_unit_error
520         (p_module_name => 'ben_schedd_hrs_rt_f'
521         ,p_hook_type   => 'AU');
522       --
523   end;
524   --
525   -- End of API User Hook for post_update.
526   --
527   --
528   hr_utility.set_location(' Leaving:'||l_proc, 10);
529 End post_update;
530 --
531 -- ----------------------------------------------------------------------------
532 -- |-----------------------------< convert_defs >-----------------------------|
533 -- ----------------------------------------------------------------------------
534 -- {Start Of Comments}
535 --
536 -- Description:
537 --   The Convert_Defs procedure has one very important function:
538 --   It must return the record structure for the row with all system defaulted
539 --   values converted into its corresponding parameter value for update. When
540 --   we attempt to update a row through the Upd process , certain
541 --   parameters can be defaulted which enables flexibility in the calling of
542 --   the upd process (e.g. only attributes which need to be updated need to be
543 --   specified). For the upd process to determine which attributes
544 --   have NOT been specified we need to check if the parameter has a reserved
545 --   system default value. Therefore, for all parameters which have a
546 --   corresponding reserved system default mechanism specified we need to
547 --   check if a system default is being used. If a system default is being
548 --   used then we convert the defaulted value into its corresponding attribute
549 --   value held in the g_old_rec data structure.
550 --
551 -- Prerequisites:
552 --   This private function can only be called from the upd process.
553 --
554 -- In Parameters:
555 --   A Pl/Sql record structre.
556 --
557 -- Post Success:
558 --   The record structure will be returned with all system defaulted parameter
559 --   values converted into its current row attribute value.
560 --
561 -- Post Failure:
562 --   No direct error handling is required within this function. Any possible
563 --   errors within this procedure will be a PL/SQL value error due to conversion
564 --   of datatypes or data lengths.
565 --
566 -- Developer Implementation Notes:
567 --   None.
568 --
569 -- Access Status:
570 --   Internal Row Handler Use Only.
571 --
572 -- {End Of Comments}
573 -- ----------------------------------------------------------------------------
574 Procedure convert_defs(p_rec in out nocopy ben_shr_shd.g_rec_type) is
575 --
576   l_proc  varchar2(72) := g_package||'convert_defs';
577 --
578 Begin
579   --
580   hr_utility.set_location('Entering:'||l_proc, 5);
581   --
582   -- We must now examine each argument value in the
583   -- p_rec plsql record structure
584   -- to see if a system default is being used. If a system default
585   -- is being used then we must set to the 'current' argument value.
586   --
587   If (p_rec.vrbl_rt_prfl_id = hr_api.g_number) then
588     p_rec.vrbl_rt_prfl_id :=
589     ben_shr_shd.g_old_rec.vrbl_rt_prfl_id;
590   End If;
591   If (p_rec.excld_flag = hr_api.g_varchar2) then
592     p_rec.excld_flag :=
593     ben_shr_shd.g_old_rec.excld_flag;
594   End If;
595   If (p_rec.ordr_num = hr_api.g_number) then
596     p_rec.ordr_num :=
597     ben_shr_shd.g_old_rec.ordr_num;
598   End If;
599   If (p_rec.freq_cd = hr_api.g_varchar2) then
600     p_rec.freq_cd :=
601     ben_shr_shd.g_old_rec.freq_cd;
602   End If;
603   If (p_rec.hrs_num = hr_api.g_number) then
604     p_rec.hrs_num :=
605     ben_shr_shd.g_old_rec.hrs_num;
606   End If;
607 
608   If (p_rec.max_hrs_num = hr_api.g_number) then
609     p_rec.max_hrs_num :=
610     ben_shr_shd.g_old_rec.max_hrs_num;
611   End If;
612   If (p_rec.schedd_hrs_rl = hr_api.g_number) then
613     p_rec.schedd_hrs_rl :=
614     ben_shr_shd.g_old_rec.schedd_hrs_rl;
615   End If;
616   If (p_rec.determination_cd = hr_api.g_varchar2) then
617     p_rec.determination_cd :=
618     ben_shr_shd.g_old_rec.determination_cd;
619   End If;
620   If (p_rec.determination_rl = hr_api.g_number) then
621     p_rec.determination_rl :=
622     ben_shr_shd.g_old_rec.determination_rl;
623   End If;
624   If (p_rec.rounding_cd = hr_api.g_varchar2) then
625     p_rec.rounding_cd :=
626     ben_shr_shd.g_old_rec.rounding_cd;
627   End If;
628   If (p_rec.rounding_rl = hr_api.g_number) then
629     p_rec.rounding_rl :=
630     ben_shr_shd.g_old_rec.rounding_rl;
631   End If;
632 
633 
634   If (p_rec.business_group_id = hr_api.g_number) then
635     p_rec.business_group_id :=
636     ben_shr_shd.g_old_rec.business_group_id;
637   End If;
638   If (p_rec.shr_attribute_category = hr_api.g_varchar2) then
639     p_rec.shr_attribute_category :=
640     ben_shr_shd.g_old_rec.shr_attribute_category;
641   End If;
642   If (p_rec.shr_attribute1 = hr_api.g_varchar2) then
643     p_rec.shr_attribute1 :=
644     ben_shr_shd.g_old_rec.shr_attribute1;
645   End If;
646   If (p_rec.shr_attribute2 = hr_api.g_varchar2) then
647     p_rec.shr_attribute2 :=
648     ben_shr_shd.g_old_rec.shr_attribute2;
649   End If;
650   If (p_rec.shr_attribute3 = hr_api.g_varchar2) then
651     p_rec.shr_attribute3 :=
652     ben_shr_shd.g_old_rec.shr_attribute3;
653   End If;
654   If (p_rec.shr_attribute4 = hr_api.g_varchar2) then
655     p_rec.shr_attribute4 :=
656     ben_shr_shd.g_old_rec.shr_attribute4;
657   End If;
658   If (p_rec.shr_attribute5 = hr_api.g_varchar2) then
659     p_rec.shr_attribute5 :=
660     ben_shr_shd.g_old_rec.shr_attribute5;
661   End If;
662   If (p_rec.shr_attribute6 = hr_api.g_varchar2) then
663     p_rec.shr_attribute6 :=
664     ben_shr_shd.g_old_rec.shr_attribute6;
665   End If;
666   If (p_rec.shr_attribute7 = hr_api.g_varchar2) then
667     p_rec.shr_attribute7 :=
668     ben_shr_shd.g_old_rec.shr_attribute7;
669   End If;
670   If (p_rec.shr_attribute8 = hr_api.g_varchar2) then
671     p_rec.shr_attribute8 :=
672     ben_shr_shd.g_old_rec.shr_attribute8;
673   End If;
674   If (p_rec.shr_attribute9 = hr_api.g_varchar2) then
675     p_rec.shr_attribute9 :=
676     ben_shr_shd.g_old_rec.shr_attribute9;
677   End If;
678   If (p_rec.shr_attribute10 = hr_api.g_varchar2) then
679     p_rec.shr_attribute10 :=
680     ben_shr_shd.g_old_rec.shr_attribute10;
681   End If;
682   If (p_rec.shr_attribute11 = hr_api.g_varchar2) then
683     p_rec.shr_attribute11 :=
684     ben_shr_shd.g_old_rec.shr_attribute11;
685   End If;
686   If (p_rec.shr_attribute12 = hr_api.g_varchar2) then
687     p_rec.shr_attribute12 :=
688     ben_shr_shd.g_old_rec.shr_attribute12;
689   End If;
690   If (p_rec.shr_attribute13 = hr_api.g_varchar2) then
691     p_rec.shr_attribute13 :=
692     ben_shr_shd.g_old_rec.shr_attribute13;
693   End If;
694   If (p_rec.shr_attribute14 = hr_api.g_varchar2) then
695     p_rec.shr_attribute14 :=
696     ben_shr_shd.g_old_rec.shr_attribute14;
697   End If;
698   If (p_rec.shr_attribute15 = hr_api.g_varchar2) then
699     p_rec.shr_attribute15 :=
700     ben_shr_shd.g_old_rec.shr_attribute15;
701   End If;
702   If (p_rec.shr_attribute16 = hr_api.g_varchar2) then
703     p_rec.shr_attribute16 :=
704     ben_shr_shd.g_old_rec.shr_attribute16;
705   End If;
706   If (p_rec.shr_attribute17 = hr_api.g_varchar2) then
707     p_rec.shr_attribute17 :=
708     ben_shr_shd.g_old_rec.shr_attribute17;
709   End If;
710   If (p_rec.shr_attribute18 = hr_api.g_varchar2) then
711     p_rec.shr_attribute18 :=
712     ben_shr_shd.g_old_rec.shr_attribute18;
713   End If;
714   If (p_rec.shr_attribute19 = hr_api.g_varchar2) then
715     p_rec.shr_attribute19 :=
716     ben_shr_shd.g_old_rec.shr_attribute19;
717   End If;
718   If (p_rec.shr_attribute20 = hr_api.g_varchar2) then
719     p_rec.shr_attribute20 :=
720     ben_shr_shd.g_old_rec.shr_attribute20;
721   End If;
722   If (p_rec.shr_attribute21 = hr_api.g_varchar2) then
723     p_rec.shr_attribute21 :=
724     ben_shr_shd.g_old_rec.shr_attribute21;
725   End If;
726   If (p_rec.shr_attribute22 = hr_api.g_varchar2) then
727     p_rec.shr_attribute22 :=
728     ben_shr_shd.g_old_rec.shr_attribute22;
729   End If;
730   If (p_rec.shr_attribute23 = hr_api.g_varchar2) then
731     p_rec.shr_attribute23 :=
732     ben_shr_shd.g_old_rec.shr_attribute23;
733   End If;
734   If (p_rec.shr_attribute24 = hr_api.g_varchar2) then
735     p_rec.shr_attribute24 :=
736     ben_shr_shd.g_old_rec.shr_attribute24;
737   End If;
738   If (p_rec.shr_attribute25 = hr_api.g_varchar2) then
739     p_rec.shr_attribute25 :=
740     ben_shr_shd.g_old_rec.shr_attribute25;
741   End If;
742   If (p_rec.shr_attribute26 = hr_api.g_varchar2) then
743     p_rec.shr_attribute26 :=
744     ben_shr_shd.g_old_rec.shr_attribute26;
745   End If;
746   If (p_rec.shr_attribute27 = hr_api.g_varchar2) then
747     p_rec.shr_attribute27 :=
748     ben_shr_shd.g_old_rec.shr_attribute27;
749   End If;
750   If (p_rec.shr_attribute28 = hr_api.g_varchar2) then
751     p_rec.shr_attribute28 :=
752     ben_shr_shd.g_old_rec.shr_attribute28;
753   End If;
754   If (p_rec.shr_attribute29 = hr_api.g_varchar2) then
755     p_rec.shr_attribute29 :=
756     ben_shr_shd.g_old_rec.shr_attribute29;
757   End If;
758   If (p_rec.shr_attribute30 = hr_api.g_varchar2) then
759     p_rec.shr_attribute30 :=
760     ben_shr_shd.g_old_rec.shr_attribute30;
761   End If;
762 
763   --
764   hr_utility.set_location(' Leaving:'||l_proc, 10);
765 --
766 End convert_defs;
767 --
768 -- ----------------------------------------------------------------------------
769 -- |---------------------------------< upd >----------------------------------|
770 -- ----------------------------------------------------------------------------
771 Procedure upd
772   (
773   p_rec			in out nocopy 	ben_shr_shd.g_rec_type,
774   p_effective_date	in 	date,
775   p_datetrack_mode	in 	varchar2
776   ) is
777 --
778   l_proc			varchar2(72) := g_package||'upd';
779   l_validation_start_date	date;
780   l_validation_end_date		date;
781 --
782 Begin
783   hr_utility.set_location('Entering:'||l_proc, 5);
784   --
785   -- Ensure that the DateTrack update mode is valid
786   --
787   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
788   --
789   -- We must lock the row which we need to update.
790   --
791   ben_shr_shd.lck
792 	(p_effective_date	 => p_effective_date,
793       	 p_datetrack_mode	 => p_datetrack_mode,
794       	 p_schedd_hrs_rt_id	 => p_rec.schedd_hrs_rt_id,
795       	 p_object_version_number => p_rec.object_version_number,
796       	 p_validation_start_date => l_validation_start_date,
797       	 p_validation_end_date	 => l_validation_end_date);
798   --
799   -- 1. During an update system defaults are used to determine if
800   --    arguments have been defaulted or not. We must therefore
801   --    derive the full record structure values to be updated.
802   --
803   -- 2. Call the supporting update validate operations.
804   --
805   convert_defs(p_rec);
806   ben_shr_bus.update_validate
807 	(p_rec			 => p_rec,
808 	 p_effective_date	 => p_effective_date,
809 	 p_datetrack_mode  	 => p_datetrack_mode,
810 	 p_validation_start_date => l_validation_start_date,
811 	 p_validation_end_date	 => l_validation_end_date);
812   --
813   -- Call the supporting pre-update operation
814   --
815   pre_update
816 	(p_rec			 => p_rec,
817 	 p_effective_date	 => p_effective_date,
818 	 p_datetrack_mode	 => p_datetrack_mode,
819 	 p_validation_start_date => l_validation_start_date,
820 	 p_validation_end_date	 => l_validation_end_date);
821   --
822   -- Update the row.
823   --
824   update_dml
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 post-update operation
832   --
833   post_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 End upd;
840 --
841 -- ----------------------------------------------------------------------------
842 -- |---------------------------------< upd >----------------------------------|
843 -- ----------------------------------------------------------------------------
844 Procedure upd
845   (
846   p_schedd_hrs_rt_id             in number,
847   p_effective_start_date         out nocopy date,
848   p_effective_end_date           out nocopy date,
849   p_vrbl_rt_prfl_id              in number           default hr_api.g_number,
850   p_excld_flag                   in varchar2         default hr_api.g_varchar2,
851   p_ordr_num                     in number           default hr_api.g_number,
852   p_freq_cd                 	in varchar2         default hr_api.g_varchar2,
853   p_hrs_num                 	in number           default hr_api.g_number,
854   p_max_hrs_num                  in number			 default hr_api.g_number,
855   p_schedd_hrs_rl                in number			 default hr_api.g_number,
856   p_determination_cd             in varchar2		 default hr_api.g_varchar2,
857   p_determination_rl             in number			 default hr_api.g_number,
858   p_rounding_cd                  in varchar2		 default hr_api.g_varchar2,
859   p_rounding_rl                  in number  		 default hr_api.g_number,
860   p_business_group_id            in number           default hr_api.g_number,
861   p_shr_attribute_category       in varchar2         default hr_api.g_varchar2,
862   p_shr_attribute1               in varchar2         default hr_api.g_varchar2,
863   p_shr_attribute2               in varchar2         default hr_api.g_varchar2,
864   p_shr_attribute3               in varchar2         default hr_api.g_varchar2,
865   p_shr_attribute4               in varchar2         default hr_api.g_varchar2,
866   p_shr_attribute5               in varchar2         default hr_api.g_varchar2,
867   p_shr_attribute6               in varchar2         default hr_api.g_varchar2,
868   p_shr_attribute7               in varchar2         default hr_api.g_varchar2,
869   p_shr_attribute8               in varchar2         default hr_api.g_varchar2,
870   p_shr_attribute9               in varchar2         default hr_api.g_varchar2,
871   p_shr_attribute10              in varchar2         default hr_api.g_varchar2,
872   p_shr_attribute11              in varchar2         default hr_api.g_varchar2,
873   p_shr_attribute12              in varchar2         default hr_api.g_varchar2,
874   p_shr_attribute13              in varchar2         default hr_api.g_varchar2,
875   p_shr_attribute14              in varchar2         default hr_api.g_varchar2,
876   p_shr_attribute15              in varchar2         default hr_api.g_varchar2,
877   p_shr_attribute16              in varchar2         default hr_api.g_varchar2,
878   p_shr_attribute17              in varchar2         default hr_api.g_varchar2,
879   p_shr_attribute18              in varchar2         default hr_api.g_varchar2,
880   p_shr_attribute19              in varchar2         default hr_api.g_varchar2,
881   p_shr_attribute20              in varchar2         default hr_api.g_varchar2,
882   p_shr_attribute21              in varchar2         default hr_api.g_varchar2,
883   p_shr_attribute22              in varchar2         default hr_api.g_varchar2,
884   p_shr_attribute23              in varchar2         default hr_api.g_varchar2,
885   p_shr_attribute24              in varchar2         default hr_api.g_varchar2,
886   p_shr_attribute25              in varchar2         default hr_api.g_varchar2,
887   p_shr_attribute26              in varchar2         default hr_api.g_varchar2,
888   p_shr_attribute27              in varchar2         default hr_api.g_varchar2,
889   p_shr_attribute28              in varchar2         default hr_api.g_varchar2,
890   p_shr_attribute29              in varchar2         default hr_api.g_varchar2,
891   p_shr_attribute30              in varchar2         default hr_api.g_varchar2,
892   p_object_version_number        in out nocopy number,
893   p_effective_date		 in date,
894   p_datetrack_mode		 in varchar2
895   ) is
896 --
897   l_rec		ben_shr_shd.g_rec_type;
898   l_proc	varchar2(72) := g_package||'upd';
899 --
900 Begin
901   hr_utility.set_location('Entering:'||l_proc, 5);
902   --
903   -- Call conversion function to turn arguments into the
904   -- l_rec structure.
905   --
906   l_rec :=
907   ben_shr_shd.convert_args
908   (
909   p_schedd_hrs_rt_id,
910   null,
911   null,
912   p_vrbl_rt_prfl_id,
913   p_excld_flag,
914   p_ordr_num,
915   p_freq_cd,
916   p_hrs_num,
917   p_max_hrs_num,
918   p_schedd_hrs_rl,
919   p_determination_cd,
920   p_determination_rl,
921   p_rounding_cd,
922   p_rounding_rl,
923   p_business_group_id,
924   p_shr_attribute_category,
925   p_shr_attribute1,
926   p_shr_attribute2,
927   p_shr_attribute3,
928   p_shr_attribute4,
929   p_shr_attribute5,
930   p_shr_attribute6,
931   p_shr_attribute7,
932   p_shr_attribute8,
933   p_shr_attribute9,
934   p_shr_attribute10,
935   p_shr_attribute11,
936   p_shr_attribute12,
937   p_shr_attribute13,
938   p_shr_attribute14,
939   p_shr_attribute15,
940   p_shr_attribute16,
941   p_shr_attribute17,
942   p_shr_attribute18,
943   p_shr_attribute19,
944   p_shr_attribute20,
945   p_shr_attribute21,
946   p_shr_attribute22,
947   p_shr_attribute23,
948   p_shr_attribute24,
949   p_shr_attribute25,
950   p_shr_attribute26,
951   p_shr_attribute27,
952   p_shr_attribute28,
953   p_shr_attribute29,
954   p_shr_attribute30,
955   p_object_version_number
956   );
957   --
958   -- Having converted the arguments into the
959   -- plsql record structure we call the corresponding record
960   -- business process.
961   --
962   upd(l_rec, p_effective_date, p_datetrack_mode);
963   p_object_version_number       := l_rec.object_version_number;
964   p_effective_start_date        := l_rec.effective_start_date;
965   p_effective_end_date          := l_rec.effective_end_date;
966   --
967   --
968   hr_utility.set_location(' Leaving:'||l_proc, 10);
969 End upd;
970 --
971 end ben_shr_upd;