DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_EGD_UPD

Source


1 Package Body ben_egd_upd as
2 /* $Header: beegdrhi.pkb 120.1 2008/04/24 10:18:32 bachakra noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_egd_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_egd_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_egd_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_elig_dpnt Row
68   --
69   update ben_elig_dpnt
70   set
71   elig_dpnt_id                      = p_rec.elig_dpnt_id,
72   create_dt                         = p_rec.create_dt,
73   elig_strt_dt                      = p_rec.elig_strt_dt,
74   elig_thru_dt                      = p_rec.elig_thru_dt,
75   ovrdn_flag                        = p_rec.ovrdn_flag,
76   ovrdn_thru_dt                     = p_rec.ovrdn_thru_dt,
77   inelg_rsn_cd                      = p_rec.inelg_rsn_cd,
78   dpnt_inelig_flag                  = p_rec.dpnt_inelig_flag,
79   elig_per_elctbl_chc_id            = p_rec.elig_per_elctbl_chc_id,
80   per_in_ler_id                     = p_rec.per_in_ler_id,
81   elig_per_id                       = p_rec.elig_per_id,
82   elig_per_opt_id                   = p_rec.elig_per_opt_id,
83   elig_cvrd_dpnt_id                 = p_rec.elig_cvrd_dpnt_id,
84   dpnt_person_id                    = p_rec.dpnt_person_id,
85   business_group_id                 = p_rec.business_group_id,
86   egd_attribute_category            = p_rec.egd_attribute_category,
87   egd_attribute1                    = p_rec.egd_attribute1,
88   egd_attribute2                    = p_rec.egd_attribute2,
89   egd_attribute3                    = p_rec.egd_attribute3,
90   egd_attribute4                    = p_rec.egd_attribute4,
91   egd_attribute5                    = p_rec.egd_attribute5,
92   egd_attribute6                    = p_rec.egd_attribute6,
93   egd_attribute7                    = p_rec.egd_attribute7,
94   egd_attribute8                    = p_rec.egd_attribute8,
95   egd_attribute9                    = p_rec.egd_attribute9,
96   egd_attribute10                   = p_rec.egd_attribute10,
97   egd_attribute11                   = p_rec.egd_attribute11,
98   egd_attribute12                   = p_rec.egd_attribute12,
99   egd_attribute13                   = p_rec.egd_attribute13,
100   egd_attribute14                   = p_rec.egd_attribute14,
101   egd_attribute15                   = p_rec.egd_attribute15,
102   egd_attribute16                   = p_rec.egd_attribute16,
103   egd_attribute17                   = p_rec.egd_attribute17,
104   egd_attribute18                   = p_rec.egd_attribute18,
105   egd_attribute19                   = p_rec.egd_attribute19,
106   egd_attribute20                   = p_rec.egd_attribute20,
107   egd_attribute21                   = p_rec.egd_attribute21,
108   egd_attribute22                   = p_rec.egd_attribute22,
109   egd_attribute23                   = p_rec.egd_attribute23,
110   egd_attribute24                   = p_rec.egd_attribute24,
111   egd_attribute25                   = p_rec.egd_attribute25,
112   egd_attribute26                   = p_rec.egd_attribute26,
113   egd_attribute27                   = p_rec.egd_attribute27,
114   egd_attribute28                   = p_rec.egd_attribute28,
115   egd_attribute29                   = p_rec.egd_attribute29,
116   egd_attribute30                   = p_rec.egd_attribute30,
117   request_id                        = p_rec.request_id,
118   program_application_id            = p_rec.program_application_id,
119   program_id                        = p_rec.program_id,
120   program_update_date               = p_rec.program_update_date,
121   object_version_number             = p_rec.object_version_number
122   where elig_dpnt_id = p_rec.elig_dpnt_id;
123   --
124   ben_egd_shd.g_api_dml := false;   -- Unset the api dml status
125   --
126   hr_utility.set_location(' Leaving:'||l_proc, 10);
127 --
128 Exception
129   When hr_api.check_integrity_violated Then
130     -- A check constraint has been violated
131     ben_egd_shd.g_api_dml := false;   -- Unset the api dml status
132     ben_egd_shd.constraint_error
133       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
134   When hr_api.parent_integrity_violated Then
135     -- Parent integrity has been violated
136     ben_egd_shd.g_api_dml := false;   -- Unset the api dml status
137     ben_egd_shd.constraint_error
138       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
139   When hr_api.unique_integrity_violated Then
140     -- Unique integrity has been violated
141     ben_egd_shd.g_api_dml := false;   -- Unset the api dml status
142     ben_egd_shd.constraint_error
143       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
144   When Others Then
145     ben_egd_shd.g_api_dml := false;   -- Unset the api dml status
146     Raise;
147 End update_dml;
148 --
149 -- ----------------------------------------------------------------------------
150 -- |------------------------------< pre_update >------------------------------|
151 -- ----------------------------------------------------------------------------
152 -- {Start Of Comments}
153 --
157 --
154 -- Description:
155 --   This private procedure contains any processing which is required before
156 --   the update dml.
158 -- Prerequisites:
159 --   This is an internal procedure which is called from the upd procedure.
160 --
161 -- In Parameters:
162 --   A Pl/Sql record structre.
163 --
164 -- Post Success:
165 --   Processing continues.
166 --
167 -- Post Failure:
168 --   If an error has occurred, an error message and exception will be raised
169 --   but not handled.
170 --
171 -- Developer Implementation Notes:
172 --   Any pre-processing required before the update dml is issued should be
173 --   coded within this procedure. It is important to note that any 3rd party
174 --   maintenance should be reviewed before placing in this procedure.
175 --
176 -- Access Status:
177 --   Internal Row Handler Use Only.
178 --
179 -- {End Of Comments}
180 -- ----------------------------------------------------------------------------
181 Procedure pre_update(p_rec in ben_egd_shd.g_rec_type) is
182 --
183   l_proc  varchar2(72) := g_package||'pre_update';
184 --
185 Begin
186   hr_utility.set_location('Entering:'||l_proc, 5);
187   --
188   hr_utility.set_location(' Leaving:'||l_proc, 10);
189 End pre_update;
190 --
191 -- ----------------------------------------------------------------------------
192 -- |-----------------------------< post_update >------------------------------|
193 -- ----------------------------------------------------------------------------
194 -- {Start Of Comments}
195 --
196 -- Description:
197 --   This private procedure contains any processing which is required after the
198 --   update dml.
199 --
200 -- Prerequisites:
201 --   This is an internal procedure which is called from the upd procedure.
202 --
203 -- In Parameters:
204 --   A Pl/Sql record structre.
205 --
206 -- Post Success:
207 --   Processing continues.
208 --
209 -- Post Failure:
210 --   If an error has occurred, an error message and exception will be raised
211 --   but not handled.
212 --
213 -- Developer Implementation Notes:
214 --   Any post-processing required after the update dml is issued should be
215 --   coded within this procedure. It is important to note that any 3rd party
216 --   maintenance should be reviewed before placing in this procedure.
217 --
218 -- Access Status:
219 --   Internal Row Handler Use Only.
220 --
221 -- {End Of Comments}
222 -- ----------------------------------------------------------------------------
223 Procedure post_update(
224 p_effective_date in date,p_rec in ben_egd_shd.g_rec_type) is
225 --
226   l_proc  varchar2(72) := g_package||'post_update';
227   --
228   l_old_rec               ben_egd_ler.g_egd_ler_rec;
229   l_new_rec               ben_egd_ler.g_egd_ler_rec;
230   --
231 Begin
232   hr_utility.set_location('Entering:'||l_proc, 5);
233   --
234   -- Life event trigger
235   --
236   l_old_rec.business_group_id := ben_egd_shd.g_old_rec.business_group_id;
237   l_old_rec.dpnt_person_id := ben_egd_shd.g_old_rec.dpnt_person_id;
238   l_old_rec.elig_strt_dt := ben_egd_shd.g_old_rec.elig_strt_dt;
239   l_old_rec.elig_thru_dt := ben_egd_shd.g_old_rec.elig_thru_dt;
240   l_old_rec.dpnt_inelig_flag := ben_egd_shd.g_old_rec.dpnt_inelig_flag;
241   l_old_rec.ovrdn_thru_dt := ben_egd_shd.g_old_rec.ovrdn_thru_dt;
242   l_old_rec.ovrdn_flag := ben_egd_shd.g_old_rec.ovrdn_flag;
243   l_old_rec.create_dt := ben_egd_shd.g_old_rec.create_dt;
244   l_old_rec.per_in_ler_id := ben_egd_shd.g_old_rec.per_in_ler_id;
245   --
246   l_new_rec.business_group_id := p_rec.business_group_id;
247   l_new_rec.dpnt_person_id := p_rec.dpnt_person_id;
248   l_new_rec.elig_strt_dt := p_rec.elig_strt_dt;
249   l_new_rec.elig_thru_dt := p_rec.elig_thru_dt;
250   l_new_rec.dpnt_inelig_flag := p_rec.dpnt_inelig_flag;
251   l_new_rec.ovrdn_thru_dt := p_rec.ovrdn_thru_dt;
252   l_new_rec.ovrdn_flag := p_rec.ovrdn_flag;
253   l_new_rec.create_dt := p_rec.create_dt;
254   l_new_rec.per_in_ler_id := p_rec.per_in_ler_id; --Bug 5630251
255 
256   hr_utility.set_location(' Old per_in_ler_id ' || l_old_rec.per_in_ler_id , 9876 );
257   --
258   ben_egd_ler.ler_chk(l_old_rec,l_new_rec,p_effective_date);
259   --
260   -- Start of API User Hook for post_update.
261   --
262   begin
263     --
264     ben_egd_rku.after_update
265       (
266   p_elig_dpnt_id                  =>p_rec.elig_dpnt_id
267  ,p_create_dt                     =>p_rec.create_dt
268  ,p_elig_strt_dt                  =>p_rec.elig_strt_dt
269  ,p_elig_thru_dt                  =>p_rec.elig_thru_dt
270  ,p_ovrdn_flag                    =>p_rec.ovrdn_flag
271  ,p_ovrdn_thru_dt                 =>p_rec.ovrdn_thru_dt
272  ,p_inelg_rsn_cd                  =>p_rec.inelg_rsn_cd
273  ,p_dpnt_inelig_flag              =>p_rec.dpnt_inelig_flag
274  ,p_elig_per_elctbl_chc_id        =>p_rec.elig_per_elctbl_chc_id
275  ,p_per_in_ler_id                 =>p_rec.per_in_ler_id
276  ,p_elig_per_id                   =>p_rec.elig_per_id
277  ,p_elig_per_opt_id               =>p_rec.elig_per_opt_id
278  ,p_elig_cvrd_dpnt_id             =>p_rec.elig_cvrd_dpnt_id
279  ,p_dpnt_person_id                =>p_rec.dpnt_person_id
280  ,p_business_group_id             =>p_rec.business_group_id
281  ,p_egd_attribute_category        =>p_rec.egd_attribute_category
282  ,p_egd_attribute1                =>p_rec.egd_attribute1
283  ,p_egd_attribute2                =>p_rec.egd_attribute2
284  ,p_egd_attribute3                =>p_rec.egd_attribute3
285  ,p_egd_attribute4                =>p_rec.egd_attribute4
286  ,p_egd_attribute5                =>p_rec.egd_attribute5
287  ,p_egd_attribute6                =>p_rec.egd_attribute6
288  ,p_egd_attribute7                =>p_rec.egd_attribute7
289  ,p_egd_attribute8                =>p_rec.egd_attribute8
290  ,p_egd_attribute9                =>p_rec.egd_attribute9
291  ,p_egd_attribute10               =>p_rec.egd_attribute10
292  ,p_egd_attribute11               =>p_rec.egd_attribute11
293  ,p_egd_attribute12               =>p_rec.egd_attribute12
294  ,p_egd_attribute13               =>p_rec.egd_attribute13
295  ,p_egd_attribute14               =>p_rec.egd_attribute14
296  ,p_egd_attribute15               =>p_rec.egd_attribute15
297  ,p_egd_attribute16               =>p_rec.egd_attribute16
298  ,p_egd_attribute17               =>p_rec.egd_attribute17
299  ,p_egd_attribute18               =>p_rec.egd_attribute18
300  ,p_egd_attribute19               =>p_rec.egd_attribute19
301  ,p_egd_attribute20               =>p_rec.egd_attribute20
302  ,p_egd_attribute21               =>p_rec.egd_attribute21
303  ,p_egd_attribute22               =>p_rec.egd_attribute22
304  ,p_egd_attribute23               =>p_rec.egd_attribute23
305  ,p_egd_attribute24               =>p_rec.egd_attribute24
306  ,p_egd_attribute25               =>p_rec.egd_attribute25
307  ,p_egd_attribute26               =>p_rec.egd_attribute26
308  ,p_egd_attribute27               =>p_rec.egd_attribute27
309  ,p_egd_attribute28               =>p_rec.egd_attribute28
310  ,p_egd_attribute29               =>p_rec.egd_attribute29
311  ,p_egd_attribute30               =>p_rec.egd_attribute30
312  ,p_request_id                    =>p_rec.request_id
313  ,p_program_application_id        =>p_rec.program_application_id
314  ,p_program_id                    =>p_rec.program_id
315  ,p_program_update_date           =>p_rec.program_update_date
316  ,p_object_version_number         =>p_rec.object_version_number
317  ,p_effective_date                =>p_effective_date
318  ,p_create_dt_o                   =>ben_egd_shd.g_old_rec.create_dt
319  ,p_elig_strt_dt_o                =>ben_egd_shd.g_old_rec.elig_strt_dt
320  ,p_elig_thru_dt_o                =>ben_egd_shd.g_old_rec.elig_thru_dt
321  ,p_ovrdn_flag_o                  =>ben_egd_shd.g_old_rec.ovrdn_flag
322  ,p_ovrdn_thru_dt_o               =>ben_egd_shd.g_old_rec.ovrdn_thru_dt
323  ,p_inelg_rsn_cd_o                =>ben_egd_shd.g_old_rec.inelg_rsn_cd
324  ,p_dpnt_inelig_flag_o            =>ben_egd_shd.g_old_rec.dpnt_inelig_flag
325  ,p_elig_per_elctbl_chc_id_o      =>ben_egd_shd.g_old_rec.elig_per_elctbl_chc_id
326  ,p_per_in_ler_id_o               =>ben_egd_shd.g_old_rec.per_in_ler_id
327  ,p_elig_per_id_o                 =>ben_egd_shd.g_old_rec.elig_per_id
328  ,p_elig_per_opt_id_o             =>ben_egd_shd.g_old_rec.elig_per_opt_id
329  ,p_elig_cvrd_dpnt_id_o           =>ben_egd_shd.g_old_rec.elig_cvrd_dpnt_id
330  ,p_dpnt_person_id_o              =>ben_egd_shd.g_old_rec.dpnt_person_id
331  ,p_business_group_id_o           =>ben_egd_shd.g_old_rec.business_group_id
332  ,p_egd_attribute_category_o      =>ben_egd_shd.g_old_rec.egd_attribute_category
333  ,p_egd_attribute1_o              =>ben_egd_shd.g_old_rec.egd_attribute1
334  ,p_egd_attribute2_o              =>ben_egd_shd.g_old_rec.egd_attribute2
335  ,p_egd_attribute3_o              =>ben_egd_shd.g_old_rec.egd_attribute3
336  ,p_egd_attribute4_o              =>ben_egd_shd.g_old_rec.egd_attribute4
337  ,p_egd_attribute5_o              =>ben_egd_shd.g_old_rec.egd_attribute5
338  ,p_egd_attribute6_o              =>ben_egd_shd.g_old_rec.egd_attribute6
339  ,p_egd_attribute7_o              =>ben_egd_shd.g_old_rec.egd_attribute7
340  ,p_egd_attribute8_o              =>ben_egd_shd.g_old_rec.egd_attribute8
341  ,p_egd_attribute9_o              =>ben_egd_shd.g_old_rec.egd_attribute9
342  ,p_egd_attribute10_o             =>ben_egd_shd.g_old_rec.egd_attribute10
343  ,p_egd_attribute11_o             =>ben_egd_shd.g_old_rec.egd_attribute11
344  ,p_egd_attribute12_o             =>ben_egd_shd.g_old_rec.egd_attribute12
345  ,p_egd_attribute13_o             =>ben_egd_shd.g_old_rec.egd_attribute13
346  ,p_egd_attribute14_o             =>ben_egd_shd.g_old_rec.egd_attribute14
347  ,p_egd_attribute15_o             =>ben_egd_shd.g_old_rec.egd_attribute15
348  ,p_egd_attribute16_o             =>ben_egd_shd.g_old_rec.egd_attribute16
349  ,p_egd_attribute17_o             =>ben_egd_shd.g_old_rec.egd_attribute17
350  ,p_egd_attribute18_o             =>ben_egd_shd.g_old_rec.egd_attribute18
351  ,p_egd_attribute19_o             =>ben_egd_shd.g_old_rec.egd_attribute19
352  ,p_egd_attribute20_o             =>ben_egd_shd.g_old_rec.egd_attribute20
353  ,p_egd_attribute21_o             =>ben_egd_shd.g_old_rec.egd_attribute21
354  ,p_egd_attribute22_o             =>ben_egd_shd.g_old_rec.egd_attribute22
355  ,p_egd_attribute23_o             =>ben_egd_shd.g_old_rec.egd_attribute23
356  ,p_egd_attribute24_o             =>ben_egd_shd.g_old_rec.egd_attribute24
357  ,p_egd_attribute25_o             =>ben_egd_shd.g_old_rec.egd_attribute25
358  ,p_egd_attribute26_o             =>ben_egd_shd.g_old_rec.egd_attribute26
359  ,p_egd_attribute27_o             =>ben_egd_shd.g_old_rec.egd_attribute27
360  ,p_egd_attribute28_o             =>ben_egd_shd.g_old_rec.egd_attribute28
361  ,p_egd_attribute29_o             =>ben_egd_shd.g_old_rec.egd_attribute29
362  ,p_egd_attribute30_o             =>ben_egd_shd.g_old_rec.egd_attribute30
363  ,p_request_id_o                  =>ben_egd_shd.g_old_rec.request_id
364  ,p_program_application_id_o      =>ben_egd_shd.g_old_rec.program_application_id
365  ,p_program_id_o                  =>ben_egd_shd.g_old_rec.program_id
366  ,p_program_update_date_o         =>ben_egd_shd.g_old_rec.program_update_date
367  ,p_object_version_number_o       =>ben_egd_shd.g_old_rec.object_version_number
368       );
369     --
370   exception
371     --
372     when hr_api.cannot_find_prog_unit then
373       --
374       hr_api.cannot_find_prog_unit_error
375         (p_module_name => 'ben_elig_dpnt'
376         ,p_hook_type   => 'AU');
377       --
378   end;
379   --
380   -- End of API User Hook for post_update.
381   --
382   --
383   hr_utility.set_location(' Leaving:'||l_proc, 10);
384 End post_update;
385 --
386 -- ----------------------------------------------------------------------------
387 -- |-----------------------------< convert_defs >-----------------------------|
388 -- ----------------------------------------------------------------------------
389 -- {Start Of Comments}
390 --
391 -- Description:
392 --   The Convert_Defs procedure has one very important function:
393 --   It must return the record structure for the row with all system defaulted
394 --   values converted into its corresponding parameter value for update. When
395 --   we attempt to update a row through the Upd process , certain
396 --   parameters can be defaulted which enables flexibility in the calling of
397 --   the upd process (e.g. only attributes which need to be updated need to be
398 --   specified). For the upd process to determine which attributes
399 --   have NOT been specified we need to check if the parameter has a reserved
400 --   system default value. Therefore, for all parameters which have a
401 --   corresponding reserved system default mechanism specified we need to
402 --   check if a system default is being used. If a system default is being
403 --   used then we convert the defaulted value into its corresponding attribute
404 --   value held in the g_old_rec data structure.
405 --
406 -- Prerequisites:
407 --   This private function can only be called from the upd process.
408 --
409 -- In Parameters:
410 --   A Pl/Sql record structre.
411 --
412 -- Post Success:
413 --   The record structure will be returned with all system defaulted parameter
414 --   values converted into its current row attribute value.
415 --
416 -- Post Failure:
417 --   No direct error handling is required within this function. Any possible
418 --   errors within this procedure will be a PL/SQL value error due to conversion
419 --   of datatypes or data lengths.
420 --
421 -- Developer Implementation Notes:
422 --   None.
423 --
424 -- Access Status:
425 --   Internal Row Handler Use Only.
426 --
427 -- {End Of Comments}
428 -- ----------------------------------------------------------------------------
429 Procedure convert_defs(p_rec in out nocopy ben_egd_shd.g_rec_type) is
430 --
431   l_proc  varchar2(72) := g_package||'convert_defs';
432 --
433 Begin
434   --
435   hr_utility.set_location('Entering:'||l_proc, 5);
436   --
437   -- We must now examine each argument value in the
438   -- p_rec plsql record structure
439   -- to see if a system default is being used. If a system default
440   -- is being used then we must set to the 'current' argument value.
441   --
445   End If;
442   If (p_rec.create_dt = hr_api.g_date) then
443     p_rec.create_dt :=
444     ben_egd_shd.g_old_rec.create_dt;
446   If (p_rec.elig_strt_dt = hr_api.g_date) then
447     p_rec.elig_strt_dt :=
448     ben_egd_shd.g_old_rec.elig_strt_dt;
449   End If;
450   If (p_rec.elig_thru_dt = hr_api.g_date) then
451     p_rec.elig_thru_dt :=
452     ben_egd_shd.g_old_rec.elig_thru_dt;
453   End If;
454   If (p_rec.ovrdn_flag = hr_api.g_varchar2) then
455     p_rec.ovrdn_flag :=
456     ben_egd_shd.g_old_rec.ovrdn_flag;
457   End If;
458   If (p_rec.ovrdn_thru_dt = hr_api.g_date) then
459     p_rec.ovrdn_thru_dt :=
460     ben_egd_shd.g_old_rec.ovrdn_thru_dt;
461   End If;
462   If (p_rec.inelg_rsn_cd = hr_api.g_varchar2) then
463     p_rec.inelg_rsn_cd :=
464     ben_egd_shd.g_old_rec.inelg_rsn_cd;
465   End If;
466   If (p_rec.dpnt_inelig_flag = hr_api.g_varchar2) then
467     p_rec.dpnt_inelig_flag :=
468     ben_egd_shd.g_old_rec.dpnt_inelig_flag;
469   End If;
470   If (p_rec.elig_per_elctbl_chc_id = hr_api.g_number) then
471     p_rec.elig_per_elctbl_chc_id :=
472     ben_egd_shd.g_old_rec.elig_per_elctbl_chc_id;
473   End If;
474   If (p_rec.per_in_ler_id = hr_api.g_number) then
475     p_rec.per_in_ler_id :=
476     ben_egd_shd.g_old_rec.per_in_ler_id;
477   End If;
478   If (p_rec.elig_per_id = hr_api.g_number) then
479     p_rec.elig_per_id :=
480     ben_egd_shd.g_old_rec.elig_per_id;
481   End If;
482   If (p_rec.elig_per_opt_id = hr_api.g_number) then
483     p_rec.elig_per_opt_id :=
484     ben_egd_shd.g_old_rec.elig_per_opt_id;
485   End If;
486   If (p_rec.elig_cvrd_dpnt_id = hr_api.g_number) then
487     p_rec.elig_cvrd_dpnt_id :=
488     ben_egd_shd.g_old_rec.elig_cvrd_dpnt_id;
489   End If;
490   If (p_rec.dpnt_person_id = hr_api.g_number) then
491     p_rec.dpnt_person_id :=
492     ben_egd_shd.g_old_rec.dpnt_person_id;
493   End If;
494   If (p_rec.business_group_id = hr_api.g_number) then
495     p_rec.business_group_id :=
496     ben_egd_shd.g_old_rec.business_group_id;
497   End If;
498   If (p_rec.egd_attribute_category = hr_api.g_varchar2) then
499     p_rec.egd_attribute_category :=
500     ben_egd_shd.g_old_rec.egd_attribute_category;
501   End If;
502   If (p_rec.egd_attribute1 = hr_api.g_varchar2) then
503     p_rec.egd_attribute1 :=
504     ben_egd_shd.g_old_rec.egd_attribute1;
505   End If;
506   If (p_rec.egd_attribute2 = hr_api.g_varchar2) then
507     p_rec.egd_attribute2 :=
508     ben_egd_shd.g_old_rec.egd_attribute2;
509   End If;
510   If (p_rec.egd_attribute3 = hr_api.g_varchar2) then
511     p_rec.egd_attribute3 :=
512     ben_egd_shd.g_old_rec.egd_attribute3;
513   End If;
514   If (p_rec.egd_attribute4 = hr_api.g_varchar2) then
515     p_rec.egd_attribute4 :=
516     ben_egd_shd.g_old_rec.egd_attribute4;
517   End If;
518   If (p_rec.egd_attribute5 = hr_api.g_varchar2) then
519     p_rec.egd_attribute5 :=
520     ben_egd_shd.g_old_rec.egd_attribute5;
521   End If;
522   If (p_rec.egd_attribute6 = hr_api.g_varchar2) then
523     p_rec.egd_attribute6 :=
524     ben_egd_shd.g_old_rec.egd_attribute6;
525   End If;
526   If (p_rec.egd_attribute7 = hr_api.g_varchar2) then
527     p_rec.egd_attribute7 :=
528     ben_egd_shd.g_old_rec.egd_attribute7;
529   End If;
530   If (p_rec.egd_attribute8 = hr_api.g_varchar2) then
531     p_rec.egd_attribute8 :=
532     ben_egd_shd.g_old_rec.egd_attribute8;
533   End If;
534   If (p_rec.egd_attribute9 = hr_api.g_varchar2) then
535     p_rec.egd_attribute9 :=
536     ben_egd_shd.g_old_rec.egd_attribute9;
537   End If;
538   If (p_rec.egd_attribute10 = hr_api.g_varchar2) then
539     p_rec.egd_attribute10 :=
540     ben_egd_shd.g_old_rec.egd_attribute10;
541   End If;
542   If (p_rec.egd_attribute11 = hr_api.g_varchar2) then
543     p_rec.egd_attribute11 :=
544     ben_egd_shd.g_old_rec.egd_attribute11;
545   End If;
546   If (p_rec.egd_attribute12 = hr_api.g_varchar2) then
547     p_rec.egd_attribute12 :=
548     ben_egd_shd.g_old_rec.egd_attribute12;
549   End If;
550   If (p_rec.egd_attribute13 = hr_api.g_varchar2) then
551     p_rec.egd_attribute13 :=
552     ben_egd_shd.g_old_rec.egd_attribute13;
553   End If;
554   If (p_rec.egd_attribute14 = hr_api.g_varchar2) then
555     p_rec.egd_attribute14 :=
556     ben_egd_shd.g_old_rec.egd_attribute14;
557   End If;
558   If (p_rec.egd_attribute15 = hr_api.g_varchar2) then
559     p_rec.egd_attribute15 :=
560     ben_egd_shd.g_old_rec.egd_attribute15;
561   End If;
562   If (p_rec.egd_attribute16 = hr_api.g_varchar2) then
563     p_rec.egd_attribute16 :=
564     ben_egd_shd.g_old_rec.egd_attribute16;
565   End If;
566   If (p_rec.egd_attribute17 = hr_api.g_varchar2) then
567     p_rec.egd_attribute17 :=
568     ben_egd_shd.g_old_rec.egd_attribute17;
569   End If;
570   If (p_rec.egd_attribute18 = hr_api.g_varchar2) then
571     p_rec.egd_attribute18 :=
572     ben_egd_shd.g_old_rec.egd_attribute18;
573   End If;
574   If (p_rec.egd_attribute19 = hr_api.g_varchar2) then
575     p_rec.egd_attribute19 :=
576     ben_egd_shd.g_old_rec.egd_attribute19;
577   End If;
578   If (p_rec.egd_attribute20 = hr_api.g_varchar2) then
579     p_rec.egd_attribute20 :=
580     ben_egd_shd.g_old_rec.egd_attribute20;
581   End If;
582   If (p_rec.egd_attribute21 = hr_api.g_varchar2) then
583     p_rec.egd_attribute21 :=
584     ben_egd_shd.g_old_rec.egd_attribute21;
585   End If;
586   If (p_rec.egd_attribute22 = hr_api.g_varchar2) then
587     p_rec.egd_attribute22 :=
588     ben_egd_shd.g_old_rec.egd_attribute22;
589   End If;
590   If (p_rec.egd_attribute23 = hr_api.g_varchar2) then
591     p_rec.egd_attribute23 :=
592     ben_egd_shd.g_old_rec.egd_attribute23;
593   End If;
594   If (p_rec.egd_attribute24 = hr_api.g_varchar2) then
595     p_rec.egd_attribute24 :=
596     ben_egd_shd.g_old_rec.egd_attribute24;
597   End If;
598   If (p_rec.egd_attribute25 = hr_api.g_varchar2) then
599     p_rec.egd_attribute25 :=
600     ben_egd_shd.g_old_rec.egd_attribute25;
601   End If;
602   If (p_rec.egd_attribute26 = hr_api.g_varchar2) then
603     p_rec.egd_attribute26 :=
604     ben_egd_shd.g_old_rec.egd_attribute26;
605   End If;
606   If (p_rec.egd_attribute27 = hr_api.g_varchar2) then
607     p_rec.egd_attribute27 :=
608     ben_egd_shd.g_old_rec.egd_attribute27;
609   End If;
610   If (p_rec.egd_attribute28 = hr_api.g_varchar2) then
611     p_rec.egd_attribute28 :=
612     ben_egd_shd.g_old_rec.egd_attribute28;
613   End If;
614   If (p_rec.egd_attribute29 = hr_api.g_varchar2) then
615     p_rec.egd_attribute29 :=
616     ben_egd_shd.g_old_rec.egd_attribute29;
617   End If;
618   If (p_rec.egd_attribute30 = hr_api.g_varchar2) then
619     p_rec.egd_attribute30 :=
620     ben_egd_shd.g_old_rec.egd_attribute30;
621   End If;
622   If (p_rec.request_id = hr_api.g_number) then
623     p_rec.request_id :=
624     ben_egd_shd.g_old_rec.request_id;
625   End If;
626   If (p_rec.program_application_id = hr_api.g_number) then
627     p_rec.program_application_id :=
628     ben_egd_shd.g_old_rec.program_application_id;
629   End If;
630   If (p_rec.program_id = hr_api.g_number) then
631     p_rec.program_id :=
632     ben_egd_shd.g_old_rec.program_id;
633   End If;
634   If (p_rec.program_update_date = hr_api.g_date) then
635     p_rec.program_update_date :=
636     ben_egd_shd.g_old_rec.program_update_date;
637   End If;
638 
639   --
640   hr_utility.set_location(' Leaving:'||l_proc, 10);
641 --
642 End convert_defs;
643 --
644 -- ----------------------------------------------------------------------------
645 -- |---------------------------------< upd >----------------------------------|
646 -- ----------------------------------------------------------------------------
647 Procedure upd
648   (
649   p_effective_date in date,
650   p_rec        in out nocopy ben_egd_shd.g_rec_type
651   ) is
652 --
653   l_proc  varchar2(72) := g_package||'upd';
654 --
655 Begin
656   hr_utility.set_location('Entering:'||l_proc, 5);
657   --
658   -- We must lock the row which we need to update.
659   --
660   ben_egd_shd.lck
661 	(
662 	p_rec.elig_dpnt_id,
663 	p_rec.object_version_number
664 	);
665   --
666   -- 1. During an update system defaults are used to determine if
667   --    arguments have been defaulted or not. We must therefore
668   --    derive the full record structure values to be updated.
669   --
670   -- 2. Call the supporting update validate operations.
671   --
672   convert_defs(p_rec);
673   ben_egd_bus.update_validate(p_rec
674   ,p_effective_date);
675   --
676   -- Call the supporting pre-update operation
677   --
678   pre_update(p_rec);
679   --
680   -- Update the row.
681   --
682   update_dml(p_rec);
683   --
684   -- Call the supporting post-update operation
685   --
686   post_update(
687 p_effective_date,p_rec);
688 End upd;
689 --
690 -- ----------------------------------------------------------------------------
691 -- |---------------------------------< upd >----------------------------------|
692 -- ----------------------------------------------------------------------------
693 Procedure upd
694   (
695   p_effective_date in date,
696   p_elig_dpnt_id                 in number,
697   p_create_dt                    in date             default hr_api.g_date,
698   p_elig_strt_dt                 in date             default hr_api.g_date,
699   p_elig_thru_dt                 in date             default hr_api.g_date,
700   p_ovrdn_flag                   in varchar2         default hr_api.g_varchar2,
701   p_ovrdn_thru_dt                in date             default hr_api.g_date,
702   p_inelg_rsn_cd                 in varchar2         default hr_api.g_varchar2,
703   p_dpnt_inelig_flag             in varchar2         default hr_api.g_varchar2,
704   p_elig_per_elctbl_chc_id       in number           default hr_api.g_number,
705   p_per_in_ler_id                in number           default hr_api.g_number,
706   p_elig_per_id                  in number           default hr_api.g_number,
707   p_elig_per_opt_id              in number           default hr_api.g_number,
708   p_elig_cvrd_dpnt_id            in number           default hr_api.g_number,
709   p_dpnt_person_id               in number           default hr_api.g_number,
710   p_business_group_id            in number           default hr_api.g_number,
711   p_egd_attribute_category       in varchar2         default hr_api.g_varchar2,
712   p_egd_attribute1               in varchar2         default hr_api.g_varchar2,
713   p_egd_attribute2               in varchar2         default hr_api.g_varchar2,
714   p_egd_attribute3               in varchar2         default hr_api.g_varchar2,
715   p_egd_attribute4               in varchar2         default hr_api.g_varchar2,
716   p_egd_attribute5               in varchar2         default hr_api.g_varchar2,
717   p_egd_attribute6               in varchar2         default hr_api.g_varchar2,
718   p_egd_attribute7               in varchar2         default hr_api.g_varchar2,
719   p_egd_attribute8               in varchar2         default hr_api.g_varchar2,
720   p_egd_attribute9               in varchar2         default hr_api.g_varchar2,
721   p_egd_attribute10              in varchar2         default hr_api.g_varchar2,
722   p_egd_attribute11              in varchar2         default hr_api.g_varchar2,
723   p_egd_attribute12              in varchar2         default hr_api.g_varchar2,
724   p_egd_attribute13              in varchar2         default hr_api.g_varchar2,
725   p_egd_attribute14              in varchar2         default hr_api.g_varchar2,
726   p_egd_attribute15              in varchar2         default hr_api.g_varchar2,
727   p_egd_attribute16              in varchar2         default hr_api.g_varchar2,
728   p_egd_attribute17              in varchar2         default hr_api.g_varchar2,
729   p_egd_attribute18              in varchar2         default hr_api.g_varchar2,
730   p_egd_attribute19              in varchar2         default hr_api.g_varchar2,
731   p_egd_attribute20              in varchar2         default hr_api.g_varchar2,
732   p_egd_attribute21              in varchar2         default hr_api.g_varchar2,
733   p_egd_attribute22              in varchar2         default hr_api.g_varchar2,
734   p_egd_attribute23              in varchar2         default hr_api.g_varchar2,
735   p_egd_attribute24              in varchar2         default hr_api.g_varchar2,
736   p_egd_attribute25              in varchar2         default hr_api.g_varchar2,
737   p_egd_attribute26              in varchar2         default hr_api.g_varchar2,
738   p_egd_attribute27              in varchar2         default hr_api.g_varchar2,
739   p_egd_attribute28              in varchar2         default hr_api.g_varchar2,
740   p_egd_attribute29              in varchar2         default hr_api.g_varchar2,
744   p_program_id                   in number           default hr_api.g_number,
741   p_egd_attribute30              in varchar2         default hr_api.g_varchar2,
742   p_request_id                   in number           default hr_api.g_number,
743   p_program_application_id       in number           default hr_api.g_number,
745   p_program_update_date          in date             default hr_api.g_date,
746   p_object_version_number        in out nocopy number
747   ) is
748 --
749   l_rec	  ben_egd_shd.g_rec_type;
750   l_proc  varchar2(72) := g_package||'upd';
751 --
752 Begin
753   hr_utility.set_location('Entering:'||l_proc, 5);
754   --
755   -- Call conversion function to turn arguments into the
756   -- l_rec structure.
757   --
758   l_rec :=
759   ben_egd_shd.convert_args
760   (
761   p_elig_dpnt_id,
762   p_create_dt,
763   p_elig_strt_dt,
764   p_elig_thru_dt,
765   p_ovrdn_flag,
766   p_ovrdn_thru_dt,
767   p_inelg_rsn_cd,
768   p_dpnt_inelig_flag,
769   p_elig_per_elctbl_chc_id,
770   p_per_in_ler_id,
771   p_elig_per_id,
772   p_elig_per_opt_id,
773   p_elig_cvrd_dpnt_id,
774   p_dpnt_person_id,
775   p_business_group_id,
776   p_egd_attribute_category,
777   p_egd_attribute1,
778   p_egd_attribute2,
779   p_egd_attribute3,
780   p_egd_attribute4,
781   p_egd_attribute5,
782   p_egd_attribute6,
783   p_egd_attribute7,
784   p_egd_attribute8,
785   p_egd_attribute9,
786   p_egd_attribute10,
787   p_egd_attribute11,
788   p_egd_attribute12,
789   p_egd_attribute13,
790   p_egd_attribute14,
791   p_egd_attribute15,
792   p_egd_attribute16,
793   p_egd_attribute17,
794   p_egd_attribute18,
795   p_egd_attribute19,
796   p_egd_attribute20,
797   p_egd_attribute21,
798   p_egd_attribute22,
799   p_egd_attribute23,
800   p_egd_attribute24,
801   p_egd_attribute25,
802   p_egd_attribute26,
803   p_egd_attribute27,
804   p_egd_attribute28,
805   p_egd_attribute29,
806   p_egd_attribute30,
807   p_request_id,
808   p_program_application_id,
809   p_program_id,
810   p_program_update_date,
811   p_object_version_number
812   );
813   --
814   -- Having converted the arguments into the
815   -- plsql record structure we call the corresponding record
816   -- business process.
817   --
818   upd(
819     p_effective_date,l_rec);
820   p_object_version_number := l_rec.object_version_number;
821   --
822   hr_utility.set_location(' Leaving:'||l_proc, 10);
823 End upd;
824 --
825 end ben_egd_upd;