DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_LIP_UPD

Source


1 Package Body hr_lip_upd as
2 /* $Header: hrliprhi.pkb 115.5 2002/12/04 05:07:14 hjonnala noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  hr_lip_upd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |----------------------------< dt_update_dml >-----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure controls the execution of dml from the datetrack mode
17 --   of CORRECTION only. It is important to note that the object version
18 --   number is only increment by 1 because the datetrack correction is
19 --   soley for one datetracked row.
20 --   This procedure controls the actual dml update logic. The functions of
21 --   this procedure are as follows:
22 --   1) Get the next object_version_number.
23 --   2) To set and unset the g_api_dml status as required (as we are about to
24 --      perform dml).
25 --   3) To update the specified row in the schema using the primary key in
26 --      the predicates.
27 --   4) To trap any constraint violations that may have occurred.
28 --   5) To raise any other errors.
29 --
30 -- Prerequisites:
31 --   This is an internal private procedure which must be called from the
32 --   update_dml procedure.
33 --
34 -- In Parameters:
35 --   A Pl/Sql record structure.
36 --
37 -- Post Success:
38 --   The specified row will be updated in the schema.
39 --
40 -- Post Failure:
41 --   On the update dml failure it is important to note that we always reset the
42 --   g_api_dml status to false.
43 --   If a check or unique integrity constraint violation is raised the
44 --   constraint_error procedure will be called.
45 --   If any other error is reported, the error will be raised after the
46 --   g_api_dml status is reset.
47 --
48 -- Developer Implementation Notes:
49 --   The update 'set' arguments list should be modified if any of your
50 --   attributes are not updateable.
51 --
52 -- Access Status:
53 --   Internal Row Handler Use Only.
54 --
55 -- {End Of Comments}
56 -- ----------------------------------------------------------------------------
57 Procedure dt_update_dml
58   (p_rec                   in out nocopy hr_lip_shd.g_rec_type
59   ,p_effective_date        in date
60   ,p_datetrack_mode        in varchar2
61   ,p_validation_start_date in date
62   ,p_validation_end_date   in date
63   ) is
64 --
65   l_proc        varchar2(72) := g_package||'dt_update_dml';
66 --
67 Begin
68   hr_utility.set_location('Entering:'||l_proc, 5);
69   --
70   If (p_datetrack_mode = hr_api.g_correction) then
71     hr_utility.set_location(l_proc, 10);
72     --
73     -- Because we are updating a row we must get the next object
74     -- version number.
75     --
76     p_rec.object_version_number :=
77       dt_api.get_object_version_number
78         (p_base_table_name => 'hr_de_liability_premiums_f'
79         ,p_base_key_column => 'liability_premiums_id'
80         ,p_base_key_value  => p_rec.liability_premiums_id
81         );
82     --
83     --
84     --
85     -- Update the hr_de_liability_premiums_f Row
86     --
87     update  hr_de_liability_premiums_f
88     set
89      liability_premiums_id                = p_rec.liability_premiums_id
90     ,organization_link_id                 = p_rec.organization_link_id
91     ,std_percentage                       = p_rec.std_percentage
92     ,calculation_method                   = p_rec.calculation_method
93     ,std_working_hours_per_year           = p_rec.std_working_hours_per_year
94     ,max_remuneration                     = p_rec.max_remuneration
95     ,attribute_category                   = p_rec.attribute_category
96     ,attribute1                           = p_rec.attribute1
97     ,attribute2                           = p_rec.attribute2
98     ,attribute3                           = p_rec.attribute3
99     ,attribute4                           = p_rec.attribute4
100     ,attribute5                           = p_rec.attribute5
101     ,attribute6                           = p_rec.attribute6
102     ,attribute7                           = p_rec.attribute7
103     ,attribute8                           = p_rec.attribute8
104     ,attribute9                           = p_rec.attribute9
105     ,attribute10                          = p_rec.attribute10
106     ,attribute11                          = p_rec.attribute11
107     ,attribute12                          = p_rec.attribute12
108     ,attribute13                          = p_rec.attribute13
109     ,attribute14                          = p_rec.attribute14
110     ,attribute15                          = p_rec.attribute15
111     ,attribute16                          = p_rec.attribute16
112     ,attribute17                          = p_rec.attribute17
113     ,attribute18                          = p_rec.attribute18
114     ,attribute19                          = p_rec.attribute19
115     ,attribute20                          = p_rec.attribute20
116     ,object_version_number                = p_rec.object_version_number
117     where   liability_premiums_id = p_rec.liability_premiums_id
118     and     effective_start_date = p_validation_start_date
119     and     effective_end_date   = p_validation_end_date;
120     --
121     --
122     --
123     -- Set the effective start and end dates
124     --
125     p_rec.effective_start_date := p_validation_start_date;
126     p_rec.effective_end_date   := p_validation_end_date;
127   End If;
128 --
129 hr_utility.set_location(' Leaving:'||l_proc, 15);
130 Exception
131   When hr_api.check_integrity_violated Then
132     -- A check constraint has been violated
133     --
134     hr_lip_shd.constraint_error
135       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
136   When hr_api.unique_integrity_violated Then
137     -- Unique integrity has been violated
138     --
139     hr_lip_shd.constraint_error
140       (p_constraint_name => hr_api.strip_constraint_name(SQLERRM));
141   When Others Then
142     --
143     Raise;
144 End dt_update_dml;
145 --
146 -- ----------------------------------------------------------------------------
147 -- |------------------------------< update_dml >------------------------------|
148 -- ----------------------------------------------------------------------------
149 -- {Start Of Comments}
150 --
151 -- Description:
152 --   This procedure calls the dt_update_dml control logic which handles
153 --   the actual datetrack dml.
154 --
155 -- Prerequisites:
156 --   This is an internal private procedure which must be called from the upd
157 --   procedure.
158 --
159 -- In Parameters:
160 --   A Pl/Sql record structre.
161 --
162 -- Post Success:
163 --   Processing contines.
164 --
165 -- Post Failure:
166 --   No specific error handling is required within this procedure.
167 --
168 -- Developer Implementation Notes:
169 --   The update 'set' arguments list should be modified if any of your
170 --   attributes are not updateable.
171 --
172 -- Access Status:
173 --   Internal Row Handler Use Only.
174 --
175 -- {End Of Comments}
176 -- ----------------------------------------------------------------------------
177 Procedure update_dml
178   (p_rec                      in out nocopy hr_lip_shd.g_rec_type
179   ,p_effective_date           in date
180   ,p_datetrack_mode           in varchar2
181   ,p_validation_start_date    in date
182   ,p_validation_end_date      in date
183   ) is
184 --
185   l_proc        varchar2(72) := g_package||'update_dml';
186 --
187 Begin
188   hr_utility.set_location('Entering:'||l_proc, 5);
189   --
190   hr_lip_upd.dt_update_dml
191     (p_rec                   => p_rec
192     ,p_effective_date        => p_effective_date
193     ,p_datetrack_mode        => p_datetrack_mode
194     ,p_validation_start_date => p_validation_start_date
195     ,p_validation_end_date   => p_validation_end_date
196     );
197   --
198   hr_utility.set_location(' Leaving:'||l_proc, 10);
199 End update_dml;
200 --
201 -- ----------------------------------------------------------------------------
202 -- |----------------------------< dt_pre_update >-----------------------------|
203 -- ----------------------------------------------------------------------------
204 -- {Start Of Comments}
205 --
206 -- Description:
207 --   The dt_pre_update procedure controls the execution
208 --   of dml for the datetrack modes of: UPDATE, UPDATE_OVERRIDE
209 --   and UPDATE_CHANGE_INSERT only. The execution required is as
210 --   follows:
211 --
212 --   1) Providing the datetrack update mode is not 'CORRECTION'
213 --      then set the effective end date of the current row (this
214 --      will be the validation_start_date - 1).
215 --   2) If the datetrack mode is 'UPDATE_OVERRIDE' then call the
216 --      corresponding delete_dml process to delete any future rows
217 --      where the effective_start_date is greater than or equal to
218 --      the validation_start_date.
219 --   3) Call the insert_dml process to insert the new updated row
220 --      details.
221 --
222 -- Prerequisites:
223 --   This is an internal procedure which is called from the
224 --   pre_update procedure.
225 --
226 -- In Parameters:
227 --
228 -- Post Success:
229 --   Processing continues.
230 --
231 -- Post Failure:
232 --   If an error has occurred, an error message and exception will be raised
233 --   but not handled.
234 --
235 -- Developer Implementation Notes:
236 --   This is an internal procedure which is required by Datetrack. Don't
237 --   remove or modify.
238 --
239 -- Access Status:
240 --   Internal Row Handler Use Only.
241 --
242 -- {End Of Comments}
243 -- ----------------------------------------------------------------------------
244 Procedure dt_pre_update
245   (p_rec                     in out nocopy     hr_lip_shd.g_rec_type
246   ,p_effective_date          in date
247   ,p_datetrack_mode          in varchar2
248   ,p_validation_start_date   in date
249   ,p_validation_end_date     in date
250   ) is
251 --
252   l_proc                 varchar2(72) := g_package||'dt_pre_update';
253   l_dummy_version_number number;
254 --
255 Begin
256   hr_utility.set_location('Entering:'||l_proc, 5);
257   If (p_datetrack_mode <> hr_api.g_correction) then
258     --
259     -- Update the current effective end date
260     --
261     hr_lip_shd.upd_effective_end_date
262       (p_effective_date         => p_effective_date
263       ,p_base_key_value         => p_rec.liability_premiums_id
264       ,p_new_effective_end_date => (p_validation_start_date - 1)
265       ,p_validation_start_date  => p_validation_start_date
266       ,p_validation_end_date    => p_validation_end_date
267       ,p_object_version_number  => l_dummy_version_number
268       );
269     --
270     If (p_datetrack_mode = hr_api.g_update_override) then
271       --
272       -- As the datetrack mode is 'UPDATE_OVERRIDE' then we must
273       -- delete any future rows
274       --
275       hr_lip_del.delete_dml
276         (p_rec                   => p_rec
277         ,p_effective_date        => p_effective_date
278         ,p_datetrack_mode        => p_datetrack_mode
279         ,p_validation_start_date => p_validation_start_date
280         ,p_validation_end_date   => p_validation_end_date
281         );
282     End If;
283     --
284     -- We must now insert the updated row
285     --
286     hr_lip_ins.insert_dml
287       (p_rec                    => p_rec
288       ,p_effective_date         => p_effective_date
289       ,p_datetrack_mode         => p_datetrack_mode
290       ,p_validation_start_date  => p_validation_start_date
291       ,p_validation_end_date    => p_validation_end_date
292       );
293   End If;
294   hr_utility.set_location(' Leaving:'||l_proc, 20);
295 End dt_pre_update;
296 --
297 -- ----------------------------------------------------------------------------
298 -- |------------------------------< pre_update >------------------------------|
299 -- ----------------------------------------------------------------------------
300 -- {Start Of Comments}
301 --
302 -- Description:
303 --   This private procedure contains any processing which is required before
304 --   the update dml.
305 --
306 -- Prerequisites:
307 --   This is an internal procedure which is called from the upd procedure.
308 --
309 -- In Parameters:
310 --   A Pl/Sql record structure.
311 --
312 -- Post Success:
313 --   Processing continues.
314 --
315 -- Post Failure:
316 --   If an error has occurred, an error message and exception will be raised
317 --   but not handled.
318 -- Developer Implementation Notes:
319 --   Any pre-processing required before the update dml is issued should be
320 --   coded within this procedure. It is important to note that any 3rd party
321 --   maintenance should be reviewed before placing in this procedure. The call
322 --   to the dt_update_dml procedure should NOT be removed.
323 --
324 -- Access Status:
325 --   Internal Row Handler Use Only.
326 --
327 -- {End Of Comments}
328 -- ----------------------------------------------------------------------------
329 Procedure pre_update
330   (p_rec                   in out nocopy hr_lip_shd.g_rec_type
331   ,p_effective_date        in date
332   ,p_datetrack_mode        in varchar2
333   ,p_validation_start_date in date
334   ,p_validation_end_date   in date
335   ) is
336 --
337   l_proc        varchar2(72) := g_package||'pre_update';
338 --
339 Begin
340   hr_utility.set_location('Entering:'||l_proc, 5);
341   --
342   --
343   --
344   dt_pre_update
345     (p_rec                   => p_rec
346     ,p_effective_date        => p_effective_date
347     ,p_datetrack_mode        => p_datetrack_mode
348     ,p_validation_start_date => p_validation_start_date
349     ,p_validation_end_date   => p_validation_end_date
350     );
351   --
352   hr_utility.set_location(' Leaving:'||l_proc, 10);
353 End pre_update;
354 --
355 -- ----------------------------------------------------------------------------
356 -- |----------------------------< post_update >-------------------------------|
357 -- ----------------------------------------------------------------------------
358 -- {Start Of Comments}
359 --
360 -- Description:
361 --   This private procedure contains any processing which is required after
362 --   the update dml.
363 --
364 -- Prerequisites:
365 --   This is an internal procedure which is called from the upd procedure.
366 --
367 -- In Parameters:
368 --   A Pl/Sql record structure.
369 --
370 -- Post Success:
371 --   Processing continues.
372 --
373 -- Post Failure:
374 --   If an error has occurred, an error message and exception will be raised
375 --   but not handled.
376 --
377 -- Developer Implementation Notes:
378 --   Any post-processing required after the update dml is issued should be
379 --   coded within this procedure. It is important to note that any 3rd party
380 --   maintenance should be reviewed before placing in this procedure.
381 --
382 -- Access Status:
383 --   Internal Row Handler Use Only.
384 --
385 -- {End Of Comments}
386 -- ----------------------------------------------------------------------------
387 Procedure post_update
388   (p_rec                   in hr_lip_shd.g_rec_type
389   ,p_effective_date        in date
390   ,p_datetrack_mode        in varchar2
391   ,p_validation_start_date in date
392   ,p_validation_end_date   in date
393   ) is
394 --
395   l_proc        varchar2(72) := g_package||'post_update';
396 --
397 Begin
398   hr_utility.set_location('Entering:'||l_proc, 5);
399   begin
400     --
401     hr_lip_rku.after_update
402       (p_effective_date
403       => p_effective_date
404       ,p_datetrack_mode
405       => p_datetrack_mode
406       ,p_validation_start_date
407       => p_validation_start_date
408       ,p_validation_end_date
409       => p_validation_end_date
410       ,p_liability_premiums_id
411       => p_rec.liability_premiums_id
412       ,p_effective_start_date
413       => p_rec.effective_start_date
414       ,p_effective_end_date
415       => p_rec.effective_end_date
416       ,p_std_percentage
417       => p_rec.std_percentage
418       ,p_calculation_method
419       => p_rec.calculation_method
420       ,p_std_working_hours_per_year
421       => p_rec.std_working_hours_per_year
422       ,p_max_remuneration
423       => p_rec.max_remuneration
424       ,p_attribute_category
425       => p_rec.attribute_category
426       ,p_attribute1
427       => p_rec.attribute1
428       ,p_attribute2
429       => p_rec.attribute2
430       ,p_attribute3
431       => p_rec.attribute3
432       ,p_attribute4
433       => p_rec.attribute4
434       ,p_attribute5
435       => p_rec.attribute5
436       ,p_attribute6
437       => p_rec.attribute6
438       ,p_attribute7
439       => p_rec.attribute7
440       ,p_attribute8
441       => p_rec.attribute8
442       ,p_attribute9
443       => p_rec.attribute9
444       ,p_attribute10
445       => p_rec.attribute10
446       ,p_attribute11
447       => p_rec.attribute11
448       ,p_attribute12
449       => p_rec.attribute12
450       ,p_attribute13
451       => p_rec.attribute13
452       ,p_attribute14
453       => p_rec.attribute14
454       ,p_attribute15
455       => p_rec.attribute15
456       ,p_attribute16
457       => p_rec.attribute16
458       ,p_attribute17
459       => p_rec.attribute17
460       ,p_attribute18
461       => p_rec.attribute18
462       ,p_attribute19
463       => p_rec.attribute19
464       ,p_attribute20
465       => p_rec.attribute20
466       ,p_object_version_number
467       => p_rec.object_version_number
468       ,p_organization_link_id_o
469       => hr_lip_shd.g_old_rec.organization_link_id
470       ,p_effective_start_date_o
471       => hr_lip_shd.g_old_rec.effective_start_date
472       ,p_effective_end_date_o
473       => hr_lip_shd.g_old_rec.effective_end_date
474       ,p_std_percentage_o
475       => hr_lip_shd.g_old_rec.std_percentage
476       ,p_calculation_method_o
477       => hr_lip_shd.g_old_rec.calculation_method
478       ,p_std_working_hours_per_year_o
479       => hr_lip_shd.g_old_rec.std_working_hours_per_year
480       ,p_max_remuneration_o
481       => hr_lip_shd.g_old_rec.max_remuneration
482       ,p_attribute_category_o
483       => hr_lip_shd.g_old_rec.attribute_category
484       ,p_attribute1_o
485       => hr_lip_shd.g_old_rec.attribute1
486       ,p_attribute2_o
487       => hr_lip_shd.g_old_rec.attribute2
488       ,p_attribute3_o
489       => hr_lip_shd.g_old_rec.attribute3
490       ,p_attribute4_o
491       => hr_lip_shd.g_old_rec.attribute4
492       ,p_attribute5_o
493       => hr_lip_shd.g_old_rec.attribute5
494       ,p_attribute6_o
495       => hr_lip_shd.g_old_rec.attribute6
496       ,p_attribute7_o
497       => hr_lip_shd.g_old_rec.attribute7
498       ,p_attribute8_o
499       => hr_lip_shd.g_old_rec.attribute8
500       ,p_attribute9_o
501       => hr_lip_shd.g_old_rec.attribute9
502       ,p_attribute10_o
503       => hr_lip_shd.g_old_rec.attribute10
504       ,p_attribute11_o
505       => hr_lip_shd.g_old_rec.attribute11
506       ,p_attribute12_o
507       => hr_lip_shd.g_old_rec.attribute12
508       ,p_attribute13_o
509       => hr_lip_shd.g_old_rec.attribute13
510       ,p_attribute14_o
511       => hr_lip_shd.g_old_rec.attribute14
512       ,p_attribute15_o
513       => hr_lip_shd.g_old_rec.attribute15
514       ,p_attribute16_o
515       => hr_lip_shd.g_old_rec.attribute16
516       ,p_attribute17_o
517       => hr_lip_shd.g_old_rec.attribute17
518       ,p_attribute18_o
519       => hr_lip_shd.g_old_rec.attribute18
520       ,p_attribute19_o
521       => hr_lip_shd.g_old_rec.attribute19
522       ,p_attribute20_o
523       => hr_lip_shd.g_old_rec.attribute20
524       ,p_object_version_number_o
525       => hr_lip_shd.g_old_rec.object_version_number
526       );
527     --
528   exception
529     --
530     when hr_api.cannot_find_prog_unit then
531       --
532       hr_api.cannot_find_prog_unit_error
533         (p_module_name => 'HR_DE_LIABILITY_PREMIUMS_F'
534         ,p_hook_type   => 'AU');
535       --
536   end;
537   --
538   hr_utility.set_location(' Leaving:'||l_proc, 10);
539 End post_update;
540 --
541 -- ----------------------------------------------------------------------------
542 -- |-----------------------------< convert_defs >-----------------------------|
543 -- ----------------------------------------------------------------------------
544 -- {Start Of Comments}
545 --
546 -- Description:
547 --   The Convert_Defs procedure has one very important function:
548 --   It must return the record structure for the row with all system defaulted
549 --   values converted into its corresponding parameter value for update. When
550 --   we attempt to update a row through the Upd process , certain
551 --   parameters can be defaulted which enables flexibility in the calling of
552 --   the upd process (e.g. only attributes which need to be updated need to be
553 --   specified). For the upd process to determine which attributes
554 --   have NOT been specified we need to check if the parameter has a reserved
555 --   system default value. Therefore, for all parameters which have a
556 --   corresponding reserved system default mechanism specified we need to
557 --   check if a system default is being used. If a system default is being
558 --   used then we convert the defaulted value into its corresponding attribute
559 --   value held in the g_old_rec data structure.
560 --
561 -- Prerequisites:
562 --   This private function can only be called from the upd process.
563 --
564 -- In Parameters:
565 --   A Pl/Sql record structure.
566 --
567 -- Post Success:
568 --   The record structure will be returned with all system defaulted parameter
569 --   values converted into its current row attribute value.
570 --
571 -- Post Failure:
572 --   No direct error handling is required within this function. Any possible
573 --   errors within this procedure will be a PL/SQL value error due to
574 --   conversion of datatypes or data lengths.
575 --
576 -- Developer Implementation Notes:
577 --   None.
578 --
579 -- Access Status:
580 --   Internal Row Handler Use Only.
581 --
582 -- {End Of Comments}
583 -- ----------------------------------------------------------------------------
584 Procedure convert_defs
585   (p_rec in out nocopy hr_lip_shd.g_rec_type
586   ) is
587 --
588 Begin
589   --
590   -- We must now examine each argument value in the
591   -- p_rec plsql record structure
592   -- to see if a system default is being used. If a system default
593   -- is being used then we must set to the 'current' argument value.
594   --
595   If (p_rec.organization_link_id = hr_api.g_number) then
596     p_rec.organization_link_id :=
597     hr_lip_shd.g_old_rec.organization_link_id;
598   End If;
599   If (p_rec.std_percentage = hr_api.g_number) then
600     p_rec.std_percentage :=
601     hr_lip_shd.g_old_rec.std_percentage;
602   End If;
603   If (p_rec.calculation_method = hr_api.g_varchar2) then
604     p_rec.calculation_method :=
605     hr_lip_shd.g_old_rec.calculation_method;
606   End If;
607   If (p_rec.std_working_hours_per_year = hr_api.g_number) then
608     p_rec.std_working_hours_per_year :=
609     hr_lip_shd.g_old_rec.std_working_hours_per_year;
610   End If;
611   If (p_rec.max_remuneration = hr_api.g_number) then
612     p_rec.max_remuneration :=
613     hr_lip_shd.g_old_rec.max_remuneration;
614   End If;
615   If (p_rec.attribute_category = hr_api.g_varchar2) then
616     p_rec.attribute_category :=
617     hr_lip_shd.g_old_rec.attribute_category;
618   End If;
619   If (p_rec.attribute1 = hr_api.g_varchar2) then
620     p_rec.attribute1 :=
621     hr_lip_shd.g_old_rec.attribute1;
622   End If;
623   If (p_rec.attribute2 = hr_api.g_varchar2) then
624     p_rec.attribute2 :=
625     hr_lip_shd.g_old_rec.attribute2;
626   End If;
627   If (p_rec.attribute3 = hr_api.g_varchar2) then
628     p_rec.attribute3 :=
629     hr_lip_shd.g_old_rec.attribute3;
630   End If;
631   If (p_rec.attribute4 = hr_api.g_varchar2) then
632     p_rec.attribute4 :=
633     hr_lip_shd.g_old_rec.attribute4;
634   End If;
635   If (p_rec.attribute5 = hr_api.g_varchar2) then
636     p_rec.attribute5 :=
637     hr_lip_shd.g_old_rec.attribute5;
638   End If;
639   If (p_rec.attribute6 = hr_api.g_varchar2) then
640     p_rec.attribute6 :=
641     hr_lip_shd.g_old_rec.attribute6;
642   End If;
643   If (p_rec.attribute7 = hr_api.g_varchar2) then
644     p_rec.attribute7 :=
645     hr_lip_shd.g_old_rec.attribute7;
646   End If;
647   If (p_rec.attribute8 = hr_api.g_varchar2) then
648     p_rec.attribute8 :=
649     hr_lip_shd.g_old_rec.attribute8;
650   End If;
651   If (p_rec.attribute9 = hr_api.g_varchar2) then
652     p_rec.attribute9 :=
653     hr_lip_shd.g_old_rec.attribute9;
654   End If;
655   If (p_rec.attribute10 = hr_api.g_varchar2) then
656     p_rec.attribute10 :=
657     hr_lip_shd.g_old_rec.attribute10;
658   End If;
659   If (p_rec.attribute11 = hr_api.g_varchar2) then
660     p_rec.attribute11 :=
661     hr_lip_shd.g_old_rec.attribute11;
662   End If;
663   If (p_rec.attribute12 = hr_api.g_varchar2) then
664     p_rec.attribute12 :=
665     hr_lip_shd.g_old_rec.attribute12;
666   End If;
667   If (p_rec.attribute13 = hr_api.g_varchar2) then
668     p_rec.attribute13 :=
669     hr_lip_shd.g_old_rec.attribute13;
670   End If;
671   If (p_rec.attribute14 = hr_api.g_varchar2) then
672     p_rec.attribute14 :=
673     hr_lip_shd.g_old_rec.attribute14;
674   End If;
675   If (p_rec.attribute15 = hr_api.g_varchar2) then
676     p_rec.attribute15 :=
677     hr_lip_shd.g_old_rec.attribute15;
678   End If;
679   If (p_rec.attribute16 = hr_api.g_varchar2) then
680     p_rec.attribute16 :=
681     hr_lip_shd.g_old_rec.attribute16;
682   End If;
683   If (p_rec.attribute17 = hr_api.g_varchar2) then
684     p_rec.attribute17 :=
685     hr_lip_shd.g_old_rec.attribute17;
686   End If;
687   If (p_rec.attribute18 = hr_api.g_varchar2) then
688     p_rec.attribute18 :=
689     hr_lip_shd.g_old_rec.attribute18;
690   End If;
691   If (p_rec.attribute19 = hr_api.g_varchar2) then
692     p_rec.attribute19 :=
693     hr_lip_shd.g_old_rec.attribute19;
694   End If;
695   If (p_rec.attribute20 = hr_api.g_varchar2) then
696     p_rec.attribute20 :=
697     hr_lip_shd.g_old_rec.attribute20;
698   End If;
699   --
700 End convert_defs;
701 --
702 -- ----------------------------------------------------------------------------
703 -- |---------------------------------< upd >----------------------------------|
704 -- ----------------------------------------------------------------------------
705 Procedure upd
706   (p_effective_date in     date
707   ,p_datetrack_mode in     varchar2
708   ,p_rec            in out nocopy hr_lip_shd.g_rec_type
709   ) is
710 --
711   l_proc                        varchar2(72) := g_package||'upd';
712   l_validation_start_date       date;
713   l_validation_end_date         date;
714 --
715 Begin
716   hr_utility.set_location('Entering:'||l_proc, 5);
717   --
718   -- Ensure that the DateTrack update mode is valid
719   --
720   dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode);
721   --
722   -- We must lock the row which we need to update.
723   --
724   hr_lip_shd.lck
725     (p_effective_date                   => p_effective_date
726     ,p_datetrack_mode                   => p_datetrack_mode
727     ,p_liability_premiums_id            => p_rec.liability_premiums_id
728     ,p_object_version_number            => p_rec.object_version_number
729     ,p_validation_start_date            => l_validation_start_date
730     ,p_validation_end_date              => l_validation_end_date
731     );
732   --
733   -- 1. During an update system defaults are used to determine if
734   --    arguments have been defaulted or not. We must therefore
735   --    derive the full record structure values to be updated.
736   --
737   -- 2. Call the supporting update validate operations.
738   --
739   hr_lip_upd.convert_defs(p_rec);
740   --
741   hr_lip_bus.update_validate
742     (p_rec                              => p_rec
743     ,p_effective_date                   => p_effective_date
744     ,p_datetrack_mode                   => p_datetrack_mode
745     ,p_validation_start_date            => l_validation_start_date
746     ,p_validation_end_date              => l_validation_end_date
747     );
748   --
749   -- Call the supporting pre-update operation
750   --
751   pre_update
752     (p_rec                              => p_rec
753     ,p_effective_date                   => p_effective_date
754     ,p_datetrack_mode                   => p_datetrack_mode
755     ,p_validation_start_date            => l_validation_start_date
756     ,p_validation_end_date              => l_validation_end_date
757     );
758   --
759   -- Update the row.
760   --
761   update_dml
762     (p_rec                              => p_rec
763     ,p_effective_date                   => p_effective_date
764     ,p_datetrack_mode                   => p_datetrack_mode
765     ,p_validation_start_date            => l_validation_start_date
766     ,p_validation_end_date                  => l_validation_end_date
767     );
768   --
769   -- Call the supporting post-update operation
770   --
771   post_update
772     (p_rec                              => p_rec
773     ,p_effective_date                   => p_effective_date
774     ,p_datetrack_mode                   => p_datetrack_mode
775     ,p_validation_start_date            => l_validation_start_date
776     ,p_validation_end_date              => l_validation_end_date
777     );
778 End upd;
779 --
780 -- ----------------------------------------------------------------------------
781 -- |------------------------------< upd >-------------------------------------|
782 -- ----------------------------------------------------------------------------
783 Procedure upd
784   (p_effective_date               in     date
785   ,p_datetrack_mode               in     varchar2
786   ,p_liability_premiums_id        in     number
787   ,p_object_version_number        in out nocopy number
788   ,p_std_percentage               in     number    default hr_api.g_number
789   ,p_calculation_method           in     varchar2  default hr_api.g_varchar2
790   ,p_std_working_hours_per_year   in     number    default hr_api.g_number
791   ,p_max_remuneration             in     number    default hr_api.g_number
792   ,p_attribute_category           in     varchar2  default hr_api.g_varchar2
793   ,p_attribute1                   in     varchar2  default hr_api.g_varchar2
794   ,p_attribute2                   in     varchar2  default hr_api.g_varchar2
795   ,p_attribute3                   in     varchar2  default hr_api.g_varchar2
796   ,p_attribute4                   in     varchar2  default hr_api.g_varchar2
797   ,p_attribute5                   in     varchar2  default hr_api.g_varchar2
798   ,p_attribute6                   in     varchar2  default hr_api.g_varchar2
799   ,p_attribute7                   in     varchar2  default hr_api.g_varchar2
800   ,p_attribute8                   in     varchar2  default hr_api.g_varchar2
801   ,p_attribute9                   in     varchar2  default hr_api.g_varchar2
802   ,p_attribute10                  in     varchar2  default hr_api.g_varchar2
803   ,p_attribute11                  in     varchar2  default hr_api.g_varchar2
804   ,p_attribute12                  in     varchar2  default hr_api.g_varchar2
805   ,p_attribute13                  in     varchar2  default hr_api.g_varchar2
806   ,p_attribute14                  in     varchar2  default hr_api.g_varchar2
807   ,p_attribute15                  in     varchar2  default hr_api.g_varchar2
808   ,p_attribute16                  in     varchar2  default hr_api.g_varchar2
809   ,p_attribute17                  in     varchar2  default hr_api.g_varchar2
810   ,p_attribute18                  in     varchar2  default hr_api.g_varchar2
811   ,p_attribute19                  in     varchar2  default hr_api.g_varchar2
812   ,p_attribute20                  in     varchar2  default hr_api.g_varchar2
813   ,p_effective_start_date            out nocopy date
814   ,p_effective_end_date              out nocopy date
815   ) is
816 --
817   l_rec         hr_lip_shd.g_rec_type;
818   l_proc        varchar2(72) := g_package||'upd';
819 --
820 Begin
821   hr_utility.set_location('Entering:'||l_proc, 5);
822   --
823   -- Call conversion function to turn arguments into the
824   -- l_rec structure.
825   --
826   l_rec :=
827   hr_lip_shd.convert_args
828     (p_liability_premiums_id
829     ,hr_api.g_number
830     ,null
831     ,null
832     ,p_std_percentage
833     ,p_calculation_method
834     ,p_std_working_hours_per_year
835     ,p_max_remuneration
836     ,p_attribute_category
837     ,p_attribute1
838     ,p_attribute2
839     ,p_attribute3
840     ,p_attribute4
841     ,p_attribute5
842     ,p_attribute6
843     ,p_attribute7
844     ,p_attribute8
845     ,p_attribute9
846     ,p_attribute10
847     ,p_attribute11
848     ,p_attribute12
849     ,p_attribute13
850     ,p_attribute14
851     ,p_attribute15
852     ,p_attribute16
853     ,p_attribute17
854     ,p_attribute18
855     ,p_attribute19
856     ,p_attribute20
857     ,p_object_version_number
858     );
859   --
860   -- Having converted the arguments into the
861   -- plsql record structure we call the corresponding record
862   -- business process.
863   --
864   hr_lip_upd.upd
865     (p_effective_date
866     ,p_datetrack_mode
867     ,l_rec
868     );
869   --
870   -- Set the out parameters
871   --
872   p_object_version_number            := l_rec.object_version_number;
873   p_effective_start_date             := l_rec.effective_start_date;
874   p_effective_end_date               := l_rec.effective_end_date;
875   --
876   --
877   hr_utility.set_location(' Leaving:'||l_proc, 10);
878 End upd;
879 --
880 end hr_lip_upd;