DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CCT_UPD

Source


1 Package Body ben_cct_upd as
2 /* $Header: becctrhi.pkb 120.0.12020000.4 2012/07/03 11:57:28 amnaraya ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_cct_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_cct_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_cm_typ_f',
78 	   p_base_key_column	=> 'cm_typ_id',
79 	   p_base_key_value	=> p_rec.cm_typ_id);
80     --
81     ben_cct_shd.g_api_dml := true;  -- Set the api dml status
82     --
83     -- Update the ben_cm_typ_f Row
84     --
85     update  ben_cm_typ_f
86     set
87         cm_typ_id                       = p_rec.cm_typ_id,
88     name                            = p_rec.name,
89     desc_txt                        = p_rec.desc_txt,
90     inactive_flag                      = p_rec.inactive_flag,
91     cm_typ_rl                       = p_rec.cm_typ_rl,
92     cm_usg_cd                       = p_rec.cm_usg_cd,
93     whnvr_trgrd_flag                = p_rec.whnvr_trgrd_flag,
94     shrt_name                       = p_rec.shrt_name,
95     pc_kit_cd                       = p_rec.pc_kit_cd,
96     trk_mlg_flag                    = p_rec.trk_mlg_flag,
97     mx_num_avlbl_val                = p_rec.mx_num_avlbl_val,
98     to_be_sent_dt_cd                = p_rec.to_be_sent_dt_cd,
99     to_be_sent_dt_rl                = p_rec.to_be_sent_dt_rl,
100     inspn_rqd_flag                  = p_rec.inspn_rqd_flag,
101     inspn_rqd_rl                    = p_rec.inspn_rqd_rl,
102     rcpent_cd                       = p_rec.rcpent_cd,
103     parnt_cm_typ_id                 = p_rec.parnt_cm_typ_id,
104     business_group_id               = p_rec.business_group_id,
105     cct_attribute_category          = p_rec.cct_attribute_category,
106     cct_attribute1                  = p_rec.cct_attribute1,
107     cct_attribute10                 = p_rec.cct_attribute10,
108     cct_attribute11                 = p_rec.cct_attribute11,
109     cct_attribute12                 = p_rec.cct_attribute12,
110     cct_attribute13                 = p_rec.cct_attribute13,
111     cct_attribute14                 = p_rec.cct_attribute14,
112     cct_attribute15                 = p_rec.cct_attribute15,
113     cct_attribute16                 = p_rec.cct_attribute16,
114     cct_attribute17                 = p_rec.cct_attribute17,
115     cct_attribute18                 = p_rec.cct_attribute18,
116     cct_attribute19                 = p_rec.cct_attribute19,
117     cct_attribute2                  = p_rec.cct_attribute2,
118     cct_attribute20                 = p_rec.cct_attribute20,
119     cct_attribute21                 = p_rec.cct_attribute21,
120     cct_attribute22                 = p_rec.cct_attribute22,
121     cct_attribute23                 = p_rec.cct_attribute23,
122     cct_attribute24                 = p_rec.cct_attribute24,
123     cct_attribute25                 = p_rec.cct_attribute25,
124     cct_attribute26                 = p_rec.cct_attribute26,
125     cct_attribute27                 = p_rec.cct_attribute27,
126     cct_attribute28                 = p_rec.cct_attribute28,
127     cct_attribute29                 = p_rec.cct_attribute29,
128     cct_attribute3                  = p_rec.cct_attribute3,
129     cct_attribute30                 = p_rec.cct_attribute30,
130     cct_attribute4                  = p_rec.cct_attribute4,
131     cct_attribute5                  = p_rec.cct_attribute5,
132     cct_attribute6                  = p_rec.cct_attribute6,
133     cct_attribute7                  = p_rec.cct_attribute7,
134     cct_attribute8                  = p_rec.cct_attribute8,
135     cct_attribute9                  = p_rec.cct_attribute9,
136     object_version_number           = p_rec.object_version_number
137     where   cm_typ_id = p_rec.cm_typ_id
138     and     effective_start_date = p_validation_start_date
139     and     effective_end_date   = p_validation_end_date;
140     --
141     --  Update MLS table.
142     --
143     update ben_cm_typ_f_tl
144     set shrt_name   = p_rec.shrt_name,
145         name  = p_rec.name,
146     last_update_date  = sysdate,
147     last_updated_by   = fnd_global.user_id,
148     last_update_login = fnd_global.login_id,
149     source_lang = userenv('LANG')
150     where cm_typ_id = p_rec.cm_typ_id
151     and   effective_start_date = p_validation_start_date
152     and   effective_end_date = p_validation_end_date
153     and   userenv('LANG') in (language, source_lang);
154     --
155     ben_cct_shd.g_api_dml := false;   -- Unset the api dml status
156     --
157     -- Set the effective start and end dates
158     --
159     p_rec.effective_start_date := p_validation_start_date;
160     p_rec.effective_end_date   := p_validation_end_date;
161   End If;
162 --
163 hr_utility.set_location(' Leaving:'||l_proc, 15);
164 Exception
165   When hr_api.check_integrity_violated Then
166     -- A check constraint has been violated
167     ben_cct_shd.g_api_dml := false;   -- Unset the api dml status
168     ben_cct_shd.constraint_error
169       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
170   When hr_api.unique_integrity_violated Then
171     -- Unique integrity has been violated
172     ben_cct_shd.g_api_dml := false;   -- Unset the api dml status
173     ben_cct_shd.constraint_error
174       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
175   When Others Then
176     ben_cct_shd.g_api_dml := false;   -- Unset the api dml status
177     Raise;
178 End dt_update_dml;
179 --
180 -- ----------------------------------------------------------------------------
181 -- |------------------------------< update_dml >------------------------------|
182 -- ----------------------------------------------------------------------------
183 -- {Start Of Comments}
184 --
185 -- Description:
186 --   This procedure calls the dt_update_dml control logic which handles
187 --   the actual datetrack dml.
188 --
189 -- Prerequisites:
190 --   This is an internal private procedure which must be called from the upd
191 --   procedure.
192 --
193 -- In Parameters:
194 --   A Pl/Sql record structre.
195 --
196 -- Post Success:
197 --   Processing contines.
198 --
199 -- Post Failure:
200 --   No specific error handling is required within this procedure.
201 --
202 -- Developer Implementation Notes:
203 --   The update 'set' arguments list should be modified if any of your
204 --   attributes are not updateable.
205 --
206 -- Access Status:
207 --   Internal Row Handler Use Only.
208 --
209 -- {End Of Comments}
210 -- ----------------------------------------------------------------------------
211 Procedure update_dml
212 	(p_rec 			 in out nocopy ben_cct_shd.g_rec_type,
213 	 p_effective_date	 in	date,
214 	 p_datetrack_mode	 in	varchar2,
215 	 p_validation_start_date in	date,
216 	 p_validation_end_date	 in	date) is
217 --
218   l_proc	varchar2(72) := g_package||'update_dml';
219 --
220 Begin
221   hr_utility.set_location('Entering:'||l_proc, 5);
222   --
223   dt_update_dml(p_rec			=> p_rec,
224 		p_effective_date	=> p_effective_date,
225 		p_datetrack_mode	=> p_datetrack_mode,
226        		p_validation_start_date	=> p_validation_start_date,
227 		p_validation_end_date	=> p_validation_end_date);
228   --
229   hr_utility.set_location(' Leaving:'||l_proc, 10);
230 End update_dml;
231 --
232 -- ----------------------------------------------------------------------------
233 -- |----------------------------< dt_pre_update >-----------------------------|
234 -- ----------------------------------------------------------------------------
235 -- {Start Of Comments}
236 --
237 -- Description:
238 --   The dt_pre_update procedure controls the execution
239 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
240 --   and UPDATE_CHANGE_INSERT only. The execution required is as
241 --   follows:
242 --
243 --   1) Providing the datetrack update mode is not 'CORRECTION'
244 --      then set the effective end date of the current row (this
245 --      will be the validation_start_date - 1).
246 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
247 --      corresponding delete_dml process to delete any future rows
248 --      where the effective_start_date is greater than or equal to
249 --	the validation_start_date.
250 --   3) Call the insert_dml process to insert the new updated row
251 --      details..
252 --
253 -- Prerequisites:
254 --   This is an internal procedure which is called from the
255 --   pre_update procedure.
256 --
257 -- In Parameters:
258 --
259 -- Post Success:
260 --   Processing continues.
261 --
262 -- Post Failure:
263 --   If an error has occurred, an error message and exception will be raised
264 --   but not handled.
265 --
266 -- Developer Implementation Notes:
267 --   This is an internal procedure which is required by Datetrack. Don't
268 --   remove or modify.
269 --
270 -- Access Status:
271 --   Internal Row Handler Use Only.
272 --
273 -- {End Of Comments}
274 -- ----------------------------------------------------------------------------
275 Procedure dt_pre_update
276 	(p_rec 			 in out nocopy ben_cct_shd.g_rec_type,
277 	 p_effective_date	 in	date,
278 	 p_datetrack_mode	 in	varchar2,
279 	 p_validation_start_date in	date,
280 	 p_validation_end_date	 in	date) is
281 --
282   l_proc	         varchar2(72) := g_package||'dt_pre_update';
283   l_dummy_version_number number;
284 --
285 Begin
286   hr_utility.set_location('Entering:'||l_proc, 5);
287   If (p_datetrack_mode <> 'CORRECTION') then
288     hr_utility.set_location(l_proc, 10);
289     --
290     -- Update the current effective end date
291     --
292     ben_cct_shd.upd_effective_end_date
293      (p_effective_date	       => p_effective_date,
294       p_base_key_value	       => p_rec.cm_typ_id,
295       p_new_effective_end_date => (p_validation_start_date - 1),
296       p_validation_start_date  => p_validation_start_date,
297       p_validation_end_date    => p_validation_end_date,
298       p_object_version_number  => l_dummy_version_number);
299     --
300     If (p_datetrack_mode = 'UPDATE_OVERRIDE') then
301       hr_utility.set_location(l_proc, 15);
302       --
303       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
304       -- delete any future rows
305       --
306       ben_cct_del.delete_dml
307         (p_rec			 => p_rec,
308 	 p_effective_date	 => p_effective_date,
309 	 p_datetrack_mode	 => p_datetrack_mode,
310 	 p_validation_start_date => p_validation_start_date,
311 	 p_validation_end_date   => p_validation_end_date);
312     End If;
313     hr_utility.set_location(l_proc, 20);
314     --
315     -- We must now insert the updated row
316     --
317     ben_cct_ins.insert_dml
318       (p_rec			=> p_rec,
319        p_effective_date		=> p_effective_date,
320        p_datetrack_mode		=> p_datetrack_mode,
321        p_validation_start_date	=> p_validation_start_date,
322        p_validation_end_date	=> p_validation_end_date);
323   End If;
324   hr_utility.set_location(' Leaving:'||l_proc, 20);
325 End dt_pre_update;
326 --
327 -- ----------------------------------------------------------------------------
328 -- |------------------------------< pre_update >------------------------------|
329 -- ----------------------------------------------------------------------------
330 -- {Start Of Comments}
331 --
332 -- Description:
333 --   This private procedure contains any processing which is required before
334 --   the update dml.
335 --
336 -- Prerequisites:
337 --   This is an internal procedure which is called from the upd procedure.
338 --
339 -- In Parameters:
340 --   A Pl/Sql record structre.
341 --
342 -- Post Success:
343 --   Processing continues.
344 --
345 -- Post Failure:
346 --   If an error has occurred, an error message and exception will be raised
347 --   but not handled.
348 --
349 -- Developer Implementation Notes:
350 --   Any pre-processing required before the update dml is issued should be
351 --   coded within this procedure. It is important to note that any 3rd party
352 --   maintenance should be reviewed before placing in this procedure. The call
353 --   to the dt_update_dml procedure should NOT be removed.
354 --
355 -- Access Status:
356 --   Internal Row Handler Use Only.
357 --
358 -- {End Of Comments}
359 -- ----------------------------------------------------------------------------
360 Procedure pre_update
361 	(p_rec 			 in out nocopy ben_cct_shd.g_rec_type,
362 	 p_effective_date	 in	date,
363 	 p_datetrack_mode	 in	varchar2,
364 	 p_validation_start_date in	date,
365 	 p_validation_end_date	 in	date) is
366 --
367   l_proc	varchar2(72) := g_package||'pre_update';
368 --
369 Begin
370   hr_utility.set_location('Entering:'||l_proc, 5);
371   --
372   --
373   --
374   dt_pre_update
375     (p_rec 		     => p_rec,
376      p_effective_date	     => p_effective_date,
377      p_datetrack_mode	     => p_datetrack_mode,
378      p_validation_start_date => p_validation_start_date,
379      p_validation_end_date   => p_validation_end_date);
380   --
381   hr_utility.set_location(' Leaving:'||l_proc, 10);
382 End pre_update;
383 --
384 -- ----------------------------------------------------------------------------
385 -- |-----------------------------< post_update >------------------------------|
386 -- ----------------------------------------------------------------------------
387 -- {Start Of Comments}
388 --
389 -- Description:
390 --   This private procedure contains any processing which is required after the
391 --   update dml.
392 --
393 -- Prerequisites:
394 --   This is an internal procedure which is called from the upd procedure.
395 --
396 -- In Parameters:
397 --   A Pl/Sql record structre.
398 --
399 -- Post Success:
400 --   Processing continues.
401 --
402 -- Post Failure:
403 --   If an error has occurred, an error message and exception will be raised
404 --   but not handled.
405 --
406 -- Developer Implementation Notes:
407 --   Any post-processing required after the update dml is issued should be
408 --   coded within this procedure. It is important to note that any 3rd party
409 --   maintenance should be reviewed before placing in this procedure.
410 --
411 -- Access Status:
412 --   Internal Row Handler Use Only.
413 --
414 -- {End Of Comments}
415 -- ----------------------------------------------------------------------------
416 Procedure post_update
417 	(p_rec 			 in ben_cct_shd.g_rec_type,
418 	 p_effective_date	 in date,
419 	 p_datetrack_mode	 in varchar2,
420 	 p_validation_start_date in date,
421 	 p_validation_end_date	 in date) is
422 --
423   l_proc	varchar2(72) := g_package||'post_update';
424 --
425 Begin
426   hr_utility.set_location('Entering:'||l_proc, 5);
427 --
428   --
429   -- Start of API User Hook for post_update.
430   --
431   begin
432     --
433     ben_cct_rku.after_update
434       (p_cm_typ_id                     =>p_rec.cm_typ_id
435       ,p_effective_start_date          =>p_rec.effective_start_date
436       ,p_effective_end_date            =>p_rec.effective_end_date
437       ,p_name                          =>p_rec.name
438       ,p_desc_txt                      =>p_rec.desc_txt
439       ,p_inactive_flag                    =>p_rec.inactive_flag
440       ,p_cm_typ_rl                     =>p_rec.cm_typ_rl
441       ,p_cm_usg_cd                     =>p_rec.cm_usg_cd
442       ,p_whnvr_trgrd_flag              =>p_rec.whnvr_trgrd_flag
443       ,p_shrt_name                     =>p_rec.shrt_name
444       ,p_pc_kit_cd                     =>p_rec.pc_kit_cd
445       ,p_trk_mlg_flag                  =>p_rec.trk_mlg_flag
446       ,p_mx_num_avlbl_val              =>p_rec.mx_num_avlbl_val
447       ,p_to_be_sent_dt_cd              =>p_rec.to_be_sent_dt_cd
448       ,p_to_be_sent_dt_rl              =>p_rec.to_be_sent_dt_rl
449       ,p_inspn_rqd_flag                =>p_rec.inspn_rqd_flag
450       ,p_inspn_rqd_rl                  =>p_rec.inspn_rqd_rl
451       ,p_rcpent_cd                     =>p_rec.rcpent_cd
452       ,p_parnt_cm_typ_id               =>p_rec.parnt_cm_typ_id
453       ,p_business_group_id             =>p_rec.business_group_id
454       ,p_cct_attribute_category        =>p_rec.cct_attribute_category
455       ,p_cct_attribute1                =>p_rec.cct_attribute1
456       ,p_cct_attribute10               =>p_rec.cct_attribute10
457       ,p_cct_attribute11               =>p_rec.cct_attribute11
458       ,p_cct_attribute12               =>p_rec.cct_attribute12
459       ,p_cct_attribute13               =>p_rec.cct_attribute13
460       ,p_cct_attribute14               =>p_rec.cct_attribute14
461       ,p_cct_attribute15               =>p_rec.cct_attribute15
462       ,p_cct_attribute16               =>p_rec.cct_attribute16
463       ,p_cct_attribute17               =>p_rec.cct_attribute17
464       ,p_cct_attribute18               =>p_rec.cct_attribute18
465       ,p_cct_attribute19               =>p_rec.cct_attribute19
466       ,p_cct_attribute2                =>p_rec.cct_attribute2
467       ,p_cct_attribute20               =>p_rec.cct_attribute20
468       ,p_cct_attribute21               =>p_rec.cct_attribute21
469       ,p_cct_attribute22               =>p_rec.cct_attribute22
470       ,p_cct_attribute23               =>p_rec.cct_attribute23
471       ,p_cct_attribute24               =>p_rec.cct_attribute24
472       ,p_cct_attribute25               =>p_rec.cct_attribute25
473       ,p_cct_attribute26               =>p_rec.cct_attribute26
474       ,p_cct_attribute27               =>p_rec.cct_attribute27
475       ,p_cct_attribute28               =>p_rec.cct_attribute28
476       ,p_cct_attribute29               =>p_rec.cct_attribute29
477       ,p_cct_attribute3                =>p_rec.cct_attribute3
478       ,p_cct_attribute30               =>p_rec.cct_attribute30
479       ,p_cct_attribute4                =>p_rec.cct_attribute4
480       ,p_cct_attribute5                =>p_rec.cct_attribute5
481       ,p_cct_attribute6                =>p_rec.cct_attribute6
482       ,p_cct_attribute7                =>p_rec.cct_attribute7
483       ,p_cct_attribute8                =>p_rec.cct_attribute8
484       ,p_cct_attribute9                =>p_rec.cct_attribute9
485       ,p_object_version_number         =>p_rec.object_version_number
486       ,p_effective_date                =>p_effective_date
487       ,p_datetrack_mode                =>p_datetrack_mode
488       ,p_validation_start_date         =>p_validation_start_date
489       ,p_validation_end_date           =>p_validation_end_date
490       ,p_effective_start_date_o        =>ben_cct_shd.g_old_rec.effective_start_date
491       ,p_effective_end_date_o          =>ben_cct_shd.g_old_rec.effective_end_date
492       ,p_name_o                        =>ben_cct_shd.g_old_rec.name
493       ,p_desc_txt_o                    =>ben_cct_shd.g_old_rec.desc_txt
494       ,p_inactive_flag_o                  =>ben_cct_shd.g_old_rec.inactive_flag
495       ,p_cm_typ_rl_o                   =>ben_cct_shd.g_old_rec.cm_typ_rl
496       ,p_cm_usg_cd_o                   =>ben_cct_shd.g_old_rec.cm_usg_cd
497       ,p_whnvr_trgrd_flag_o            =>ben_cct_shd.g_old_rec.whnvr_trgrd_flag
498       ,p_shrt_name_o                   =>ben_cct_shd.g_old_rec.shrt_name
499       ,p_pc_kit_cd_o                   =>ben_cct_shd.g_old_rec.pc_kit_cd
500       ,p_trk_mlg_flag_o                =>ben_cct_shd.g_old_rec.trk_mlg_flag
501       ,p_mx_num_avlbl_val_o            =>ben_cct_shd.g_old_rec.mx_num_avlbl_val
502       ,p_to_be_sent_dt_cd_o            =>ben_cct_shd.g_old_rec.to_be_sent_dt_cd
503       ,p_to_be_sent_dt_rl_o            =>ben_cct_shd.g_old_rec.to_be_sent_dt_rl
504       ,p_inspn_rqd_flag_o              =>ben_cct_shd.g_old_rec.inspn_rqd_flag
505       ,p_inspn_rqd_rl_o                =>ben_cct_shd.g_old_rec.inspn_rqd_rl
506       ,p_rcpent_cd_o                   =>ben_cct_shd.g_old_rec.rcpent_cd
507       ,p_parnt_cm_typ_id_o             =>ben_cct_shd.g_old_rec.parnt_cm_typ_id
508       ,p_business_group_id_o           =>ben_cct_shd.g_old_rec.business_group_id
509       ,p_cct_attribute_category_o      =>ben_cct_shd.g_old_rec.cct_attribute_category
510       ,p_cct_attribute1_o              =>ben_cct_shd.g_old_rec.cct_attribute1
511       ,p_cct_attribute10_o             =>ben_cct_shd.g_old_rec.cct_attribute10
512       ,p_cct_attribute11_o             =>ben_cct_shd.g_old_rec.cct_attribute11
513       ,p_cct_attribute12_o             =>ben_cct_shd.g_old_rec.cct_attribute12
514       ,p_cct_attribute13_o             =>ben_cct_shd.g_old_rec.cct_attribute13
515       ,p_cct_attribute14_o             =>ben_cct_shd.g_old_rec.cct_attribute14
516       ,p_cct_attribute15_o             =>ben_cct_shd.g_old_rec.cct_attribute15
517       ,p_cct_attribute16_o             =>ben_cct_shd.g_old_rec.cct_attribute16
518       ,p_cct_attribute17_o             =>ben_cct_shd.g_old_rec.cct_attribute17
519       ,p_cct_attribute18_o             =>ben_cct_shd.g_old_rec.cct_attribute18
520       ,p_cct_attribute19_o             =>ben_cct_shd.g_old_rec.cct_attribute19
521       ,p_cct_attribute2_o              =>ben_cct_shd.g_old_rec.cct_attribute2
522       ,p_cct_attribute20_o             =>ben_cct_shd.g_old_rec.cct_attribute20
523       ,p_cct_attribute21_o             =>ben_cct_shd.g_old_rec.cct_attribute21
524       ,p_cct_attribute22_o             =>ben_cct_shd.g_old_rec.cct_attribute22
525       ,p_cct_attribute23_o             =>ben_cct_shd.g_old_rec.cct_attribute23
526       ,p_cct_attribute24_o             =>ben_cct_shd.g_old_rec.cct_attribute24
527       ,p_cct_attribute25_o             =>ben_cct_shd.g_old_rec.cct_attribute25
528       ,p_cct_attribute26_o             =>ben_cct_shd.g_old_rec.cct_attribute26
529       ,p_cct_attribute27_o             =>ben_cct_shd.g_old_rec.cct_attribute27
530       ,p_cct_attribute28_o             =>ben_cct_shd.g_old_rec.cct_attribute28
531       ,p_cct_attribute29_o             =>ben_cct_shd.g_old_rec.cct_attribute29
532       ,p_cct_attribute3_o              =>ben_cct_shd.g_old_rec.cct_attribute3
533       ,p_cct_attribute30_o             =>ben_cct_shd.g_old_rec.cct_attribute30
534       ,p_cct_attribute4_o              =>ben_cct_shd.g_old_rec.cct_attribute4
535       ,p_cct_attribute5_o              =>ben_cct_shd.g_old_rec.cct_attribute5
536       ,p_cct_attribute6_o              =>ben_cct_shd.g_old_rec.cct_attribute6
537       ,p_cct_attribute7_o              =>ben_cct_shd.g_old_rec.cct_attribute7
538       ,p_cct_attribute8_o              =>ben_cct_shd.g_old_rec.cct_attribute8
539       ,p_cct_attribute9_o              =>ben_cct_shd.g_old_rec.cct_attribute9
540       ,p_object_version_number_o       =>ben_cct_shd.g_old_rec.object_version_number);
541     --
542   exception
543     --
544     when hr_api.cannot_find_prog_unit then
545       --
546       hr_api.cannot_find_prog_unit_error
547         (p_module_name => 'ben_cm_typ_f'
548         ,p_hook_type   => 'AU');
549       --
550   end;
551   --
552   -- End of API User Hook for post_update.
553   --
554   --
555   hr_utility.set_location(' Leaving:'||l_proc, 10);
556 End post_update;
557 --
558 -- ----------------------------------------------------------------------------
559 -- |-----------------------------< convert_defs >-----------------------------|
560 -- ----------------------------------------------------------------------------
561 -- {Start Of Comments}
562 --
563 -- Description:
564 --   The Convert_Defs procedure has one very important function:
565 --   It must return the record structure for the row with all system defaulted
566 --   values converted into its corresponding parameter value for update. When
567 --   we attempt to update a row through the Upd process , certain
568 --   parameters can be defaulted which enables flexibility in the calling of
569 --   the upd process (e.g. only attributes which need to be updated need to be
570 --   specified). For the upd process to determine which attributes
571 --   have NOT been specified we need to check if the parameter has a reserved
572 --   system default value. Therefore, for all parameters which have a
573 --   corresponding reserved system default mechanism specified we need to
574 --   check if a system default is being used. If a system default is being
575 --   used then we convert the defaulted value into its corresponding attribute
576 --   value held in the g_old_rec data structure.
577 --
578 -- Prerequisites:
579 --   This private function can only be called from the upd process.
580 --
581 -- In Parameters:
582 --   A Pl/Sql record structre.
583 --
584 -- Post Success:
585 --   The record structure will be returned with all system defaulted parameter
586 --   values converted into its current row attribute value.
587 --
588 -- Post Failure:
589 --   No direct error handling is required within this function. Any possible
590 --   errors within this procedure will be a PL/SQL value error due to conversion
591 --   of datatypes or data lengths.
592 --
593 -- Developer Implementation Notes:
594 --   None.
595 --
596 -- Access Status:
597 --   Internal Row Handler Use Only.
598 --
599 -- {End Of Comments}
600 -- ----------------------------------------------------------------------------
601 Procedure convert_defs(p_rec in out nocopy ben_cct_shd.g_rec_type) is
602 --
603   l_proc  varchar2(72) := g_package||'convert_defs';
604 --
605 Begin
606   --
607   hr_utility.set_location('Entering:'||l_proc, 5);
608   --
609   -- We must now examine each argument value in the
610   -- p_rec plsql record structure
611   -- to see if a system default is being used. If a system default
612   -- is being used then we must set to the 'current' argument value.
613   --
614   If (p_rec.name = hr_api.g_varchar2) then
615     p_rec.name :=
616     ben_cct_shd.g_old_rec.name;
617   End If;
618   If (p_rec.desc_txt = hr_api.g_varchar2) then
619     p_rec.desc_txt :=
620     ben_cct_shd.g_old_rec.desc_txt;
621   End If;
622   If (p_rec.inactive_flag = hr_api.g_varchar2) then
623     p_rec.inactive_flag :=
624     ben_cct_shd.g_old_rec.inactive_flag;
625   End If;
626   If (p_rec.cm_typ_rl = hr_api.g_number) then
627     p_rec.cm_typ_rl :=
628     ben_cct_shd.g_old_rec.cm_typ_rl;
629   End If;
630   If (p_rec.cm_usg_cd = hr_api.g_varchar2) then
631     p_rec.cm_usg_cd :=
632     ben_cct_shd.g_old_rec.cm_usg_cd;
633   End If;
634   If (p_rec.whnvr_trgrd_flag = hr_api.g_varchar2) then
635     p_rec.whnvr_trgrd_flag :=
636     ben_cct_shd.g_old_rec.whnvr_trgrd_flag;
637   End If;
638   If (p_rec.shrt_name = hr_api.g_varchar2) then
639     p_rec.shrt_name :=
640     ben_cct_shd.g_old_rec.shrt_name;
641   End If;
642   If (p_rec.pc_kit_cd = hr_api.g_varchar2) then
643     p_rec.pc_kit_cd :=
644     ben_cct_shd.g_old_rec.pc_kit_cd;
645   End If;
646   If (p_rec.trk_mlg_flag = hr_api.g_varchar2) then
647     p_rec.trk_mlg_flag :=
648     ben_cct_shd.g_old_rec.trk_mlg_flag;
649   End If;
650   If (p_rec.mx_num_avlbl_val = hr_api.g_number) then
651     p_rec.mx_num_avlbl_val :=
652     ben_cct_shd.g_old_rec.mx_num_avlbl_val;
653   End If;
654   If (p_rec.to_be_sent_dt_cd = hr_api.g_varchar2) then
655     p_rec.to_be_sent_dt_cd :=
656     ben_cct_shd.g_old_rec.to_be_sent_dt_cd;
657   End If;
658   If (p_rec.to_be_sent_dt_rl = hr_api.g_number) then
659     p_rec.to_be_sent_dt_rl :=
660     ben_cct_shd.g_old_rec.to_be_sent_dt_rl;
661   End If;
662   If (p_rec.inspn_rqd_flag = hr_api.g_varchar2) then
663     p_rec.inspn_rqd_flag :=
664     ben_cct_shd.g_old_rec.inspn_rqd_flag;
665   End If;
666   If (p_rec.inspn_rqd_rl = hr_api.g_number) then
667     p_rec.inspn_rqd_rl :=
668     ben_cct_shd.g_old_rec.inspn_rqd_rl;
669   End If;
670   If (p_rec.rcpent_cd = hr_api.g_varchar2) then
671     p_rec.rcpent_cd :=
672     ben_cct_shd.g_old_rec.rcpent_cd;
673   End If;
674   If (p_rec.parnt_cm_typ_id = hr_api.g_number) then
675     p_rec.parnt_cm_typ_id :=
676     ben_cct_shd.g_old_rec.parnt_cm_typ_id;
677   End If;
678   If (p_rec.business_group_id = hr_api.g_number) then
679     p_rec.business_group_id :=
680     ben_cct_shd.g_old_rec.business_group_id;
681   End If;
682   If (p_rec.cct_attribute_category = hr_api.g_varchar2) then
683     p_rec.cct_attribute_category :=
684     ben_cct_shd.g_old_rec.cct_attribute_category;
685   End If;
686   If (p_rec.cct_attribute1 = hr_api.g_varchar2) then
687     p_rec.cct_attribute1 :=
688     ben_cct_shd.g_old_rec.cct_attribute1;
689   End If;
690   If (p_rec.cct_attribute10 = hr_api.g_varchar2) then
691     p_rec.cct_attribute10 :=
692     ben_cct_shd.g_old_rec.cct_attribute10;
693   End If;
694   If (p_rec.cct_attribute11 = hr_api.g_varchar2) then
695     p_rec.cct_attribute11 :=
696     ben_cct_shd.g_old_rec.cct_attribute11;
697   End If;
698   If (p_rec.cct_attribute12 = hr_api.g_varchar2) then
699     p_rec.cct_attribute12 :=
700     ben_cct_shd.g_old_rec.cct_attribute12;
701   End If;
702   If (p_rec.cct_attribute13 = hr_api.g_varchar2) then
703     p_rec.cct_attribute13 :=
704     ben_cct_shd.g_old_rec.cct_attribute13;
705   End If;
706   If (p_rec.cct_attribute14 = hr_api.g_varchar2) then
707     p_rec.cct_attribute14 :=
708     ben_cct_shd.g_old_rec.cct_attribute14;
709   End If;
710   If (p_rec.cct_attribute15 = hr_api.g_varchar2) then
711     p_rec.cct_attribute15 :=
712     ben_cct_shd.g_old_rec.cct_attribute15;
713   End If;
714   If (p_rec.cct_attribute16 = hr_api.g_varchar2) then
715     p_rec.cct_attribute16 :=
716     ben_cct_shd.g_old_rec.cct_attribute16;
717   End If;
718   If (p_rec.cct_attribute17 = hr_api.g_varchar2) then
719     p_rec.cct_attribute17 :=
720     ben_cct_shd.g_old_rec.cct_attribute17;
721   End If;
722   If (p_rec.cct_attribute18 = hr_api.g_varchar2) then
723     p_rec.cct_attribute18 :=
724     ben_cct_shd.g_old_rec.cct_attribute18;
725   End If;
726   If (p_rec.cct_attribute19 = hr_api.g_varchar2) then
727     p_rec.cct_attribute19 :=
728     ben_cct_shd.g_old_rec.cct_attribute19;
729   End If;
730   If (p_rec.cct_attribute2 = hr_api.g_varchar2) then
731     p_rec.cct_attribute2 :=
732     ben_cct_shd.g_old_rec.cct_attribute2;
733   End If;
734   If (p_rec.cct_attribute20 = hr_api.g_varchar2) then
735     p_rec.cct_attribute20 :=
736     ben_cct_shd.g_old_rec.cct_attribute20;
737   End If;
738   If (p_rec.cct_attribute21 = hr_api.g_varchar2) then
739     p_rec.cct_attribute21 :=
740     ben_cct_shd.g_old_rec.cct_attribute21;
741   End If;
742   If (p_rec.cct_attribute22 = hr_api.g_varchar2) then
743     p_rec.cct_attribute22 :=
744     ben_cct_shd.g_old_rec.cct_attribute22;
745   End If;
746   If (p_rec.cct_attribute23 = hr_api.g_varchar2) then
747     p_rec.cct_attribute23 :=
748     ben_cct_shd.g_old_rec.cct_attribute23;
749   End If;
750   If (p_rec.cct_attribute24 = hr_api.g_varchar2) then
751     p_rec.cct_attribute24 :=
752     ben_cct_shd.g_old_rec.cct_attribute24;
753   End If;
754   If (p_rec.cct_attribute25 = hr_api.g_varchar2) then
755     p_rec.cct_attribute25 :=
756     ben_cct_shd.g_old_rec.cct_attribute25;
757   End If;
758   If (p_rec.cct_attribute26 = hr_api.g_varchar2) then
759     p_rec.cct_attribute26 :=
760     ben_cct_shd.g_old_rec.cct_attribute26;
761   End If;
762   If (p_rec.cct_attribute27 = hr_api.g_varchar2) then
763     p_rec.cct_attribute27 :=
764     ben_cct_shd.g_old_rec.cct_attribute27;
765   End If;
766   If (p_rec.cct_attribute28 = hr_api.g_varchar2) then
767     p_rec.cct_attribute28 :=
768     ben_cct_shd.g_old_rec.cct_attribute28;
769   End If;
770   If (p_rec.cct_attribute29 = hr_api.g_varchar2) then
771     p_rec.cct_attribute29 :=
772     ben_cct_shd.g_old_rec.cct_attribute29;
773   End If;
774   If (p_rec.cct_attribute3 = hr_api.g_varchar2) then
775     p_rec.cct_attribute3 :=
776     ben_cct_shd.g_old_rec.cct_attribute3;
777   End If;
778   If (p_rec.cct_attribute30 = hr_api.g_varchar2) then
779     p_rec.cct_attribute30 :=
780     ben_cct_shd.g_old_rec.cct_attribute30;
781   End If;
782   If (p_rec.cct_attribute4 = hr_api.g_varchar2) then
783     p_rec.cct_attribute4 :=
784     ben_cct_shd.g_old_rec.cct_attribute4;
785   End If;
786   If (p_rec.cct_attribute5 = hr_api.g_varchar2) then
787     p_rec.cct_attribute5 :=
788     ben_cct_shd.g_old_rec.cct_attribute5;
789   End If;
790   If (p_rec.cct_attribute6 = hr_api.g_varchar2) then
791     p_rec.cct_attribute6 :=
792     ben_cct_shd.g_old_rec.cct_attribute6;
793   End If;
794   If (p_rec.cct_attribute7 = hr_api.g_varchar2) then
795     p_rec.cct_attribute7 :=
796     ben_cct_shd.g_old_rec.cct_attribute7;
797   End If;
798   If (p_rec.cct_attribute8 = hr_api.g_varchar2) then
799     p_rec.cct_attribute8 :=
800     ben_cct_shd.g_old_rec.cct_attribute8;
801   End If;
802   If (p_rec.cct_attribute9 = hr_api.g_varchar2) then
803     p_rec.cct_attribute9 :=
804     ben_cct_shd.g_old_rec.cct_attribute9;
805   End If;
806   --
807   hr_utility.set_location(' Leaving:'||l_proc, 10);
808 --
809 End convert_defs;
810 --
811 -- ----------------------------------------------------------------------------
812 -- |---------------------------------< upd >----------------------------------|
813 -- ----------------------------------------------------------------------------
814 Procedure upd
815   (
816   p_rec			in out nocopy 	ben_cct_shd.g_rec_type,
817   p_effective_date	in 	date,
818   p_datetrack_mode	in 	varchar2
819   ) is
820 --
821   l_proc			varchar2(72) := g_package||'upd';
822   l_validation_start_date	date;
823   l_validation_end_date		date;
824 --
825 Begin
826   hr_utility.set_location('Entering:'||l_proc, 5);
827   --
828   -- Ensure that the DateTrack update mode is valid
829   --
830   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
831   --
832   -- We must lock the row which we need to update.
833   --
834   ben_cct_shd.lck
835 	(p_effective_date	 => p_effective_date,
836       	 p_datetrack_mode	 => p_datetrack_mode,
837       	 p_cm_typ_id	 => p_rec.cm_typ_id,
838       	 p_object_version_number => p_rec.object_version_number,
839       	 p_validation_start_date => l_validation_start_date,
840       	 p_validation_end_date	 => l_validation_end_date);
841   --
842   -- 1. During an update system defaults are used to determine if
843   --    arguments have been defaulted or not. We must therefore
844   --    derive the full record structure values to be updated.
845   --
846   -- 2. Call the supporting update validate operations.
847   --
848   convert_defs(p_rec);
849   ben_cct_bus.update_validate
850 	(p_rec			 => p_rec,
851 	 p_effective_date	 => p_effective_date,
852 	 p_datetrack_mode  	 => p_datetrack_mode,
853 	 p_validation_start_date => l_validation_start_date,
854 	 p_validation_end_date	 => l_validation_end_date);
855   --
856   -- Call the supporting pre-update operation
857   --
858   pre_update
859 	(p_rec			 => p_rec,
860 	 p_effective_date	 => p_effective_date,
861 	 p_datetrack_mode	 => p_datetrack_mode,
862 	 p_validation_start_date => l_validation_start_date,
863 	 p_validation_end_date	 => l_validation_end_date);
864   --
865   -- Update the row.
866   --
867   update_dml
868 	(p_rec			 => p_rec,
869 	 p_effective_date	 => p_effective_date,
870 	 p_datetrack_mode	 => p_datetrack_mode,
871 	 p_validation_start_date => l_validation_start_date,
872 	 p_validation_end_date	 => l_validation_end_date);
873   --
874   -- Call the supporting post-update operation
875   --
876   post_update
877 	(p_rec			 => p_rec,
878 	 p_effective_date	 => p_effective_date,
879 	 p_datetrack_mode	 => p_datetrack_mode,
880 	 p_validation_start_date => l_validation_start_date,
881 	 p_validation_end_date	 => l_validation_end_date);
882 End upd;
883 --
884 -- ----------------------------------------------------------------------------
885 -- |---------------------------------< upd >----------------------------------|
886 -- ----------------------------------------------------------------------------
887 Procedure upd
888   (
889   p_cm_typ_id                    in number,
890   p_effective_start_date         out nocopy date,
891   p_effective_end_date           out nocopy date,
892   p_name                         in varchar2         default hr_api.g_varchar2,
893   p_desc_txt                     in varchar2         default hr_api.g_varchar2,
894   p_inactive_flag                     in varchar2         default hr_api.g_varchar2,
895   p_cm_typ_rl                    in number           default hr_api.g_number,
896   p_cm_usg_cd                    in varchar2         default hr_api.g_varchar2,
897   p_whnvr_trgrd_flag             in varchar2         default hr_api.g_varchar2,
898   p_shrt_name                    in varchar2         default hr_api.g_varchar2,
899   p_pc_kit_cd                    in varchar2         default hr_api.g_varchar2,
900   p_trk_mlg_flag                 in varchar2         default hr_api.g_varchar2,
901   p_mx_num_avlbl_val             in number           default hr_api.g_number,
902   p_to_be_sent_dt_cd             in varchar2         default hr_api.g_varchar2,
903   p_to_be_sent_dt_rl             in number           default hr_api.g_number,
904   p_inspn_rqd_flag               in varchar2         default hr_api.g_varchar2,
905   p_inspn_rqd_rl                 in number           default hr_api.g_number,
906   p_rcpent_cd                    in varchar2         default hr_api.g_varchar2,
907   p_parnt_cm_typ_id              in number           default hr_api.g_number,
908   p_business_group_id            in number           default hr_api.g_number,
909   p_cct_attribute_category       in varchar2         default hr_api.g_varchar2,
910   p_cct_attribute1               in varchar2         default hr_api.g_varchar2,
911   p_cct_attribute10              in varchar2         default hr_api.g_varchar2,
912   p_cct_attribute11              in varchar2         default hr_api.g_varchar2,
913   p_cct_attribute12              in varchar2         default hr_api.g_varchar2,
914   p_cct_attribute13              in varchar2         default hr_api.g_varchar2,
915   p_cct_attribute14              in varchar2         default hr_api.g_varchar2,
916   p_cct_attribute15              in varchar2         default hr_api.g_varchar2,
917   p_cct_attribute16              in varchar2         default hr_api.g_varchar2,
918   p_cct_attribute17              in varchar2         default hr_api.g_varchar2,
919   p_cct_attribute18              in varchar2         default hr_api.g_varchar2,
920   p_cct_attribute19              in varchar2         default hr_api.g_varchar2,
921   p_cct_attribute2               in varchar2         default hr_api.g_varchar2,
922   p_cct_attribute20              in varchar2         default hr_api.g_varchar2,
923   p_cct_attribute21              in varchar2         default hr_api.g_varchar2,
924   p_cct_attribute22              in varchar2         default hr_api.g_varchar2,
925   p_cct_attribute23              in varchar2         default hr_api.g_varchar2,
926   p_cct_attribute24              in varchar2         default hr_api.g_varchar2,
927   p_cct_attribute25              in varchar2         default hr_api.g_varchar2,
928   p_cct_attribute26              in varchar2         default hr_api.g_varchar2,
929   p_cct_attribute27              in varchar2         default hr_api.g_varchar2,
930   p_cct_attribute28              in varchar2         default hr_api.g_varchar2,
931   p_cct_attribute29              in varchar2         default hr_api.g_varchar2,
932   p_cct_attribute3               in varchar2         default hr_api.g_varchar2,
933   p_cct_attribute30              in varchar2         default hr_api.g_varchar2,
934   p_cct_attribute4               in varchar2         default hr_api.g_varchar2,
935   p_cct_attribute5               in varchar2         default hr_api.g_varchar2,
936   p_cct_attribute6               in varchar2         default hr_api.g_varchar2,
937   p_cct_attribute7               in varchar2         default hr_api.g_varchar2,
938   p_cct_attribute8               in varchar2         default hr_api.g_varchar2,
939   p_cct_attribute9               in varchar2         default hr_api.g_varchar2,
940   p_object_version_number        in out nocopy number,
941   p_effective_date		 in date,
942   p_datetrack_mode		 in varchar2
943   ) is
944 --
945   l_rec		ben_cct_shd.g_rec_type;
946   l_proc	varchar2(72) := g_package||'upd';
947 --
948 Begin
949   hr_utility.set_location('Entering:'||l_proc, 5);
950   --
951   -- Call conversion function to turn arguments into the
952   -- l_rec structure.
953   --
954   l_rec :=
955   ben_cct_shd.convert_args
956   (
957   p_cm_typ_id,
958   null,
959   null,
960   p_name,
961   p_desc_txt,
962   p_inactive_flag,
963   p_cm_typ_rl,
964   p_cm_usg_cd,
965   p_whnvr_trgrd_flag,
966   p_shrt_name,
967   p_pc_kit_cd,
968   p_trk_mlg_flag,
969   p_mx_num_avlbl_val,
970   p_to_be_sent_dt_cd,
971   p_to_be_sent_dt_rl,
972   p_inspn_rqd_flag,
973   p_inspn_rqd_rl,
974   p_rcpent_cd,
975   p_parnt_cm_typ_id,
976   p_business_group_id,
977   p_cct_attribute_category,
978   p_cct_attribute1,
979   p_cct_attribute10,
980   p_cct_attribute11,
981   p_cct_attribute12,
982   p_cct_attribute13,
983   p_cct_attribute14,
984   p_cct_attribute15,
985   p_cct_attribute16,
986   p_cct_attribute17,
987   p_cct_attribute18,
988   p_cct_attribute19,
989   p_cct_attribute2,
990   p_cct_attribute20,
991   p_cct_attribute21,
992   p_cct_attribute22,
993   p_cct_attribute23,
994   p_cct_attribute24,
995   p_cct_attribute25,
996   p_cct_attribute26,
997   p_cct_attribute27,
998   p_cct_attribute28,
999   p_cct_attribute29,
1000   p_cct_attribute3,
1001   p_cct_attribute30,
1002   p_cct_attribute4,
1003   p_cct_attribute5,
1004   p_cct_attribute6,
1005   p_cct_attribute7,
1006   p_cct_attribute8,
1007   p_cct_attribute9,
1008   p_object_version_number
1009   );
1010   --
1011   -- Having converted the arguments into the
1012   -- plsql record structure we call the corresponding record
1013   -- business process.
1014   --
1015   upd(l_rec, p_effective_date, p_datetrack_mode);
1016   p_object_version_number       := l_rec.object_version_number;
1017   p_effective_start_date        := l_rec.effective_start_date;
1018   p_effective_end_date          := l_rec.effective_end_date;
1019   --
1020   --
1021   hr_utility.set_location(' Leaving:'||l_proc, 10);
1022 End upd;
1023 --
1024 end ben_cct_upd;