DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_XEL_UPD

Source


1 Package Body ben_xel_upd as
2 /* $Header: bexelrhi.pkb 120.1 2005/06/08 13:15:34 tjesumic noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_xel_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_xel_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_xel_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_ext_data_elmt Row
68   --
69   update ben_ext_data_elmt
70   set
71   ext_data_elmt_id                  = p_rec.ext_data_elmt_id,
72   name                              = p_rec.name,
73   xml_tag_name                      = p_rec.xml_tag_name ,
74   data_elmt_typ_cd                  = p_rec.data_elmt_typ_cd,
75   data_elmt_rl                      = p_rec.data_elmt_rl,
76   frmt_mask_cd                      = p_rec.frmt_mask_cd,
77   string_val                        = p_rec.string_val,
78   dflt_val                          = p_rec.dflt_val,
79   max_length_num                    = p_rec.max_length_num,
80   just_cd                          = p_rec.just_cd,
81 	ttl_fnctn_cd		   =p_rec.ttl_fnctn_cd,
82 	ttl_cond_oper_cd	=p_rec.ttl_cond_oper_cd,
83 	ttl_cond_val		=p_rec.ttl_cond_val,
84 	ttl_sum_ext_data_elmt_id		=p_rec.ttl_sum_ext_data_elmt_id,
85 	ttl_cond_ext_data_elmt_id		=p_rec.ttl_cond_ext_data_elmt_id ,
86   ext_fld_id                        = p_rec.ext_fld_id,
87   business_group_id                 = p_rec.business_group_id,
88   legislation_code                  = p_rec.legislation_code,
89   xel_attribute_category            = p_rec.xel_attribute_category,
90   xel_attribute1                    = p_rec.xel_attribute1,
91   xel_attribute2                    = p_rec.xel_attribute2,
92   xel_attribute3                    = p_rec.xel_attribute3,
93   xel_attribute4                    = p_rec.xel_attribute4,
94   xel_attribute5                    = p_rec.xel_attribute5,
95   xel_attribute6                    = p_rec.xel_attribute6,
96   xel_attribute7                    = p_rec.xel_attribute7,
97   xel_attribute8                    = p_rec.xel_attribute8,
98   xel_attribute9                    = p_rec.xel_attribute9,
99   xel_attribute10                   = p_rec.xel_attribute10,
100   xel_attribute11                   = p_rec.xel_attribute11,
101   xel_attribute12                   = p_rec.xel_attribute12,
102   xel_attribute13                   = p_rec.xel_attribute13,
103   xel_attribute14                   = p_rec.xel_attribute14,
104   xel_attribute15                   = p_rec.xel_attribute15,
105   xel_attribute16                   = p_rec.xel_attribute16,
106   xel_attribute17                   = p_rec.xel_attribute17,
107   xel_attribute18                   = p_rec.xel_attribute18,
108   xel_attribute19                   = p_rec.xel_attribute19,
109   xel_attribute20                   = p_rec.xel_attribute20,
110   xel_attribute21                   = p_rec.xel_attribute21,
111   xel_attribute22                   = p_rec.xel_attribute22,
112   xel_attribute23                   = p_rec.xel_attribute23,
113   xel_attribute24                   = p_rec.xel_attribute24,
114   xel_attribute25                   = p_rec.xel_attribute25,
115   xel_attribute26                   = p_rec.xel_attribute26,
116   xel_attribute27                   = p_rec.xel_attribute27,
117   xel_attribute28                   = p_rec.xel_attribute28,
118   xel_attribute29                   = p_rec.xel_attribute29,
119   xel_attribute30                   = p_rec.xel_attribute30,
120   defined_balance_id                = p_rec.defined_balance_id,
121   last_update_date                  = p_rec.last_update_date,
122   last_updated_by                   = p_rec.last_updated_by,
123   last_update_login                 = p_rec.last_update_login,
124   object_version_number             = p_rec.object_version_number
125   where ext_data_elmt_id = p_rec.ext_data_elmt_id;
126   --
127   ben_xel_shd.g_api_dml := false;   -- Unset the api dml status
128   --
129   hr_utility.set_location(' Leaving:'||l_proc, 10);
130 --
131 Exception
132   When hr_api.check_integrity_violated Then
133     -- A check constraint has been violated
134     ben_xel_shd.g_api_dml := false;   -- Unset the api dml status
135     ben_xel_shd.constraint_error
136       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
137   When hr_api.parent_integrity_violated Then
138     -- Parent integrity has been violated
139     ben_xel_shd.g_api_dml := false;   -- Unset the api dml status
140     ben_xel_shd.constraint_error
141       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
142   When hr_api.unique_integrity_violated Then
143     -- Unique integrity has been violated
144     ben_xel_shd.g_api_dml := false;   -- Unset the api dml status
145     ben_xel_shd.constraint_error
146       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
147   When Others Then
148     ben_xel_shd.g_api_dml := false;   -- Unset the api dml status
149     Raise;
150 End update_dml;
151 --
152 -- ----------------------------------------------------------------------------
153 -- |------------------------------< pre_update >------------------------------|
154 -- ----------------------------------------------------------------------------
155 -- {Start Of Comments}
156 --
157 -- Description:
158 --   This private procedure contains any processing which is required before
159 --   the update dml.
160 --
161 -- Prerequisites:
162 --   This is an internal procedure which is called from the upd procedure.
163 --
164 -- In Parameters:
165 --   A Pl/Sql record structre.
166 --
167 -- Post Success:
168 --   Processing continues.
169 --
170 -- Post Failure:
171 --   If an error has occurred, an error message and exception will be raised
172 --   but not handled.
173 --
174 -- Developer Implementation Notes:
175 --   Any pre-processing required before the update dml is issued should be
176 --   coded within this procedure. It is important to note that any 3rd party
177 --   maintenance should be reviewed before placing in this procedure.
178 --
179 -- Access Status:
180 --   Internal Row Handler Use Only.
181 --
182 -- {End Of Comments}
183 -- ----------------------------------------------------------------------------
184 Procedure pre_update(p_rec in ben_xel_shd.g_rec_type) is
185 --
186   l_proc  varchar2(72) := g_package||'pre_update';
187 --
188 Begin
189   hr_utility.set_location('Entering:'||l_proc, 5);
190   --
191   hr_utility.set_location(' Leaving:'||l_proc, 10);
192 End pre_update;
193 --
194 -- ----------------------------------------------------------------------------
195 -- |-----------------------------< post_update >------------------------------|
196 -- ----------------------------------------------------------------------------
197 -- {Start Of Comments}
198 --
199 -- Description:
200 --   This private procedure contains any processing which is required after the
201 --   update dml.
202 --
203 -- Prerequisites:
204 --   This is an internal procedure which is called from the upd procedure.
205 --
206 -- In Parameters:
207 --   A Pl/Sql record structre.
208 --
209 -- Post Success:
210 --   Processing continues.
211 --
212 -- Post Failure:
213 --   If an error has occurred, an error message and exception will be raised
214 --   but not handled.
215 --
216 -- Developer Implementation Notes:
217 --   Any post-processing required after the update dml is issued should be
218 --   coded within this procedure. It is important to note that any 3rd party
219 --   maintenance should be reviewed before placing in this procedure.
220 --
221 -- Access Status:
222 --   Internal Row Handler Use Only.
223 --
224 -- {End Of Comments}
225 -- ----------------------------------------------------------------------------
226 Procedure post_update(
227 p_effective_date in date,p_rec in ben_xel_shd.g_rec_type) is
228 --
229   l_proc  varchar2(72) := g_package||'post_update';
230 --
231 Begin
232   hr_utility.set_location('Entering:'||l_proc, 5);
233 --
234   --
235   -- Start of API User Hook for post_update.
236   --
237   begin
238     --
239     ben_xel_rku.after_update
240       (
241   p_ext_data_elmt_id              =>p_rec.ext_data_elmt_id
242  ,p_name                          =>p_rec.name
243  ,p_xml_tag_name                  =>p_rec.xml_tag_name
244  ,p_data_elmt_typ_cd              =>p_rec.data_elmt_typ_cd
245  ,p_data_elmt_rl                  =>p_rec.data_elmt_rl
246  ,p_frmt_mask_cd                  =>p_rec.frmt_mask_cd
247  ,p_string_val                    =>p_rec.string_val
248  ,p_dflt_val                      =>p_rec.dflt_val
249  ,p_max_length_num                =>p_rec.max_length_num
250  ,p_just_cd                      =>p_rec.just_cd
251 	,p_ttl_fnctn_cd		   =>p_rec.ttl_fnctn_cd,
252 	p_ttl_cond_oper_cd	=>p_rec.ttl_cond_oper_cd,
253 	p_ttl_cond_val		=>p_rec.ttl_cond_val,
254 	p_ttl_sum_ext_data_elmt_id		=>p_rec.ttl_sum_ext_data_elmt_id,
255 	p_ttl_cond_ext_data_elmt_id		=>p_rec.ttl_cond_ext_data_elmt_id ,
256  p_ext_fld_id                    =>p_rec.ext_fld_id
257  ,p_business_group_id             =>p_rec.business_group_id
258  ,p_legislation_code              =>p_rec.legislation_code
259  ,p_xel_attribute_category        =>p_rec.xel_attribute_category
260  ,p_xel_attribute1                =>p_rec.xel_attribute1
261  ,p_xel_attribute2                =>p_rec.xel_attribute2
262  ,p_xel_attribute3                =>p_rec.xel_attribute3
263  ,p_xel_attribute4                =>p_rec.xel_attribute4
264  ,p_xel_attribute5                =>p_rec.xel_attribute5
265  ,p_xel_attribute6                =>p_rec.xel_attribute6
266  ,p_xel_attribute7                =>p_rec.xel_attribute7
267  ,p_xel_attribute8                =>p_rec.xel_attribute8
268  ,p_xel_attribute9                =>p_rec.xel_attribute9
269  ,p_xel_attribute10               =>p_rec.xel_attribute10
270  ,p_xel_attribute11               =>p_rec.xel_attribute11
271  ,p_xel_attribute12               =>p_rec.xel_attribute12
272  ,p_xel_attribute13               =>p_rec.xel_attribute13
273  ,p_xel_attribute14               =>p_rec.xel_attribute14
274  ,p_xel_attribute15               =>p_rec.xel_attribute15
275  ,p_xel_attribute16               =>p_rec.xel_attribute16
276  ,p_xel_attribute17               =>p_rec.xel_attribute17
277  ,p_xel_attribute18               =>p_rec.xel_attribute18
278  ,p_xel_attribute19               =>p_rec.xel_attribute19
279  ,p_xel_attribute20               =>p_rec.xel_attribute20
280  ,p_xel_attribute21               =>p_rec.xel_attribute21
281  ,p_xel_attribute22               =>p_rec.xel_attribute22
282  ,p_xel_attribute23               =>p_rec.xel_attribute23
283  ,p_xel_attribute24               =>p_rec.xel_attribute24
284  ,p_xel_attribute25               =>p_rec.xel_attribute25
285  ,p_xel_attribute26               =>p_rec.xel_attribute26
286  ,p_xel_attribute27               =>p_rec.xel_attribute27
287  ,p_xel_attribute28               =>p_rec.xel_attribute28
288  ,p_xel_attribute29               =>p_rec.xel_attribute29
289  ,p_xel_attribute30               =>p_rec.xel_attribute30
290  ,p_defined_balance_id            =>p_rec.defined_balance_id
291  ,p_object_version_number         =>p_rec.object_version_number
292  ,p_effective_date                =>p_effective_date
293  ,p_name_o                        =>ben_xel_shd.g_old_rec.name
294  ,p_xml_tag_name_o                =>ben_xel_shd.g_old_rec.xml_tag_name
295  ,p_data_elmt_typ_cd_o            =>ben_xel_shd.g_old_rec.data_elmt_typ_cd
296  ,p_data_elmt_rl_o                =>ben_xel_shd.g_old_rec.data_elmt_rl
297  ,p_frmt_mask_cd_o                =>ben_xel_shd.g_old_rec.frmt_mask_cd
298  ,p_string_val_o                  =>ben_xel_shd.g_old_rec.string_val
299  ,p_dflt_val_o                    =>ben_xel_shd.g_old_rec.dflt_val
300  ,p_max_length_num_o              =>ben_xel_shd.g_old_rec.max_length_num
301  ,p_just_cd_o                    =>ben_xel_shd.g_old_rec.just_cd
302 	,p_ttl_fnctn_cd_o		   =>ben_xel_shd.g_old_rec.ttl_fnctn_cd,
303 	p_ttl_cond_oper_cd_o	=>ben_xel_shd.g_old_rec.ttl_cond_oper_cd,
304 	p_ttl_cond_val_o		=>ben_xel_shd.g_old_rec.ttl_cond_val,
305 	p_ttl_sum_ext_data_elmt_id_o		=>ben_xel_shd.g_old_rec.ttl_sum_ext_data_elmt_id,
306        p_ttl_cond_ext_data_elmt_id_o		=>ben_xel_shd.g_old_rec.ttl_cond_ext_data_elmt_id ,
307  p_ext_fld_id_o                  =>ben_xel_shd.g_old_rec.ext_fld_id
308  ,p_business_group_id_o           => ben_xel_shd.g_old_rec.business_group_id
309  ,p_legislation_code_o            => ben_xel_shd.g_old_rec.legislation_code
310  ,p_xel_attribute_category_o      =>ben_xel_shd.g_old_rec.xel_attribute_category
311  ,p_xel_attribute1_o              =>ben_xel_shd.g_old_rec.xel_attribute1
312  ,p_xel_attribute2_o              =>ben_xel_shd.g_old_rec.xel_attribute2
313  ,p_xel_attribute3_o              =>ben_xel_shd.g_old_rec.xel_attribute3
314  ,p_xel_attribute4_o              =>ben_xel_shd.g_old_rec.xel_attribute4
315  ,p_xel_attribute5_o              =>ben_xel_shd.g_old_rec.xel_attribute5
316  ,p_xel_attribute6_o              =>ben_xel_shd.g_old_rec.xel_attribute6
317  ,p_xel_attribute7_o              =>ben_xel_shd.g_old_rec.xel_attribute7
318  ,p_xel_attribute8_o              =>ben_xel_shd.g_old_rec.xel_attribute8
319  ,p_xel_attribute9_o              =>ben_xel_shd.g_old_rec.xel_attribute9
320  ,p_xel_attribute10_o             =>ben_xel_shd.g_old_rec.xel_attribute10
321  ,p_xel_attribute11_o             =>ben_xel_shd.g_old_rec.xel_attribute11
322  ,p_xel_attribute12_o             =>ben_xel_shd.g_old_rec.xel_attribute12
323  ,p_xel_attribute13_o             =>ben_xel_shd.g_old_rec.xel_attribute13
324  ,p_xel_attribute14_o             =>ben_xel_shd.g_old_rec.xel_attribute14
325  ,p_xel_attribute15_o             =>ben_xel_shd.g_old_rec.xel_attribute15
326  ,p_xel_attribute16_o             =>ben_xel_shd.g_old_rec.xel_attribute16
327  ,p_xel_attribute17_o             =>ben_xel_shd.g_old_rec.xel_attribute17
328  ,p_xel_attribute18_o             =>ben_xel_shd.g_old_rec.xel_attribute18
329  ,p_xel_attribute19_o             =>ben_xel_shd.g_old_rec.xel_attribute19
330  ,p_xel_attribute20_o             =>ben_xel_shd.g_old_rec.xel_attribute20
331  ,p_xel_attribute21_o             =>ben_xel_shd.g_old_rec.xel_attribute21
332  ,p_xel_attribute22_o             =>ben_xel_shd.g_old_rec.xel_attribute22
333  ,p_xel_attribute23_o             =>ben_xel_shd.g_old_rec.xel_attribute23
334  ,p_xel_attribute24_o             =>ben_xel_shd.g_old_rec.xel_attribute24
335  ,p_xel_attribute25_o             =>ben_xel_shd.g_old_rec.xel_attribute25
336  ,p_xel_attribute26_o             =>ben_xel_shd.g_old_rec.xel_attribute26
337  ,p_xel_attribute27_o             =>ben_xel_shd.g_old_rec.xel_attribute27
338  ,p_xel_attribute28_o             =>ben_xel_shd.g_old_rec.xel_attribute28
339  ,p_xel_attribute29_o             =>ben_xel_shd.g_old_rec.xel_attribute29
340  ,p_xel_attribute30_o             =>ben_xel_shd.g_old_rec.xel_attribute30
341  ,p_defined_balance_id_o          =>ben_xel_shd.g_old_rec.defined_balance_id
342  ,p_object_version_number_o       =>ben_xel_shd.g_old_rec.object_version_number
343       );
344     --
345   exception
346     --
347     when hr_api.cannot_find_prog_unit then
348       --
349       hr_api.cannot_find_prog_unit_error
350         (p_module_name => 'ben_ext_data_elmt'
351         ,p_hook_type   => 'AU');
352       --
353   end;
354   --
355   -- End of API User Hook for post_update.
356   --
357   --
358   hr_utility.set_location(' Leaving:'||l_proc, 10);
359 End post_update;
360 --
361 -- ----------------------------------------------------------------------------
362 -- |-----------------------------< convert_defs >-----------------------------|
363 -- ----------------------------------------------------------------------------
364 -- {Start Of Comments}
365 --
366 -- Description:
367 --   The Convert_Defs procedure has one very important function:
368 --   It must return the record structure for the row with all system defaulted
369 --   values converted into its corresponding parameter value for update. When
370 --   we attempt to update a row through the Upd process , certain
371 --   parameters can be defaulted which enables flexibility in the calling of
372 --   the upd process (e.g. only attributes which need to be updated need to be
373 --   specified). For the upd process to determine which attributes
374 --   have NOT been specified we need to check if the parameter has a reserved
375 --   system default value. Therefore, for all parameters which have a
376 --   corresponding reserved system default mechanism specified we need to
377 --   check if a system default is being used. If a system default is being
378 --   used then we convert the defaulted value into its corresponding attribute
379 --   value held in the g_old_rec data structure.
380 --
381 -- Prerequisites:
382 --   This private function can only be called from the upd process.
383 --
384 -- In Parameters:
385 --   A Pl/Sql record structre.
386 --
387 -- Post Success:
388 --   The record structure will be returned with all system defaulted parameter
389 --   values converted into its current row attribute value.
390 --
391 -- Post Failure:
392 --   No direct error handling is required within this function. Any possible
393 --   errors within this procedure will be a PL/SQL value error due to conversion
394 --   of datatypes or data lengths.
395 --
396 -- Developer Implementation Notes:
397 --   None.
398 --
399 -- Access Status:
400 --   Internal Row Handler Use Only.
401 --
402 -- {End Of Comments}
403 -- ----------------------------------------------------------------------------
404 Procedure convert_defs(p_rec in out nocopy ben_xel_shd.g_rec_type) is
405 --
406   l_proc  varchar2(72) := g_package||'convert_defs';
407 --
408 Begin
409   --
410   hr_utility.set_location('Entering:'||l_proc, 5);
411   --
412   -- We must now examine each argument value in the
413   -- p_rec plsql record structure
414   -- to see if a system default is being used. If a system default
415   -- is being used then we must set to the 'current' argument value.
416   --
417   If (p_rec.name = hr_api.g_varchar2) then
418     p_rec.name :=
419     ben_xel_shd.g_old_rec.name;
420   End If;
421   If (p_rec.xml_tag_name  = hr_api.g_varchar2) then
422     p_rec.xml_tag_name  :=
423     ben_xel_shd.g_old_rec.xml_tag_name;
424   End If;
425   If (p_rec.data_elmt_typ_cd = hr_api.g_varchar2) then
426     p_rec.data_elmt_typ_cd :=
427     ben_xel_shd.g_old_rec.data_elmt_typ_cd;
428   End If;
429   If (p_rec.data_elmt_rl = hr_api.g_number) then
430     p_rec.data_elmt_rl :=
431     ben_xel_shd.g_old_rec.data_elmt_rl;
432   End If;
433   If (p_rec.frmt_mask_cd = hr_api.g_varchar2) then
434     p_rec.frmt_mask_cd :=
435     ben_xel_shd.g_old_rec.frmt_mask_cd;
436   End If;
437   If (p_rec.string_val = hr_api.g_varchar2) then
438     p_rec.string_val :=
439     ben_xel_shd.g_old_rec.string_val;
440   End If;
441   If (p_rec.dflt_val = hr_api.g_varchar2) then
442     p_rec.dflt_val :=
443     ben_xel_shd.g_old_rec.dflt_val;
444   End If;
445   If (p_rec.max_length_num = hr_api.g_number) then
446     p_rec.max_length_num :=
447     ben_xel_shd.g_old_rec.max_length_num;
448   End If;
449   if (p_rec.just_cd = hr_api.g_varchar2) then
450     p_rec.just_cd :=
451     ben_xel_shd.g_old_rec.just_cd;
452   End If;
453   if (p_rec.ttl_fnctn_cd = hr_api.g_varchar2) then
454     p_rec.ttl_fnctn_cd :=
455     ben_xel_shd.g_old_rec.ttl_fnctn_cd;
456   End If;
457   if (p_rec.ttl_cond_oper_cd = hr_api.g_varchar2) then
458     p_rec.ttl_cond_oper_cd :=
459     ben_xel_shd.g_old_rec.ttl_cond_oper_cd;
460   End If;
461   if (p_rec.ttl_cond_val = hr_api.g_varchar2) then
462     p_rec.ttl_cond_val :=
463     ben_xel_shd.g_old_rec.ttl_cond_val;
464   End If;
465   If (p_rec.ttl_sum_ext_data_elmt_id = hr_api.g_number) then
466     p_rec.ttl_sum_ext_data_elmt_id :=
467     ben_xel_shd.g_old_rec.ttl_sum_ext_data_elmt_id;
468   End If;
469   If (p_rec.ttl_cond_ext_data_elmt_id = hr_api.g_number) then
470     p_rec.ttl_cond_ext_data_elmt_id :=
471     ben_xel_shd.g_old_rec.ttl_cond_ext_data_elmt_id;
472   End If;
473   If (p_rec.ext_fld_id = hr_api.g_number) then
474     p_rec.ext_fld_id :=
475     ben_xel_shd.g_old_rec.ext_fld_id;
476   End If;
477   If (p_rec.business_group_id = hr_api.g_number) then
478     p_rec.business_group_id :=
479     ben_xel_shd.g_old_rec.business_group_id;
480   End If;
481   If (p_rec.legislation_code = hr_api.g_varchar2) then
482     p_rec.legislation_code :=
483     ben_xel_shd.g_old_rec.legislation_code;
484   End If;
485   If (p_rec.xel_attribute_category = hr_api.g_varchar2) then
486     p_rec.xel_attribute_category :=
487     ben_xel_shd.g_old_rec.xel_attribute_category;
488   End If;
489   If (p_rec.xel_attribute1 = hr_api.g_varchar2) then
490     p_rec.xel_attribute1 :=
491     ben_xel_shd.g_old_rec.xel_attribute1;
492   End If;
493   If (p_rec.xel_attribute2 = hr_api.g_varchar2) then
494     p_rec.xel_attribute2 :=
495     ben_xel_shd.g_old_rec.xel_attribute2;
496   End If;
497   If (p_rec.xel_attribute3 = hr_api.g_varchar2) then
498     p_rec.xel_attribute3 :=
499     ben_xel_shd.g_old_rec.xel_attribute3;
500   End If;
501   If (p_rec.xel_attribute4 = hr_api.g_varchar2) then
502     p_rec.xel_attribute4 :=
503     ben_xel_shd.g_old_rec.xel_attribute4;
504   End If;
505   If (p_rec.xel_attribute5 = hr_api.g_varchar2) then
506     p_rec.xel_attribute5 :=
507     ben_xel_shd.g_old_rec.xel_attribute5;
508   End If;
509   If (p_rec.xel_attribute6 = hr_api.g_varchar2) then
510     p_rec.xel_attribute6 :=
511     ben_xel_shd.g_old_rec.xel_attribute6;
512   End If;
513   If (p_rec.xel_attribute7 = hr_api.g_varchar2) then
514     p_rec.xel_attribute7 :=
515     ben_xel_shd.g_old_rec.xel_attribute7;
516   End If;
517   If (p_rec.xel_attribute8 = hr_api.g_varchar2) then
518     p_rec.xel_attribute8 :=
519     ben_xel_shd.g_old_rec.xel_attribute8;
520   End If;
521   If (p_rec.xel_attribute9 = hr_api.g_varchar2) then
522     p_rec.xel_attribute9 :=
523     ben_xel_shd.g_old_rec.xel_attribute9;
524   End If;
525   If (p_rec.xel_attribute10 = hr_api.g_varchar2) then
526     p_rec.xel_attribute10 :=
527     ben_xel_shd.g_old_rec.xel_attribute10;
528   End If;
529   If (p_rec.xel_attribute11 = hr_api.g_varchar2) then
530     p_rec.xel_attribute11 :=
531     ben_xel_shd.g_old_rec.xel_attribute11;
532   End If;
533   If (p_rec.xel_attribute12 = hr_api.g_varchar2) then
534     p_rec.xel_attribute12 :=
535     ben_xel_shd.g_old_rec.xel_attribute12;
536   End If;
537   If (p_rec.xel_attribute13 = hr_api.g_varchar2) then
538     p_rec.xel_attribute13 :=
539     ben_xel_shd.g_old_rec.xel_attribute13;
540   End If;
541   If (p_rec.xel_attribute14 = hr_api.g_varchar2) then
542     p_rec.xel_attribute14 :=
543     ben_xel_shd.g_old_rec.xel_attribute14;
544   End If;
545   If (p_rec.xel_attribute15 = hr_api.g_varchar2) then
546     p_rec.xel_attribute15 :=
547     ben_xel_shd.g_old_rec.xel_attribute15;
548   End If;
549   If (p_rec.xel_attribute16 = hr_api.g_varchar2) then
550     p_rec.xel_attribute16 :=
551     ben_xel_shd.g_old_rec.xel_attribute16;
552   End If;
553   If (p_rec.xel_attribute17 = hr_api.g_varchar2) then
554     p_rec.xel_attribute17 :=
555     ben_xel_shd.g_old_rec.xel_attribute17;
556   End If;
557   If (p_rec.xel_attribute18 = hr_api.g_varchar2) then
558     p_rec.xel_attribute18 :=
559     ben_xel_shd.g_old_rec.xel_attribute18;
560   End If;
561   If (p_rec.xel_attribute19 = hr_api.g_varchar2) then
562     p_rec.xel_attribute19 :=
563     ben_xel_shd.g_old_rec.xel_attribute19;
564   End If;
565   If (p_rec.xel_attribute20 = hr_api.g_varchar2) then
566     p_rec.xel_attribute20 :=
567     ben_xel_shd.g_old_rec.xel_attribute20;
568   End If;
569   If (p_rec.xel_attribute21 = hr_api.g_varchar2) then
570     p_rec.xel_attribute21 :=
571     ben_xel_shd.g_old_rec.xel_attribute21;
572   End If;
573   If (p_rec.xel_attribute22 = hr_api.g_varchar2) then
574     p_rec.xel_attribute22 :=
575     ben_xel_shd.g_old_rec.xel_attribute22;
576   End If;
577   If (p_rec.xel_attribute23 = hr_api.g_varchar2) then
578     p_rec.xel_attribute23 :=
579     ben_xel_shd.g_old_rec.xel_attribute23;
580   End If;
581   If (p_rec.xel_attribute24 = hr_api.g_varchar2) then
582     p_rec.xel_attribute24 :=
583     ben_xel_shd.g_old_rec.xel_attribute24;
584   End If;
585   If (p_rec.xel_attribute25 = hr_api.g_varchar2) then
586     p_rec.xel_attribute25 :=
587     ben_xel_shd.g_old_rec.xel_attribute25;
588   End If;
589   If (p_rec.xel_attribute26 = hr_api.g_varchar2) then
590     p_rec.xel_attribute26 :=
591     ben_xel_shd.g_old_rec.xel_attribute26;
592   End If;
593   If (p_rec.xel_attribute27 = hr_api.g_varchar2) then
594     p_rec.xel_attribute27 :=
595     ben_xel_shd.g_old_rec.xel_attribute27;
596   End If;
597   If (p_rec.xel_attribute28 = hr_api.g_varchar2) then
598     p_rec.xel_attribute28 :=
599     ben_xel_shd.g_old_rec.xel_attribute28;
600   End If;
601   If (p_rec.xel_attribute29 = hr_api.g_varchar2) then
602     p_rec.xel_attribute29 :=
603     ben_xel_shd.g_old_rec.xel_attribute29;
604   End If;
605   If (p_rec.xel_attribute30 = hr_api.g_varchar2) then
606     p_rec.xel_attribute30 :=
607     ben_xel_shd.g_old_rec.xel_attribute30;
608   End If;
609 
610 
611   If (p_rec.defined_balance_id = hr_api.g_number) then
612     p_rec.defined_balance_id :=
613     ben_xel_shd.g_old_rec.defined_balance_id;
614   End If;
615 
616   --
617   hr_utility.set_location(' Leaving:'||l_proc, 10);
618 --
619 End convert_defs;
620 --
621 -- ----------------------------------------------------------------------------
622 -- |---------------------------------< upd >----------------------------------|
623 -- ----------------------------------------------------------------------------
624 Procedure upd
625   (
626   p_effective_date in date,
627   p_rec        in out nocopy ben_xel_shd.g_rec_type
628   ) is
629 --
630   l_proc  varchar2(72) := g_package||'upd';
631 --
632 Begin
633   hr_utility.set_location('Entering:'||l_proc, 5);
634   --
635   -- We must lock the row which we need to update.
636   --
637   ben_xel_shd.lck
638 	(
639 	p_rec.ext_data_elmt_id,
640 	p_rec.object_version_number
641 	);
642   --
643   -- 1. During an update system defaults are used to determine if
644   --    arguments have been defaulted or not. We must therefore
645   --    derive the full record structure values to be updated.
646   --
647   -- 2. Call the supporting update validate operations.
648   --
649   convert_defs(p_rec);
650   ben_xel_bus.update_validate(p_rec
651   ,p_effective_date);
652   --
653   ben_xel_bus.chk_xml_name_format
654           ( p_xml_tag_name    => p_rec.xml_tag_name
655           ) ;
656 
657   -- Call the supporting pre-update operation
658   --
659   pre_update(p_rec);
660   --
661   -- Update the row.
662   --
663   update_dml(p_rec);
664   --
665   -- Call the supporting post-update operation
666   --
667   post_update(
668 p_effective_date,p_rec);
669 End upd;
670 --
671 -- ----------------------------------------------------------------------------
672 -- |---------------------------------< upd >----------------------------------|
673 -- ----------------------------------------------------------------------------
674 Procedure upd
675   (
676   p_effective_date in date,
677   p_ext_data_elmt_id             in number,
678   p_name                         in varchar2         default hr_api.g_varchar2,
679   p_xml_tag_name                 in varchar2         default hr_api.g_varchar2,
680   p_data_elmt_typ_cd             in varchar2         default hr_api.g_varchar2,
681   p_data_elmt_rl                 in number           default hr_api.g_number,
682   p_frmt_mask_cd                 in varchar2         default hr_api.g_varchar2,
683   p_string_val                   in varchar2         default hr_api.g_varchar2,
684   p_dflt_val                     in varchar2         default hr_api.g_varchar2,
685   p_max_length_num               in number           default hr_api.g_number,
686   p_just_cd                     in varchar2         default hr_api.g_varchar2,
687 	p_ttl_fnctn_cd in varchar2         default hr_api.g_varchar2
688 	,p_ttl_cond_oper_cd    in varchar2         default   hr_api.g_varchar2
689 	,p_ttl_cond_val        in varchar2         default   hr_api.g_varchar2
690 	,p_ttl_sum_ext_data_elmt_id in number           default   hr_api.g_number
691 	,p_ttl_cond_ext_data_elmt_id  in number           default   hr_api.g_number
692   ,p_ext_fld_id                   in number           default hr_api.g_number,
693   p_business_group_id            in number           default hr_api.g_number,
694   p_legislation_code             in varchar2         default hr_api.g_varchar2,
695   p_xel_attribute_category       in varchar2         default hr_api.g_varchar2,
696   p_xel_attribute1               in varchar2         default hr_api.g_varchar2,
697   p_xel_attribute2               in varchar2         default hr_api.g_varchar2,
698   p_xel_attribute3               in varchar2         default hr_api.g_varchar2,
699   p_xel_attribute4               in varchar2         default hr_api.g_varchar2,
700   p_xel_attribute5               in varchar2         default hr_api.g_varchar2,
701   p_xel_attribute6               in varchar2         default hr_api.g_varchar2,
702   p_xel_attribute7               in varchar2         default hr_api.g_varchar2,
703   p_xel_attribute8               in varchar2         default hr_api.g_varchar2,
704   p_xel_attribute9               in varchar2         default hr_api.g_varchar2,
705   p_xel_attribute10              in varchar2         default hr_api.g_varchar2,
706   p_xel_attribute11              in varchar2         default hr_api.g_varchar2,
707   p_xel_attribute12              in varchar2         default hr_api.g_varchar2,
708   p_xel_attribute13              in varchar2         default hr_api.g_varchar2,
709   p_xel_attribute14              in varchar2         default hr_api.g_varchar2,
710   p_xel_attribute15              in varchar2         default hr_api.g_varchar2,
711   p_xel_attribute16              in varchar2         default hr_api.g_varchar2,
712   p_xel_attribute17              in varchar2         default hr_api.g_varchar2,
713   p_xel_attribute18              in varchar2         default hr_api.g_varchar2,
714   p_xel_attribute19              in varchar2         default hr_api.g_varchar2,
715   p_xel_attribute20              in varchar2         default hr_api.g_varchar2,
716   p_xel_attribute21              in varchar2         default hr_api.g_varchar2,
717   p_xel_attribute22              in varchar2         default hr_api.g_varchar2,
718   p_xel_attribute23              in varchar2         default hr_api.g_varchar2,
719   p_xel_attribute24              in varchar2         default hr_api.g_varchar2,
720   p_xel_attribute25              in varchar2         default hr_api.g_varchar2,
721   p_xel_attribute26              in varchar2         default hr_api.g_varchar2,
722   p_xel_attribute27              in varchar2         default hr_api.g_varchar2,
723   p_xel_attribute28              in varchar2         default hr_api.g_varchar2,
724   p_xel_attribute29              in varchar2         default hr_api.g_varchar2,
725   p_xel_attribute30              in varchar2         default hr_api.g_varchar2,
726   p_defined_balance_id           in number           default hr_api.g_number,
727   p_last_update_date             in date             default hr_api.g_date,
728   p_creation_date                in date             default hr_api.g_date,
729   p_last_updated_by              in number           default hr_api.g_number,
730   p_last_update_login            in number           default hr_api.g_number,
731   p_created_by                   in number           default hr_api.g_number,
732   p_object_version_number        in out nocopy number
733   ) is
734 --
735   l_rec	  ben_xel_shd.g_rec_type;
736   l_proc  varchar2(72) := g_package||'upd';
737 --
738 Begin
739   hr_utility.set_location('Entering:'||l_proc, 5);
740   --
741   -- Call conversion function to turn arguments into the
742   -- l_rec structure.
743   --
744   l_rec :=
745   ben_xel_shd.convert_args
746   (
747   p_ext_data_elmt_id,
748   p_name,
749   p_xml_tag_name,
750   p_data_elmt_typ_cd,
751   p_data_elmt_rl,
752   p_frmt_mask_cd,
753   p_string_val,
754   p_dflt_val,
755   p_max_length_num,
756   p_just_cd,
757 	p_ttl_fnctn_cd,
758 	p_ttl_cond_oper_cd,
759 	p_ttl_cond_val,
760 	p_ttl_sum_ext_data_elmt_id,
761 	p_ttl_cond_ext_data_elmt_id,
762   p_ext_fld_id,
763   p_business_group_id,
764   p_legislation_code,
765   p_xel_attribute_category,
766   p_xel_attribute1,
767   p_xel_attribute2,
768   p_xel_attribute3,
769   p_xel_attribute4,
770   p_xel_attribute5,
771   p_xel_attribute6,
772   p_xel_attribute7,
773   p_xel_attribute8,
774   p_xel_attribute9,
775   p_xel_attribute10,
776   p_xel_attribute11,
777   p_xel_attribute12,
778   p_xel_attribute13,
779   p_xel_attribute14,
780   p_xel_attribute15,
781   p_xel_attribute16,
782   p_xel_attribute17,
783   p_xel_attribute18,
784   p_xel_attribute19,
785   p_xel_attribute20,
786   p_xel_attribute21,
787   p_xel_attribute22,
788   p_xel_attribute23,
789   p_xel_attribute24,
790   p_xel_attribute25,
791   p_xel_attribute26,
792   p_xel_attribute27,
793   p_xel_attribute28,
794   p_xel_attribute29,
795   p_xel_attribute30,
796   p_defined_balance_id,
797   p_last_update_date ,
798   p_creation_date    ,
799   p_last_updated_by  ,
800   p_last_update_login,
801   p_created_by       ,
802   p_object_version_number
803   );
804   --
805   -- Having converted the arguments into the
806   -- plsql record structure we call the corresponding record
807   -- business process.
808   --
809   upd(
810     p_effective_date,l_rec);
811   p_object_version_number := l_rec.object_version_number;
812   --
813   hr_utility.set_location(' Leaving:'||l_proc, 10);
814 End upd;
815 --
816 end ben_xel_upd;