DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PDT_UPD

Source


1 Package Body ben_pdt_upd as
2 /* $Header: bepdtrhi.pkb 115.0 2003/10/30 09:33 rpillay noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ben_pdt_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
55   (p_rec in out nocopy ben_pdt_shd.g_rec_type
56   ) is
57 --
58   l_proc  varchar2(72) := g_package||'update_dml';
59 --
60 Begin
61   hr_utility.set_location('Entering:'||l_proc, 5);
62   --
63   -- Increment the object version
64   p_rec.object_version_number := p_rec.object_version_number + 1;
65   --
66   --
67   --
68   -- Update the ben_pymt_check_det Row
69   --
70   update ben_pymt_check_det
71     set
72      pymt_check_det_id               = p_rec.pymt_check_det_id
73     ,person_id                       = p_rec.person_id
74     ,business_group_id               = p_rec.business_group_id
75     ,check_num                       = p_rec.check_num
76     ,pymt_dt                         = p_rec.pymt_dt
77     ,pymt_amt                        = p_rec.pymt_amt
78     ,pdt_attribute_category          = p_rec.pdt_attribute_category
79     ,pdt_attribute1                  = p_rec.pdt_attribute1
80     ,pdt_attribute2                  = p_rec.pdt_attribute2
81     ,pdt_attribute3                  = p_rec.pdt_attribute3
82     ,pdt_attribute4                  = p_rec.pdt_attribute4
83     ,pdt_attribute5                  = p_rec.pdt_attribute5
84     ,pdt_attribute6                  = p_rec.pdt_attribute6
85     ,pdt_attribute7                  = p_rec.pdt_attribute7
86     ,pdt_attribute8                  = p_rec.pdt_attribute8
87     ,pdt_attribute9                  = p_rec.pdt_attribute9
88     ,pdt_attribute10                 = p_rec.pdt_attribute10
89     ,pdt_attribute11                 = p_rec.pdt_attribute11
90     ,pdt_attribute12                 = p_rec.pdt_attribute12
91     ,pdt_attribute13                 = p_rec.pdt_attribute13
92     ,pdt_attribute14                 = p_rec.pdt_attribute14
93     ,pdt_attribute15                 = p_rec.pdt_attribute15
94     ,pdt_attribute16                 = p_rec.pdt_attribute16
95     ,pdt_attribute17                 = p_rec.pdt_attribute17
96     ,pdt_attribute18                 = p_rec.pdt_attribute18
97     ,pdt_attribute19                 = p_rec.pdt_attribute19
98     ,pdt_attribute20                 = p_rec.pdt_attribute20
99     ,pdt_attribute21                 = p_rec.pdt_attribute21
100     ,pdt_attribute22                 = p_rec.pdt_attribute22
101     ,pdt_attribute23                 = p_rec.pdt_attribute23
102     ,pdt_attribute24                 = p_rec.pdt_attribute24
103     ,pdt_attribute25                 = p_rec.pdt_attribute25
104     ,pdt_attribute26                 = p_rec.pdt_attribute26
105     ,pdt_attribute27                 = p_rec.pdt_attribute27
106     ,pdt_attribute28                 = p_rec.pdt_attribute28
107     ,pdt_attribute29                 = p_rec.pdt_attribute29
108     ,pdt_attribute30                 = p_rec.pdt_attribute30
109     ,object_version_number           = p_rec.object_version_number
110     where pymt_check_det_id = p_rec.pymt_check_det_id;
111   --
112   --
113   --
114   hr_utility.set_location(' Leaving:'||l_proc, 10);
115 --
116 Exception
117   When hr_api.check_integrity_violated Then
118     -- A check constraint has been violated
119     --
120     ben_pdt_shd.constraint_error
121       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
122   When hr_api.parent_integrity_violated Then
123     -- Parent integrity has been violated
124     --
125     ben_pdt_shd.constraint_error
126       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
127   When hr_api.unique_integrity_violated Then
128     -- Unique integrity has been violated
129     --
130     ben_pdt_shd.constraint_error
131       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
132   When Others Then
133     --
134     Raise;
135 End update_dml;
136 --
137 -- ----------------------------------------------------------------------------
138 -- |------------------------------< pre_update >------------------------------|
139 -- ----------------------------------------------------------------------------
140 -- {Start Of Comments}
141 --
142 -- Description:
143 --   This private procedure contains any processing which is required before
144 --   the update dml.
145 --
146 -- Prerequisites:
147 --   This is an internal procedure which is called from the upd procedure.
148 --
149 -- In Parameters:
150 --   A Pl/Sql record structure.
151 --
152 -- Post Success:
153 --   Processing continues.
154 --
155 -- Post Failure:
156 --   If an error has occurred, an error message and exception wil be raised
157 --   but not handled.
158 --
159 -- Developer Implementation Notes:
160 --   Any pre-processing required before the update dml is issued should be
161 --   coded within this procedure. It is important to note that any 3rd party
162 --   maintenance should be reviewed before placing in this procedure.
163 --
164 -- Access Status:
165 --   Internal Row Handler Use Only.
166 --
167 -- {End Of Comments}
168 -- ----------------------------------------------------------------------------
169 Procedure pre_update
170   (p_rec in ben_pdt_shd.g_rec_type
171   ) is
172 --
173   l_proc  varchar2(72) := g_package||'pre_update';
174 --
175 Begin
176   hr_utility.set_location('Entering:'||l_proc, 5);
177   --
178   hr_utility.set_location(' Leaving:'||l_proc, 10);
179 End pre_update;
180 --
181 -- ----------------------------------------------------------------------------
182 -- |-----------------------------< post_update >------------------------------|
183 -- ----------------------------------------------------------------------------
184 -- {Start Of Comments}
185 --
186 -- Description:
187 --   This private procedure contains any processing which is required after
188 --   the update dml.
189 --
190 -- Prerequisites:
191 --   This is an internal procedure which is called from the upd procedure.
192 --
193 -- In Parameters:
194 --   A Pl/Sql record structure.
195 --
196 -- Post Success:
197 --   Processing continues.
198 --
199 -- Post Failure:
200 --   If an error has occurred, an error message and exception will be raised
201 --   but not handled.
202 --
203 -- Developer Implementation Notes:
204 --   Any post-processing required after the update dml is issued should be
205 --   coded within this procedure. It is important to note that any 3rd party
206 --   maintenance should be reviewed before placing in this procedure.
207 --
208 -- Access Status:
209 --   Internal Row Handler Use Only.
210 --
211 -- {End Of Comments}
212 -- ----------------------------------------------------------------------------
213 Procedure post_update
214   (p_effective_date               in date
215   ,p_rec                          in ben_pdt_shd.g_rec_type
216   ) is
217 --
218   l_proc  varchar2(72) := g_package||'post_update';
219 --
220 Begin
221   hr_utility.set_location('Entering:'||l_proc, 5);
222   begin
223     --
224     ben_pdt_rku.after_update
225       (p_effective_date              => p_effective_date
226       ,p_pymt_check_det_id
227       => p_rec.pymt_check_det_id
228       ,p_person_id
229       => p_rec.person_id
230       ,p_business_group_id
231       => p_rec.business_group_id
232       ,p_check_num
233       => p_rec.check_num
234       ,p_pymt_dt
235       => p_rec.pymt_dt
236       ,p_pymt_amt
237       => p_rec.pymt_amt
238       ,p_pdt_attribute_category
239       => p_rec.pdt_attribute_category
240       ,p_pdt_attribute1
241       => p_rec.pdt_attribute1
242       ,p_pdt_attribute2
243       => p_rec.pdt_attribute2
244       ,p_pdt_attribute3
245       => p_rec.pdt_attribute3
246       ,p_pdt_attribute4
247       => p_rec.pdt_attribute4
248       ,p_pdt_attribute5
249       => p_rec.pdt_attribute5
250       ,p_pdt_attribute6
251       => p_rec.pdt_attribute6
252       ,p_pdt_attribute7
253       => p_rec.pdt_attribute7
254       ,p_pdt_attribute8
255       => p_rec.pdt_attribute8
256       ,p_pdt_attribute9
257       => p_rec.pdt_attribute9
258       ,p_pdt_attribute10
259       => p_rec.pdt_attribute10
260       ,p_pdt_attribute11
261       => p_rec.pdt_attribute11
262       ,p_pdt_attribute12
263       => p_rec.pdt_attribute12
264       ,p_pdt_attribute13
265       => p_rec.pdt_attribute13
266       ,p_pdt_attribute14
267       => p_rec.pdt_attribute14
268       ,p_pdt_attribute15
269       => p_rec.pdt_attribute15
270       ,p_pdt_attribute16
271       => p_rec.pdt_attribute16
272       ,p_pdt_attribute17
273       => p_rec.pdt_attribute17
274       ,p_pdt_attribute18
275       => p_rec.pdt_attribute18
276       ,p_pdt_attribute19
277       => p_rec.pdt_attribute19
278       ,p_pdt_attribute20
279       => p_rec.pdt_attribute20
280       ,p_pdt_attribute21
281       => p_rec.pdt_attribute21
282       ,p_pdt_attribute22
283       => p_rec.pdt_attribute22
284       ,p_pdt_attribute23
285       => p_rec.pdt_attribute23
286       ,p_pdt_attribute24
287       => p_rec.pdt_attribute24
288       ,p_pdt_attribute25
289       => p_rec.pdt_attribute25
290       ,p_pdt_attribute26
291       => p_rec.pdt_attribute26
292       ,p_pdt_attribute27
293       => p_rec.pdt_attribute27
294       ,p_pdt_attribute28
295       => p_rec.pdt_attribute28
296       ,p_pdt_attribute29
297       => p_rec.pdt_attribute29
298       ,p_pdt_attribute30
299       => p_rec.pdt_attribute30
300       ,p_object_version_number
301       => p_rec.object_version_number
302       ,p_person_id_o
303       => ben_pdt_shd.g_old_rec.person_id
304       ,p_business_group_id_o
305       => ben_pdt_shd.g_old_rec.business_group_id
306       ,p_check_num_o
307       => ben_pdt_shd.g_old_rec.check_num
308       ,p_pymt_dt_o
309       => ben_pdt_shd.g_old_rec.pymt_dt
310       ,p_pymt_amt_o
311       => ben_pdt_shd.g_old_rec.pymt_amt
312       ,p_pdt_attribute_category_o
313       => ben_pdt_shd.g_old_rec.pdt_attribute_category
314       ,p_pdt_attribute1_o
315       => ben_pdt_shd.g_old_rec.pdt_attribute1
316       ,p_pdt_attribute2_o
317       => ben_pdt_shd.g_old_rec.pdt_attribute2
318       ,p_pdt_attribute3_o
319       => ben_pdt_shd.g_old_rec.pdt_attribute3
320       ,p_pdt_attribute4_o
321       => ben_pdt_shd.g_old_rec.pdt_attribute4
322       ,p_pdt_attribute5_o
323       => ben_pdt_shd.g_old_rec.pdt_attribute5
324       ,p_pdt_attribute6_o
325       => ben_pdt_shd.g_old_rec.pdt_attribute6
326       ,p_pdt_attribute7_o
327       => ben_pdt_shd.g_old_rec.pdt_attribute7
328       ,p_pdt_attribute8_o
329       => ben_pdt_shd.g_old_rec.pdt_attribute8
330       ,p_pdt_attribute9_o
331       => ben_pdt_shd.g_old_rec.pdt_attribute9
332       ,p_pdt_attribute10_o
333       => ben_pdt_shd.g_old_rec.pdt_attribute10
334       ,p_pdt_attribute11_o
335       => ben_pdt_shd.g_old_rec.pdt_attribute11
336       ,p_pdt_attribute12_o
337       => ben_pdt_shd.g_old_rec.pdt_attribute12
338       ,p_pdt_attribute13_o
339       => ben_pdt_shd.g_old_rec.pdt_attribute13
340       ,p_pdt_attribute14_o
341       => ben_pdt_shd.g_old_rec.pdt_attribute14
342       ,p_pdt_attribute15_o
343       => ben_pdt_shd.g_old_rec.pdt_attribute15
344       ,p_pdt_attribute16_o
345       => ben_pdt_shd.g_old_rec.pdt_attribute16
346       ,p_pdt_attribute17_o
347       => ben_pdt_shd.g_old_rec.pdt_attribute17
348       ,p_pdt_attribute18_o
349       => ben_pdt_shd.g_old_rec.pdt_attribute18
350       ,p_pdt_attribute19_o
351       => ben_pdt_shd.g_old_rec.pdt_attribute19
352       ,p_pdt_attribute20_o
353       => ben_pdt_shd.g_old_rec.pdt_attribute20
354       ,p_pdt_attribute21_o
355       => ben_pdt_shd.g_old_rec.pdt_attribute21
356       ,p_pdt_attribute22_o
357       => ben_pdt_shd.g_old_rec.pdt_attribute22
358       ,p_pdt_attribute23_o
359       => ben_pdt_shd.g_old_rec.pdt_attribute23
360       ,p_pdt_attribute24_o
361       => ben_pdt_shd.g_old_rec.pdt_attribute24
362       ,p_pdt_attribute25_o
363       => ben_pdt_shd.g_old_rec.pdt_attribute25
364       ,p_pdt_attribute26_o
365       => ben_pdt_shd.g_old_rec.pdt_attribute26
366       ,p_pdt_attribute27_o
367       => ben_pdt_shd.g_old_rec.pdt_attribute27
368       ,p_pdt_attribute28_o
369       => ben_pdt_shd.g_old_rec.pdt_attribute28
370       ,p_pdt_attribute29_o
371       => ben_pdt_shd.g_old_rec.pdt_attribute29
372       ,p_pdt_attribute30_o
373       => ben_pdt_shd.g_old_rec.pdt_attribute30
374       ,p_object_version_number_o
375       => ben_pdt_shd.g_old_rec.object_version_number
376       );
377     --
378   exception
379     --
380     when hr_api.cannot_find_prog_unit then
381       --
382       hr_api.cannot_find_prog_unit_error
383         (p_module_name => 'BEN_PYMT_CHECK_DET'
384         ,p_hook_type   => 'AU');
385       --
386   end;
387   --
388   hr_utility.set_location(' Leaving:'||l_proc, 10);
389 End post_update;
390 --
391 -- ----------------------------------------------------------------------------
392 -- |-----------------------------< convert_defs >-----------------------------|
393 -- ----------------------------------------------------------------------------
394 -- {Start Of Comments}
395 --
396 -- Description:
397 --   The Convert_Defs procedure has one very important function:
398 --   It must return the record structure for the row with all system defaulted
399 --   values converted into its corresponding parameter value for update. When
400 --   we attempt to update a row through the Upd process , certain
401 --   parameters can be defaulted which enables flexibility in the calling of
402 --   the upd process (e.g. only attributes which need to be updated need to be
403 --   specified). For the upd process to determine which attributes
404 --   have NOT been specified we need to check if the parameter has a reserved
405 --   system default value. Therefore, for all parameters which have a
406 --   corresponding reserved system default mechanism specified we need to
407 --   check if a system default is being used. If a system default is being
408 --   used then we convert the defaulted value into its corresponding attribute
409 --   value held in the g_old_rec data structure.
410 --
411 -- Prerequisites:
412 --   This private function can only be called from the upd process.
413 --
414 -- In Parameters:
415 --   A Pl/Sql record structure.
416 --
417 -- Post Success:
418 --   The record structure will be returned with all system defaulted parameter
419 --   values converted into its current row attribute value.
420 --
421 -- Post Failure:
422 --   No direct error handling is required within this function. Any possible
423 --   errors within this procedure will be a PL/SQL value error due to
424 --   conversion of datatypes or data lengths.
425 --
426 -- Developer Implementation Notes:
427 --   None.
428 --
429 -- Access Status:
430 --   Internal Row Handler Use Only.
431 --
432 -- {End Of Comments}
433 -- ----------------------------------------------------------------------------
434 Procedure convert_defs
435   (p_rec in out nocopy ben_pdt_shd.g_rec_type
436   ) is
437 --
438 Begin
439   --
440   -- We must now examine each argument value in the
441   -- p_rec plsql record structure
442   -- to see if a system default is being used. If a system default
443   -- is being used then we must set to the 'current' argument value.
444   --
445   If (p_rec.person_id = hr_api.g_number) then
446     p_rec.person_id :=
447     ben_pdt_shd.g_old_rec.person_id;
448   End If;
449   If (p_rec.business_group_id = hr_api.g_number) then
450     p_rec.business_group_id :=
451     ben_pdt_shd.g_old_rec.business_group_id;
452   End If;
453   If (p_rec.check_num = hr_api.g_varchar2) then
454     p_rec.check_num :=
455     ben_pdt_shd.g_old_rec.check_num;
456   End If;
457   If (p_rec.pymt_dt = hr_api.g_date) then
458     p_rec.pymt_dt :=
459     ben_pdt_shd.g_old_rec.pymt_dt;
460   End If;
461   If (p_rec.pymt_amt = hr_api.g_number) then
462     p_rec.pymt_amt :=
463     ben_pdt_shd.g_old_rec.pymt_amt;
464   End If;
465   If (p_rec.pdt_attribute_category = hr_api.g_varchar2) then
466     p_rec.pdt_attribute_category :=
467     ben_pdt_shd.g_old_rec.pdt_attribute_category;
468   End If;
469   If (p_rec.pdt_attribute1 = hr_api.g_varchar2) then
470     p_rec.pdt_attribute1 :=
471     ben_pdt_shd.g_old_rec.pdt_attribute1;
472   End If;
473   If (p_rec.pdt_attribute2 = hr_api.g_varchar2) then
474     p_rec.pdt_attribute2 :=
475     ben_pdt_shd.g_old_rec.pdt_attribute2;
476   End If;
477   If (p_rec.pdt_attribute3 = hr_api.g_varchar2) then
478     p_rec.pdt_attribute3 :=
479     ben_pdt_shd.g_old_rec.pdt_attribute3;
480   End If;
481   If (p_rec.pdt_attribute4 = hr_api.g_varchar2) then
482     p_rec.pdt_attribute4 :=
483     ben_pdt_shd.g_old_rec.pdt_attribute4;
484   End If;
485   If (p_rec.pdt_attribute5 = hr_api.g_varchar2) then
486     p_rec.pdt_attribute5 :=
487     ben_pdt_shd.g_old_rec.pdt_attribute5;
488   End If;
489   If (p_rec.pdt_attribute6 = hr_api.g_varchar2) then
490     p_rec.pdt_attribute6 :=
491     ben_pdt_shd.g_old_rec.pdt_attribute6;
492   End If;
493   If (p_rec.pdt_attribute7 = hr_api.g_varchar2) then
494     p_rec.pdt_attribute7 :=
495     ben_pdt_shd.g_old_rec.pdt_attribute7;
496   End If;
497   If (p_rec.pdt_attribute8 = hr_api.g_varchar2) then
498     p_rec.pdt_attribute8 :=
499     ben_pdt_shd.g_old_rec.pdt_attribute8;
500   End If;
501   If (p_rec.pdt_attribute9 = hr_api.g_varchar2) then
502     p_rec.pdt_attribute9 :=
503     ben_pdt_shd.g_old_rec.pdt_attribute9;
504   End If;
505   If (p_rec.pdt_attribute10 = hr_api.g_varchar2) then
506     p_rec.pdt_attribute10 :=
507     ben_pdt_shd.g_old_rec.pdt_attribute10;
508   End If;
509   If (p_rec.pdt_attribute11 = hr_api.g_varchar2) then
510     p_rec.pdt_attribute11 :=
511     ben_pdt_shd.g_old_rec.pdt_attribute11;
512   End If;
513   If (p_rec.pdt_attribute12 = hr_api.g_varchar2) then
514     p_rec.pdt_attribute12 :=
515     ben_pdt_shd.g_old_rec.pdt_attribute12;
516   End If;
517   If (p_rec.pdt_attribute13 = hr_api.g_varchar2) then
518     p_rec.pdt_attribute13 :=
519     ben_pdt_shd.g_old_rec.pdt_attribute13;
520   End If;
521   If (p_rec.pdt_attribute14 = hr_api.g_varchar2) then
522     p_rec.pdt_attribute14 :=
523     ben_pdt_shd.g_old_rec.pdt_attribute14;
524   End If;
525   If (p_rec.pdt_attribute15 = hr_api.g_varchar2) then
526     p_rec.pdt_attribute15 :=
527     ben_pdt_shd.g_old_rec.pdt_attribute15;
528   End If;
529   If (p_rec.pdt_attribute16 = hr_api.g_varchar2) then
530     p_rec.pdt_attribute16 :=
531     ben_pdt_shd.g_old_rec.pdt_attribute16;
532   End If;
533   If (p_rec.pdt_attribute17 = hr_api.g_varchar2) then
534     p_rec.pdt_attribute17 :=
535     ben_pdt_shd.g_old_rec.pdt_attribute17;
536   End If;
537   If (p_rec.pdt_attribute18 = hr_api.g_varchar2) then
538     p_rec.pdt_attribute18 :=
539     ben_pdt_shd.g_old_rec.pdt_attribute18;
540   End If;
541   If (p_rec.pdt_attribute19 = hr_api.g_varchar2) then
542     p_rec.pdt_attribute19 :=
543     ben_pdt_shd.g_old_rec.pdt_attribute19;
544   End If;
545   If (p_rec.pdt_attribute20 = hr_api.g_varchar2) then
546     p_rec.pdt_attribute20 :=
547     ben_pdt_shd.g_old_rec.pdt_attribute20;
548   End If;
549   If (p_rec.pdt_attribute21 = hr_api.g_varchar2) then
550     p_rec.pdt_attribute21 :=
551     ben_pdt_shd.g_old_rec.pdt_attribute21;
552   End If;
553   If (p_rec.pdt_attribute22 = hr_api.g_varchar2) then
554     p_rec.pdt_attribute22 :=
555     ben_pdt_shd.g_old_rec.pdt_attribute22;
556   End If;
557   If (p_rec.pdt_attribute23 = hr_api.g_varchar2) then
558     p_rec.pdt_attribute23 :=
559     ben_pdt_shd.g_old_rec.pdt_attribute23;
560   End If;
561   If (p_rec.pdt_attribute24 = hr_api.g_varchar2) then
562     p_rec.pdt_attribute24 :=
563     ben_pdt_shd.g_old_rec.pdt_attribute24;
564   End If;
565   If (p_rec.pdt_attribute25 = hr_api.g_varchar2) then
566     p_rec.pdt_attribute25 :=
567     ben_pdt_shd.g_old_rec.pdt_attribute25;
568   End If;
569   If (p_rec.pdt_attribute26 = hr_api.g_varchar2) then
570     p_rec.pdt_attribute26 :=
571     ben_pdt_shd.g_old_rec.pdt_attribute26;
572   End If;
573   If (p_rec.pdt_attribute27 = hr_api.g_varchar2) then
574     p_rec.pdt_attribute27 :=
575     ben_pdt_shd.g_old_rec.pdt_attribute27;
576   End If;
577   If (p_rec.pdt_attribute28 = hr_api.g_varchar2) then
578     p_rec.pdt_attribute28 :=
579     ben_pdt_shd.g_old_rec.pdt_attribute28;
580   End If;
581   If (p_rec.pdt_attribute29 = hr_api.g_varchar2) then
582     p_rec.pdt_attribute29 :=
583     ben_pdt_shd.g_old_rec.pdt_attribute29;
584   End If;
585   If (p_rec.pdt_attribute30 = hr_api.g_varchar2) then
586     p_rec.pdt_attribute30 :=
587     ben_pdt_shd.g_old_rec.pdt_attribute30;
588   End If;
589   --
590 End convert_defs;
591 --
592 -- ----------------------------------------------------------------------------
593 -- |---------------------------------< upd >----------------------------------|
594 -- ----------------------------------------------------------------------------
595 Procedure upd
596   (p_effective_date               in date
597   ,p_rec                          in out nocopy ben_pdt_shd.g_rec_type
598   ) is
599 --
600   l_proc  varchar2(72) := g_package||'upd';
601 --
602 Begin
603   hr_utility.set_location('Entering:'||l_proc, 5);
604   --
605   -- We must lock the row which we need to update.
606   --
607   ben_pdt_shd.lck
608     (p_rec.pymt_check_det_id
609     ,p_rec.object_version_number
610     );
611   --
612   -- 1. During an update system defaults are used to determine if
613   --    arguments have been defaulted or not. We must therefore
614   --    derive the full record structure values to be updated.
615   --
616   -- 2. Call the supporting update validate operations.
617   --
618   convert_defs(p_rec);
619   ben_pdt_bus.update_validate
620      (p_effective_date
621      ,p_rec
622      );
623   --
624   -- Call to raise any errors on multi-message list
625   hr_multi_message.end_validation_set;
626   --
627   -- Call the supporting pre-update operation
628   --
629   ben_pdt_upd.pre_update(p_rec);
630   --
631   -- Update the row.
632   --
633   ben_pdt_upd.update_dml(p_rec);
634   --
635   -- Call the supporting post-update operation
636   --
637   ben_pdt_upd.post_update
638      (p_effective_date
639      ,p_rec
640      );
641   --
642   -- Call to raise any errors on multi-message list
643   hr_multi_message.end_validation_set;
644 End upd;
645 --
646 -- ----------------------------------------------------------------------------
647 -- |---------------------------------< upd >----------------------------------|
648 -- ----------------------------------------------------------------------------
649 Procedure upd
650   (p_effective_date               in     date
651   ,p_pymt_check_det_id            in     number
652   ,p_object_version_number        in out nocopy number
653   ,p_person_id                    in     number    default hr_api.g_number
654   ,p_business_group_id            in     number    default hr_api.g_number
655   ,p_check_num                    in     varchar2  default hr_api.g_varchar2
656   ,p_pymt_dt                      in     date      default hr_api.g_date
657   ,p_pymt_amt                     in     number    default hr_api.g_number
658   ,p_pdt_attribute_category       in     varchar2  default hr_api.g_varchar2
659   ,p_pdt_attribute1               in     varchar2  default hr_api.g_varchar2
660   ,p_pdt_attribute2               in     varchar2  default hr_api.g_varchar2
661   ,p_pdt_attribute3               in     varchar2  default hr_api.g_varchar2
662   ,p_pdt_attribute4               in     varchar2  default hr_api.g_varchar2
663   ,p_pdt_attribute5               in     varchar2  default hr_api.g_varchar2
664   ,p_pdt_attribute6               in     varchar2  default hr_api.g_varchar2
665   ,p_pdt_attribute7               in     varchar2  default hr_api.g_varchar2
666   ,p_pdt_attribute8               in     varchar2  default hr_api.g_varchar2
667   ,p_pdt_attribute9               in     varchar2  default hr_api.g_varchar2
668   ,p_pdt_attribute10              in     varchar2  default hr_api.g_varchar2
669   ,p_pdt_attribute11              in     varchar2  default hr_api.g_varchar2
670   ,p_pdt_attribute12              in     varchar2  default hr_api.g_varchar2
671   ,p_pdt_attribute13              in     varchar2  default hr_api.g_varchar2
672   ,p_pdt_attribute14              in     varchar2  default hr_api.g_varchar2
673   ,p_pdt_attribute15              in     varchar2  default hr_api.g_varchar2
674   ,p_pdt_attribute16              in     varchar2  default hr_api.g_varchar2
675   ,p_pdt_attribute17              in     varchar2  default hr_api.g_varchar2
676   ,p_pdt_attribute18              in     varchar2  default hr_api.g_varchar2
677   ,p_pdt_attribute19              in     varchar2  default hr_api.g_varchar2
678   ,p_pdt_attribute20              in     varchar2  default hr_api.g_varchar2
679   ,p_pdt_attribute21              in     varchar2  default hr_api.g_varchar2
680   ,p_pdt_attribute22              in     varchar2  default hr_api.g_varchar2
681   ,p_pdt_attribute23              in     varchar2  default hr_api.g_varchar2
682   ,p_pdt_attribute24              in     varchar2  default hr_api.g_varchar2
683   ,p_pdt_attribute25              in     varchar2  default hr_api.g_varchar2
684   ,p_pdt_attribute26              in     varchar2  default hr_api.g_varchar2
685   ,p_pdt_attribute27              in     varchar2  default hr_api.g_varchar2
686   ,p_pdt_attribute28              in     varchar2  default hr_api.g_varchar2
687   ,p_pdt_attribute29              in     varchar2  default hr_api.g_varchar2
688   ,p_pdt_attribute30              in     varchar2  default hr_api.g_varchar2
689   ) is
690 --
691   l_rec   ben_pdt_shd.g_rec_type;
692   l_proc  varchar2(72) := g_package||'upd';
693 --
694 Begin
695   hr_utility.set_location('Entering:'||l_proc, 5);
696   --
697   -- Call conversion function to turn arguments into the
698   -- l_rec structure.
699   --
700   l_rec :=
701   ben_pdt_shd.convert_args
702   (p_pymt_check_det_id
703   ,p_person_id
704   ,p_business_group_id
705   ,p_check_num
706   ,p_pymt_dt
707   ,p_pymt_amt
708   ,p_pdt_attribute_category
709   ,p_pdt_attribute1
710   ,p_pdt_attribute2
711   ,p_pdt_attribute3
712   ,p_pdt_attribute4
713   ,p_pdt_attribute5
714   ,p_pdt_attribute6
715   ,p_pdt_attribute7
716   ,p_pdt_attribute8
717   ,p_pdt_attribute9
718   ,p_pdt_attribute10
719   ,p_pdt_attribute11
720   ,p_pdt_attribute12
721   ,p_pdt_attribute13
722   ,p_pdt_attribute14
723   ,p_pdt_attribute15
724   ,p_pdt_attribute16
725   ,p_pdt_attribute17
726   ,p_pdt_attribute18
727   ,p_pdt_attribute19
728   ,p_pdt_attribute20
729   ,p_pdt_attribute21
730   ,p_pdt_attribute22
731   ,p_pdt_attribute23
732   ,p_pdt_attribute24
733   ,p_pdt_attribute25
734   ,p_pdt_attribute26
735   ,p_pdt_attribute27
736   ,p_pdt_attribute28
737   ,p_pdt_attribute29
738   ,p_pdt_attribute30
739   ,p_object_version_number
740   );
741   --
742   -- Having converted the arguments into the
743   -- plsql record structure we call the corresponding record
744   -- business process.
745   --
746   ben_pdt_upd.upd
747      (p_effective_date
748      ,l_rec
749      );
750   p_object_version_number := l_rec.object_version_number;
751   --
752   hr_utility.set_location(' Leaving:'||l_proc, 10);
753 End upd;
754 --
755 end ben_pdt_upd;