DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CRT_UPD

Source


1 Package Body ben_crt_upd as
2 /* $Header: becrtrhi.pkb 115.11 2004/06/22 07:52:16 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_crt_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_crt_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_crt_shd.g_api_dml := true;  -- Set the api dml status
66   --
67   -- Update the ben_crt_ordr Row
68   --
69   update ben_crt_ordr
70   set
71   crt_ordr_id                       = p_rec.crt_ordr_id,
72   crt_ordr_typ_cd                   = p_rec.crt_ordr_typ_cd,
73   apls_perd_endg_dt                 = p_rec.apls_perd_endg_dt,
74   apls_perd_strtg_dt                = p_rec.apls_perd_strtg_dt,
75   crt_ident                         = p_rec.crt_ident,
76   description                       = p_rec.description,
77   detd_qlfd_ordr_dt                 = p_rec.detd_qlfd_ordr_dt,
78   issue_dt                          = p_rec.issue_dt,
79   qdro_amt                          = p_rec.qdro_amt,
80   qdro_dstr_mthd_cd                 = p_rec.qdro_dstr_mthd_cd,
81   qdro_pct                          = p_rec.qdro_pct,
82   rcvd_dt                           = p_rec.rcvd_dt,
83   uom                               = p_rec.uom,
84   crt_issng                         = p_rec.crt_issng,
85   pl_id                             = p_rec.pl_id,
86   person_id                         = p_rec.person_id,
87   business_group_id                 = p_rec.business_group_id,
88   crt_attribute_category            = p_rec.crt_attribute_category,
89   crt_attribute1                    = p_rec.crt_attribute1,
90   crt_attribute2                    = p_rec.crt_attribute2,
91   crt_attribute3                    = p_rec.crt_attribute3,
92   crt_attribute4                    = p_rec.crt_attribute4,
93   crt_attribute5                    = p_rec.crt_attribute5,
94   crt_attribute6                    = p_rec.crt_attribute6,
95   crt_attribute7                    = p_rec.crt_attribute7,
96   crt_attribute8                    = p_rec.crt_attribute8,
97   crt_attribute9                    = p_rec.crt_attribute9,
98   crt_attribute10                   = p_rec.crt_attribute10,
99   crt_attribute11                   = p_rec.crt_attribute11,
100   crt_attribute12                   = p_rec.crt_attribute12,
101   crt_attribute13                   = p_rec.crt_attribute13,
102   crt_attribute14                   = p_rec.crt_attribute14,
103   crt_attribute15                   = p_rec.crt_attribute15,
104   crt_attribute16                   = p_rec.crt_attribute16,
105   crt_attribute17                   = p_rec.crt_attribute17,
106   crt_attribute18                   = p_rec.crt_attribute18,
107   crt_attribute19                   = p_rec.crt_attribute19,
108   crt_attribute20                   = p_rec.crt_attribute20,
109   crt_attribute21                   = p_rec.crt_attribute21,
110   crt_attribute22                   = p_rec.crt_attribute22,
111   crt_attribute23                   = p_rec.crt_attribute23,
112   crt_attribute24                   = p_rec.crt_attribute24,
113   crt_attribute25                   = p_rec.crt_attribute25,
114   crt_attribute26                   = p_rec.crt_attribute26,
115   crt_attribute27                   = p_rec.crt_attribute27,
116   crt_attribute28                   = p_rec.crt_attribute28,
117   crt_attribute29                   = p_rec.crt_attribute29,
118   crt_attribute30                   = p_rec.crt_attribute30,
119   object_version_number             = p_rec.object_version_number,
120   qdro_num_pymt_val                 = p_rec.qdro_num_pymt_val,
121   qdro_per_perd_cd                  = p_rec.qdro_per_perd_cd,
122   pl_typ_id                         = p_rec.pl_typ_id
123   where crt_ordr_id = p_rec.crt_ordr_id;
124   --
125   ben_crt_shd.g_api_dml := false;   -- Unset the api dml status
126   --
127   hr_utility.set_location(' Leaving:'||l_proc, 10);
128 --
129 Exception
130   When hr_api.check_integrity_violated Then
131     -- A check constraint has been violated
132     ben_crt_shd.g_api_dml := false;   -- Unset the api dml status
133     ben_crt_shd.constraint_error
134       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
135   When hr_api.parent_integrity_violated Then
136     -- Parent integrity has been violated
137     ben_crt_shd.g_api_dml := false;   -- Unset the api dml status
138     ben_crt_shd.constraint_error
139       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
140   When hr_api.unique_integrity_violated Then
141     -- Unique integrity has been violated
142     ben_crt_shd.g_api_dml := false;   -- Unset the api dml status
143     ben_crt_shd.constraint_error
144       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
145   When Others Then
146     ben_crt_shd.g_api_dml := false;   -- Unset the api dml status
147     Raise;
148 End update_dml;
149 --
150 -- ----------------------------------------------------------------------------
151 -- |------------------------------< pre_update >------------------------------|
152 -- ----------------------------------------------------------------------------
153 -- {Start Of Comments}
154 --
155 -- Description:
156 --   This private procedure contains any processing which is required before
157 --   the update dml.
158 --
159 -- Prerequisites:
160 --   This is an internal procedure which is called from the upd procedure.
161 --
162 -- In Parameters:
163 --   A Pl/Sql record structre.
164 --
165 -- Post Success:
166 --   Processing continues.
167 --
168 -- Post Failure:
169 --   If an error has occurred, an error message and exception will be raised
170 --   but not handled.
171 --
172 -- Developer Implementation Notes:
173 --   Any pre-processing required before the update dml is issued should be
174 --   coded within this procedure. It is important to note that any 3rd party
175 --   maintenance should be reviewed before placing in this procedure.
176 --
177 -- Access Status:
178 --   Internal Row Handler Use Only.
179 --
180 -- {End Of Comments}
181 -- ----------------------------------------------------------------------------
182 Procedure pre_update(p_rec in ben_crt_shd.g_rec_type) is
183 --
184   l_proc  varchar2(72) := g_package||'pre_update';
185 --
186 Begin
187   hr_utility.set_location('Entering:'||l_proc, 5);
188   --
189   hr_utility.set_location(' Leaving:'||l_proc, 10);
190 End pre_update;
191 --
192 -- ----------------------------------------------------------------------------
193 -- |-----------------------------< post_update >------------------------------|
194 -- ----------------------------------------------------------------------------
195 -- {Start Of Comments}
196 --
197 -- Description:
198 --   This private procedure contains any processing which is required after the
199 --   update dml.
200 --
201 -- Prerequisites:
202 --   This is an internal procedure which is called from the upd procedure.
203 --
204 -- In Parameters:
205 --   A Pl/Sql record structre.
206 --
207 -- Post Success:
208 --   Processing continues.
209 --
210 -- Post Failure:
211 --   If an error has occurred, an error message and exception will be raised
212 --   but not handled.
213 --
214 -- Developer Implementation Notes:
215 --   Any post-processing required after the update dml is issued should be
216 --   coded within this procedure. It is important to note that any 3rd party
217 --   maintenance should be reviewed before placing in this procedure.
218 --
219 -- Access Status:
220 --   Internal Row Handler Use Only.
221 --
222 -- {End Of Comments}
223 -- ----------------------------------------------------------------------------
224 Procedure post_update( p_effective_date in date,p_rec in ben_crt_shd.g_rec_type) is
225 --
226   l_proc  varchar2(72) := g_package||'post_update';
227   l_old_rec ben_crt_ler.g_crt_ler_rec  ;
228   l_new_rec ben_crt_ler.g_crt_ler_rec  ;
229 --
230 Begin
231   hr_utility.set_location('Entering:'||l_proc, 5);
232 --
233   --
234   -- Start of API User Hook for post_update.
235   --
236   begin
237   l_old_rec.business_group_id    := ben_crt_shd.g_old_rec.business_group_id;
238   l_old_rec.person_id            := ben_crt_shd.g_old_rec.person_id;
239   l_old_rec.apls_perd_strtg_dt   := ben_crt_shd.g_old_rec.apls_perd_strtg_dt;
240   l_old_rec.apls_perd_endg_dt    := ben_crt_shd.g_old_rec.apls_perd_endg_dt;
241   l_old_rec.crt_ordr_typ_cd      := ben_crt_shd.g_old_rec.crt_ordr_typ_cd;
242   l_old_rec.rcvd_dt              := ben_crt_shd.g_old_rec.rcvd_dt;
243   l_old_rec.pl_id                := ben_crt_shd.g_old_rec.pl_id;
244   l_old_rec.pl_typ_id            := ben_crt_shd.g_old_rec.pl_typ_id;
245   l_new_rec.business_group_id := p_rec.business_group_id;
246   l_new_rec.person_id         := p_rec.person_id;
247   l_new_rec.apls_perd_strtg_dt:= p_rec.apls_perd_strtg_dt;
248   l_new_rec.apls_perd_endg_dt := p_rec.apls_perd_endg_dt;
249   l_new_rec.crt_ordr_typ_cd   := p_rec.crt_ordr_typ_cd;
250   l_new_rec.rcvd_dt           := p_rec.rcvd_dt;
251   l_new_rec.pl_id             := p_rec.pl_id;
252   l_new_rec.pl_typ_id         := p_rec.pl_typ_id;
253   l_new_rec.crt_ordr_id       := p_rec.crt_ordr_id;
254   --
255   ben_crt_rku.after_update
256       (
257   p_crt_ordr_id                   =>p_rec.crt_ordr_id
258  ,p_crt_ordr_typ_cd               =>p_rec.crt_ordr_typ_cd
259  ,p_apls_perd_endg_dt             =>p_rec.apls_perd_endg_dt
260  ,p_apls_perd_strtg_dt            =>p_rec.apls_perd_strtg_dt
261  ,p_crt_ident                     =>p_rec.crt_ident
262  ,p_description                   =>p_rec.description
263  ,p_detd_qlfd_ordr_dt             =>p_rec.detd_qlfd_ordr_dt
264  ,p_issue_dt                      =>p_rec.issue_dt
265  ,p_qdro_amt                      =>p_rec.qdro_amt
266  ,p_qdro_dstr_mthd_cd             =>p_rec.qdro_dstr_mthd_cd
267  ,p_qdro_pct                      =>p_rec.qdro_pct
268  ,p_rcvd_dt                       =>p_rec.rcvd_dt
269  ,p_uom                           =>p_rec.uom
270  ,p_crt_issng                     =>p_rec.crt_issng
271  ,p_pl_id                         =>p_rec.pl_id
272  ,p_person_id                     =>p_rec.person_id
273  ,p_business_group_id             =>p_rec.business_group_id
274  ,p_crt_attribute_category        =>p_rec.crt_attribute_category
275  ,p_crt_attribute1                =>p_rec.crt_attribute1
276  ,p_crt_attribute2                =>p_rec.crt_attribute2
277  ,p_crt_attribute3                =>p_rec.crt_attribute3
278  ,p_crt_attribute4                =>p_rec.crt_attribute4
279  ,p_crt_attribute5                =>p_rec.crt_attribute5
280  ,p_crt_attribute6                =>p_rec.crt_attribute6
281  ,p_crt_attribute7                =>p_rec.crt_attribute7
282  ,p_crt_attribute8                =>p_rec.crt_attribute8
283  ,p_crt_attribute9                =>p_rec.crt_attribute9
284  ,p_crt_attribute10               =>p_rec.crt_attribute10
285  ,p_crt_attribute11               =>p_rec.crt_attribute11
286  ,p_crt_attribute12               =>p_rec.crt_attribute12
287  ,p_crt_attribute13               =>p_rec.crt_attribute13
288  ,p_crt_attribute14               =>p_rec.crt_attribute14
289  ,p_crt_attribute15               =>p_rec.crt_attribute15
290  ,p_crt_attribute16               =>p_rec.crt_attribute16
291  ,p_crt_attribute17               =>p_rec.crt_attribute17
292  ,p_crt_attribute18               =>p_rec.crt_attribute18
293  ,p_crt_attribute19               =>p_rec.crt_attribute19
294  ,p_crt_attribute20               =>p_rec.crt_attribute20
295  ,p_crt_attribute21               =>p_rec.crt_attribute21
296  ,p_crt_attribute22               =>p_rec.crt_attribute22
297  ,p_crt_attribute23               =>p_rec.crt_attribute23
298  ,p_crt_attribute24               =>p_rec.crt_attribute24
299  ,p_crt_attribute25               =>p_rec.crt_attribute25
300  ,p_crt_attribute26               =>p_rec.crt_attribute26
301  ,p_crt_attribute27               =>p_rec.crt_attribute27
302  ,p_crt_attribute28               =>p_rec.crt_attribute28
303  ,p_crt_attribute29               =>p_rec.crt_attribute29
304  ,p_crt_attribute30               =>p_rec.crt_attribute30
305  ,p_object_version_number         =>p_rec.object_version_number
306  ,p_qdro_num_pymt_val             =>p_rec.qdro_num_pymt_val
307  ,p_qdro_per_perd_cd              =>p_rec.qdro_per_perd_cd
308  ,p_pl_typ_id                     =>p_rec.pl_typ_id
309  ,p_effective_date                =>p_effective_date
310  ,p_crt_ordr_typ_cd_o             =>ben_crt_shd.g_old_rec.crt_ordr_typ_cd
311  ,p_apls_perd_endg_dt_o           =>ben_crt_shd.g_old_rec.apls_perd_endg_dt
312  ,p_apls_perd_strtg_dt_o          =>ben_crt_shd.g_old_rec.apls_perd_strtg_dt
313  ,p_crt_ident_o                   =>ben_crt_shd.g_old_rec.crt_ident
314  ,p_description_o                 =>ben_crt_shd.g_old_rec.description
315  ,p_detd_qlfd_ordr_dt_o           =>ben_crt_shd.g_old_rec.detd_qlfd_ordr_dt
316  ,p_issue_dt_o                    =>ben_crt_shd.g_old_rec.issue_dt
317  ,p_qdro_amt_o                    =>ben_crt_shd.g_old_rec.qdro_amt
318  ,p_qdro_dstr_mthd_cd_o           =>ben_crt_shd.g_old_rec.qdro_dstr_mthd_cd
319  ,p_qdro_pct_o                    =>ben_crt_shd.g_old_rec.qdro_pct
320  ,p_rcvd_dt_o                     =>ben_crt_shd.g_old_rec.rcvd_dt
321  ,p_uom_o                         =>ben_crt_shd.g_old_rec.uom
322  ,p_crt_issng_o                   =>ben_crt_shd.g_old_rec.crt_issng
323  ,p_pl_id_o                       =>ben_crt_shd.g_old_rec.pl_id
324  ,p_person_id_o                   =>ben_crt_shd.g_old_rec.person_id
325  ,p_business_group_id_o           =>ben_crt_shd.g_old_rec.business_group_id
326  ,p_crt_attribute_category_o      =>ben_crt_shd.g_old_rec.crt_attribute_category
327  ,p_crt_attribute1_o              =>ben_crt_shd.g_old_rec.crt_attribute1
328  ,p_crt_attribute2_o              =>ben_crt_shd.g_old_rec.crt_attribute2
329  ,p_crt_attribute3_o              =>ben_crt_shd.g_old_rec.crt_attribute3
330  ,p_crt_attribute4_o              =>ben_crt_shd.g_old_rec.crt_attribute4
331  ,p_crt_attribute5_o              =>ben_crt_shd.g_old_rec.crt_attribute5
332  ,p_crt_attribute6_o              =>ben_crt_shd.g_old_rec.crt_attribute6
333  ,p_crt_attribute7_o              =>ben_crt_shd.g_old_rec.crt_attribute7
334  ,p_crt_attribute8_o              =>ben_crt_shd.g_old_rec.crt_attribute8
335  ,p_crt_attribute9_o              =>ben_crt_shd.g_old_rec.crt_attribute9
336  ,p_crt_attribute10_o             =>ben_crt_shd.g_old_rec.crt_attribute10
337  ,p_crt_attribute11_o             =>ben_crt_shd.g_old_rec.crt_attribute11
338  ,p_crt_attribute12_o             =>ben_crt_shd.g_old_rec.crt_attribute12
339  ,p_crt_attribute13_o             =>ben_crt_shd.g_old_rec.crt_attribute13
340  ,p_crt_attribute14_o             =>ben_crt_shd.g_old_rec.crt_attribute14
341  ,p_crt_attribute15_o             =>ben_crt_shd.g_old_rec.crt_attribute15
342  ,p_crt_attribute16_o             =>ben_crt_shd.g_old_rec.crt_attribute16
343  ,p_crt_attribute17_o             =>ben_crt_shd.g_old_rec.crt_attribute17
344  ,p_crt_attribute18_o             =>ben_crt_shd.g_old_rec.crt_attribute18
345  ,p_crt_attribute19_o             =>ben_crt_shd.g_old_rec.crt_attribute19
346  ,p_crt_attribute20_o             =>ben_crt_shd.g_old_rec.crt_attribute20
347  ,p_crt_attribute21_o             =>ben_crt_shd.g_old_rec.crt_attribute21
348  ,p_crt_attribute22_o             =>ben_crt_shd.g_old_rec.crt_attribute22
349  ,p_crt_attribute23_o             =>ben_crt_shd.g_old_rec.crt_attribute23
350  ,p_crt_attribute24_o             =>ben_crt_shd.g_old_rec.crt_attribute24
351  ,p_crt_attribute25_o             =>ben_crt_shd.g_old_rec.crt_attribute25
352  ,p_crt_attribute26_o             =>ben_crt_shd.g_old_rec.crt_attribute26
353  ,p_crt_attribute27_o             =>ben_crt_shd.g_old_rec.crt_attribute27
354  ,p_crt_attribute28_o             =>ben_crt_shd.g_old_rec.crt_attribute28
355  ,p_crt_attribute29_o             =>ben_crt_shd.g_old_rec.crt_attribute29
356  ,p_crt_attribute30_o             =>ben_crt_shd.g_old_rec.crt_attribute30
357  ,p_object_version_number_o       =>ben_crt_shd.g_old_rec.object_version_number
358  ,p_qdro_num_pymt_val_o           =>ben_crt_shd.g_old_rec.qdro_num_pymt_val
359  ,p_qdro_per_perd_cd_o            =>ben_crt_shd.g_old_rec.qdro_per_perd_cd
360  ,p_pl_typ_id_o                   =>ben_crt_shd.g_old_rec.pl_typ_id
361       );
362   --
363   hr_utility.set_location('D M Modie crt ' ||hr_general.g_data_migrator_mode , 378);
364   if hr_general.g_data_migrator_mode not in ( 'Y','P') then
365       hr_utility.set_location(' calling ler check in update  ' , 1408379 );
366       --for bug 1408379 the call for this functiom moved from trigger
367       ben_crt_ler.ler_chk(p_old => l_old_rec,
368                       p_new => l_new_rec ,
369                       p_effective_date => p_effective_date  );
370    End if ;
371   exception
372     --
373     when hr_api.cannot_find_prog_unit then
374       --
375       hr_api.cannot_find_prog_unit_error
376         (p_module_name => 'ben_crt_ordr'
377         ,p_hook_type   => 'AU');
378       --
379   end;
380   --
381   -- End of API User Hook for post_update.
382   --
383   --
384   hr_utility.set_location(' Leaving:'||l_proc, 10);
385 End post_update;
386 --
387 -- ----------------------------------------------------------------------------
388 -- |-----------------------------< convert_defs >-----------------------------|
389 -- ----------------------------------------------------------------------------
390 -- {Start Of Comments}
391 --
392 -- Description:
393 --   The Convert_Defs procedure has one very important function:
394 --   It must return the record structure for the row with all system defaulted
395 --   values converted into its corresponding parameter value for update. When
396 --   we attempt to update a row through the Upd process , certain
397 --   parameters can be defaulted which enables flexibility in the calling of
398 --   the upd process (e.g. only attributes which need to be updated need to be
399 --   specified). For the upd process to determine which attributes
400 --   have NOT been specified we need to check if the parameter has a reserved
401 --   system default value. Therefore, for all parameters which have a
402 --   corresponding reserved system default mechanism specified we need to
403 --   check if a system default is being used. If a system default is being
404 --   used then we convert the defaulted value into its corresponding attribute
405 --   value held in the g_old_rec data structure.
406 --
407 -- Prerequisites:
408 --   This private function can only be called from the upd process.
409 --
410 -- In Parameters:
411 --   A Pl/Sql record structre.
412 --
413 -- Post Success:
414 --   The record structure will be returned with all system defaulted parameter
415 --   values converted into its current row attribute value.
416 --
417 -- Post Failure:
418 --   No direct error handling is required within this function. Any possible
419 --   errors within this procedure will be a PL/SQL value error due to conversion
420 --   of datatypes or data lengths.
421 --
422 -- Developer Implementation Notes:
423 --   None.
424 --
425 -- Access Status:
426 --   Internal Row Handler Use Only.
427 --
428 -- {End Of Comments}
429 -- ----------------------------------------------------------------------------
430 Procedure convert_defs(p_rec in out nocopy ben_crt_shd.g_rec_type) is
431 --
432   l_proc  varchar2(72) := g_package||'convert_defs';
433 --
434 Begin
435   --
436   hr_utility.set_location('Entering:'||l_proc, 5);
437   --
438   -- We must now examine each argument value in the
439   -- p_rec plsql record structure
440   -- to see if a system default is being used. If a system default
441   -- is being used then we must set to the 'current' argument value.
442   --
443   If (p_rec.crt_ordr_typ_cd = hr_api.g_varchar2) then
444     p_rec.crt_ordr_typ_cd :=
445     ben_crt_shd.g_old_rec.crt_ordr_typ_cd;
446   End If;
447   If (p_rec.apls_perd_endg_dt = hr_api.g_date) then
448     p_rec.apls_perd_endg_dt :=
449     ben_crt_shd.g_old_rec.apls_perd_endg_dt;
450   End If;
451   If (p_rec.apls_perd_strtg_dt = hr_api.g_date) then
452     p_rec.apls_perd_strtg_dt :=
453     ben_crt_shd.g_old_rec.apls_perd_strtg_dt;
454   End If;
455   If (p_rec.crt_ident = hr_api.g_varchar2) then
456     p_rec.crt_ident :=
457     ben_crt_shd.g_old_rec.crt_ident;
458   End If;
459   If (p_rec.description = hr_api.g_varchar2) then
460     p_rec.description :=
461     ben_crt_shd.g_old_rec.description;
462   End If;
463   If (p_rec.detd_qlfd_ordr_dt = hr_api.g_date) then
464     p_rec.detd_qlfd_ordr_dt :=
465     ben_crt_shd.g_old_rec.detd_qlfd_ordr_dt;
466   End If;
467   If (p_rec.issue_dt = hr_api.g_date) then
468     p_rec.issue_dt :=
469     ben_crt_shd.g_old_rec.issue_dt;
470   End If;
471   If (p_rec.qdro_amt = hr_api.g_number) then
472     p_rec.qdro_amt :=
473     ben_crt_shd.g_old_rec.qdro_amt;
474   End If;
475   If (p_rec.qdro_dstr_mthd_cd = hr_api.g_varchar2) then
476     p_rec.qdro_dstr_mthd_cd :=
477     ben_crt_shd.g_old_rec.qdro_dstr_mthd_cd;
478   End If;
479   If (p_rec.qdro_pct = hr_api.g_number) then
480     p_rec.qdro_pct :=
481     ben_crt_shd.g_old_rec.qdro_pct;
482   End If;
483   If (p_rec.rcvd_dt = hr_api.g_date) then
484     p_rec.rcvd_dt :=
485     ben_crt_shd.g_old_rec.rcvd_dt;
486   End If;
487   If (p_rec.uom = hr_api.g_varchar2) then
488     p_rec.uom :=
489     ben_crt_shd.g_old_rec.uom;
490   End If;
491   If (p_rec.crt_issng = hr_api.g_varchar2) then
492     p_rec.crt_issng :=
493     ben_crt_shd.g_old_rec.crt_issng;
494   End If;
495   If (p_rec.pl_id = hr_api.g_number) then
496     p_rec.pl_id :=
497     ben_crt_shd.g_old_rec.pl_id;
498   End If;
499   If (p_rec.person_id = hr_api.g_number) then
500     p_rec.person_id :=
501     ben_crt_shd.g_old_rec.person_id;
502   End If;
503   If (p_rec.business_group_id = hr_api.g_number) then
504     p_rec.business_group_id :=
505     ben_crt_shd.g_old_rec.business_group_id;
506   End If;
507   If (p_rec.crt_attribute_category = hr_api.g_varchar2) then
508     p_rec.crt_attribute_category :=
509     ben_crt_shd.g_old_rec.crt_attribute_category;
510   End If;
511   If (p_rec.crt_attribute1 = hr_api.g_varchar2) then
512     p_rec.crt_attribute1 :=
513     ben_crt_shd.g_old_rec.crt_attribute1;
514   End If;
515   If (p_rec.crt_attribute2 = hr_api.g_varchar2) then
516     p_rec.crt_attribute2 :=
517     ben_crt_shd.g_old_rec.crt_attribute2;
518   End If;
519   If (p_rec.crt_attribute3 = hr_api.g_varchar2) then
520     p_rec.crt_attribute3 :=
521     ben_crt_shd.g_old_rec.crt_attribute3;
522   End If;
523   If (p_rec.crt_attribute4 = hr_api.g_varchar2) then
524     p_rec.crt_attribute4 :=
525     ben_crt_shd.g_old_rec.crt_attribute4;
526   End If;
527   If (p_rec.crt_attribute5 = hr_api.g_varchar2) then
528     p_rec.crt_attribute5 :=
529     ben_crt_shd.g_old_rec.crt_attribute5;
530   End If;
531   If (p_rec.crt_attribute6 = hr_api.g_varchar2) then
532     p_rec.crt_attribute6 :=
533     ben_crt_shd.g_old_rec.crt_attribute6;
534   End If;
535   If (p_rec.crt_attribute7 = hr_api.g_varchar2) then
536     p_rec.crt_attribute7 :=
537     ben_crt_shd.g_old_rec.crt_attribute7;
538   End If;
539   If (p_rec.crt_attribute8 = hr_api.g_varchar2) then
540     p_rec.crt_attribute8 :=
541     ben_crt_shd.g_old_rec.crt_attribute8;
542   End If;
543   If (p_rec.crt_attribute9 = hr_api.g_varchar2) then
544     p_rec.crt_attribute9 :=
545     ben_crt_shd.g_old_rec.crt_attribute9;
546   End If;
547   If (p_rec.crt_attribute10 = hr_api.g_varchar2) then
548     p_rec.crt_attribute10 :=
549     ben_crt_shd.g_old_rec.crt_attribute10;
550   End If;
551   If (p_rec.crt_attribute11 = hr_api.g_varchar2) then
552     p_rec.crt_attribute11 :=
553     ben_crt_shd.g_old_rec.crt_attribute11;
554   End If;
555   If (p_rec.crt_attribute12 = hr_api.g_varchar2) then
556     p_rec.crt_attribute12 :=
557     ben_crt_shd.g_old_rec.crt_attribute12;
558   End If;
559   If (p_rec.crt_attribute13 = hr_api.g_varchar2) then
560     p_rec.crt_attribute13 :=
561     ben_crt_shd.g_old_rec.crt_attribute13;
562   End If;
563   If (p_rec.crt_attribute14 = hr_api.g_varchar2) then
564     p_rec.crt_attribute14 :=
565     ben_crt_shd.g_old_rec.crt_attribute14;
566   End If;
567   If (p_rec.crt_attribute15 = hr_api.g_varchar2) then
568     p_rec.crt_attribute15 :=
569     ben_crt_shd.g_old_rec.crt_attribute15;
570   End If;
571   If (p_rec.crt_attribute16 = hr_api.g_varchar2) then
572     p_rec.crt_attribute16 :=
573     ben_crt_shd.g_old_rec.crt_attribute16;
574   End If;
575   If (p_rec.crt_attribute17 = hr_api.g_varchar2) then
576     p_rec.crt_attribute17 :=
577     ben_crt_shd.g_old_rec.crt_attribute17;
578   End If;
579   If (p_rec.crt_attribute18 = hr_api.g_varchar2) then
580     p_rec.crt_attribute18 :=
581     ben_crt_shd.g_old_rec.crt_attribute18;
582   End If;
583   If (p_rec.crt_attribute19 = hr_api.g_varchar2) then
584     p_rec.crt_attribute19 :=
585     ben_crt_shd.g_old_rec.crt_attribute19;
586   End If;
587   If (p_rec.crt_attribute20 = hr_api.g_varchar2) then
588     p_rec.crt_attribute20 :=
589     ben_crt_shd.g_old_rec.crt_attribute20;
590   End If;
591   If (p_rec.crt_attribute21 = hr_api.g_varchar2) then
592     p_rec.crt_attribute21 :=
593     ben_crt_shd.g_old_rec.crt_attribute21;
594   End If;
595   If (p_rec.crt_attribute22 = hr_api.g_varchar2) then
596     p_rec.crt_attribute22 :=
597     ben_crt_shd.g_old_rec.crt_attribute22;
598   End If;
599   If (p_rec.crt_attribute23 = hr_api.g_varchar2) then
600     p_rec.crt_attribute23 :=
601     ben_crt_shd.g_old_rec.crt_attribute23;
602   End If;
603   If (p_rec.crt_attribute24 = hr_api.g_varchar2) then
604     p_rec.crt_attribute24 :=
605     ben_crt_shd.g_old_rec.crt_attribute24;
606   End If;
607   If (p_rec.crt_attribute25 = hr_api.g_varchar2) then
608     p_rec.crt_attribute25 :=
609     ben_crt_shd.g_old_rec.crt_attribute25;
610   End If;
611   If (p_rec.crt_attribute26 = hr_api.g_varchar2) then
612     p_rec.crt_attribute26 :=
613     ben_crt_shd.g_old_rec.crt_attribute26;
614   End If;
615   If (p_rec.crt_attribute27 = hr_api.g_varchar2) then
616     p_rec.crt_attribute27 :=
617     ben_crt_shd.g_old_rec.crt_attribute27;
618   End If;
619   If (p_rec.crt_attribute28 = hr_api.g_varchar2) then
620     p_rec.crt_attribute28 :=
621     ben_crt_shd.g_old_rec.crt_attribute28;
622   End If;
623   If (p_rec.crt_attribute29 = hr_api.g_varchar2) then
624     p_rec.crt_attribute29 :=
625     ben_crt_shd.g_old_rec.crt_attribute29;
626   End If;
627   If (p_rec.crt_attribute30 = hr_api.g_varchar2) then
628     p_rec.crt_attribute30 :=
629     ben_crt_shd.g_old_rec.crt_attribute30;
630   End If;
631   If (p_rec.qdro_num_pymt_val = hr_api.g_number) then
632     p_rec.qdro_num_pymt_val :=
633     ben_crt_shd.g_old_rec.qdro_num_pymt_val;
634   End If;
635   If (p_rec.qdro_per_perd_cd = hr_api.g_varchar2) then
636     p_rec.qdro_per_perd_cd :=
637     ben_crt_shd.g_old_rec.qdro_per_perd_cd;
638   End If;
639   If (p_rec.pl_typ_id = hr_api.g_number) then
640     p_rec.pl_typ_id :=
641     ben_crt_shd.g_old_rec.pl_typ_id;
642   End If;
643   --
644   hr_utility.set_location(' Leaving:'||l_proc, 10);
645 --
646 End convert_defs;
647 --
648 -- ----------------------------------------------------------------------------
649 -- |---------------------------------< upd >----------------------------------|
650 -- ----------------------------------------------------------------------------
651 Procedure upd
652   (
653   p_effective_date in date,
654   p_rec        in out nocopy ben_crt_shd.g_rec_type
655   ) is
656 --
657   l_proc  varchar2(72) := g_package||'upd';
658 --
659 Begin
660   hr_utility.set_location('Entering:'||l_proc, 5);
661   --
662   -- We must lock the row which we need to update.
663   ---
664   ben_crt_shd.lck
665 	(
666 	p_rec.crt_ordr_id,
667 	p_rec.object_version_number
668 	);
669 
670 
671   --
672   -- 1. During an update system defaults are used to determine if
673   --    arguments have been defaulted or not. We must therefore
674   --    derive the full record structure values to be updated.
675   --
676   -- 2. Call the supporting update validate operations.
677   --
678   convert_defs(p_rec);
679   ben_crt_bus.update_validate(p_rec
680   ,p_effective_date);
681   --
682   -- Call the supporting pre-update operation
683   --
684   pre_update(p_rec);
685   --
686   -- Update the row.
687   --
688   update_dml(p_rec);
689   --
690   -- Call the supporting post-update operation
691   --
692   post_update( p_effective_date,p_rec);
693 
694 
695 End upd;
696 --
697 -- ----------------------------------------------------------------------------
698 -- |---------------------------------< upd >----------------------------------|
699 -- ----------------------------------------------------------------------------
700 Procedure upd
701   (
702   p_effective_date in date,
703   p_crt_ordr_id                  in number,
704   p_crt_ordr_typ_cd              in varchar2         default hr_api.g_varchar2,
705   p_apls_perd_endg_dt            in date             default hr_api.g_date,
706   p_apls_perd_strtg_dt           in date             default hr_api.g_date,
707   p_crt_ident                    in varchar2         default hr_api.g_varchar2,
708   p_description                  in varchar2         default hr_api.g_varchar2,
709   p_detd_qlfd_ordr_dt            in date             default hr_api.g_date,
710   p_issue_dt                     in date             default hr_api.g_date,
711   p_qdro_amt                     in number           default hr_api.g_number,
712   p_qdro_dstr_mthd_cd            in varchar2         default hr_api.g_varchar2,
713   p_qdro_pct                     in number           default hr_api.g_number,
714   p_rcvd_dt                      in date             default hr_api.g_date,
715   p_uom                          in varchar2         default hr_api.g_varchar2,
716   p_crt_issng                    in varchar2         default hr_api.g_varchar2,
717   p_pl_id                        in number           default hr_api.g_number,
718   p_person_id                    in number           default hr_api.g_number,
719   p_business_group_id            in number           default hr_api.g_number,
720   p_crt_attribute_category       in varchar2         default hr_api.g_varchar2,
721   p_crt_attribute1               in varchar2         default hr_api.g_varchar2,
722   p_crt_attribute2               in varchar2         default hr_api.g_varchar2,
723   p_crt_attribute3               in varchar2         default hr_api.g_varchar2,
724   p_crt_attribute4               in varchar2         default hr_api.g_varchar2,
725   p_crt_attribute5               in varchar2         default hr_api.g_varchar2,
726   p_crt_attribute6               in varchar2         default hr_api.g_varchar2,
727   p_crt_attribute7               in varchar2         default hr_api.g_varchar2,
728   p_crt_attribute8               in varchar2         default hr_api.g_varchar2,
729   p_crt_attribute9               in varchar2         default hr_api.g_varchar2,
730   p_crt_attribute10              in varchar2         default hr_api.g_varchar2,
731   p_crt_attribute11              in varchar2         default hr_api.g_varchar2,
732   p_crt_attribute12              in varchar2         default hr_api.g_varchar2,
733   p_crt_attribute13              in varchar2         default hr_api.g_varchar2,
734   p_crt_attribute14              in varchar2         default hr_api.g_varchar2,
735   p_crt_attribute15              in varchar2         default hr_api.g_varchar2,
736   p_crt_attribute16              in varchar2         default hr_api.g_varchar2,
737   p_crt_attribute17              in varchar2         default hr_api.g_varchar2,
738   p_crt_attribute18              in varchar2         default hr_api.g_varchar2,
739   p_crt_attribute19              in varchar2         default hr_api.g_varchar2,
740   p_crt_attribute20              in varchar2         default hr_api.g_varchar2,
741   p_crt_attribute21              in varchar2         default hr_api.g_varchar2,
742   p_crt_attribute22              in varchar2         default hr_api.g_varchar2,
743   p_crt_attribute23              in varchar2         default hr_api.g_varchar2,
744   p_crt_attribute24              in varchar2         default hr_api.g_varchar2,
745   p_crt_attribute25              in varchar2         default hr_api.g_varchar2,
746   p_crt_attribute26              in varchar2         default hr_api.g_varchar2,
747   p_crt_attribute27              in varchar2         default hr_api.g_varchar2,
748   p_crt_attribute28              in varchar2         default hr_api.g_varchar2,
749   p_crt_attribute29              in varchar2         default hr_api.g_varchar2,
750   p_crt_attribute30              in varchar2         default hr_api.g_varchar2,
751   p_object_version_number        in out nocopy number,
752   p_qdro_num_pymt_val            in number           default hr_api.g_number,
753   p_qdro_per_perd_cd             in varchar2         default hr_api.g_varchar2,
754   p_pl_typ_id                    in number           default hr_api.g_number
755   ) is
756 --
757   l_rec	  ben_crt_shd.g_rec_type;
758   l_proc  varchar2(72) := g_package||'upd';
759 --
760 Begin
761   hr_utility.set_location('Entering:'||l_proc, 5);
762   --
763   -- Call conversion function to turn arguments into the
764   -- l_rec structure.
765   --
766   l_rec :=
767   ben_crt_shd.convert_args
768   (
769   p_crt_ordr_id,
770   p_crt_ordr_typ_cd,
771   p_apls_perd_endg_dt,
772   p_apls_perd_strtg_dt,
773   p_crt_ident,
774   p_description,
775   p_detd_qlfd_ordr_dt,
776   p_issue_dt,
777   p_qdro_amt,
778   p_qdro_dstr_mthd_cd,
779   p_qdro_pct,
780   p_rcvd_dt,
781   p_uom,
782   p_crt_issng,
783   p_pl_id,
784   p_person_id,
785   p_business_group_id,
786   p_crt_attribute_category,
787   p_crt_attribute1,
788   p_crt_attribute2,
789   p_crt_attribute3,
790   p_crt_attribute4,
791   p_crt_attribute5,
792   p_crt_attribute6,
793   p_crt_attribute7,
794   p_crt_attribute8,
795   p_crt_attribute9,
796   p_crt_attribute10,
797   p_crt_attribute11,
798   p_crt_attribute12,
799   p_crt_attribute13,
800   p_crt_attribute14,
801   p_crt_attribute15,
802   p_crt_attribute16,
803   p_crt_attribute17,
804   p_crt_attribute18,
805   p_crt_attribute19,
806   p_crt_attribute20,
807   p_crt_attribute21,
808   p_crt_attribute22,
809   p_crt_attribute23,
810   p_crt_attribute24,
811   p_crt_attribute25,
812   p_crt_attribute26,
813   p_crt_attribute27,
814   p_crt_attribute28,
815   p_crt_attribute29,
816   p_crt_attribute30,
817   p_object_version_number,
818   p_qdro_num_pymt_val,
819   p_qdro_per_perd_cd,
820   p_pl_typ_id
821   );
822   --
823   -- Having converted the arguments into the
824   -- plsql record structure we call the corresponding record
825   -- business process.
826   --
827   upd(
828     p_effective_date,l_rec);
829   p_object_version_number := l_rec.object_version_number;
830   --
831   hr_utility.set_location(' Leaving:'||l_proc, 10);
832 End upd;
833 --
834 end ben_crt_upd;