DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PCX_UPD

Source


1 Package Body ben_pcx_upd as
2 /* $Header: bepcxrhi.pkb 120.0 2005/05/28 10:21:17 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_pcx_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_pcx_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_pl_bnf_ctfn_f',
78 	   p_base_key_column	=> 'pl_bnf_ctfn_id',
79 	   p_base_key_value	=> p_rec.pl_bnf_ctfn_id);
80     --
81     ben_pcx_shd.g_api_dml := true;  -- Set the api dml status
82     --
83     -- Update the ben_pl_bnf_ctfn_f Row
84     --
85     update  ben_pl_bnf_ctfn_f
86     set
87         pl_bnf_ctfn_id                  = p_rec.pl_bnf_ctfn_id,
88     pl_id                           = p_rec.pl_id,
89     bnf_ctfn_typ_cd                 = p_rec.bnf_ctfn_typ_cd,
90     lack_ctfn_sspnd_enrt_flag       = p_rec.lack_ctfn_sspnd_enrt_flag,
91     pfd_flag                        = p_rec.pfd_flag,
92     rqd_flag                        = p_rec.rqd_flag,
93     ctfn_rqd_when_rl                = p_rec.ctfn_rqd_when_rl,
94     bnf_typ_cd                      = p_rec.bnf_typ_cd,
95     rlshp_typ_cd                    = p_rec.rlshp_typ_cd,
96     object_version_number           = p_rec.object_version_number,
97     business_group_id               = p_rec.business_group_id,
98     pcx_attribute_category          = p_rec.pcx_attribute_category,
99     pcx_attribute1                  = p_rec.pcx_attribute1,
100     pcx_attribute2                  = p_rec.pcx_attribute2,
101     pcx_attribute3                  = p_rec.pcx_attribute3,
102     pcx_attribute4                  = p_rec.pcx_attribute4,
103     pcx_attribute5                  = p_rec.pcx_attribute5,
104     pcx_attribute6                  = p_rec.pcx_attribute6,
105     pcx_attribute7                  = p_rec.pcx_attribute7,
106     pcx_attribute8                  = p_rec.pcx_attribute8,
107     pcx_attribute9                  = p_rec.pcx_attribute9,
108     pcx_attribute10                 = p_rec.pcx_attribute10,
109     pcx_attribute11                 = p_rec.pcx_attribute11,
110     pcx_attribute12                 = p_rec.pcx_attribute12,
111     pcx_attribute13                 = p_rec.pcx_attribute13,
112     pcx_attribute14                 = p_rec.pcx_attribute14,
113     pcx_attribute15                 = p_rec.pcx_attribute15,
114     pcx_attribute16                 = p_rec.pcx_attribute16,
115     pcx_attribute17                 = p_rec.pcx_attribute17,
116     pcx_attribute18                 = p_rec.pcx_attribute18,
117     pcx_attribute19                 = p_rec.pcx_attribute19,
118     pcx_attribute20                 = p_rec.pcx_attribute20,
119     pcx_attribute21                 = p_rec.pcx_attribute21,
120     pcx_attribute22                 = p_rec.pcx_attribute22,
121     pcx_attribute23                 = p_rec.pcx_attribute23,
122     pcx_attribute24                 = p_rec.pcx_attribute24,
123     pcx_attribute25                 = p_rec.pcx_attribute25,
124     pcx_attribute26                 = p_rec.pcx_attribute26,
125     pcx_attribute27                 = p_rec.pcx_attribute27,
126     pcx_attribute28                 = p_rec.pcx_attribute28,
127     pcx_attribute29                 = p_rec.pcx_attribute29,
128     pcx_attribute30                 = p_rec.pcx_attribute30
129     where   pl_bnf_ctfn_id = p_rec.pl_bnf_ctfn_id
130     and     effective_start_date = p_validation_start_date
131     and     effective_end_date   = p_validation_end_date;
132     --
133     ben_pcx_shd.g_api_dml := false;   -- Unset the api dml status
134     --
135     -- Set the effective start and end dates
136     --
137     p_rec.effective_start_date := p_validation_start_date;
138     p_rec.effective_end_date   := p_validation_end_date;
139   End If;
140 --
141 hr_utility.set_location(' Leaving:'||l_proc, 15);
142 Exception
143   When hr_api.check_integrity_violated Then
144     -- A check constraint has been violated
145     ben_pcx_shd.g_api_dml := false;   -- Unset the api dml status
146     ben_pcx_shd.constraint_error
147       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
148   When hr_api.unique_integrity_violated Then
149     -- Unique integrity has been violated
150     ben_pcx_shd.g_api_dml := false;   -- Unset the api dml status
151     ben_pcx_shd.constraint_error
152       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
153   When Others Then
154     ben_pcx_shd.g_api_dml := false;   -- Unset the api dml status
155     Raise;
156 End dt_update_dml;
157 --
158 -- ----------------------------------------------------------------------------
159 -- |------------------------------< update_dml >------------------------------|
160 -- ----------------------------------------------------------------------------
161 -- {Start Of Comments}
162 --
163 -- Description:
164 --   This procedure calls the dt_update_dml control logic which handles
165 --   the actual datetrack dml.
166 --
167 -- Prerequisites:
168 --   This is an internal private procedure which must be called from the upd
169 --   procedure.
170 --
171 -- In Parameters:
172 --   A Pl/Sql record structre.
173 --
174 -- Post Success:
175 --   Processing contines.
176 --
177 -- Post Failure:
178 --   No specific error handling is required within this procedure.
179 --
180 -- Developer Implementation Notes:
181 --   The update 'set' arguments list should be modified if any of your
182 --   attributes are not updateable.
183 --
184 -- Access Status:
185 --   Internal Row Handler Use Only.
186 --
187 -- {End Of Comments}
188 -- ----------------------------------------------------------------------------
189 Procedure update_dml
190 	(p_rec 			 in out nocopy ben_pcx_shd.g_rec_type,
191 	 p_effective_date	 in	date,
192 	 p_datetrack_mode	 in	varchar2,
193 	 p_validation_start_date in	date,
194 	 p_validation_end_date	 in	date) is
195 --
196   l_proc	varchar2(72) := g_package||'update_dml';
197 --
198 Begin
199   hr_utility.set_location('Entering:'||l_proc, 5);
200   --
201   dt_update_dml(p_rec			=> p_rec,
202 		p_effective_date	=> p_effective_date,
203 		p_datetrack_mode	=> p_datetrack_mode,
204        		p_validation_start_date	=> p_validation_start_date,
205 		p_validation_end_date	=> p_validation_end_date);
206   --
207   hr_utility.set_location(' Leaving:'||l_proc, 10);
208 End update_dml;
209 --
210 -- ----------------------------------------------------------------------------
211 -- |----------------------------< dt_pre_update >-----------------------------|
212 -- ----------------------------------------------------------------------------
213 -- {Start Of Comments}
214 --
215 -- Description:
216 --   The dt_pre_update procedure controls the execution
217 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
218 --   and UPDATE_CHANGE_INSERT only. The execution required is as
219 --   follows:
220 --
221 --   1) Providing the datetrack update mode is not 'CORRECTION'
222 --      then set the effective end date of the current row (this
223 --      will be the validation_start_date - 1).
224 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
225 --      corresponding delete_dml process to delete any future rows
226 --      where the effective_start_date is greater than or equal to
227 --	the validation_start_date.
228 --   3) Call the insert_dml process to insert the new updated row
229 --      details..
230 --
231 -- Prerequisites:
232 --   This is an internal procedure which is called from the
233 --   pre_update procedure.
234 --
235 -- In Parameters:
236 --
237 -- Post Success:
238 --   Processing continues.
239 --
240 -- Post Failure:
241 --   If an error has occurred, an error message and exception will be raised
242 --   but not handled.
243 --
244 -- Developer Implementation Notes:
245 --   This is an internal procedure which is required by Datetrack. Don't
246 --   remove or modify.
247 --
248 -- Access Status:
249 --   Internal Row Handler Use Only.
250 --
251 -- {End Of Comments}
252 -- ----------------------------------------------------------------------------
253 Procedure dt_pre_update
254 	(p_rec 			 in out nocopy ben_pcx_shd.g_rec_type,
255 	 p_effective_date	 in	date,
256 	 p_datetrack_mode	 in	varchar2,
257 	 p_validation_start_date in	date,
258 	 p_validation_end_date	 in	date) is
259 --
260   l_proc	         varchar2(72) := g_package||'dt_pre_update';
261   l_dummy_version_number number;
262 --
263 Begin
264   hr_utility.set_location('Entering:'||l_proc, 5);
265   If (p_datetrack_mode <> 'CORRECTION') then
266     hr_utility.set_location(l_proc, 10);
267     --
268     -- Update the current effective end date
269     --
270     ben_pcx_shd.upd_effective_end_date
271      (p_effective_date	       => p_effective_date,
272       p_base_key_value	       => p_rec.pl_bnf_ctfn_id,
273       p_new_effective_end_date => (p_validation_start_date - 1),
274       p_validation_start_date  => p_validation_start_date,
275       p_validation_end_date    => p_validation_end_date,
276       p_object_version_number  => l_dummy_version_number);
277     --
278     If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
279       hr_utility.set_location(l_proc, 15);
280       --
281       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
282       -- delete any future rows
283       --
284       ben_pcx_del.delete_dml
285         (p_rec			 => p_rec,
286 	 p_effective_date	 => p_effective_date,
287 	 p_datetrack_mode	 => p_datetrack_mode,
288 	 p_validation_start_date => p_validation_start_date,
289 	 p_validation_end_date   => p_validation_end_date);
290     End If;
291     hr_utility.set_location(l_proc, 20);
292     --
293     -- We must now insert the updated row
294     --
295     ben_pcx_ins.insert_dml
296       (p_rec			=> p_rec,
297        p_effective_date		=> p_effective_date,
298        p_datetrack_mode		=> p_datetrack_mode,
299        p_validation_start_date	=> p_validation_start_date,
300        p_validation_end_date	=> p_validation_end_date);
301   End If;
302   hr_utility.set_location(' Leaving:'||l_proc, 20);
303 End dt_pre_update;
304 --
305 -- ----------------------------------------------------------------------------
306 -- |------------------------------< pre_update >------------------------------|
307 -- ----------------------------------------------------------------------------
308 -- {Start Of Comments}
309 --
310 -- Description:
311 --   This private procedure contains any processing which is required before
312 --   the update dml.
313 --
314 -- Prerequisites:
315 --   This is an internal procedure which is called from the upd procedure.
316 --
317 -- In Parameters:
318 --   A Pl/Sql record structre.
319 --
320 -- Post Success:
321 --   Processing continues.
322 --
323 -- Post Failure:
324 --   If an error has occurred, an error message and exception will be raised
325 --   but not handled.
326 --
327 -- Developer Implementation Notes:
328 --   Any pre-processing required before the update dml is issued should be
329 --   coded within this procedure. It is important to note that any 3rd party
330 --   maintenance should be reviewed before placing in this procedure. The call
331 --   to the dt_update_dml procedure should NOT be removed.
332 --
333 -- Access Status:
334 --   Internal Row Handler Use Only.
335 --
336 -- {End Of Comments}
337 -- ----------------------------------------------------------------------------
338 Procedure pre_update
339 	(p_rec 			 in out nocopy ben_pcx_shd.g_rec_type,
340 	 p_effective_date	 in	date,
341 	 p_datetrack_mode	 in	varchar2,
342 	 p_validation_start_date in	date,
343 	 p_validation_end_date	 in	date) is
344 --
345   l_proc	varchar2(72) := g_package||'pre_update';
346 --
347 Begin
348   hr_utility.set_location('Entering:'||l_proc, 5);
349   --
350   --
351   --
352   dt_pre_update
353     (p_rec 		     => p_rec,
354      p_effective_date	     => p_effective_date,
355      p_datetrack_mode	     => p_datetrack_mode,
356      p_validation_start_date => p_validation_start_date,
357      p_validation_end_date   => p_validation_end_date);
358   --
359   hr_utility.set_location(' Leaving:'||l_proc, 10);
360 End pre_update;
361 --
362 -- ----------------------------------------------------------------------------
363 -- |-----------------------------< post_update >------------------------------|
364 -- ----------------------------------------------------------------------------
365 -- {Start Of Comments}
366 --
367 -- Description:
368 --   This private procedure contains any processing which is required after the
369 --   update dml.
370 --
371 -- Prerequisites:
372 --   This is an internal procedure which is called from the upd procedure.
373 --
374 -- In Parameters:
375 --   A Pl/Sql record structre.
376 --
377 -- Post Success:
378 --   Processing continues.
379 --
380 -- Post Failure:
381 --   If an error has occurred, an error message and exception will be raised
382 --   but not handled.
383 --
384 -- Developer Implementation Notes:
385 --   Any post-processing required after the update dml is issued should be
386 --   coded within this procedure. It is important to note that any 3rd party
387 --   maintenance should be reviewed before placing in this procedure.
388 --
389 -- Access Status:
390 --   Internal Row Handler Use Only.
391 --
392 -- {End Of Comments}
393 -- ----------------------------------------------------------------------------
394 Procedure post_update
395 	(p_rec 			 in ben_pcx_shd.g_rec_type,
396 	 p_effective_date	 in date,
397 	 p_datetrack_mode	 in varchar2,
398 	 p_validation_start_date in date,
399 	 p_validation_end_date	 in date) is
400 --
401   l_proc	varchar2(72) := g_package||'post_update';
402 --
403 Begin
404   hr_utility.set_location('Entering:'||l_proc, 5);
405 --
406   --
407   -- Start of API User Hook for post_update.
408   --
409   begin
410     --
411     ben_pcx_rku.after_update
412       (
413   p_pl_bnf_ctfn_id                =>p_rec.pl_bnf_ctfn_id
414  ,p_effective_start_date          =>p_rec.effective_start_date
415  ,p_effective_end_date            =>p_rec.effective_end_date
416  ,p_pl_id                         =>p_rec.pl_id
417  ,p_bnf_ctfn_typ_cd               =>p_rec.bnf_ctfn_typ_cd
418  ,p_lack_ctfn_sspnd_enrt_flag     =>p_rec.lack_ctfn_sspnd_enrt_flag
419  ,p_pfd_flag                      =>p_rec.pfd_flag
420  ,p_rqd_flag                      =>p_rec.rqd_flag
421  ,p_ctfn_rqd_when_rl              =>p_rec.ctfn_rqd_when_rl
422  ,p_bnf_typ_cd                    =>p_rec.bnf_typ_cd
423  ,p_rlshp_typ_cd                  =>p_rec.rlshp_typ_cd
424  ,p_object_version_number         =>p_rec.object_version_number
425  ,p_business_group_id             =>p_rec.business_group_id
426  ,p_pcx_attribute_category        =>p_rec.pcx_attribute_category
427  ,p_pcx_attribute1                =>p_rec.pcx_attribute1
428  ,p_pcx_attribute2                =>p_rec.pcx_attribute2
429  ,p_pcx_attribute3                =>p_rec.pcx_attribute3
430  ,p_pcx_attribute4                =>p_rec.pcx_attribute4
431  ,p_pcx_attribute5                =>p_rec.pcx_attribute5
432  ,p_pcx_attribute6                =>p_rec.pcx_attribute6
433  ,p_pcx_attribute7                =>p_rec.pcx_attribute7
434  ,p_pcx_attribute8                =>p_rec.pcx_attribute8
435  ,p_pcx_attribute9                =>p_rec.pcx_attribute9
436  ,p_pcx_attribute10               =>p_rec.pcx_attribute10
437  ,p_pcx_attribute11               =>p_rec.pcx_attribute11
438  ,p_pcx_attribute12               =>p_rec.pcx_attribute12
439  ,p_pcx_attribute13               =>p_rec.pcx_attribute13
440  ,p_pcx_attribute14               =>p_rec.pcx_attribute14
441  ,p_pcx_attribute15               =>p_rec.pcx_attribute15
442  ,p_pcx_attribute16               =>p_rec.pcx_attribute16
443  ,p_pcx_attribute17               =>p_rec.pcx_attribute17
444  ,p_pcx_attribute18               =>p_rec.pcx_attribute18
445  ,p_pcx_attribute19               =>p_rec.pcx_attribute19
446  ,p_pcx_attribute20               =>p_rec.pcx_attribute20
447  ,p_pcx_attribute21               =>p_rec.pcx_attribute21
448  ,p_pcx_attribute22               =>p_rec.pcx_attribute22
449  ,p_pcx_attribute23               =>p_rec.pcx_attribute23
450  ,p_pcx_attribute24               =>p_rec.pcx_attribute24
451  ,p_pcx_attribute25               =>p_rec.pcx_attribute25
452  ,p_pcx_attribute26               =>p_rec.pcx_attribute26
453  ,p_pcx_attribute27               =>p_rec.pcx_attribute27
454  ,p_pcx_attribute28               =>p_rec.pcx_attribute28
455  ,p_pcx_attribute29               =>p_rec.pcx_attribute29
456  ,p_pcx_attribute30               =>p_rec.pcx_attribute30
457  ,p_effective_date                =>p_effective_date
458  ,p_datetrack_mode                =>p_datetrack_mode
459  ,p_validation_start_date         =>p_validation_start_date
460  ,p_validation_end_date           =>p_validation_end_date
461  ,p_effective_start_date_o        =>ben_pcx_shd.g_old_rec.effective_start_date
462  ,p_effective_end_date_o          =>ben_pcx_shd.g_old_rec.effective_end_date
463  ,p_pl_id_o                       =>ben_pcx_shd.g_old_rec.pl_id
464  ,p_bnf_ctfn_typ_cd_o             =>ben_pcx_shd.g_old_rec.bnf_ctfn_typ_cd
465  ,p_lack_ctfn_sspnd_enrt_flag_o   =>ben_pcx_shd.g_old_rec.lack_ctfn_sspnd_enrt_flag
466  ,p_pfd_flag_o                    =>ben_pcx_shd.g_old_rec.pfd_flag
467  ,p_rqd_flag_o                    =>ben_pcx_shd.g_old_rec.rqd_flag
468  ,p_ctfn_rqd_when_rl_o            =>ben_pcx_shd.g_old_rec.ctfn_rqd_when_rl
469  ,p_bnf_typ_cd_o                  =>ben_pcx_shd.g_old_rec.bnf_typ_cd
470  ,p_rlshp_typ_cd_o                =>ben_pcx_shd.g_old_rec.rlshp_typ_cd
471  ,p_object_version_number_o       =>ben_pcx_shd.g_old_rec.object_version_number
472  ,p_business_group_id_o           =>ben_pcx_shd.g_old_rec.business_group_id
473  ,p_pcx_attribute_category_o      =>ben_pcx_shd.g_old_rec.pcx_attribute_category
474  ,p_pcx_attribute1_o              =>ben_pcx_shd.g_old_rec.pcx_attribute1
475  ,p_pcx_attribute2_o              =>ben_pcx_shd.g_old_rec.pcx_attribute2
476  ,p_pcx_attribute3_o              =>ben_pcx_shd.g_old_rec.pcx_attribute3
477  ,p_pcx_attribute4_o              =>ben_pcx_shd.g_old_rec.pcx_attribute4
478  ,p_pcx_attribute5_o              =>ben_pcx_shd.g_old_rec.pcx_attribute5
479  ,p_pcx_attribute6_o              =>ben_pcx_shd.g_old_rec.pcx_attribute6
480  ,p_pcx_attribute7_o              =>ben_pcx_shd.g_old_rec.pcx_attribute7
481  ,p_pcx_attribute8_o              =>ben_pcx_shd.g_old_rec.pcx_attribute8
482  ,p_pcx_attribute9_o              =>ben_pcx_shd.g_old_rec.pcx_attribute9
483  ,p_pcx_attribute10_o             =>ben_pcx_shd.g_old_rec.pcx_attribute10
484  ,p_pcx_attribute11_o             =>ben_pcx_shd.g_old_rec.pcx_attribute11
485  ,p_pcx_attribute12_o             =>ben_pcx_shd.g_old_rec.pcx_attribute12
486  ,p_pcx_attribute13_o             =>ben_pcx_shd.g_old_rec.pcx_attribute13
487  ,p_pcx_attribute14_o             =>ben_pcx_shd.g_old_rec.pcx_attribute14
488  ,p_pcx_attribute15_o             =>ben_pcx_shd.g_old_rec.pcx_attribute15
489  ,p_pcx_attribute16_o             =>ben_pcx_shd.g_old_rec.pcx_attribute16
490  ,p_pcx_attribute17_o             =>ben_pcx_shd.g_old_rec.pcx_attribute17
491  ,p_pcx_attribute18_o             =>ben_pcx_shd.g_old_rec.pcx_attribute18
492  ,p_pcx_attribute19_o             =>ben_pcx_shd.g_old_rec.pcx_attribute19
493  ,p_pcx_attribute20_o             =>ben_pcx_shd.g_old_rec.pcx_attribute20
494  ,p_pcx_attribute21_o             =>ben_pcx_shd.g_old_rec.pcx_attribute21
495  ,p_pcx_attribute22_o             =>ben_pcx_shd.g_old_rec.pcx_attribute22
496  ,p_pcx_attribute23_o             =>ben_pcx_shd.g_old_rec.pcx_attribute23
497  ,p_pcx_attribute24_o             =>ben_pcx_shd.g_old_rec.pcx_attribute24
498  ,p_pcx_attribute25_o             =>ben_pcx_shd.g_old_rec.pcx_attribute25
499  ,p_pcx_attribute26_o             =>ben_pcx_shd.g_old_rec.pcx_attribute26
500  ,p_pcx_attribute27_o             =>ben_pcx_shd.g_old_rec.pcx_attribute27
501  ,p_pcx_attribute28_o             =>ben_pcx_shd.g_old_rec.pcx_attribute28
502  ,p_pcx_attribute29_o             =>ben_pcx_shd.g_old_rec.pcx_attribute29
503  ,p_pcx_attribute30_o             =>ben_pcx_shd.g_old_rec.pcx_attribute30
504       );
505     --
506   exception
507     --
508     when hr_api.cannot_find_prog_unit then
509       --
510       hr_api.cannot_find_prog_unit_error
511         (p_module_name => 'ben_pl_bnf_ctfn_f'
512         ,p_hook_type   => 'AU');
513       --
514   end;
515   --
516   -- End of API User Hook for post_update.
517   --
518   --
519   hr_utility.set_location(' Leaving:'||l_proc, 10);
520 End post_update;
521 --
522 -- ----------------------------------------------------------------------------
523 -- |-----------------------------< convert_defs >-----------------------------|
524 -- ----------------------------------------------------------------------------
525 -- {Start Of Comments}
526 --
527 -- Description:
528 --   The Convert_Defs procedure has one very important function:
529 --   It must return the record structure for the row with all system defaulted
530 --   values converted into its corresponding parameter value for update. When
531 --   we attempt to update a row through the Upd process , certain
532 --   parameters can be defaulted which enables flexibility in the calling of
533 --   the upd process (e.g. only attributes which need to be updated need to be
534 --   specified). For the upd process to determine which attributes
535 --   have NOT been specified we need to check if the parameter has a reserved
536 --   system default value. Therefore, for all parameters which have a
537 --   corresponding reserved system default mechanism specified we need to
538 --   check if a system default is being used. If a system default is being
539 --   used then we convert the defaulted value into its corresponding attribute
540 --   value held in the g_old_rec data structure.
541 --
542 -- Prerequisites:
543 --   This private function can only be called from the upd process.
544 --
545 -- In Parameters:
546 --   A Pl/Sql record structre.
547 --
548 -- Post Success:
549 --   The record structure will be returned with all system defaulted parameter
550 --   values converted into its current row attribute value.
551 --
552 -- Post Failure:
553 --   No direct error handling is required within this function. Any possible
554 --   errors within this procedure will be a PL/SQL value error due to conversion
555 --   of datatypes or data lengths.
556 --
557 -- Developer Implementation Notes:
558 --   None.
559 --
560 -- Access Status:
561 --   Internal Row Handler Use Only.
562 --
563 -- {End Of Comments}
564 -- ----------------------------------------------------------------------------
565 Procedure convert_defs(p_rec in out nocopy ben_pcx_shd.g_rec_type) is
566 --
567   l_proc  varchar2(72) := g_package||'convert_defs';
568 --
569 Begin
570   --
571   hr_utility.set_location('Entering:'||l_proc, 5);
572   --
573   -- We must now examine each argument value in the
574   -- p_rec plsql record structure
575   -- to see if a system default is being used. If a system default
576   -- is being used then we must set to the 'current' argument value.
577   --
578   If (p_rec.pl_id = hr_api.g_number) then
579     p_rec.pl_id :=
580     ben_pcx_shd.g_old_rec.pl_id;
581   End If;
582   If (p_rec.bnf_ctfn_typ_cd = hr_api.g_varchar2) then
583     p_rec.bnf_ctfn_typ_cd :=
584     ben_pcx_shd.g_old_rec.bnf_ctfn_typ_cd;
585   End If;
586   If (p_rec.lack_ctfn_sspnd_enrt_flag = hr_api.g_varchar2) then
587     p_rec.lack_ctfn_sspnd_enrt_flag :=
588     ben_pcx_shd.g_old_rec.lack_ctfn_sspnd_enrt_flag;
589   End If;
590   If (p_rec.pfd_flag = hr_api.g_varchar2) then
591     p_rec.pfd_flag :=
592     ben_pcx_shd.g_old_rec.pfd_flag;
593   End If;
594   If (p_rec.rqd_flag = hr_api.g_varchar2) then
595     p_rec.rqd_flag :=
596     ben_pcx_shd.g_old_rec.rqd_flag;
597   End If;
598   If (p_rec.ctfn_rqd_when_rl = hr_api.g_number) then
599     p_rec.ctfn_rqd_when_rl :=
600     ben_pcx_shd.g_old_rec.ctfn_rqd_when_rl;
601   End If;
602   If (p_rec.bnf_typ_cd = hr_api.g_varchar2) then
603     p_rec.bnf_typ_cd :=
604     ben_pcx_shd.g_old_rec.bnf_typ_cd;
605   End If;
606   If (p_rec.rlshp_typ_cd = hr_api.g_varchar2) then
607     p_rec.rlshp_typ_cd :=
608     ben_pcx_shd.g_old_rec.rlshp_typ_cd;
609   End If;
610   If (p_rec.business_group_id = hr_api.g_number) then
611     p_rec.business_group_id :=
612     ben_pcx_shd.g_old_rec.business_group_id;
613   End If;
614   If (p_rec.pcx_attribute_category = hr_api.g_varchar2) then
615     p_rec.pcx_attribute_category :=
616     ben_pcx_shd.g_old_rec.pcx_attribute_category;
617   End If;
618   If (p_rec.pcx_attribute1 = hr_api.g_varchar2) then
619     p_rec.pcx_attribute1 :=
620     ben_pcx_shd.g_old_rec.pcx_attribute1;
621   End If;
622   If (p_rec.pcx_attribute2 = hr_api.g_varchar2) then
623     p_rec.pcx_attribute2 :=
624     ben_pcx_shd.g_old_rec.pcx_attribute2;
625   End If;
626   If (p_rec.pcx_attribute3 = hr_api.g_varchar2) then
627     p_rec.pcx_attribute3 :=
628     ben_pcx_shd.g_old_rec.pcx_attribute3;
629   End If;
630   If (p_rec.pcx_attribute4 = hr_api.g_varchar2) then
631     p_rec.pcx_attribute4 :=
632     ben_pcx_shd.g_old_rec.pcx_attribute4;
633   End If;
634   If (p_rec.pcx_attribute5 = hr_api.g_varchar2) then
635     p_rec.pcx_attribute5 :=
636     ben_pcx_shd.g_old_rec.pcx_attribute5;
637   End If;
638   If (p_rec.pcx_attribute6 = hr_api.g_varchar2) then
639     p_rec.pcx_attribute6 :=
640     ben_pcx_shd.g_old_rec.pcx_attribute6;
641   End If;
642   If (p_rec.pcx_attribute7 = hr_api.g_varchar2) then
643     p_rec.pcx_attribute7 :=
644     ben_pcx_shd.g_old_rec.pcx_attribute7;
645   End If;
646   If (p_rec.pcx_attribute8 = hr_api.g_varchar2) then
647     p_rec.pcx_attribute8 :=
648     ben_pcx_shd.g_old_rec.pcx_attribute8;
649   End If;
650   If (p_rec.pcx_attribute9 = hr_api.g_varchar2) then
651     p_rec.pcx_attribute9 :=
652     ben_pcx_shd.g_old_rec.pcx_attribute9;
653   End If;
654   If (p_rec.pcx_attribute10 = hr_api.g_varchar2) then
655     p_rec.pcx_attribute10 :=
656     ben_pcx_shd.g_old_rec.pcx_attribute10;
657   End If;
658   If (p_rec.pcx_attribute11 = hr_api.g_varchar2) then
659     p_rec.pcx_attribute11 :=
660     ben_pcx_shd.g_old_rec.pcx_attribute11;
661   End If;
662   If (p_rec.pcx_attribute12 = hr_api.g_varchar2) then
663     p_rec.pcx_attribute12 :=
664     ben_pcx_shd.g_old_rec.pcx_attribute12;
665   End If;
666   If (p_rec.pcx_attribute13 = hr_api.g_varchar2) then
667     p_rec.pcx_attribute13 :=
668     ben_pcx_shd.g_old_rec.pcx_attribute13;
669   End If;
670   If (p_rec.pcx_attribute14 = hr_api.g_varchar2) then
671     p_rec.pcx_attribute14 :=
672     ben_pcx_shd.g_old_rec.pcx_attribute14;
673   End If;
674   If (p_rec.pcx_attribute15 = hr_api.g_varchar2) then
675     p_rec.pcx_attribute15 :=
676     ben_pcx_shd.g_old_rec.pcx_attribute15;
677   End If;
678   If (p_rec.pcx_attribute16 = hr_api.g_varchar2) then
679     p_rec.pcx_attribute16 :=
680     ben_pcx_shd.g_old_rec.pcx_attribute16;
681   End If;
682   If (p_rec.pcx_attribute17 = hr_api.g_varchar2) then
683     p_rec.pcx_attribute17 :=
684     ben_pcx_shd.g_old_rec.pcx_attribute17;
685   End If;
686   If (p_rec.pcx_attribute18 = hr_api.g_varchar2) then
687     p_rec.pcx_attribute18 :=
688     ben_pcx_shd.g_old_rec.pcx_attribute18;
689   End If;
690   If (p_rec.pcx_attribute19 = hr_api.g_varchar2) then
691     p_rec.pcx_attribute19 :=
692     ben_pcx_shd.g_old_rec.pcx_attribute19;
693   End If;
694   If (p_rec.pcx_attribute20 = hr_api.g_varchar2) then
695     p_rec.pcx_attribute20 :=
696     ben_pcx_shd.g_old_rec.pcx_attribute20;
697   End If;
698   If (p_rec.pcx_attribute21 = hr_api.g_varchar2) then
699     p_rec.pcx_attribute21 :=
700     ben_pcx_shd.g_old_rec.pcx_attribute21;
701   End If;
702   If (p_rec.pcx_attribute22 = hr_api.g_varchar2) then
703     p_rec.pcx_attribute22 :=
704     ben_pcx_shd.g_old_rec.pcx_attribute22;
705   End If;
706   If (p_rec.pcx_attribute23 = hr_api.g_varchar2) then
707     p_rec.pcx_attribute23 :=
708     ben_pcx_shd.g_old_rec.pcx_attribute23;
709   End If;
710   If (p_rec.pcx_attribute24 = hr_api.g_varchar2) then
711     p_rec.pcx_attribute24 :=
712     ben_pcx_shd.g_old_rec.pcx_attribute24;
713   End If;
714   If (p_rec.pcx_attribute25 = hr_api.g_varchar2) then
715     p_rec.pcx_attribute25 :=
716     ben_pcx_shd.g_old_rec.pcx_attribute25;
717   End If;
718   If (p_rec.pcx_attribute26 = hr_api.g_varchar2) then
719     p_rec.pcx_attribute26 :=
720     ben_pcx_shd.g_old_rec.pcx_attribute26;
721   End If;
722   If (p_rec.pcx_attribute27 = hr_api.g_varchar2) then
723     p_rec.pcx_attribute27 :=
724     ben_pcx_shd.g_old_rec.pcx_attribute27;
725   End If;
726   If (p_rec.pcx_attribute28 = hr_api.g_varchar2) then
727     p_rec.pcx_attribute28 :=
728     ben_pcx_shd.g_old_rec.pcx_attribute28;
729   End If;
730   If (p_rec.pcx_attribute29 = hr_api.g_varchar2) then
731     p_rec.pcx_attribute29 :=
732     ben_pcx_shd.g_old_rec.pcx_attribute29;
733   End If;
734   If (p_rec.pcx_attribute30 = hr_api.g_varchar2) then
735     p_rec.pcx_attribute30 :=
736     ben_pcx_shd.g_old_rec.pcx_attribute30;
737   End If;
738   --
739   hr_utility.set_location(' Leaving:'||l_proc, 10);
740 --
741 End convert_defs;
742 --
743 -- ----------------------------------------------------------------------------
744 -- |---------------------------------< upd >----------------------------------|
745 -- ----------------------------------------------------------------------------
746 Procedure upd
747   (
748   p_rec			in out nocopy 	ben_pcx_shd.g_rec_type,
749   p_effective_date	in 	date,
750   p_datetrack_mode	in 	varchar2
751   ) is
752 --
753   l_proc			varchar2(72) := g_package||'upd';
754   l_validation_start_date	date;
755   l_validation_end_date		date;
756 --
757 Begin
758   hr_utility.set_location('Entering:'||l_proc, 5);
759   --
760   -- Ensure that the DateTrack update mode is valid
761   --
762   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
763   --
764   -- We must lock the row which we need to update.
765   --
766   ben_pcx_shd.lck
767 	(p_effective_date	 => p_effective_date,
768       	 p_datetrack_mode	 => p_datetrack_mode,
769       	 p_pl_bnf_ctfn_id	 => p_rec.pl_bnf_ctfn_id,
770       	 p_object_version_number => p_rec.object_version_number,
771       	 p_validation_start_date => l_validation_start_date,
772       	 p_validation_end_date	 => l_validation_end_date);
773   --
774   -- 1. During an update system defaults are used to determine if
775   --    arguments have been defaulted or not. We must therefore
776   --    derive the full record structure values to be updated.
777   --
778   -- 2. Call the supporting update validate operations.
779   --
780   convert_defs(p_rec);
781   ben_pcx_bus.update_validate
782 	(p_rec			 => p_rec,
783 	 p_effective_date	 => p_effective_date,
784 	 p_datetrack_mode  	 => p_datetrack_mode,
785 	 p_validation_start_date => l_validation_start_date,
786 	 p_validation_end_date	 => l_validation_end_date);
787   --
788   -- Call the supporting pre-update operation
789   --
790   pre_update
791 	(p_rec			 => p_rec,
792 	 p_effective_date	 => p_effective_date,
793 	 p_datetrack_mode	 => p_datetrack_mode,
794 	 p_validation_start_date => l_validation_start_date,
795 	 p_validation_end_date	 => l_validation_end_date);
796   --
797   -- Update the row.
798   --
799   update_dml
800 	(p_rec			 => p_rec,
801 	 p_effective_date	 => p_effective_date,
802 	 p_datetrack_mode	 => p_datetrack_mode,
803 	 p_validation_start_date => l_validation_start_date,
804 	 p_validation_end_date	 => l_validation_end_date);
805   --
806   -- Call the supporting post-update operation
807   --
808   post_update
809 	(p_rec			 => p_rec,
810 	 p_effective_date	 => p_effective_date,
811 	 p_datetrack_mode	 => p_datetrack_mode,
812 	 p_validation_start_date => l_validation_start_date,
813 	 p_validation_end_date	 => l_validation_end_date);
814 End upd;
815 --
816 -- ----------------------------------------------------------------------------
817 -- |---------------------------------< upd >----------------------------------|
818 -- ----------------------------------------------------------------------------
819 Procedure upd
820   (
821   p_pl_bnf_ctfn_id               in number,
822   p_effective_start_date         out nocopy date,
823   p_effective_end_date           out nocopy date,
824   p_pl_id                        in number           default hr_api.g_number,
825   p_bnf_ctfn_typ_cd              in varchar2         default hr_api.g_varchar2,
826   p_lack_ctfn_sspnd_enrt_flag    in varchar2         default hr_api.g_varchar2,
827   p_pfd_flag                     in varchar2         default hr_api.g_varchar2,
828   p_rqd_flag                     in varchar2         default hr_api.g_varchar2,
829   p_ctfn_rqd_when_rl             in number           default hr_api.g_number,
830   p_bnf_typ_cd                   in varchar2         default hr_api.g_varchar2,
831   p_rlshp_typ_cd                 in varchar2         default hr_api.g_varchar2,
832   p_object_version_number        in out nocopy number,
833   p_business_group_id            in number           default hr_api.g_number,
834   p_pcx_attribute_category       in varchar2         default hr_api.g_varchar2,
835   p_pcx_attribute1               in varchar2         default hr_api.g_varchar2,
836   p_pcx_attribute2               in varchar2         default hr_api.g_varchar2,
837   p_pcx_attribute3               in varchar2         default hr_api.g_varchar2,
838   p_pcx_attribute4               in varchar2         default hr_api.g_varchar2,
839   p_pcx_attribute5               in varchar2         default hr_api.g_varchar2,
840   p_pcx_attribute6               in varchar2         default hr_api.g_varchar2,
841   p_pcx_attribute7               in varchar2         default hr_api.g_varchar2,
842   p_pcx_attribute8               in varchar2         default hr_api.g_varchar2,
843   p_pcx_attribute9               in varchar2         default hr_api.g_varchar2,
844   p_pcx_attribute10              in varchar2         default hr_api.g_varchar2,
845   p_pcx_attribute11              in varchar2         default hr_api.g_varchar2,
846   p_pcx_attribute12              in varchar2         default hr_api.g_varchar2,
847   p_pcx_attribute13              in varchar2         default hr_api.g_varchar2,
848   p_pcx_attribute14              in varchar2         default hr_api.g_varchar2,
849   p_pcx_attribute15              in varchar2         default hr_api.g_varchar2,
850   p_pcx_attribute16              in varchar2         default hr_api.g_varchar2,
851   p_pcx_attribute17              in varchar2         default hr_api.g_varchar2,
852   p_pcx_attribute18              in varchar2         default hr_api.g_varchar2,
853   p_pcx_attribute19              in varchar2         default hr_api.g_varchar2,
854   p_pcx_attribute20              in varchar2         default hr_api.g_varchar2,
855   p_pcx_attribute21              in varchar2         default hr_api.g_varchar2,
856   p_pcx_attribute22              in varchar2         default hr_api.g_varchar2,
857   p_pcx_attribute23              in varchar2         default hr_api.g_varchar2,
858   p_pcx_attribute24              in varchar2         default hr_api.g_varchar2,
859   p_pcx_attribute25              in varchar2         default hr_api.g_varchar2,
860   p_pcx_attribute26              in varchar2         default hr_api.g_varchar2,
861   p_pcx_attribute27              in varchar2         default hr_api.g_varchar2,
862   p_pcx_attribute28              in varchar2         default hr_api.g_varchar2,
863   p_pcx_attribute29              in varchar2         default hr_api.g_varchar2,
864   p_pcx_attribute30              in varchar2         default hr_api.g_varchar2,
865   p_effective_date		 in date,
866   p_datetrack_mode		 in varchar2
867   ) is
868 --
869   l_rec		ben_pcx_shd.g_rec_type;
870   l_proc	varchar2(72) := g_package||'upd';
871 --
872 Begin
873   hr_utility.set_location('Entering:'||l_proc, 5);
874   --
875   -- Call conversion function to turn arguments into the
876   -- l_rec structure.
877   --
878   l_rec :=
879   ben_pcx_shd.convert_args
880   (
881   p_pl_bnf_ctfn_id,
882   null,
883   null,
884   p_pl_id,
885   p_bnf_ctfn_typ_cd,
886   p_lack_ctfn_sspnd_enrt_flag,
887   p_pfd_flag,
888   p_rqd_flag,
889   p_ctfn_rqd_when_rl,
890   p_bnf_typ_cd,
891   p_rlshp_typ_cd,
892   p_object_version_number,
893   p_business_group_id,
894   p_pcx_attribute_category,
895   p_pcx_attribute1,
896   p_pcx_attribute2,
897   p_pcx_attribute3,
898   p_pcx_attribute4,
899   p_pcx_attribute5,
900   p_pcx_attribute6,
901   p_pcx_attribute7,
902   p_pcx_attribute8,
903   p_pcx_attribute9,
904   p_pcx_attribute10,
905   p_pcx_attribute11,
906   p_pcx_attribute12,
907   p_pcx_attribute13,
908   p_pcx_attribute14,
909   p_pcx_attribute15,
910   p_pcx_attribute16,
911   p_pcx_attribute17,
912   p_pcx_attribute18,
913   p_pcx_attribute19,
914   p_pcx_attribute20,
915   p_pcx_attribute21,
916   p_pcx_attribute22,
917   p_pcx_attribute23,
918   p_pcx_attribute24,
919   p_pcx_attribute25,
920   p_pcx_attribute26,
921   p_pcx_attribute27,
922   p_pcx_attribute28,
923   p_pcx_attribute29,
924   p_pcx_attribute30
925   );
926   --
927   -- Having converted the arguments into the
928   -- plsql record structure we call the corresponding record
929   -- business process.
930   --
931   upd(l_rec, p_effective_date, p_datetrack_mode);
932   p_object_version_number       := l_rec.object_version_number;
933   p_effective_start_date        := l_rec.effective_start_date;
934   p_effective_end_date          := l_rec.effective_end_date;
935   --
936   --
937   hr_utility.set_location(' Leaving:'||l_proc, 10);
938 End upd;
939 --
940 end ben_pcx_upd;