DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_LPE_UPD

Source


1 Package Body ben_lpe_upd as
2 /* $Header: belperhi.pkb 115.13 2002/12/16 07:02:30 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_lpe_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_lpe_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_ler_chg_pl_nip_enrt_f',
78 	   p_base_key_column	=> 'ler_chg_pl_nip_enrt_id',
79 	   p_base_key_value	=> p_rec.ler_chg_pl_nip_enrt_id);
80     --
81     ben_lpe_shd.g_api_dml := true;  -- Set the api dml status
82     --
83     -- Update the ben_ler_chg_pl_nip_enrt_f Row
84     --
85     update  ben_ler_chg_pl_nip_enrt_f
86     set
87         ler_chg_pl_nip_enrt_id          = p_rec.ler_chg_pl_nip_enrt_id,
88     business_group_id               = p_rec.business_group_id,
89     pl_id                           = p_rec.pl_id,
90     ler_id                          = p_rec.ler_id,
91     tco_chg_enrt_cd                 = p_rec.tco_chg_enrt_cd,
92     crnt_enrt_prclds_chg_flag       = p_rec.crnt_enrt_prclds_chg_flag,
93     dflt_enrt_cd                    = p_rec.dflt_enrt_cd,
94     dflt_enrt_rl                    = p_rec.dflt_enrt_rl,
95     dflt_flag                       = p_rec.dflt_flag,
96     enrt_rl                         = p_rec.enrt_rl,
97     enrt_cd                         = p_rec.enrt_cd,
98     stl_elig_cant_chg_flag          = p_rec.stl_elig_cant_chg_flag,
99     enrt_mthd_cd                    = p_rec.enrt_mthd_cd,
100     auto_enrt_mthd_rl               = p_rec.auto_enrt_mthd_rl,
101     lpe_attribute_category          = p_rec.lpe_attribute_category,
102     lpe_attribute1                  = p_rec.lpe_attribute1,
103     lpe_attribute2                  = p_rec.lpe_attribute2,
104     lpe_attribute3                  = p_rec.lpe_attribute3,
105     lpe_attribute4                  = p_rec.lpe_attribute4,
106     lpe_attribute5                  = p_rec.lpe_attribute5,
107     lpe_attribute6                  = p_rec.lpe_attribute6,
108     lpe_attribute7                  = p_rec.lpe_attribute7,
109     lpe_attribute8                  = p_rec.lpe_attribute8,
110     lpe_attribute9                  = p_rec.lpe_attribute9,
111     lpe_attribute10                 = p_rec.lpe_attribute10,
112     lpe_attribute11                 = p_rec.lpe_attribute11,
113     lpe_attribute12                 = p_rec.lpe_attribute12,
114     lpe_attribute13                 = p_rec.lpe_attribute13,
115     lpe_attribute14                 = p_rec.lpe_attribute14,
116     lpe_attribute15                 = p_rec.lpe_attribute15,
117     lpe_attribute16                 = p_rec.lpe_attribute16,
118     lpe_attribute17                 = p_rec.lpe_attribute17,
119     lpe_attribute18                 = p_rec.lpe_attribute18,
120     lpe_attribute19                 = p_rec.lpe_attribute19,
121     lpe_attribute20                 = p_rec.lpe_attribute20,
122     lpe_attribute21                 = p_rec.lpe_attribute21,
123     lpe_attribute22                 = p_rec.lpe_attribute22,
124     lpe_attribute23                 = p_rec.lpe_attribute23,
125     lpe_attribute24                 = p_rec.lpe_attribute24,
126     lpe_attribute25                 = p_rec.lpe_attribute25,
127     lpe_attribute26                 = p_rec.lpe_attribute26,
128     lpe_attribute27                 = p_rec.lpe_attribute27,
129     lpe_attribute28                 = p_rec.lpe_attribute28,
130     lpe_attribute29                 = p_rec.lpe_attribute29,
131     lpe_attribute30                 = p_rec.lpe_attribute30,
132     object_version_number           = p_rec.object_version_number
133     where   ler_chg_pl_nip_enrt_id = p_rec.ler_chg_pl_nip_enrt_id
134     and     effective_start_date = p_validation_start_date
135     and     effective_end_date   = p_validation_end_date;
136     --
137     ben_lpe_shd.g_api_dml := false;   -- Unset the api dml status
138     --
139     -- Set the effective start and end dates
140     --
141     p_rec.effective_start_date := p_validation_start_date;
142     p_rec.effective_end_date   := p_validation_end_date;
143   End If;
144 --
145 hr_utility.set_location(' Leaving:'||l_proc, 15);
146 Exception
147   When hr_api.check_integrity_violated Then
148     -- A check constraint has been violated
149     ben_lpe_shd.g_api_dml := false;   -- Unset the api dml status
150     ben_lpe_shd.constraint_error
151       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
152   When hr_api.unique_integrity_violated Then
153     -- Unique integrity has been violated
154     ben_lpe_shd.g_api_dml := false;   -- Unset the api dml status
155     ben_lpe_shd.constraint_error
156       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
157   When Others Then
158     ben_lpe_shd.g_api_dml := false;   -- Unset the api dml status
159     Raise;
160 End dt_update_dml;
161 --
162 -- ----------------------------------------------------------------------------
163 -- |------------------------------< update_dml >------------------------------|
164 -- ----------------------------------------------------------------------------
165 -- {Start Of Comments}
166 --
167 -- Description:
168 --   This procedure calls the dt_update_dml control logic which handles
169 --   the actual datetrack dml.
170 --
171 -- Prerequisites:
172 --   This is an internal private procedure which must be called from the upd
173 --   procedure.
174 --
175 -- In Parameters:
176 --   A Pl/Sql record structre.
177 --
178 -- Post Success:
179 --   Processing contines.
180 --
181 -- Post Failure:
182 --   No specific error handling is required within this procedure.
183 --
184 -- Developer Implementation Notes:
185 --   The update 'set' arguments list should be modified if any of your
186 --   attributes are not updateable.
187 --
188 -- Access Status:
189 --   Internal Row Handler Use Only.
190 --
191 -- {End Of Comments}
192 -- ----------------------------------------------------------------------------
193 Procedure update_dml
194 	(p_rec 			 in out nocopy ben_lpe_shd.g_rec_type,
195 	 p_effective_date	 in	date,
196 	 p_datetrack_mode	 in	varchar2,
197 	 p_validation_start_date in	date,
198 	 p_validation_end_date	 in	date) is
199 --
200   l_proc	varchar2(72) := g_package||'update_dml';
201 --
202 Begin
203   hr_utility.set_location('Entering:'||l_proc, 5);
204   --
205   dt_update_dml(p_rec			=> p_rec,
206 		p_effective_date	=> p_effective_date,
207 		p_datetrack_mode	=> p_datetrack_mode,
208        		p_validation_start_date	=> p_validation_start_date,
209 		p_validation_end_date	=> p_validation_end_date);
210   --
211   hr_utility.set_location(' Leaving:'||l_proc, 10);
212 End update_dml;
213 --
214 -- ----------------------------------------------------------------------------
215 -- |----------------------------< dt_pre_update >-----------------------------|
216 -- ----------------------------------------------------------------------------
217 -- {Start Of Comments}
218 --
219 -- Description:
220 --   The dt_pre_update procedure controls the execution
221 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
222 --   and UPDATE_CHANGE_INSERT only. The execution required is as
223 --   follows:
224 --
225 --   1) Providing the datetrack update mode is not 'CORRECTION'
226 --      then set the effective end date of the current row (this
227 --      will be the validation_start_date - 1).
228 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
229 --      corresponding delete_dml process to delete any future rows
230 --      where the effective_start_date is greater than or equal to
231 --	the validation_start_date.
232 --   3) Call the insert_dml process to insert the new updated row
233 --      details..
234 --
235 -- Prerequisites:
236 --   This is an internal procedure which is called from the
237 --   pre_update procedure.
238 --
239 -- In Parameters:
240 --
241 -- Post Success:
242 --   Processing continues.
243 --
244 -- Post Failure:
245 --   If an error has occurred, an error message and exception will be raised
246 --   but not handled.
247 --
248 -- Developer Implementation Notes:
249 --   This is an internal procedure which is required by Datetrack. Don't
250 --   remove or modify.
251 --
252 -- Access Status:
253 --   Internal Row Handler Use Only.
254 --
255 -- {End Of Comments}
256 -- ----------------------------------------------------------------------------
257 Procedure dt_pre_update
258 	(p_rec 			 in out nocopy ben_lpe_shd.g_rec_type,
259 	 p_effective_date	 in	date,
260 	 p_datetrack_mode	 in	varchar2,
261 	 p_validation_start_date in	date,
262 	 p_validation_end_date	 in	date) is
263 --
264   l_proc	         varchar2(72) := g_package||'dt_pre_update';
265   l_dummy_version_number number;
266 --
267 Begin
268   hr_utility.set_location('Entering:'||l_proc, 5);
269   If (p_datetrack_mode <> 'CORRECTION') then
270     hr_utility.set_location(l_proc, 10);
271     --
272     -- Update the current effective end date
273     --
274     ben_lpe_shd.upd_effective_end_date
275      (p_effective_date	       => p_effective_date,
276       p_base_key_value	       => p_rec.ler_chg_pl_nip_enrt_id,
277       p_new_effective_end_date => (p_validation_start_date - 1),
278       p_validation_start_date  => p_validation_start_date,
279       p_validation_end_date    => p_validation_end_date,
280       p_object_version_number  => l_dummy_version_number);
281     --
282     If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
283       hr_utility.set_location(l_proc, 15);
284       --
285       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
286       -- delete any future rows
287       --
288       ben_lpe_del.delete_dml
289         (p_rec			 => p_rec,
290 	 p_effective_date	 => p_effective_date,
291 	 p_datetrack_mode	 => p_datetrack_mode,
292 	 p_validation_start_date => p_validation_start_date,
293 	 p_validation_end_date   => p_validation_end_date);
294     End If;
295     hr_utility.set_location(l_proc, 20);
296     --
297     -- We must now insert the updated row
298     --
299     ben_lpe_ins.insert_dml
300       (p_rec			=> p_rec,
301        p_effective_date		=> p_effective_date,
302        p_datetrack_mode		=> p_datetrack_mode,
303        p_validation_start_date	=> p_validation_start_date,
304        p_validation_end_date	=> p_validation_end_date);
305   End If;
306   hr_utility.set_location(' Leaving:'||l_proc, 20);
307 End dt_pre_update;
308 --
309 -- ----------------------------------------------------------------------------
310 -- |------------------------------< pre_update >------------------------------|
311 -- ----------------------------------------------------------------------------
312 -- {Start Of Comments}
313 --
314 -- Description:
315 --   This private procedure contains any processing which is required before
316 --   the update dml.
317 --
318 -- Prerequisites:
319 --   This is an internal procedure which is called from the upd procedure.
320 --
321 -- In Parameters:
322 --   A Pl/Sql record structre.
323 --
324 -- Post Success:
325 --   Processing continues.
326 --
327 -- Post Failure:
328 --   If an error has occurred, an error message and exception will be raised
329 --   but not handled.
330 --
331 -- Developer Implementation Notes:
332 --   Any pre-processing required before the update dml is issued should be
333 --   coded within this procedure. It is important to note that any 3rd party
334 --   maintenance should be reviewed before placing in this procedure. The call
335 --   to the dt_update_dml procedure should NOT be removed.
336 --
337 -- Access Status:
338 --   Internal Row Handler Use Only.
339 --
340 -- {End Of Comments}
341 -- ----------------------------------------------------------------------------
342 Procedure pre_update
343 	(p_rec 			 in out nocopy ben_lpe_shd.g_rec_type,
344 	 p_effective_date	 in	date,
345 	 p_datetrack_mode	 in	varchar2,
346 	 p_validation_start_date in	date,
347 	 p_validation_end_date	 in	date) is
348 --
349   l_proc	varchar2(72) := g_package||'pre_update';
350 --
351 Begin
352   hr_utility.set_location('Entering:'||l_proc, 5);
353   --
354   --
355   --
356   dt_pre_update
357     (p_rec 		     => p_rec,
358      p_effective_date	     => p_effective_date,
359      p_datetrack_mode	     => p_datetrack_mode,
360      p_validation_start_date => p_validation_start_date,
361      p_validation_end_date   => p_validation_end_date);
362   --
363   hr_utility.set_location(' Leaving:'||l_proc, 10);
364 End pre_update;
365 --
366 -- ----------------------------------------------------------------------------
367 -- |-----------------------------< post_update >------------------------------|
368 -- ----------------------------------------------------------------------------
369 -- {Start Of Comments}
370 --
371 -- Description:
372 --   This private procedure contains any processing which is required after the
373 --   update dml.
374 --
375 -- Prerequisites:
376 --   This is an internal procedure which is called from the upd procedure.
377 --
378 -- In Parameters:
379 --   A Pl/Sql record structre.
380 --
381 -- Post Success:
382 --   Processing continues.
383 --
384 -- Post Failure:
385 --   If an error has occurred, an error message and exception will be raised
386 --   but not handled.
387 --
388 -- Developer Implementation Notes:
389 --   Any post-processing required after the update dml is issued should be
390 --   coded within this procedure. It is important to note that any 3rd party
391 --   maintenance should be reviewed before placing in this procedure.
392 --
393 -- Access Status:
394 --   Internal Row Handler Use Only.
395 --
396 -- {End Of Comments}
397 -- ----------------------------------------------------------------------------
398 Procedure post_update
399 	(p_rec 			 in ben_lpe_shd.g_rec_type,
400 	 p_effective_date	 in date,
401 	 p_datetrack_mode	 in varchar2,
402 	 p_validation_start_date in date,
403 	 p_validation_end_date	 in date) is
404 --
405   l_proc	varchar2(72) := g_package||'post_update';
406 --
407 Begin
408   hr_utility.set_location('Entering:'||l_proc, 5);
409 --
410   --
411   -- Start of API User Hook for post_update.
412   --
413   begin
414     --
415     ben_lpe_rku.after_update
416       (
417   p_ler_chg_pl_nip_enrt_id        =>p_rec.ler_chg_pl_nip_enrt_id
418  ,p_effective_start_date          =>p_rec.effective_start_date
419  ,p_effective_end_date            =>p_rec.effective_end_date
420  ,p_business_group_id             =>p_rec.business_group_id
421  ,p_pl_id                         =>p_rec.pl_id
422  ,p_ler_id                        =>p_rec.ler_id
423  ,p_tco_chg_enrt_cd               =>p_rec.tco_chg_enrt_cd
424  ,p_crnt_enrt_prclds_chg_flag     =>p_rec.crnt_enrt_prclds_chg_flag
425  ,p_dflt_enrt_cd                  =>p_rec.dflt_enrt_cd
426  ,p_dflt_enrt_rl                  =>p_rec.dflt_enrt_rl
427  ,p_dflt_flag                     =>p_rec.dflt_flag
428  ,p_enrt_rl                       =>p_rec.enrt_rl
429  ,p_enrt_cd                       =>p_rec.enrt_cd
430  ,p_stl_elig_cant_chg_flag        =>p_rec.stl_elig_cant_chg_flag
431  ,p_enrt_mthd_cd                  =>p_rec.enrt_mthd_cd
432  ,p_auto_enrt_mthd_rl             =>p_rec.auto_enrt_mthd_rl
433  ,p_lpe_attribute_category        =>p_rec.lpe_attribute_category
434  ,p_lpe_attribute1                =>p_rec.lpe_attribute1
435  ,p_lpe_attribute2                =>p_rec.lpe_attribute2
436  ,p_lpe_attribute3                =>p_rec.lpe_attribute3
437  ,p_lpe_attribute4                =>p_rec.lpe_attribute4
438  ,p_lpe_attribute5                =>p_rec.lpe_attribute5
439  ,p_lpe_attribute6                =>p_rec.lpe_attribute6
440  ,p_lpe_attribute7                =>p_rec.lpe_attribute7
441  ,p_lpe_attribute8                =>p_rec.lpe_attribute8
442  ,p_lpe_attribute9                =>p_rec.lpe_attribute9
443  ,p_lpe_attribute10               =>p_rec.lpe_attribute10
444  ,p_lpe_attribute11               =>p_rec.lpe_attribute11
445  ,p_lpe_attribute12               =>p_rec.lpe_attribute12
446  ,p_lpe_attribute13               =>p_rec.lpe_attribute13
447  ,p_lpe_attribute14               =>p_rec.lpe_attribute14
448  ,p_lpe_attribute15               =>p_rec.lpe_attribute15
449  ,p_lpe_attribute16               =>p_rec.lpe_attribute16
450  ,p_lpe_attribute17               =>p_rec.lpe_attribute17
451  ,p_lpe_attribute18               =>p_rec.lpe_attribute18
452  ,p_lpe_attribute19               =>p_rec.lpe_attribute19
453  ,p_lpe_attribute20               =>p_rec.lpe_attribute20
454  ,p_lpe_attribute21               =>p_rec.lpe_attribute21
455  ,p_lpe_attribute22               =>p_rec.lpe_attribute22
456  ,p_lpe_attribute23               =>p_rec.lpe_attribute23
457  ,p_lpe_attribute24               =>p_rec.lpe_attribute24
458  ,p_lpe_attribute25               =>p_rec.lpe_attribute25
459  ,p_lpe_attribute26               =>p_rec.lpe_attribute26
460  ,p_lpe_attribute27               =>p_rec.lpe_attribute27
461  ,p_lpe_attribute28               =>p_rec.lpe_attribute28
462  ,p_lpe_attribute29               =>p_rec.lpe_attribute29
463  ,p_lpe_attribute30               =>p_rec.lpe_attribute30
464  ,p_object_version_number         =>p_rec.object_version_number
465  ,p_effective_date                =>p_effective_date
466  ,p_datetrack_mode                =>p_datetrack_mode
467  ,p_validation_start_date         =>p_validation_start_date
468  ,p_validation_end_date           =>p_validation_end_date
469  ,p_effective_start_date_o        =>ben_lpe_shd.g_old_rec.effective_start_date
470  ,p_effective_end_date_o          =>ben_lpe_shd.g_old_rec.effective_end_date
471  ,p_business_group_id_o           =>ben_lpe_shd.g_old_rec.business_group_id
472  ,p_pl_id_o                       =>ben_lpe_shd.g_old_rec.pl_id
473  ,p_ler_id_o                      =>ben_lpe_shd.g_old_rec.ler_id
474  ,p_tco_chg_enrt_cd_o             =>ben_lpe_shd.g_old_rec.tco_chg_enrt_cd
475  ,p_crnt_enrt_prclds_chg_flag_o   =>ben_lpe_shd.g_old_rec.crnt_enrt_prclds_chg_flag
476  ,p_dflt_enrt_cd_o                =>ben_lpe_shd.g_old_rec.dflt_enrt_cd
477  ,p_dflt_enrt_rl_o                =>ben_lpe_shd.g_old_rec.dflt_enrt_rl
478  ,p_dflt_flag_o                   =>ben_lpe_shd.g_old_rec.dflt_flag
479  ,p_enrt_rl_o                     =>ben_lpe_shd.g_old_rec.enrt_rl
480  ,p_enrt_cd_o                     =>ben_lpe_shd.g_old_rec.enrt_cd
481  ,p_stl_elig_cant_chg_flag_o      =>ben_lpe_shd.g_old_rec.stl_elig_cant_chg_flag
482  ,p_enrt_mthd_cd_o                =>ben_lpe_shd.g_old_rec.enrt_mthd_cd
483  ,p_auto_enrt_mthd_rl_o           =>ben_lpe_shd.g_old_rec.auto_enrt_mthd_rl
484  ,p_lpe_attribute_category_o      =>ben_lpe_shd.g_old_rec.lpe_attribute_category
485  ,p_lpe_attribute1_o              =>ben_lpe_shd.g_old_rec.lpe_attribute1
486  ,p_lpe_attribute2_o              =>ben_lpe_shd.g_old_rec.lpe_attribute2
487  ,p_lpe_attribute3_o              =>ben_lpe_shd.g_old_rec.lpe_attribute3
488  ,p_lpe_attribute4_o              =>ben_lpe_shd.g_old_rec.lpe_attribute4
489  ,p_lpe_attribute5_o              =>ben_lpe_shd.g_old_rec.lpe_attribute5
490  ,p_lpe_attribute6_o              =>ben_lpe_shd.g_old_rec.lpe_attribute6
491  ,p_lpe_attribute7_o              =>ben_lpe_shd.g_old_rec.lpe_attribute7
492  ,p_lpe_attribute8_o              =>ben_lpe_shd.g_old_rec.lpe_attribute8
493  ,p_lpe_attribute9_o              =>ben_lpe_shd.g_old_rec.lpe_attribute9
494  ,p_lpe_attribute10_o             =>ben_lpe_shd.g_old_rec.lpe_attribute10
495  ,p_lpe_attribute11_o             =>ben_lpe_shd.g_old_rec.lpe_attribute11
496  ,p_lpe_attribute12_o             =>ben_lpe_shd.g_old_rec.lpe_attribute12
497  ,p_lpe_attribute13_o             =>ben_lpe_shd.g_old_rec.lpe_attribute13
498  ,p_lpe_attribute14_o             =>ben_lpe_shd.g_old_rec.lpe_attribute14
499  ,p_lpe_attribute15_o             =>ben_lpe_shd.g_old_rec.lpe_attribute15
500  ,p_lpe_attribute16_o             =>ben_lpe_shd.g_old_rec.lpe_attribute16
501  ,p_lpe_attribute17_o             =>ben_lpe_shd.g_old_rec.lpe_attribute17
502  ,p_lpe_attribute18_o             =>ben_lpe_shd.g_old_rec.lpe_attribute18
503  ,p_lpe_attribute19_o             =>ben_lpe_shd.g_old_rec.lpe_attribute19
504  ,p_lpe_attribute20_o             =>ben_lpe_shd.g_old_rec.lpe_attribute20
505  ,p_lpe_attribute21_o             =>ben_lpe_shd.g_old_rec.lpe_attribute21
506  ,p_lpe_attribute22_o             =>ben_lpe_shd.g_old_rec.lpe_attribute22
507  ,p_lpe_attribute23_o             =>ben_lpe_shd.g_old_rec.lpe_attribute23
508  ,p_lpe_attribute24_o             =>ben_lpe_shd.g_old_rec.lpe_attribute24
509  ,p_lpe_attribute25_o             =>ben_lpe_shd.g_old_rec.lpe_attribute25
510  ,p_lpe_attribute26_o             =>ben_lpe_shd.g_old_rec.lpe_attribute26
511  ,p_lpe_attribute27_o             =>ben_lpe_shd.g_old_rec.lpe_attribute27
512  ,p_lpe_attribute28_o             =>ben_lpe_shd.g_old_rec.lpe_attribute28
513  ,p_lpe_attribute29_o             =>ben_lpe_shd.g_old_rec.lpe_attribute29
514  ,p_lpe_attribute30_o             =>ben_lpe_shd.g_old_rec.lpe_attribute30
515  ,p_object_version_number_o       =>ben_lpe_shd.g_old_rec.object_version_number
516       );
517     --
518   exception
519     --
520     when hr_api.cannot_find_prog_unit then
521       --
522       hr_api.cannot_find_prog_unit_error
523         (p_module_name => 'ben_ler_chg_pl_nip_enrt_f'
524         ,p_hook_type   => 'AU');
525       --
526   end;
527   --
528   -- End of API User Hook for post_update.
529   --
530   --
531   hr_utility.set_location(' Leaving:'||l_proc, 10);
532 End post_update;
533 --
534 -- ----------------------------------------------------------------------------
535 -- |-----------------------------< convert_defs >-----------------------------|
536 -- ----------------------------------------------------------------------------
537 -- {Start Of Comments}
538 --
539 -- Description:
540 --   The Convert_Defs procedure has one very important function:
541 --   It must return the record structure for the row with all system defaulted
542 --   values converted into its corresponding parameter value for update. When
543 --   we attempt to update a row through the Upd process , certain
544 --   parameters can be defaulted which enables flexibility in the calling of
545 --   the upd process (e.g. only attributes which need to be updated need to be
546 --   specified). For the upd process to determine which attributes
547 --   have NOT been specified we need to check if the parameter has a reserved
548 --   system default value. Therefore, for all parameters which have a
549 --   corresponding reserved system default mechanism specified we need to
550 --   check if a system default is being used. If a system default is being
551 --   used then we convert the defaulted value into its corresponding attribute
552 --   value held in the g_old_rec data structure.
553 --
554 -- Prerequisites:
555 --   This private function can only be called from the upd process.
556 --
557 -- In Parameters:
558 --   A Pl/Sql record structre.
559 --
560 -- Post Success:
561 --   The record structure will be returned with all system defaulted parameter
562 --   values converted into its current row attribute value.
563 --
564 -- Post Failure:
565 --   No direct error handling is required within this function. Any possible
566 --   errors within this procedure will be a PL/SQL value error due to conversion
567 --   of datatypes or data lengths.
568 --
569 -- Developer Implementation Notes:
570 --   None.
571 --
572 -- Access Status:
573 --   Internal Row Handler Use Only.
574 --
575 -- {End Of Comments}
576 -- ----------------------------------------------------------------------------
577 Procedure convert_defs(p_rec in out nocopy ben_lpe_shd.g_rec_type) is
578 --
579   l_proc  varchar2(72) := g_package||'convert_defs';
580 --
581 Begin
582   --
583   hr_utility.set_location('Entering:'||l_proc, 5);
584   --
585   -- We must now examine each argument value in the
586   -- p_rec plsql record structure
587   -- to see if a system default is being used. If a system default
588   -- is being used then we must set to the 'current' argument value.
589   --
590   If (p_rec.business_group_id = hr_api.g_number) then
591     p_rec.business_group_id :=
592     ben_lpe_shd.g_old_rec.business_group_id;
593   End If;
594   If (p_rec.pl_id = hr_api.g_number) then
595     p_rec.pl_id :=
596     ben_lpe_shd.g_old_rec.pl_id;
597   End If;
598   If (p_rec.ler_id = hr_api.g_number) then
599     p_rec.ler_id :=
600     ben_lpe_shd.g_old_rec.ler_id;
601   End If;
602   If (p_rec.tco_chg_enrt_cd = hr_api.g_varchar2) then
603     p_rec.tco_chg_enrt_cd :=
604     ben_lpe_shd.g_old_rec.tco_chg_enrt_cd;
605   End If;
606   If (p_rec.crnt_enrt_prclds_chg_flag = hr_api.g_varchar2) then
607     p_rec.crnt_enrt_prclds_chg_flag :=
608     ben_lpe_shd.g_old_rec.crnt_enrt_prclds_chg_flag;
609   End If;
610   If (p_rec.dflt_enrt_cd = hr_api.g_varchar2) then
611     p_rec.dflt_enrt_cd :=
612     ben_lpe_shd.g_old_rec.dflt_enrt_cd;
613   End If;
614   If (p_rec.dflt_enrt_rl = hr_api.g_number) then
615     p_rec.dflt_enrt_rl :=
616     ben_lpe_shd.g_old_rec.dflt_enrt_rl;
617   End If;
618   If (p_rec.dflt_flag = hr_api.g_varchar2) then
619     p_rec.dflt_flag :=
620     ben_lpe_shd.g_old_rec.dflt_flag;
621   End If;
622   If (p_rec.enrt_rl = hr_api.g_number) then
623     p_rec.enrt_rl :=
624     ben_lpe_shd.g_old_rec.enrt_rl;
625   End If;
626   If (p_rec.enrt_cd = hr_api.g_varchar2) then
627     p_rec.enrt_cd :=
628     ben_lpe_shd.g_old_rec.enrt_cd;
629   End If;
630   If (p_rec.stl_elig_cant_chg_flag = hr_api.g_varchar2) then
631     p_rec.stl_elig_cant_chg_flag :=
632     ben_lpe_shd.g_old_rec.stl_elig_cant_chg_flag;
633   End If;
634   If (p_rec.enrt_mthd_cd = hr_api.g_varchar2) then
635     p_rec.enrt_mthd_cd :=
636     ben_lpe_shd.g_old_rec.enrt_mthd_cd;
637   End If;
638   If (p_rec.auto_enrt_mthd_rl = hr_api.g_number) then
639     p_rec.auto_enrt_mthd_rl :=
640     ben_lpe_shd.g_old_rec.auto_enrt_mthd_rl;
641   End If;
642   If (p_rec.lpe_attribute_category = hr_api.g_varchar2) then
643     p_rec.lpe_attribute_category :=
644     ben_lpe_shd.g_old_rec.lpe_attribute_category;
645   End If;
646   If (p_rec.lpe_attribute1 = hr_api.g_varchar2) then
647     p_rec.lpe_attribute1 :=
648     ben_lpe_shd.g_old_rec.lpe_attribute1;
649   End If;
650   If (p_rec.lpe_attribute2 = hr_api.g_varchar2) then
651     p_rec.lpe_attribute2 :=
652     ben_lpe_shd.g_old_rec.lpe_attribute2;
653   End If;
654   If (p_rec.lpe_attribute3 = hr_api.g_varchar2) then
655     p_rec.lpe_attribute3 :=
656     ben_lpe_shd.g_old_rec.lpe_attribute3;
657   End If;
658   If (p_rec.lpe_attribute4 = hr_api.g_varchar2) then
659     p_rec.lpe_attribute4 :=
660     ben_lpe_shd.g_old_rec.lpe_attribute4;
661   End If;
662   If (p_rec.lpe_attribute5 = hr_api.g_varchar2) then
663     p_rec.lpe_attribute5 :=
664     ben_lpe_shd.g_old_rec.lpe_attribute5;
665   End If;
666   If (p_rec.lpe_attribute6 = hr_api.g_varchar2) then
667     p_rec.lpe_attribute6 :=
668     ben_lpe_shd.g_old_rec.lpe_attribute6;
669   End If;
670   If (p_rec.lpe_attribute7 = hr_api.g_varchar2) then
671     p_rec.lpe_attribute7 :=
672     ben_lpe_shd.g_old_rec.lpe_attribute7;
673   End If;
674   If (p_rec.lpe_attribute8 = hr_api.g_varchar2) then
675     p_rec.lpe_attribute8 :=
676     ben_lpe_shd.g_old_rec.lpe_attribute8;
677   End If;
678   If (p_rec.lpe_attribute9 = hr_api.g_varchar2) then
679     p_rec.lpe_attribute9 :=
680     ben_lpe_shd.g_old_rec.lpe_attribute9;
681   End If;
682   If (p_rec.lpe_attribute10 = hr_api.g_varchar2) then
683     p_rec.lpe_attribute10 :=
684     ben_lpe_shd.g_old_rec.lpe_attribute10;
685   End If;
686   If (p_rec.lpe_attribute11 = hr_api.g_varchar2) then
687     p_rec.lpe_attribute11 :=
688     ben_lpe_shd.g_old_rec.lpe_attribute11;
689   End If;
690   If (p_rec.lpe_attribute12 = hr_api.g_varchar2) then
691     p_rec.lpe_attribute12 :=
692     ben_lpe_shd.g_old_rec.lpe_attribute12;
693   End If;
694   If (p_rec.lpe_attribute13 = hr_api.g_varchar2) then
695     p_rec.lpe_attribute13 :=
696     ben_lpe_shd.g_old_rec.lpe_attribute13;
697   End If;
698   If (p_rec.lpe_attribute14 = hr_api.g_varchar2) then
699     p_rec.lpe_attribute14 :=
700     ben_lpe_shd.g_old_rec.lpe_attribute14;
701   End If;
702   If (p_rec.lpe_attribute15 = hr_api.g_varchar2) then
703     p_rec.lpe_attribute15 :=
704     ben_lpe_shd.g_old_rec.lpe_attribute15;
705   End If;
706   If (p_rec.lpe_attribute16 = hr_api.g_varchar2) then
707     p_rec.lpe_attribute16 :=
708     ben_lpe_shd.g_old_rec.lpe_attribute16;
709   End If;
710   If (p_rec.lpe_attribute17 = hr_api.g_varchar2) then
711     p_rec.lpe_attribute17 :=
712     ben_lpe_shd.g_old_rec.lpe_attribute17;
713   End If;
714   If (p_rec.lpe_attribute18 = hr_api.g_varchar2) then
715     p_rec.lpe_attribute18 :=
716     ben_lpe_shd.g_old_rec.lpe_attribute18;
717   End If;
718   If (p_rec.lpe_attribute19 = hr_api.g_varchar2) then
719     p_rec.lpe_attribute19 :=
720     ben_lpe_shd.g_old_rec.lpe_attribute19;
721   End If;
722   If (p_rec.lpe_attribute20 = hr_api.g_varchar2) then
723     p_rec.lpe_attribute20 :=
724     ben_lpe_shd.g_old_rec.lpe_attribute20;
725   End If;
726   If (p_rec.lpe_attribute21 = hr_api.g_varchar2) then
727     p_rec.lpe_attribute21 :=
728     ben_lpe_shd.g_old_rec.lpe_attribute21;
729   End If;
730   If (p_rec.lpe_attribute22 = hr_api.g_varchar2) then
731     p_rec.lpe_attribute22 :=
732     ben_lpe_shd.g_old_rec.lpe_attribute22;
733   End If;
734   If (p_rec.lpe_attribute23 = hr_api.g_varchar2) then
735     p_rec.lpe_attribute23 :=
736     ben_lpe_shd.g_old_rec.lpe_attribute23;
737   End If;
738   If (p_rec.lpe_attribute24 = hr_api.g_varchar2) then
739     p_rec.lpe_attribute24 :=
740     ben_lpe_shd.g_old_rec.lpe_attribute24;
741   End If;
742   If (p_rec.lpe_attribute25 = hr_api.g_varchar2) then
743     p_rec.lpe_attribute25 :=
744     ben_lpe_shd.g_old_rec.lpe_attribute25;
745   End If;
746   If (p_rec.lpe_attribute26 = hr_api.g_varchar2) then
747     p_rec.lpe_attribute26 :=
748     ben_lpe_shd.g_old_rec.lpe_attribute26;
749   End If;
750   If (p_rec.lpe_attribute27 = hr_api.g_varchar2) then
751     p_rec.lpe_attribute27 :=
752     ben_lpe_shd.g_old_rec.lpe_attribute27;
753   End If;
754   If (p_rec.lpe_attribute28 = hr_api.g_varchar2) then
755     p_rec.lpe_attribute28 :=
756     ben_lpe_shd.g_old_rec.lpe_attribute28;
757   End If;
758   If (p_rec.lpe_attribute29 = hr_api.g_varchar2) then
759     p_rec.lpe_attribute29 :=
760     ben_lpe_shd.g_old_rec.lpe_attribute29;
761   End If;
762   If (p_rec.lpe_attribute30 = hr_api.g_varchar2) then
763     p_rec.lpe_attribute30 :=
764     ben_lpe_shd.g_old_rec.lpe_attribute30;
765   End If;
766 
767   --
768   hr_utility.set_location(' Leaving:'||l_proc, 10);
769 --
770 End convert_defs;
771 --
772 -- ----------------------------------------------------------------------------
773 -- |---------------------------------< upd >----------------------------------|
774 -- ----------------------------------------------------------------------------
775 Procedure upd
776   (
777   p_rec			in out nocopy 	ben_lpe_shd.g_rec_type,
778   p_effective_date	in 	date,
779   p_datetrack_mode	in 	varchar2
780   ) is
781 --
782   l_proc			varchar2(72) := g_package||'upd';
783   l_validation_start_date	date;
784   l_validation_end_date		date;
785 --
786 Begin
787   hr_utility.set_location('Entering:'||l_proc, 5);
788   --
789   -- Ensure that the DateTrack update mode is valid
790   --
791   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
792   --
793   -- We must lock the row which we need to update.
794   --
795   ben_lpe_shd.lck
796 	(p_effective_date	 => p_effective_date,
797       	 p_datetrack_mode	 => p_datetrack_mode,
798       	 p_ler_chg_pl_nip_enrt_id	 => p_rec.ler_chg_pl_nip_enrt_id,
799       	 p_object_version_number => p_rec.object_version_number,
800       	 p_validation_start_date => l_validation_start_date,
801       	 p_validation_end_date	 => l_validation_end_date);
802   --
803   -- 1. During an update system defaults are used to determine if
804   --    arguments have been defaulted or not. We must therefore
805   --    derive the full record structure values to be updated.
806   --
807   -- 2. Call the supporting update validate operations.
808   --
809   convert_defs(p_rec);
810   ben_lpe_bus.update_validate
811 	(p_rec			 => p_rec,
812 	 p_effective_date	 => p_effective_date,
813 	 p_datetrack_mode  	 => p_datetrack_mode,
814 	 p_validation_start_date => l_validation_start_date,
815 	 p_validation_end_date	 => l_validation_end_date);
816   --
817   -- Call the supporting pre-update operation
818   --
819   pre_update
820 	(p_rec			 => p_rec,
821 	 p_effective_date	 => p_effective_date,
822 	 p_datetrack_mode	 => p_datetrack_mode,
823 	 p_validation_start_date => l_validation_start_date,
824 	 p_validation_end_date	 => l_validation_end_date);
825   --
826   -- Update the row.
827   --
828   update_dml
829 	(p_rec			 => p_rec,
830 	 p_effective_date	 => p_effective_date,
831 	 p_datetrack_mode	 => p_datetrack_mode,
832 	 p_validation_start_date => l_validation_start_date,
833 	 p_validation_end_date	 => l_validation_end_date);
834   --
835   -- Call the supporting post-update operation
836   --
837   post_update
838 	(p_rec			 => p_rec,
839 	 p_effective_date	 => p_effective_date,
840 	 p_datetrack_mode	 => p_datetrack_mode,
841 	 p_validation_start_date => l_validation_start_date,
842 	 p_validation_end_date	 => l_validation_end_date);
843 End upd;
844 --
845 -- ----------------------------------------------------------------------------
846 -- |---------------------------------< upd >----------------------------------|
847 -- ----------------------------------------------------------------------------
848 Procedure upd
849   (
850   p_ler_chg_pl_nip_enrt_id       in number,
851   p_effective_start_date         out nocopy date,
852   p_effective_end_date           out nocopy date,
853   p_business_group_id            in number           default hr_api.g_number,
854   p_pl_id                        in number           default hr_api.g_number,
855   p_ler_id                       in number           default hr_api.g_number,
856   p_tco_chg_enrt_cd              in varchar2         default hr_api.g_varchar2,
857   p_crnt_enrt_prclds_chg_flag    in varchar2         default hr_api.g_varchar2,
858   p_dflt_enrt_cd                 in varchar2         default hr_api.g_varchar2,
859   p_dflt_enrt_rl                 in number           default hr_api.g_number,
860   p_dflt_flag                    in varchar2         default hr_api.g_varchar2,
861   p_enrt_rl                      in number           default hr_api.g_number,
862   p_enrt_cd                      in varchar2         default hr_api.g_varchar2,
863   p_stl_elig_cant_chg_flag       in varchar2         default hr_api.g_varchar2,
864   p_enrt_mthd_cd                 in varchar2         default hr_api.g_varchar2,
865   p_auto_enrt_mthd_rl            in number           default hr_api.g_number,
866   p_lpe_attribute_category       in varchar2         default hr_api.g_varchar2,
867   p_lpe_attribute1               in varchar2         default hr_api.g_varchar2,
868   p_lpe_attribute2               in varchar2         default hr_api.g_varchar2,
869   p_lpe_attribute3               in varchar2         default hr_api.g_varchar2,
870   p_lpe_attribute4               in varchar2         default hr_api.g_varchar2,
871   p_lpe_attribute5               in varchar2         default hr_api.g_varchar2,
872   p_lpe_attribute6               in varchar2         default hr_api.g_varchar2,
873   p_lpe_attribute7               in varchar2         default hr_api.g_varchar2,
874   p_lpe_attribute8               in varchar2         default hr_api.g_varchar2,
875   p_lpe_attribute9               in varchar2         default hr_api.g_varchar2,
876   p_lpe_attribute10              in varchar2         default hr_api.g_varchar2,
877   p_lpe_attribute11              in varchar2         default hr_api.g_varchar2,
878   p_lpe_attribute12              in varchar2         default hr_api.g_varchar2,
879   p_lpe_attribute13              in varchar2         default hr_api.g_varchar2,
880   p_lpe_attribute14              in varchar2         default hr_api.g_varchar2,
881   p_lpe_attribute15              in varchar2         default hr_api.g_varchar2,
882   p_lpe_attribute16              in varchar2         default hr_api.g_varchar2,
883   p_lpe_attribute17              in varchar2         default hr_api.g_varchar2,
884   p_lpe_attribute18              in varchar2         default hr_api.g_varchar2,
885   p_lpe_attribute19              in varchar2         default hr_api.g_varchar2,
886   p_lpe_attribute20              in varchar2         default hr_api.g_varchar2,
887   p_lpe_attribute21              in varchar2         default hr_api.g_varchar2,
888   p_lpe_attribute22              in varchar2         default hr_api.g_varchar2,
889   p_lpe_attribute23              in varchar2         default hr_api.g_varchar2,
890   p_lpe_attribute24              in varchar2         default hr_api.g_varchar2,
891   p_lpe_attribute25              in varchar2         default hr_api.g_varchar2,
892   p_lpe_attribute26              in varchar2         default hr_api.g_varchar2,
893   p_lpe_attribute27              in varchar2         default hr_api.g_varchar2,
894   p_lpe_attribute28              in varchar2         default hr_api.g_varchar2,
895   p_lpe_attribute29              in varchar2         default hr_api.g_varchar2,
896   p_lpe_attribute30              in varchar2         default hr_api.g_varchar2,
897   p_object_version_number        in out nocopy number,
898   p_effective_date		 in date,
899   p_datetrack_mode		 in varchar2
900   ) is
901 --
902   l_rec		ben_lpe_shd.g_rec_type;
903   l_proc	varchar2(72) := g_package||'upd';
904 --
905 Begin
906   hr_utility.set_location('Entering:'||l_proc, 5);
907   --
908   -- Call conversion function to turn arguments into the
909   -- l_rec structure.
910   --
911   l_rec :=
912   ben_lpe_shd.convert_args
913   (
914   p_ler_chg_pl_nip_enrt_id,
915   null,
916   null,
917   p_business_group_id,
918   p_pl_id,
919   p_ler_id,
920   p_tco_chg_enrt_cd,
921   p_crnt_enrt_prclds_chg_flag,
922   p_dflt_enrt_cd,
923   p_dflt_enrt_rl,
924   p_dflt_flag,
925   p_enrt_rl,
926   p_enrt_cd,
927   p_stl_elig_cant_chg_flag,
928   p_enrt_mthd_cd,
929   p_auto_enrt_mthd_rl,
930   p_lpe_attribute_category,
931   p_lpe_attribute1,
932   p_lpe_attribute2,
933   p_lpe_attribute3,
934   p_lpe_attribute4,
935   p_lpe_attribute5,
936   p_lpe_attribute6,
937   p_lpe_attribute7,
938   p_lpe_attribute8,
939   p_lpe_attribute9,
940   p_lpe_attribute10,
941   p_lpe_attribute11,
942   p_lpe_attribute12,
943   p_lpe_attribute13,
944   p_lpe_attribute14,
945   p_lpe_attribute15,
946   p_lpe_attribute16,
947   p_lpe_attribute17,
948   p_lpe_attribute18,
949   p_lpe_attribute19,
950   p_lpe_attribute20,
951   p_lpe_attribute21,
952   p_lpe_attribute22,
953   p_lpe_attribute23,
954   p_lpe_attribute24,
955   p_lpe_attribute25,
956   p_lpe_attribute26,
957   p_lpe_attribute27,
958   p_lpe_attribute28,
959   p_lpe_attribute29,
960   p_lpe_attribute30,
961   p_object_version_number
962   );
963   --
964   -- Having converted the arguments into the
965   -- plsql record structure we call the corresponding record
966   -- business process.
967   --
968   upd(l_rec, p_effective_date, p_datetrack_mode);
969   p_object_version_number       := l_rec.object_version_number;
970   p_effective_start_date        := l_rec.effective_start_date;
971   p_effective_end_date          := l_rec.effective_end_date;
972   --
973   --
974   hr_utility.set_location(' Leaving:'||l_proc, 10);
975 End upd;
976 --
977 end ben_lpe_upd;