DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_BPR_UPD

Source


1 Package Body per_bpr_upd as
2 /* $Header: pebprrhi.pkb 115.6 2002/12/02 14:33:23 apholt noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  per_bpr_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 per_bpr_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 p_rec.object_version_number := p_rec.object_version_number + 1;
63   --
64   --
65   -- Update the per_bf_payroll_runs Row
66   --
67   update per_bf_payroll_runs
68   set
69   payroll_run_id                    = p_rec.payroll_run_id,
70   payroll_identifier                = p_rec.payroll_identifier,
71   period_start_date                 = p_rec.period_start_date,
72   period_end_date                   = p_rec.period_end_date,
73   processing_date                   = p_rec.processing_date,
74   object_version_number             = p_rec.object_version_number,
75   bpr_attribute_category                = p_rec.bpr_attribute_category,
76   bpr_attribute1                        = p_rec.bpr_attribute1,
77   bpr_attribute2                        = p_rec.bpr_attribute2,
78   bpr_attribute3                        = p_rec.bpr_attribute3,
79   bpr_attribute4                        = p_rec.bpr_attribute4,
80   bpr_attribute5                        = p_rec.bpr_attribute5,
81   bpr_attribute6                        = p_rec.bpr_attribute6,
82   bpr_attribute7                        = p_rec.bpr_attribute7,
83   bpr_attribute8                        = p_rec.bpr_attribute8,
84   bpr_attribute9                        = p_rec.bpr_attribute9,
85   bpr_attribute10                       = p_rec.bpr_attribute10,
86   bpr_attribute11                       = p_rec.bpr_attribute11,
87   bpr_attribute12                       = p_rec.bpr_attribute12,
88   bpr_attribute13                       = p_rec.bpr_attribute13,
89   bpr_attribute14                       = p_rec.bpr_attribute14,
90   bpr_attribute15                       = p_rec.bpr_attribute15,
91   bpr_attribute16                       = p_rec.bpr_attribute16,
92   bpr_attribute17                       = p_rec.bpr_attribute17,
93   bpr_attribute18                       = p_rec.bpr_attribute18,
94   bpr_attribute19                       = p_rec.bpr_attribute19,
95   bpr_attribute20                       = p_rec.bpr_attribute20,
96   bpr_attribute21                       = p_rec.bpr_attribute21,
97   bpr_attribute22                       = p_rec.bpr_attribute22,
98   bpr_attribute23                       = p_rec.bpr_attribute23,
99   bpr_attribute24                       = p_rec.bpr_attribute24,
100   bpr_attribute25                       = p_rec.bpr_attribute25,
101   bpr_attribute26                       = p_rec.bpr_attribute26,
102   bpr_attribute27                       = p_rec.bpr_attribute27,
103   bpr_attribute28                       = p_rec.bpr_attribute28,
104   bpr_attribute29                       = p_rec.bpr_attribute29,
105   bpr_attribute30                       = p_rec.bpr_attribute30
106 
107   where payroll_run_id = p_rec.payroll_run_id;
108   --
109   --
110   hr_utility.set_location(' Leaving:'||l_proc, 10);
111 --
112 Exception
113   When hr_api.check_integrity_violated Then
114     -- A check constraint has been violated
115     per_bpr_shd.constraint_error
116       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
117   When hr_api.parent_integrity_violated Then
118     -- Parent integrity has been violated
119     per_bpr_shd.constraint_error
120       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
121   When hr_api.unique_integrity_violated Then
122     -- Unique integrity has been violated
123     per_bpr_shd.constraint_error
124       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
125   When Others Then
126     Raise;
127 End update_dml;
128 --
129 -- ----------------------------------------------------------------------------
130 -- |------------------------------< pre_update >------------------------------|
131 -- ----------------------------------------------------------------------------
132 -- {Start Of Comments}
133 --
134 -- Description:
135 --   This private procedure contains any processing which is required before
136 --   the update dml.
137 --
138 -- Prerequisites:
139 --   This is an internal procedure which is called from the upd procedure.
140 --
141 -- In Parameters:
142 --   A Pl/Sql record structure.
143 --
144 -- Post Success:
145 --   Processing continues.
146 --
147 -- Post Failure:
148 --   If an error has occurred, an error message and exception wil be raised
149 --   but not handled.
150 --
151 -- Developer Implementation Notes:
152 --   Any pre-processing required before the update dml is issued should be
153 --   coded within this procedure. It is important to note that any 3rd party
154 --   maintenance should be reviewed before placing in this procedure.
155 --
156 -- Access Status:
157 --   Internal Row Handler Use Only.
158 --
159 -- {End Of Comments}
160 -- ----------------------------------------------------------------------------
161 Procedure pre_update(p_rec in per_bpr_shd.g_rec_type) is
162 --
163   l_proc  varchar2(72) := g_package||'pre_update';
164 --
165 Begin
166   hr_utility.set_location('Entering:'||l_proc, 5);
167   --
168   hr_utility.set_location(' Leaving:'||l_proc, 10);
169 End pre_update;
170 --
171 -- ----------------------------------------------------------------------------
172 -- |-----------------------------< post_update >------------------------------|
173 -- ----------------------------------------------------------------------------
174 -- {Start Of Comments}
175 --
176 -- Description:
177 --   This private procedure contains any processing which is required after the
178 --   update dml.
179 --
180 -- Prerequisites:
181 --   This is an internal procedure which is called from the upd procedure.
182 --
183 -- In Parameters:
184 --   A Pl/Sql record structre.
185 --
186 -- Post Success:
187 --   Processing continues.
188 --
189 -- Post Failure:
190 --   If an error has occurred, an error message and exception will be raised
191 --   but not handled.
192 --
193 -- Developer Implementation Notes:
194 --   Any post-processing required after the update dml is issued should be
195 --   coded within this procedure. It is important to note that any 3rd party
196 --   maintenance should be reviewed before placing in this procedure.
197 --
198 -- Access Status:
199 --   Internal Row Handler Use Only.
200 --
201 -- {End Of Comments}
202 -- ----------------------------------------------------------------------------
203 Procedure post_update(p_effective_date   in  date,
204                       p_rec in per_bpr_shd.g_rec_type) is
205 --
206   l_proc  varchar2(72) := g_package||'post_update';
207 --
208 Begin
209   hr_utility.set_location('Entering:'||l_proc, 5);
210   begin
211     --
212     per_bpr_rku.after_update
213       (p_effective_date              => p_effective_date,
214       p_payroll_run_id             => p_rec.payroll_run_id,
215       p_payroll_identifier         => p_rec.payroll_identifier,
216       p_period_start_date          => p_rec.period_start_date,
217       p_period_end_date            => p_rec.period_end_date,
218       p_processing_date            => p_rec.processing_date,
219       p_object_version_number      => p_rec.object_version_number,
220       p_bpr_attribute_category         => p_rec.bpr_attribute_category,
221       p_bpr_attribute1                 => p_rec.bpr_attribute1,
222       p_bpr_attribute2                 => p_rec.bpr_attribute2,
223       p_bpr_attribute3                 => p_rec.bpr_attribute3,
224       p_bpr_attribute4                 => p_rec.bpr_attribute4,
225       p_bpr_attribute5                 => p_rec.bpr_attribute5,
226       p_bpr_attribute6                 => p_rec.bpr_attribute6,
227       p_bpr_attribute7                 => p_rec.bpr_attribute7,
228       p_bpr_attribute8                 => p_rec.bpr_attribute8,
229       p_bpr_attribute9                 => p_rec.bpr_attribute9,
230       p_bpr_attribute10                => p_rec.bpr_attribute10,
231       p_bpr_attribute11                => p_rec.bpr_attribute11,
232       p_bpr_attribute12                => p_rec.bpr_attribute12,
233       p_bpr_attribute13                => p_rec.bpr_attribute13,
234       p_bpr_attribute14                => p_rec.bpr_attribute14,
235       p_bpr_attribute15                => p_rec.bpr_attribute15,
236       p_bpr_attribute16                => p_rec.bpr_attribute16,
237       p_bpr_attribute17                => p_rec.bpr_attribute17,
238       p_bpr_attribute18                => p_rec.bpr_attribute18,
239       p_bpr_attribute19                => p_rec.bpr_attribute19,
240       p_bpr_attribute20                => p_rec.bpr_attribute20,
241       p_bpr_attribute21                => p_rec.bpr_attribute21,
242       p_bpr_attribute22                => p_rec.bpr_attribute22,
243       p_bpr_attribute23                => p_rec.bpr_attribute23,
244       p_bpr_attribute24                => p_rec.bpr_attribute24,
245       p_bpr_attribute25                => p_rec.bpr_attribute25,
246       p_bpr_attribute26                => p_rec.bpr_attribute26,
247       p_bpr_attribute27                => p_rec.bpr_attribute27,
248       p_bpr_attribute28                => p_rec.bpr_attribute28,
249       p_bpr_attribute29                => p_rec.bpr_attribute29,
250       p_bpr_attribute30                => p_rec.bpr_attribute30,
251       p_payroll_id_o
252       => per_bpr_shd.g_old_rec.payroll_id,
253       p_business_group_id_o
254       => per_bpr_shd.g_old_rec.business_group_id,
255       p_payroll_identifier_o
256       => per_bpr_shd.g_old_rec.payroll_identifier,
257       p_period_start_date_o
258       => per_bpr_shd.g_old_rec.period_start_date,
259       p_period_end_date_o
260       => per_bpr_shd.g_old_rec.period_end_date,
261       p_processing_date_o
262       => per_bpr_shd.g_old_rec.processing_date,
263       p_object_version_number_o
264       => per_bpr_shd.g_old_rec.object_version_number,
265       p_bpr_attribute_category_o
266       => per_bpr_shd.g_old_rec.bpr_attribute_category,
267       p_bpr_attribute1_o
268       => per_bpr_shd.g_old_rec.bpr_attribute1,
269       p_bpr_attribute2_o
270       => per_bpr_shd.g_old_rec.bpr_attribute2,
271       p_bpr_attribute3_o
272       => per_bpr_shd.g_old_rec.bpr_attribute3,
273       p_bpr_attribute4_o
274       => per_bpr_shd.g_old_rec.bpr_attribute4,
275       p_bpr_attribute5_o
276       => per_bpr_shd.g_old_rec.bpr_attribute5,
277       p_bpr_attribute6_o
278       => per_bpr_shd.g_old_rec.bpr_attribute6,
279       p_bpr_attribute7_o
280       => per_bpr_shd.g_old_rec.bpr_attribute7,
281       p_bpr_attribute8_o
282       => per_bpr_shd.g_old_rec.bpr_attribute8,
283       p_bpr_attribute9_o
284       => per_bpr_shd.g_old_rec.bpr_attribute9,
285       p_bpr_attribute10_o
286       => per_bpr_shd.g_old_rec.bpr_attribute10,
287       p_bpr_attribute11_o
288       => per_bpr_shd.g_old_rec.bpr_attribute11,
289       p_bpr_attribute12_o
290       => per_bpr_shd.g_old_rec.bpr_attribute12,
291       p_bpr_attribute13_o
292       => per_bpr_shd.g_old_rec.bpr_attribute13,
293       p_bpr_attribute14_o
294       => per_bpr_shd.g_old_rec.bpr_attribute14,
295       p_bpr_attribute15_o
296       => per_bpr_shd.g_old_rec.bpr_attribute15,
297       p_bpr_attribute16_o
298       => per_bpr_shd.g_old_rec.bpr_attribute16,
299       p_bpr_attribute17_o
300       => per_bpr_shd.g_old_rec.bpr_attribute17,
301       p_bpr_attribute18_o
302       => per_bpr_shd.g_old_rec.bpr_attribute18,
303       p_bpr_attribute19_o
304       => per_bpr_shd.g_old_rec.bpr_attribute19,
305       p_bpr_attribute20_o
306       => per_bpr_shd.g_old_rec.bpr_attribute20,
307       p_bpr_attribute21_o
308       => per_bpr_shd.g_old_rec.bpr_attribute21,
309       p_bpr_attribute22_o
310       => per_bpr_shd.g_old_rec.bpr_attribute22,
311       p_bpr_attribute23_o
312       => per_bpr_shd.g_old_rec.bpr_attribute23,
313       p_bpr_attribute24_o
314       => per_bpr_shd.g_old_rec.bpr_attribute24,
315       p_bpr_attribute25_o
316       => per_bpr_shd.g_old_rec.bpr_attribute25,
317       p_bpr_attribute26_o
318       => per_bpr_shd.g_old_rec.bpr_attribute26,
319       p_bpr_attribute27_o
320       => per_bpr_shd.g_old_rec.bpr_attribute27,
321       p_bpr_attribute28_o
322       => per_bpr_shd.g_old_rec.bpr_attribute28,
323       p_bpr_attribute29_o
324       => per_bpr_shd.g_old_rec.bpr_attribute29,
325       p_bpr_attribute30_o
326       => per_bpr_shd.g_old_rec.bpr_attribute30
327       );
328     --
329   exception
330     --
331     when hr_api.cannot_find_prog_unit then
332       --
333       hr_api.cannot_find_prog_unit_error
334         (p_module_name => 'PER_BF_PAYROLL_RUNS'
335         ,p_hook_type   => 'AU');
336       --
337   end;
338   --
339   hr_utility.set_location(' Leaving:'||l_proc, 10);
340 End post_update;
341 --
342 -- ----------------------------------------------------------------------------
343 -- |-----------------------------< convert_defs >-----------------------------|
344 -- ----------------------------------------------------------------------------
345 -- {Start Of Comments}
346 --
347 -- Description:
348 --   The Convert_Defs procedure has one very important function:
349 --   It must return the record structure for the row with all system defaulted
350 --   values converted into its corresponding parameter value for update. When
351 --   we attempt to update a row through the Upd process , certain
352 --   parameters can be defaulted which enables flexibility in the calling of
353 --   the upd process (e.g. only attributes which need to be updated need to be
354 --   specified). For the upd process to determine which attributes
355 --   have NOT been specified we need to check if the parameter has a reserved
356 --   system default value. Therefore, for all parameters which have a
357 --   corresponding reserved system default mechanism specified we need to
358 --   check if a system default is being used. If a system default is being
359 --   used then we convert the defaulted value into its corresponding attribute
360 --   value held in the g_old_rec data structure.
361 --
362 -- Prerequisites:
363 --   This private function can only be called from the upd process.
364 --
365 -- In Parameters:
366 --   A Pl/Sql record structre.
367 --
368 -- Post Success:
369 --   The record structure will be returned with all system defaulted parameter
370 --   values converted into its current row attribute value.
371 --
372 -- Post Failure:
373 --   No direct error handling is required within this function. Any possible
374 --   errors within this procedure will be a PL/SQL value error due to
375 --   conversion of datatypes or data lengths.
376 --
377 -- Developer Implementation Notes:
378 --   None.
379 --
380 -- Access Status:
381 --   Internal Row Handler Use Only.
382 --
383 -- {End Of Comments}
384 -- ----------------------------------------------------------------------------
385 Procedure convert_defs(p_rec in out nocopy per_bpr_shd.g_rec_type) is
386 --
387   l_proc  varchar2(72) := g_package||'convert_defs';
388 --
389 Begin
390   --
391   hr_utility.set_location('Entering:'||l_proc, 5);
392   --
393   -- We must now examine each argument value in the
394   -- p_rec plsql record structure
395   -- to see if a system default is being used. If a system default
396   -- is being used then we must set to the 'current' argument value.
397   --
398   If (p_rec.payroll_id = hr_api.g_number) then
399     p_rec.payroll_id :=
400     per_bpr_shd.g_old_rec.payroll_id;
401   End If;
402   If (p_rec.business_group_id = hr_api.g_number) then
403     p_rec.business_group_id :=
404     per_bpr_shd.g_old_rec.business_group_id;
405   End If;
406   If (p_rec.payroll_identifier = hr_api.g_varchar2) then
407     p_rec.payroll_identifier :=
408     per_bpr_shd.g_old_rec.payroll_identifier;
409   End If;
410   If (p_rec.period_start_date = hr_api.g_date) then
411     p_rec.period_start_date :=
412     per_bpr_shd.g_old_rec.period_start_date;
413   End If;
414   If (p_rec.period_end_date = hr_api.g_date) then
415     p_rec.period_end_date :=
416     per_bpr_shd.g_old_rec.period_end_date;
417   End If;
418   If (p_rec.processing_date = hr_api.g_date) then
419     p_rec.processing_date :=
420     per_bpr_shd.g_old_rec.processing_date;
421   End If;
422   If (p_rec.bpr_attribute_category = hr_api.g_varchar2) then
423     p_rec.bpr_attribute_category :=
424     per_bpr_shd.g_old_rec.bpr_attribute_category;
425   End If;
426   If (p_rec.bpr_attribute1 = hr_api.g_varchar2) then
427     p_rec.bpr_attribute1:=
428     per_bpr_shd.g_old_rec.bpr_attribute1;
429   End If;
430   If (p_rec.bpr_attribute2 = hr_api.g_varchar2) then
431     p_rec.bpr_attribute2:=
432     per_bpr_shd.g_old_rec.bpr_attribute2;
433   End If;
434   If (p_rec.bpr_attribute3 = hr_api.g_varchar2) then
435     p_rec.bpr_attribute3:=
436     per_bpr_shd.g_old_rec.bpr_attribute3;
437   End If;
438   If (p_rec.bpr_attribute4 = hr_api.g_varchar2) then
439   p_rec.bpr_attribute4:=
440     per_bpr_shd.g_old_rec.bpr_attribute4;
441   End If;
442   If (p_rec.bpr_attribute5 = hr_api.g_varchar2) then
443     p_rec.bpr_attribute5:=
444     per_bpr_shd.g_old_rec.bpr_attribute5;
445   End If;
446   If (p_rec.bpr_attribute6 = hr_api.g_varchar2) then
447     p_rec.bpr_attribute6:=
448     per_bpr_shd.g_old_rec.bpr_attribute6;
449   End If;
450   If (p_rec.bpr_attribute7 = hr_api.g_varchar2) then
451     p_rec.bpr_attribute7:=
452     per_bpr_shd.g_old_rec.bpr_attribute7;
453   End If;
454   If (p_rec.bpr_attribute8 = hr_api.g_varchar2) then
455     p_rec.bpr_attribute8:=
456     per_bpr_shd.g_old_rec.bpr_attribute8;
457   End If;
458   If (p_rec.bpr_attribute9 = hr_api.g_varchar2) then
459     p_rec.bpr_attribute9:=
460     per_bpr_shd.g_old_rec.bpr_attribute9;
461   End If;
462   If (p_rec.bpr_attribute10 = hr_api.g_varchar2) then
463     p_rec.bpr_attribute10:=
464     per_bpr_shd.g_old_rec.bpr_attribute10;
465   End If;
466   If (p_rec.bpr_attribute11 = hr_api.g_varchar2) then
467     p_rec.bpr_attribute11:=
468     per_bpr_shd.g_old_rec.bpr_attribute11;
469   End If;
470   If (p_rec.bpr_attribute12 = hr_api.g_varchar2) then
471     p_rec.bpr_attribute12:=
472     per_bpr_shd.g_old_rec.bpr_attribute12;
473   End If;
474   If (p_rec.bpr_attribute13 = hr_api.g_varchar2) then
475     p_rec.bpr_attribute13:=
476     per_bpr_shd.g_old_rec.bpr_attribute13;
477   End If;
478   If (p_rec.bpr_attribute14 = hr_api.g_varchar2) then
479     p_rec.bpr_attribute14:=
480     per_bpr_shd.g_old_rec.bpr_attribute14;
481   End If;
482   If (p_rec.bpr_attribute15 = hr_api.g_varchar2) then
483     p_rec.bpr_attribute15:=
484     per_bpr_shd.g_old_rec.bpr_attribute15;
485   End If;
486   If (p_rec.bpr_attribute16 = hr_api.g_varchar2) then
487     p_rec.bpr_attribute16:=
488     per_bpr_shd.g_old_rec.bpr_attribute16;
489   End If;
490   If (p_rec.bpr_attribute17 = hr_api.g_varchar2) then
491     p_rec.bpr_attribute17:=
492     per_bpr_shd.g_old_rec.bpr_attribute17;
493   End If;
494   If (p_rec.bpr_attribute18 = hr_api.g_varchar2) then
495     p_rec.bpr_attribute18:=
496     per_bpr_shd.g_old_rec.bpr_attribute18;
497   End If;
498   If (p_rec.bpr_attribute19 = hr_api.g_varchar2) then
499     p_rec.bpr_attribute19:=
500     per_bpr_shd.g_old_rec.bpr_attribute19;
501   End If;
502   If (p_rec.bpr_attribute20 = hr_api.g_varchar2) then
503     p_rec.bpr_attribute20:=
504     per_bpr_shd.g_old_rec.bpr_attribute20;
505   End If;
506   If (p_rec.bpr_attribute21 = hr_api.g_varchar2) then
507     p_rec.bpr_attribute21:=
508     per_bpr_shd.g_old_rec.bpr_attribute21;
509   End If;
510   If (p_rec.bpr_attribute22 = hr_api.g_varchar2) then
511     p_rec.bpr_attribute22:=
512     per_bpr_shd.g_old_rec.bpr_attribute22;
513   End If;
514   If (p_rec.bpr_attribute23 = hr_api.g_varchar2) then
515     p_rec.bpr_attribute23:=
516     per_bpr_shd.g_old_rec.bpr_attribute23;
517   End If;
518   If (p_rec.bpr_attribute24 = hr_api.g_varchar2) then
519     p_rec.bpr_attribute24:=
520     per_bpr_shd.g_old_rec.bpr_attribute24;
521   End If;
522   If (p_rec.bpr_attribute25 = hr_api.g_varchar2) then
523     p_rec.bpr_attribute25:=
524     per_bpr_shd.g_old_rec.bpr_attribute25;
525   End If;
526   If (p_rec.bpr_attribute26 = hr_api.g_varchar2) then
527     p_rec.bpr_attribute26:=
528     per_bpr_shd.g_old_rec.bpr_attribute26;
529   End If;
530   If (p_rec.bpr_attribute27 = hr_api.g_varchar2) then
531     p_rec.bpr_attribute27:=
532     per_bpr_shd.g_old_rec.bpr_attribute27;
533   End If;
534   If (p_rec.bpr_attribute28 = hr_api.g_varchar2) then
535     p_rec.bpr_attribute28:=
536     per_bpr_shd.g_old_rec.bpr_attribute28;
537   End If;
538   If (p_rec.bpr_attribute29 = hr_api.g_varchar2) then
539     p_rec.bpr_attribute29:=
540     per_bpr_shd.g_old_rec.bpr_attribute29;
541   End If;
542   If (p_rec.bpr_attribute30 = hr_api.g_varchar2) then
543     p_rec.bpr_attribute30:=
544     per_bpr_shd.g_old_rec.bpr_attribute30;
545   End If;
546 
547   --
548   hr_utility.set_location(' Leaving:'||l_proc, 10);
549 --
550 End convert_defs;
551 --
552 -- ----------------------------------------------------------------------------
553 -- |---------------------------------< upd >----------------------------------|
554 -- ----------------------------------------------------------------------------
555 Procedure upd
556   (
557   p_effective_date   in  date,
558   p_rec        in out nocopy per_bpr_shd.g_rec_type
559   ) is
560 --
561   l_proc  varchar2(72) := g_package||'upd';
562 --
563 Begin
564   hr_utility.set_location('Entering:'||l_proc, 5);
565   --
566   -- We must lock the row which we need to update.
567   --
568   per_bpr_shd.lck
569     (
570       p_rec.payroll_run_id,
571        p_rec.object_version_number
572     );
573   --
574   -- 1. During an update system defaults are used to determine if
575   --    arguments have been defaulted or not. We must therefore
576   --    derive the full record structure values to be updated.
577   --
578   -- 2. Call the supporting update validate operations.
579   --
580   convert_defs(p_rec);
581   per_bpr_bus.update_validate(p_effective_date,
582                              p_rec
583                              );
584   --
585   -- Call the supporting pre-update operation
586   --
587   pre_update(p_rec);
588   --
589   -- Update the row.
590   --
591   update_dml(p_rec);
592   --
593   -- Call the supporting post-update operation
594   --
595   post_update(p_effective_date
596 	     ,p_rec);
597 End upd;
598 --
599 -- ----------------------------------------------------------------------------
600 -- |---------------------------------< upd >----------------------------------|
601 -- ----------------------------------------------------------------------------
602 Procedure upd
603   (
604    p_effective_date   in  date,
605   p_payroll_run_id              in number,
606   p_payroll_identifier          in varchar2       default hr_api.g_varchar2,
607   p_period_start_date           in date           default hr_api.g_date,
608   p_period_end_date             in date           default hr_api.g_date,
609   p_processing_date             in date           default hr_api.g_date,
610   p_object_version_number       in out nocopy number,
611   p_bpr_attribute_category          in varchar2       default hr_api.g_varchar2,
612   p_bpr_attribute1                  in varchar2       default hr_api.g_varchar2,
613   p_bpr_attribute2                  in varchar2       default hr_api.g_varchar2,
614   p_bpr_attribute3                  in varchar2       default hr_api.g_varchar2,
615   p_bpr_attribute4                  in varchar2       default hr_api.g_varchar2,
616   p_bpr_attribute5                  in varchar2       default hr_api.g_varchar2,
617   p_bpr_attribute6                  in varchar2       default hr_api.g_varchar2,
618   p_bpr_attribute7                  in varchar2       default hr_api.g_varchar2,
619   p_bpr_attribute8                  in varchar2       default hr_api.g_varchar2,
620   p_bpr_attribute9                  in varchar2       default hr_api.g_varchar2,
621   p_bpr_attribute10                 in varchar2       default hr_api.g_varchar2,
622   p_bpr_attribute11                 in varchar2       default hr_api.g_varchar2,
623   p_bpr_attribute12                 in varchar2       default hr_api.g_varchar2,
624   p_bpr_attribute13                 in varchar2       default hr_api.g_varchar2,
625   p_bpr_attribute14                 in varchar2       default hr_api.g_varchar2,
626   p_bpr_attribute15                 in varchar2       default hr_api.g_varchar2,
627   p_bpr_attribute16                 in varchar2       default hr_api.g_varchar2,
628   p_bpr_attribute17                 in varchar2       default hr_api.g_varchar2,
629   p_bpr_attribute18                 in varchar2       default hr_api.g_varchar2,
630   p_bpr_attribute19                 in varchar2       default hr_api.g_varchar2,
631   p_bpr_attribute20                 in varchar2       default hr_api.g_varchar2,
632   p_bpr_attribute21                 in varchar2       default hr_api.g_varchar2,
633   p_bpr_attribute22                 in varchar2       default hr_api.g_varchar2,
634   p_bpr_attribute23                 in varchar2       default hr_api.g_varchar2,
635   p_bpr_attribute24                 in varchar2       default hr_api.g_varchar2,
636   p_bpr_attribute25                 in varchar2       default hr_api.g_varchar2,
637   p_bpr_attribute26                 in varchar2       default hr_api.g_varchar2,
638   p_bpr_attribute27                 in varchar2       default hr_api.g_varchar2,
639   p_bpr_attribute28                 in varchar2       default hr_api.g_varchar2,
640   p_bpr_attribute29                 in varchar2       default hr_api.g_varchar2,
641   p_bpr_attribute30                 in varchar2       default hr_api.g_varchar2
642   ) is
643 --
644   l_rec	  per_bpr_shd.g_rec_type;
645   l_proc  varchar2(72) := g_package||'upd';
646 --
647 Begin
648   hr_utility.set_location('Entering:'||l_proc, 5);
649   --
650   -- Call conversion function to turn arguments into the
651   -- l_rec structure.
652   --
653   l_rec :=
654   per_bpr_shd.convert_args
655   (
656   p_payroll_run_id,
657   hr_api.g_number,
658   hr_api.g_number,
659   p_payroll_identifier,
660   p_period_start_date,
661   p_period_end_date,
662   p_processing_date,
663   p_object_version_number,
664   p_bpr_attribute_category,
665   p_bpr_attribute1,
666   p_bpr_attribute2,
667   p_bpr_attribute3,
668   p_bpr_attribute4,
669   p_bpr_attribute5,
670   p_bpr_attribute6,
671   p_bpr_attribute7,
672   p_bpr_attribute8,
673   p_bpr_attribute9,
674   p_bpr_attribute10,
675   p_bpr_attribute11,
676   p_bpr_attribute12,
677   p_bpr_attribute13,
678   p_bpr_attribute14,
679   p_bpr_attribute15,
680   p_bpr_attribute16,
681   p_bpr_attribute17,
682   p_bpr_attribute18,
683   p_bpr_attribute19,
684   p_bpr_attribute20,
685   p_bpr_attribute21,
686   p_bpr_attribute22,
687   p_bpr_attribute23,
688   p_bpr_attribute24,
689   p_bpr_attribute25,
690   p_bpr_attribute26,
691   p_bpr_attribute27,
692   p_bpr_attribute28,
693   p_bpr_attribute29,
694   p_bpr_attribute30
695   );
696   --
697   -- Having converted the arguments into the
698   -- plsql record structure we call the corresponding record
699   -- business process.
700   --
701   upd(p_effective_date,
702       l_rec
703      );
704   p_object_version_number := l_rec.object_version_number;
705   --
706   hr_utility.set_location(' Leaving:'||l_proc, 10);
707 End upd;
708 --
709 end per_bpr_upd;