DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CMT_UPD

Source


1 Package Body ben_cmt_upd as
2 /* $Header: becmtrhi.pkb 115.14 2002/12/31 23:57:48 mmudigon ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_cmt_upd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------------< update_dml >------------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the actual dml update logic. The processing of
17 --   this procedure is:
18 --   1) Increment the object_version_number by 1 if the object_version_number
19 --      is defined as an attribute for this entity.
20 --   2) To set and unset the g_api_dml status as required (as we are about to
21 --      perform dml).
22 --   3) To update the specified row in the schema using the primary key in
23 --      the predicates.
24 --   4) To trap any constraint violations that may have occurred.
25 --   5) To raise any other errors.
26 --
27 -- Prerequisites:
28 --   This is an internal private procedure which must be called from the upd
29 --   procedure.
30 --
31 -- In Parameters:
32 --   A Pl/Sql record structre.
33 --
34 -- Post Success:
35 --   The specified row will be updated in the schema.
36 --
37 -- Post Failure:
38 --   On the update dml failure it is important to note that we always reset the
39 --   g_api_dml status to false.
40 --   If a check, unique or parent integrity constraint violation is raised the
41 --   constraint_error procedure will be called.
42 --   If any other error is reported, the error will be raised after the
43 --   g_api_dml status is reset.
44 --
45 -- Developer Implementation Notes:
46 --   The update 'set' attribute list should be modified if any of your
47 --   attributes are not updateable.
48 --
49 -- Access Status:
50 --   Internal Row Handler Use Only.
51 --
52 -- {End Of Comments}
53 -- ----------------------------------------------------------------------------
54 Procedure update_dml(p_rec in out nocopy ben_cmt_shd.g_rec_type) is
55 --
56   l_proc  varchar2(72) := g_package||'update_dml';
57 --
58 Begin
59   hr_utility.set_location('Entering:'||l_proc, 5);
60   --
61   -- Increment the object version
62   --
63   p_rec.object_version_number := p_rec.object_version_number + 1;
64   --
65   ben_cmt_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_cm_dlvry_mthd_typ Row
68   --
69   update ben_cm_dlvry_mthd_typ
70   set
71   cm_dlvry_mthd_typ_id              = p_rec.cm_dlvry_mthd_typ_id,
72   cm_dlvry_mthd_typ_cd              = p_rec.cm_dlvry_mthd_typ_cd,
73   business_group_id                 = p_rec.business_group_id,
74   cm_typ_id                         = p_rec.cm_typ_id,
75   cmt_attribute1                    = p_rec.cmt_attribute1,
76   cmt_attribute10                   = p_rec.cmt_attribute10,
77   cmt_attribute11                   = p_rec.cmt_attribute11,
78   cmt_attribute12                   = p_rec.cmt_attribute12,
79   cmt_attribute13                   = p_rec.cmt_attribute13,
80   cmt_attribute14                   = p_rec.cmt_attribute14,
81   cmt_attribute15                   = p_rec.cmt_attribute15,
82   cmt_attribute16                   = p_rec.cmt_attribute16,
83   cmt_attribute17                   = p_rec.cmt_attribute17,
84   cmt_attribute18                   = p_rec.cmt_attribute18,
85   cmt_attribute19                   = p_rec.cmt_attribute19,
86   cmt_attribute2                    = p_rec.cmt_attribute2,
87   cmt_attribute20                   = p_rec.cmt_attribute20,
88   cmt_attribute21                   = p_rec.cmt_attribute21,
89   cmt_attribute22                   = p_rec.cmt_attribute22,
90   cmt_attribute23                   = p_rec.cmt_attribute23,
91   cmt_attribute24                   = p_rec.cmt_attribute24,
92   cmt_attribute25                   = p_rec.cmt_attribute25,
93   cmt_attribute26                   = p_rec.cmt_attribute26,
94   cmt_attribute27                   = p_rec.cmt_attribute27,
95   cmt_attribute28                   = p_rec.cmt_attribute28,
96   cmt_attribute29                   = p_rec.cmt_attribute29,
97   cmt_attribute3                    = p_rec.cmt_attribute3,
98   cmt_attribute30                   = p_rec.cmt_attribute30,
99   rqd_flag                          = p_rec.rqd_flag,
100   cmt_attribute_category            = p_rec.cmt_attribute_category,
101   cmt_attribute4                    = p_rec.cmt_attribute4,
102   cmt_attribute5                    = p_rec.cmt_attribute5,
103   cmt_attribute6                    = p_rec.cmt_attribute6,
104   cmt_attribute7                    = p_rec.cmt_attribute7,
105   cmt_attribute8                    = p_rec.cmt_attribute8,
106   cmt_attribute9                    = p_rec.cmt_attribute9,
107   dflt_flag                         = p_rec.dflt_flag,
108   object_version_number             = p_rec.object_version_number
109   where cm_dlvry_mthd_typ_id = p_rec.cm_dlvry_mthd_typ_id;
110   --
111   ben_cmt_shd.g_api_dml := false;   -- Unset the api dml status
112   --
113   hr_utility.set_location(' Leaving:'||l_proc, 10);
114 --
115 Exception
116   When hr_api.check_integrity_violated Then
117     -- A check constraint has been violated
118     ben_cmt_shd.g_api_dml := false;   -- Unset the api dml status
119     ben_cmt_shd.constraint_error
120       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
121   When hr_api.parent_integrity_violated Then
122     -- Parent integrity has been violated
123     ben_cmt_shd.g_api_dml := false;   -- Unset the api dml status
124     ben_cmt_shd.constraint_error
125       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
126   When hr_api.unique_integrity_violated Then
127     -- Unique integrity has been violated
128     ben_cmt_shd.g_api_dml := false;   -- Unset the api dml status
129     ben_cmt_shd.constraint_error
130       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
131   When Others Then
132     ben_cmt_shd.g_api_dml := false;   -- Unset the api dml status
133     Raise;
134 End update_dml;
135 --
136 -- ----------------------------------------------------------------------------
137 -- |------------------------------< pre_update >------------------------------|
138 -- ----------------------------------------------------------------------------
139 -- {Start Of Comments}
140 --
141 -- Description:
142 --   This private procedure contains any processing which is required before
143 --   the update dml.
144 --
145 -- Prerequisites:
146 --   This is an internal procedure which is called from the upd procedure.
147 --
148 -- In Parameters:
149 --   A Pl/Sql record structre.
150 --
151 -- Post Success:
152 --   Processing continues.
153 --
154 -- Post Failure:
155 --   If an error has occurred, an error message and exception will be raised
156 --   but not handled.
157 --
158 -- Developer Implementation Notes:
159 --   Any pre-processing required before the update dml is issued should be
160 --   coded within this procedure. It is important to note that any 3rd party
161 --   maintenance should be reviewed before placing in this procedure.
162 --
163 -- Access Status:
164 --   Internal Row Handler Use Only.
165 --
166 -- {End Of Comments}
167 -- ----------------------------------------------------------------------------
168 Procedure pre_update(p_rec in ben_cmt_shd.g_rec_type) is
169 --
170   l_proc  varchar2(72) := g_package||'pre_update';
171 --
172 Begin
173   hr_utility.set_location('Entering:'||l_proc, 5);
174   --
175   hr_utility.set_location(' Leaving:'||l_proc, 10);
176 End pre_update;
177 --
178 -- ----------------------------------------------------------------------------
179 -- |-----------------------------< post_update >------------------------------|
180 -- ----------------------------------------------------------------------------
181 -- {Start Of Comments}
182 --
183 -- Description:
184 --   This private procedure contains any processing which is required after the
185 --   update dml.
186 --
187 -- Prerequisites:
188 --   This is an internal procedure which is called from the upd procedure.
189 --
190 -- In Parameters:
191 --   A Pl/Sql record structre.
192 --
193 -- Post Success:
194 --   Processing continues.
195 --
196 -- Post Failure:
197 --   If an error has occurred, an error message and exception will be raised
198 --   but not handled.
199 --
200 -- Developer Implementation Notes:
201 --   Any post-processing required after the update dml is issued should be
202 --   coded within this procedure. It is important to note that any 3rd party
203 --   maintenance should be reviewed before placing in this procedure.
204 --
205 -- Access Status:
206 --   Internal Row Handler Use Only.
207 --
208 -- {End Of Comments}
209 -- ----------------------------------------------------------------------------
210 Procedure post_update(
211 p_effective_date in date,p_rec in ben_cmt_shd.g_rec_type) is
212 --
213   l_proc  varchar2(72) := g_package||'post_update';
214 --
215 Begin
216   hr_utility.set_location('Entering:'||l_proc, 5);
217 --
218   --
219   -- Start of API User Hook for post_update.
220   --
221   begin
222     --
223     ben_cmt_rku.after_update
224       (
225   p_cm_dlvry_mthd_typ_id          =>p_rec.cm_dlvry_mthd_typ_id
226  ,p_cm_dlvry_mthd_typ_cd          =>p_rec.cm_dlvry_mthd_typ_cd
227  ,p_business_group_id             =>p_rec.business_group_id
228  ,p_cm_typ_id                     =>p_rec.cm_typ_id
229  ,p_cmt_attribute1                =>p_rec.cmt_attribute1
230  ,p_cmt_attribute10               =>p_rec.cmt_attribute10
231  ,p_cmt_attribute11               =>p_rec.cmt_attribute11
232  ,p_cmt_attribute12               =>p_rec.cmt_attribute12
233  ,p_cmt_attribute13               =>p_rec.cmt_attribute13
234  ,p_cmt_attribute14               =>p_rec.cmt_attribute14
235  ,p_cmt_attribute15               =>p_rec.cmt_attribute15
236  ,p_cmt_attribute16               =>p_rec.cmt_attribute16
237  ,p_cmt_attribute17               =>p_rec.cmt_attribute17
238  ,p_cmt_attribute18               =>p_rec.cmt_attribute18
239  ,p_cmt_attribute19               =>p_rec.cmt_attribute19
240  ,p_cmt_attribute2                =>p_rec.cmt_attribute2
241  ,p_cmt_attribute20               =>p_rec.cmt_attribute20
242  ,p_cmt_attribute21               =>p_rec.cmt_attribute21
243  ,p_cmt_attribute22               =>p_rec.cmt_attribute22
244  ,p_cmt_attribute23               =>p_rec.cmt_attribute23
245  ,p_cmt_attribute24               =>p_rec.cmt_attribute24
246  ,p_cmt_attribute25               =>p_rec.cmt_attribute25
247  ,p_cmt_attribute26               =>p_rec.cmt_attribute26
248  ,p_cmt_attribute27               =>p_rec.cmt_attribute27
249  ,p_cmt_attribute28               =>p_rec.cmt_attribute28
250  ,p_cmt_attribute29               =>p_rec.cmt_attribute29
251  ,p_cmt_attribute3                =>p_rec.cmt_attribute3
252  ,p_cmt_attribute30               =>p_rec.cmt_attribute30
253  ,p_rqd_flag                      =>p_rec.rqd_flag
254  ,p_cmt_attribute_category        =>p_rec.cmt_attribute_category
255  ,p_cmt_attribute4                =>p_rec.cmt_attribute4
256  ,p_cmt_attribute5                =>p_rec.cmt_attribute5
257  ,p_cmt_attribute6                =>p_rec.cmt_attribute6
258  ,p_cmt_attribute7                =>p_rec.cmt_attribute7
259  ,p_cmt_attribute8                =>p_rec.cmt_attribute8
260  ,p_cmt_attribute9                =>p_rec.cmt_attribute9
261  ,p_dflt_flag                     =>p_rec.dflt_flag
262  ,p_object_version_number         =>p_rec.object_version_number
263  ,p_effective_date                =>p_effective_date
264  ,p_cm_dlvry_mthd_typ_cd_o        =>ben_cmt_shd.g_old_rec.cm_dlvry_mthd_typ_cd
265  ,p_business_group_id_o           =>ben_cmt_shd.g_old_rec.business_group_id
266  ,p_cm_typ_id_o                   =>ben_cmt_shd.g_old_rec.cm_typ_id
267  ,p_cmt_attribute1_o              =>ben_cmt_shd.g_old_rec.cmt_attribute1
268  ,p_cmt_attribute10_o             =>ben_cmt_shd.g_old_rec.cmt_attribute10
269  ,p_cmt_attribute11_o             =>ben_cmt_shd.g_old_rec.cmt_attribute11
270  ,p_cmt_attribute12_o             =>ben_cmt_shd.g_old_rec.cmt_attribute12
271  ,p_cmt_attribute13_o             =>ben_cmt_shd.g_old_rec.cmt_attribute13
272  ,p_cmt_attribute14_o             =>ben_cmt_shd.g_old_rec.cmt_attribute14
273  ,p_cmt_attribute15_o             =>ben_cmt_shd.g_old_rec.cmt_attribute15
274  ,p_cmt_attribute16_o             =>ben_cmt_shd.g_old_rec.cmt_attribute16
275  ,p_cmt_attribute17_o             =>ben_cmt_shd.g_old_rec.cmt_attribute17
276  ,p_cmt_attribute18_o             =>ben_cmt_shd.g_old_rec.cmt_attribute18
277  ,p_cmt_attribute19_o             =>ben_cmt_shd.g_old_rec.cmt_attribute19
278  ,p_cmt_attribute2_o              =>ben_cmt_shd.g_old_rec.cmt_attribute2
279  ,p_cmt_attribute20_o             =>ben_cmt_shd.g_old_rec.cmt_attribute20
280  ,p_cmt_attribute21_o             =>ben_cmt_shd.g_old_rec.cmt_attribute21
281  ,p_cmt_attribute22_o             =>ben_cmt_shd.g_old_rec.cmt_attribute22
282  ,p_cmt_attribute23_o             =>ben_cmt_shd.g_old_rec.cmt_attribute23
283  ,p_cmt_attribute24_o             =>ben_cmt_shd.g_old_rec.cmt_attribute24
284  ,p_cmt_attribute25_o             =>ben_cmt_shd.g_old_rec.cmt_attribute25
285  ,p_cmt_attribute26_o             =>ben_cmt_shd.g_old_rec.cmt_attribute26
286  ,p_cmt_attribute27_o             =>ben_cmt_shd.g_old_rec.cmt_attribute27
287  ,p_cmt_attribute28_o             =>ben_cmt_shd.g_old_rec.cmt_attribute28
288  ,p_cmt_attribute29_o             =>ben_cmt_shd.g_old_rec.cmt_attribute29
289  ,p_cmt_attribute3_o              =>ben_cmt_shd.g_old_rec.cmt_attribute3
290  ,p_cmt_attribute30_o             =>ben_cmt_shd.g_old_rec.cmt_attribute30
291  ,p_rqd_flag_o                    =>ben_cmt_shd.g_old_rec.rqd_flag
292  ,p_cmt_attribute_category_o      =>ben_cmt_shd.g_old_rec.cmt_attribute_category
293  ,p_cmt_attribute4_o              =>ben_cmt_shd.g_old_rec.cmt_attribute4
294  ,p_cmt_attribute5_o              =>ben_cmt_shd.g_old_rec.cmt_attribute5
295  ,p_cmt_attribute6_o              =>ben_cmt_shd.g_old_rec.cmt_attribute6
296  ,p_cmt_attribute7_o              =>ben_cmt_shd.g_old_rec.cmt_attribute7
297  ,p_cmt_attribute8_o              =>ben_cmt_shd.g_old_rec.cmt_attribute8
298  ,p_cmt_attribute9_o              =>ben_cmt_shd.g_old_rec.cmt_attribute9
299  ,p_dflt_flag_o                   =>ben_cmt_shd.g_old_rec.dflt_flag
300  ,p_object_version_number_o       =>ben_cmt_shd.g_old_rec.object_version_number
301       );
302     --
303   exception
304     --
305     when hr_api.cannot_find_prog_unit then
306       --
307       hr_api.cannot_find_prog_unit_error
308         (p_module_name => 'ben_cm_dlvry_mthd_typ'
309         ,p_hook_type   => 'AU');
310       --
311   end;
312   --
313   -- End of API User Hook for post_update.
314   --
315   --
316   hr_utility.set_location(' Leaving:'||l_proc, 10);
317 End post_update;
318 --
319 -- ----------------------------------------------------------------------------
320 -- |-----------------------------< convert_defs >-----------------------------|
321 -- ----------------------------------------------------------------------------
322 -- {Start Of Comments}
323 --
324 -- Description:
325 --   The Convert_Defs procedure has one very important function:
326 --   It must return the record structure for the row with all system defaulted
327 --   values converted into its corresponding parameter value for update. When
328 --   we attempt to update a row through the Upd process , certain
329 --   parameters can be defaulted which enables flexibility in the calling of
330 --   the upd process (e.g. only attributes which need to be updated need to be
331 --   specified). For the upd process to determine which attributes
332 --   have NOT been specified we need to check if the parameter has a reserved
333 --   system default value. Therefore, for all parameters which have a
334 --   corresponding reserved system default mechanism specified we need to
335 --   check if a system default is being used. If a system default is being
336 --   used then we convert the defaulted value into its corresponding attribute
337 --   value held in the g_old_rec data structure.
338 --
339 -- Prerequisites:
340 --   This private function can only be called from the upd process.
341 --
342 -- In Parameters:
343 --   A Pl/Sql record structre.
344 --
345 -- Post Success:
346 --   The record structure will be returned with all system defaulted parameter
347 --   values converted into its current row attribute value.
348 --
349 -- Post Failure:
350 --   No direct error handling is required within this function. Any possible
351 --   errors within this procedure will be a PL/SQL value error due to conversion
352 --   of datatypes or data lengths.
353 --
354 -- Developer Implementation Notes:
355 --   None.
356 --
357 -- Access Status:
358 --   Internal Row Handler Use Only.
359 --
360 -- {End Of Comments}
361 -- ----------------------------------------------------------------------------
362 Procedure convert_defs(p_rec in out nocopy ben_cmt_shd.g_rec_type) is
363 --
364   l_proc  varchar2(72) := g_package||'convert_defs';
365 --
366 Begin
367   --
368   hr_utility.set_location('Entering:'||l_proc, 5);
369   --
370   -- We must now examine each argument value in the
371   -- p_rec plsql record structure
372   -- to see if a system default is being used. If a system default
373   -- is being used then we must set to the 'current' argument value.
374   --
375   If (p_rec.cm_dlvry_mthd_typ_cd = hr_api.g_varchar2) then
376     p_rec.cm_dlvry_mthd_typ_cd :=
377     ben_cmt_shd.g_old_rec.cm_dlvry_mthd_typ_cd;
378   End If;
379   If (p_rec.business_group_id = hr_api.g_number) then
380     p_rec.business_group_id :=
381     ben_cmt_shd.g_old_rec.business_group_id;
382   End If;
383   If (p_rec.cm_typ_id = hr_api.g_number) then
384     p_rec.cm_typ_id :=
385     ben_cmt_shd.g_old_rec.cm_typ_id;
386   End If;
387   If (p_rec.cmt_attribute1 = hr_api.g_varchar2) then
388     p_rec.cmt_attribute1 :=
389     ben_cmt_shd.g_old_rec.cmt_attribute1;
390   End If;
391   If (p_rec.cmt_attribute10 = hr_api.g_varchar2) then
392     p_rec.cmt_attribute10 :=
393     ben_cmt_shd.g_old_rec.cmt_attribute10;
394   End If;
395   If (p_rec.cmt_attribute11 = hr_api.g_varchar2) then
396     p_rec.cmt_attribute11 :=
397     ben_cmt_shd.g_old_rec.cmt_attribute11;
398   End If;
399   If (p_rec.cmt_attribute12 = hr_api.g_varchar2) then
400     p_rec.cmt_attribute12 :=
401     ben_cmt_shd.g_old_rec.cmt_attribute12;
402   End If;
403   If (p_rec.cmt_attribute13 = hr_api.g_varchar2) then
404     p_rec.cmt_attribute13 :=
405     ben_cmt_shd.g_old_rec.cmt_attribute13;
406   End If;
407   If (p_rec.cmt_attribute14 = hr_api.g_varchar2) then
408     p_rec.cmt_attribute14 :=
409     ben_cmt_shd.g_old_rec.cmt_attribute14;
410   End If;
411   If (p_rec.cmt_attribute15 = hr_api.g_varchar2) then
412     p_rec.cmt_attribute15 :=
413     ben_cmt_shd.g_old_rec.cmt_attribute15;
414   End If;
415   If (p_rec.cmt_attribute16 = hr_api.g_varchar2) then
416     p_rec.cmt_attribute16 :=
417     ben_cmt_shd.g_old_rec.cmt_attribute16;
418   End If;
419   If (p_rec.cmt_attribute17 = hr_api.g_varchar2) then
420     p_rec.cmt_attribute17 :=
421     ben_cmt_shd.g_old_rec.cmt_attribute17;
422   End If;
423   If (p_rec.cmt_attribute18 = hr_api.g_varchar2) then
424     p_rec.cmt_attribute18 :=
425     ben_cmt_shd.g_old_rec.cmt_attribute18;
426   End If;
427   If (p_rec.cmt_attribute19 = hr_api.g_varchar2) then
428     p_rec.cmt_attribute19 :=
429     ben_cmt_shd.g_old_rec.cmt_attribute19;
430   End If;
431   If (p_rec.cmt_attribute2 = hr_api.g_varchar2) then
432     p_rec.cmt_attribute2 :=
433     ben_cmt_shd.g_old_rec.cmt_attribute2;
434   End If;
435   If (p_rec.cmt_attribute20 = hr_api.g_varchar2) then
436     p_rec.cmt_attribute20 :=
437     ben_cmt_shd.g_old_rec.cmt_attribute20;
438   End If;
439   If (p_rec.cmt_attribute21 = hr_api.g_varchar2) then
440     p_rec.cmt_attribute21 :=
441     ben_cmt_shd.g_old_rec.cmt_attribute21;
442   End If;
443   If (p_rec.cmt_attribute22 = hr_api.g_varchar2) then
444     p_rec.cmt_attribute22 :=
445     ben_cmt_shd.g_old_rec.cmt_attribute22;
446   End If;
447   If (p_rec.cmt_attribute23 = hr_api.g_varchar2) then
448     p_rec.cmt_attribute23 :=
449     ben_cmt_shd.g_old_rec.cmt_attribute23;
450   End If;
451   If (p_rec.cmt_attribute24 = hr_api.g_varchar2) then
452     p_rec.cmt_attribute24 :=
453     ben_cmt_shd.g_old_rec.cmt_attribute24;
454   End If;
455   If (p_rec.cmt_attribute25 = hr_api.g_varchar2) then
456     p_rec.cmt_attribute25 :=
457     ben_cmt_shd.g_old_rec.cmt_attribute25;
458   End If;
459   If (p_rec.cmt_attribute26 = hr_api.g_varchar2) then
460     p_rec.cmt_attribute26 :=
461     ben_cmt_shd.g_old_rec.cmt_attribute26;
462   End If;
463   If (p_rec.cmt_attribute27 = hr_api.g_varchar2) then
464     p_rec.cmt_attribute27 :=
465     ben_cmt_shd.g_old_rec.cmt_attribute27;
466   End If;
467   If (p_rec.cmt_attribute28 = hr_api.g_varchar2) then
468     p_rec.cmt_attribute28 :=
469     ben_cmt_shd.g_old_rec.cmt_attribute28;
470   End If;
471   If (p_rec.cmt_attribute29 = hr_api.g_varchar2) then
472     p_rec.cmt_attribute29 :=
473     ben_cmt_shd.g_old_rec.cmt_attribute29;
474   End If;
475   If (p_rec.cmt_attribute3 = hr_api.g_varchar2) then
476     p_rec.cmt_attribute3 :=
477     ben_cmt_shd.g_old_rec.cmt_attribute3;
478   End If;
479   If (p_rec.cmt_attribute30 = hr_api.g_varchar2) then
480     p_rec.cmt_attribute30 :=
481     ben_cmt_shd.g_old_rec.cmt_attribute30;
482   End If;
483   If (p_rec.rqd_flag = hr_api.g_varchar2) then
484     p_rec.rqd_flag :=
485     ben_cmt_shd.g_old_rec.rqd_flag;
486   End If;
487   If (p_rec.cmt_attribute_category = hr_api.g_varchar2) then
488     p_rec.cmt_attribute_category :=
489     ben_cmt_shd.g_old_rec.cmt_attribute_category;
490   End If;
491   If (p_rec.cmt_attribute4 = hr_api.g_varchar2) then
492     p_rec.cmt_attribute4 :=
493     ben_cmt_shd.g_old_rec.cmt_attribute4;
494   End If;
495   If (p_rec.cmt_attribute5 = hr_api.g_varchar2) then
496     p_rec.cmt_attribute5 :=
497     ben_cmt_shd.g_old_rec.cmt_attribute5;
498   End If;
499   If (p_rec.cmt_attribute6 = hr_api.g_varchar2) then
500     p_rec.cmt_attribute6 :=
501     ben_cmt_shd.g_old_rec.cmt_attribute6;
502   End If;
503   If (p_rec.cmt_attribute7 = hr_api.g_varchar2) then
504     p_rec.cmt_attribute7 :=
505     ben_cmt_shd.g_old_rec.cmt_attribute7;
506   End If;
507   If (p_rec.cmt_attribute8 = hr_api.g_varchar2) then
508     p_rec.cmt_attribute8 :=
509     ben_cmt_shd.g_old_rec.cmt_attribute8;
510   End If;
511   If (p_rec.cmt_attribute9 = hr_api.g_varchar2) then
512     p_rec.cmt_attribute9 :=
513     ben_cmt_shd.g_old_rec.cmt_attribute9;
514   End If;
515   If (p_rec.dflt_flag = hr_api.g_varchar2) then
516     p_rec.dflt_flag :=
517     ben_cmt_shd.g_old_rec.dflt_flag;
518   End If;
519 
520   --
521   hr_utility.set_location(' Leaving:'||l_proc, 10);
522 --
523 End convert_defs;
524 --
525 -- ----------------------------------------------------------------------------
526 -- |---------------------------------< upd >----------------------------------|
527 -- ----------------------------------------------------------------------------
528 Procedure upd
529   (
530   p_effective_date in date,
531   p_rec        in out nocopy ben_cmt_shd.g_rec_type
532   ) is
533 --
534   l_proc  varchar2(72) := g_package||'upd';
535 --
536 Begin
537   hr_utility.set_location('Entering:'||l_proc, 5);
538   --
539   -- We must lock the row which we need to update.
540   --
541   ben_cmt_shd.lck
542 	(
543 	p_rec.cm_dlvry_mthd_typ_id,
544 	p_rec.object_version_number
545 	);
546   --
547   -- 1. During an update system defaults are used to determine if
548   --    arguments have been defaulted or not. We must therefore
549   --    derive the full record structure values to be updated.
550   --
551   -- 2. Call the supporting update validate operations.
552   --
553   convert_defs(p_rec);
554   ben_cmt_bus.update_validate(p_rec
555   ,p_effective_date);
556   --
557   -- Call the supporting pre-update operation
558   --
559   pre_update(p_rec);
560   --
561   -- Update the row.
562   --
563   update_dml(p_rec);
564   --
565   -- Call the supporting post-update operation
566   --
567   post_update(
568 p_effective_date,p_rec);
569 End upd;
570 --
571 -- ----------------------------------------------------------------------------
572 -- |---------------------------------< upd >----------------------------------|
573 -- ----------------------------------------------------------------------------
574 Procedure upd
575   (
576   p_effective_date in date,
577   p_cm_dlvry_mthd_typ_id         in number,
578   p_cm_dlvry_mthd_typ_cd         in varchar2         default hr_api.g_varchar2,
579   p_business_group_id            in number           default hr_api.g_number,
580   p_cm_typ_id                    in number           default hr_api.g_number,
581   p_cmt_attribute1               in varchar2         default hr_api.g_varchar2,
582   p_cmt_attribute10              in varchar2         default hr_api.g_varchar2,
583   p_cmt_attribute11              in varchar2         default hr_api.g_varchar2,
584   p_cmt_attribute12              in varchar2         default hr_api.g_varchar2,
585   p_cmt_attribute13              in varchar2         default hr_api.g_varchar2,
586   p_cmt_attribute14              in varchar2         default hr_api.g_varchar2,
587   p_cmt_attribute15              in varchar2         default hr_api.g_varchar2,
588   p_cmt_attribute16              in varchar2         default hr_api.g_varchar2,
589   p_cmt_attribute17              in varchar2         default hr_api.g_varchar2,
590   p_cmt_attribute18              in varchar2         default hr_api.g_varchar2,
591   p_cmt_attribute19              in varchar2         default hr_api.g_varchar2,
592   p_cmt_attribute2               in varchar2         default hr_api.g_varchar2,
593   p_cmt_attribute20              in varchar2         default hr_api.g_varchar2,
594   p_cmt_attribute21              in varchar2         default hr_api.g_varchar2,
595   p_cmt_attribute22              in varchar2         default hr_api.g_varchar2,
596   p_cmt_attribute23              in varchar2         default hr_api.g_varchar2,
597   p_cmt_attribute24              in varchar2         default hr_api.g_varchar2,
598   p_cmt_attribute25              in varchar2         default hr_api.g_varchar2,
599   p_cmt_attribute26              in varchar2         default hr_api.g_varchar2,
600   p_cmt_attribute27              in varchar2         default hr_api.g_varchar2,
601   p_cmt_attribute28              in varchar2         default hr_api.g_varchar2,
602   p_cmt_attribute29              in varchar2         default hr_api.g_varchar2,
603   p_cmt_attribute3               in varchar2         default hr_api.g_varchar2,
604   p_cmt_attribute30              in varchar2         default hr_api.g_varchar2,
605   p_rqd_flag                     in varchar2         default hr_api.g_varchar2,
606   p_cmt_attribute_category       in varchar2         default hr_api.g_varchar2,
607   p_cmt_attribute4               in varchar2         default hr_api.g_varchar2,
608   p_cmt_attribute5               in varchar2         default hr_api.g_varchar2,
609   p_cmt_attribute6               in varchar2         default hr_api.g_varchar2,
610   p_cmt_attribute7               in varchar2         default hr_api.g_varchar2,
611   p_cmt_attribute8               in varchar2         default hr_api.g_varchar2,
612   p_cmt_attribute9               in varchar2         default hr_api.g_varchar2,
613   p_dflt_flag                    in varchar2         default hr_api.g_varchar2,
614   p_object_version_number        in out nocopy number
615   ) is
616 --
617   l_rec	  ben_cmt_shd.g_rec_type;
618   l_proc  varchar2(72) := g_package||'upd';
619 --
620 Begin
621   hr_utility.set_location('Entering:'||l_proc, 5);
622   --
623   -- Call conversion function to turn arguments into the
624   -- l_rec structure.
625   --
626   l_rec :=
627   ben_cmt_shd.convert_args
628   (
629   p_cm_dlvry_mthd_typ_id,
630   p_cm_dlvry_mthd_typ_cd,
631   p_business_group_id,
632   p_cm_typ_id,
633   p_cmt_attribute1,
634   p_cmt_attribute10,
635   p_cmt_attribute11,
636   p_cmt_attribute12,
637   p_cmt_attribute13,
638   p_cmt_attribute14,
639   p_cmt_attribute15,
640   p_cmt_attribute16,
641   p_cmt_attribute17,
642   p_cmt_attribute18,
643   p_cmt_attribute19,
644   p_cmt_attribute2,
645   p_cmt_attribute20,
646   p_cmt_attribute21,
647   p_cmt_attribute22,
648   p_cmt_attribute23,
649   p_cmt_attribute24,
650   p_cmt_attribute25,
651   p_cmt_attribute26,
652   p_cmt_attribute27,
653   p_cmt_attribute28,
654   p_cmt_attribute29,
655   p_cmt_attribute3,
656   p_cmt_attribute30,
657   p_rqd_flag,
658   p_cmt_attribute_category,
659   p_cmt_attribute4,
660   p_cmt_attribute5,
661   p_cmt_attribute6,
662   p_cmt_attribute7,
663   p_cmt_attribute8,
664   p_cmt_attribute9,
665   p_dflt_flag,
666   p_object_version_number
667   );
668   --
669   -- Having converted the arguments into the
670   -- plsql record structure we call the corresponding record
671   -- business process.
672   --
673   upd(
674     p_effective_date,l_rec);
675   p_object_version_number := l_rec.object_version_number;
676   --
677   hr_utility.set_location(' Leaving:'||l_proc, 10);
678 End upd;
679 --
680 end ben_cmt_upd;