DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CLP_SHD

Source


1 Package Body ben_clp_shd as
2 /* $Header: beclprhi.pkb 120.0.12010000.2 2008/08/05 14:17:49 ubhat ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_clp_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14 --
15   l_proc 	varchar2(72) := g_package||'return_api_dml_status';
16 --
17 Begin
18   hr_utility.set_location('Entering:'||l_proc, 5);
19   --
20   Return (nvl(g_api_dml, false));
21   --
22   hr_utility.set_location(' Leaving:'||l_proc, 10);
23 End return_api_dml_status;
24 --
25 -- ----------------------------------------------------------------------------
26 -- |---------------------------< constraint_error >---------------------------|
27 -- ----------------------------------------------------------------------------
28 Procedure constraint_error
29             (p_constraint_name in all_constraints.constraint_name%TYPE) Is
30 --
31   l_proc 	varchar2(72) := g_package||'constraint_error';
32 --
33 Begin
34   hr_utility.set_location('Entering:'||l_proc, 5);
35   --
36   If (p_constraint_name = 'BEN_CLPSE_LF_EVT_F_PK') Then
37     hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
38     hr_utility.set_message_token('PROCEDURE', l_proc);
39     hr_utility.set_message_token('STEP','5');
40     hr_utility.raise_error;
41   Else
42     hr_utility.set_message(801, 'HR_7877_API_INVALID_CONSTRAINT');
43     hr_utility.set_message_token('PROCEDURE', l_proc);
44     hr_utility.set_message_token('CONSTRAINT_NAME', p_constraint_name);
45     hr_utility.raise_error;
46   End If;
47   --
48   hr_utility.set_location(' Leaving:'||l_proc, 10);
49 End constraint_error;
50 --
51 -- ----------------------------------------------------------------------------
52 -- |-----------------------------< api_updating >-----------------------------|
53 -- ----------------------------------------------------------------------------
54 Function api_updating
55   (p_effective_date		in date,
56    p_clpse_lf_evt_id		in number,
57    p_object_version_number	in number
58   ) Return Boolean Is
59 --
60   --
61   -- Cursor selects the 'current' row from the HR Schema
62   --
63   Cursor C_Sel1 is
64     select
65 	clpse_lf_evt_id,
66 	effective_start_date,
67 	effective_end_date,
68 	business_group_id,
69 	seq,
70 	ler1_id,
71 	bool1_cd,
72 	ler2_id,
73 	bool2_cd,
74 	ler3_id,
75 	bool3_cd,
76 	ler4_id,
77 	bool4_cd,
78 	ler5_id,
79 	bool5_cd,
80 	ler6_id,
81 	bool6_cd,
82 	ler7_id,
83 	bool7_cd,
84 	ler8_id,
85 	bool8_cd,
86 	ler9_id,
87 	bool9_cd,
88 	ler10_id,
89 	eval_cd,
90 	eval_rl,
91 	tlrnc_dys_num,
92 	eval_ler_id,
93 	eval_ler_det_cd,
94 	eval_ler_det_rl,
95 	clp_attribute_category,
96 	clp_attribute1,
97 	clp_attribute2,
98 	clp_attribute3,
99 	clp_attribute4,
100 	clp_attribute5,
101 	clp_attribute6,
102 	clp_attribute7,
103 	clp_attribute8,
104 	clp_attribute9,
105 	clp_attribute10,
106 	clp_attribute11,
107 	clp_attribute12,
108 	clp_attribute13,
109 	clp_attribute14,
110 	clp_attribute15,
111 	clp_attribute16,
112 	clp_attribute17,
113 	clp_attribute18,
114 	clp_attribute19,
115 	clp_attribute20,
116 	clp_attribute21,
117 	clp_attribute22,
118 	clp_attribute23,
119 	clp_attribute24,
120 	clp_attribute25,
121 	clp_attribute26,
122 	clp_attribute27,
123 	clp_attribute28,
124 	clp_attribute29,
125 	clp_attribute30,
126 	object_version_number
127     from	ben_clpse_lf_evt_f
128     where	clpse_lf_evt_id = p_clpse_lf_evt_id
129     and		p_effective_date
130     between	effective_start_date and effective_end_date;
131 --
132   l_proc	varchar2(72)	:= g_package||'api_updating';
133   l_fct_ret	boolean;
134 --
135 Begin
136   hr_utility.set_location('Entering:'||l_proc, 5);
137   --
138   If (p_effective_date is null or
139       p_clpse_lf_evt_id is null or
140       p_object_version_number is null) Then
141     --
142     -- One of the primary key arguments is null therefore we must
143     -- set the returning function value to false
144     --
145     l_fct_ret := false;
146   Else
147     If (p_clpse_lf_evt_id = g_old_rec.clpse_lf_evt_id and
148         p_object_version_number = g_old_rec.object_version_number) Then
149       hr_utility.set_location(l_proc, 10);
150       --
151       -- The g_old_rec is current therefore we must
152       -- set the returning function to true
153       --
154       l_fct_ret := true;
155     Else
156       --
157       -- Select the current row
158       --
159       Open C_Sel1;
160       Fetch C_Sel1 Into g_old_rec;
161       If C_Sel1%notfound Then
162         Close C_Sel1;
163         --
164         -- The primary key is invalid therefore we must error
165         --
166         hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
167         hr_utility.raise_error;
168       End If;
169       Close C_Sel1;
170       If (p_object_version_number <> g_old_rec.object_version_number) Then
171         hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
172         hr_utility.raise_error;
173       End If;
174       hr_utility.set_location(l_proc, 15);
175       l_fct_ret := true;
176     End If;
177   End If;
178   hr_utility.set_location(' Leaving:'||l_proc, 20);
179   Return (l_fct_ret);
180 --
181 End api_updating;
182 --
183 -- ----------------------------------------------------------------------------
184 -- |--------------------------< find_dt_del_modes >---------------------------|
185 -- ----------------------------------------------------------------------------
186 Procedure find_dt_del_modes
187 	(p_effective_date	in  date,
188 	 p_base_key_value	in  number,
189 	 p_zap		 out nocopy boolean,
190 	 p_delete	 out nocopy boolean,
191 	 p_future_change out nocopy boolean,
192 	 p_delete_next_change out nocopy boolean) is
193 --
194   l_proc 		varchar2(72) 	:= g_package||'find_dt_del_modes';
195 --
196   l_parent_key_value1	number;
197   l_parent_key_value2	number;
198   l_parent_key_value3	number;
199   l_parent_key_value4	number;
200   l_parent_key_value5	number;
201   l_parent_key_value6	number;
202   l_parent_key_value7	number;
203   l_parent_key_value8	number;
204   l_parent_key_value9	number;
205   l_parent_key_value10	number;
206   l_parent_key_value11	number;
207   l_parent_key_value12	number;
208   l_zap                 boolean;
209   l_zap1                boolean;
210   l_delete              boolean;
211   l_delete1             boolean;
212   l_future_change       boolean;
213   l_future_change1      boolean;
214   l_delete_next_change  boolean;
215   l_delete_next_change1 boolean;
216   --
217   Cursor C_Sel1 Is
218     select  t.ler1_id,
219 	    t.ler2_id,
220 	    t.ler3_id,
221 	    t.ler4_id,
222 	    t.ler5_id,
223 	    t.ler6_id,
224 	    t.ler7_id,
225 	    t.ler8_id,
226 	    t.ler9_id,
227 	    t.ler10_id,
228 	    t.eval_ler_id
229     from    ben_clpse_lf_evt_f t
230     where   t.clpse_lf_evt_id = p_base_key_value
231     and     p_effective_date
232     between t.effective_start_date and t.effective_end_date;
233 --
234 Begin
235   hr_utility.set_location('Entering:'||l_proc, 5);
236   Open  C_Sel1;
237   Fetch C_Sel1 Into l_parent_key_value1,
238 		    l_parent_key_value2,
239 		    l_parent_key_value3,
240 		    l_parent_key_value4,
241 		    l_parent_key_value5,
242 		    l_parent_key_value6,
243 		    l_parent_key_value7,
244 		    l_parent_key_value8,
245 		    l_parent_key_value9,
246 		    l_parent_key_value10,
247 		    l_parent_key_value11;
248   If C_Sel1%notfound then
249     Close C_Sel1;
250     hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
251     hr_utility.set_message_token('PROCEDURE', l_proc);
252     hr_utility.set_message_token('STEP','10');
253     hr_utility.raise_error;
254   End If;
255   Close C_Sel1;
256   --
257   -- Call the corresponding datetrack api
258   --
259   dt_api.find_dt_del_modes
260 	(p_effective_date	=> p_effective_date,
261 	 p_base_table_name	=> 'ben_clpse_lf_evt_f',
262 	 p_base_key_column	=> 'clpse_lf_evt_id',
263 	 p_base_key_value	=> p_base_key_value,
264 	 p_parent_table_name1	=> 'ben_ler_f',
265 	 p_parent_key_column1	=> 'ler_id',
266 	 p_parent_key_value1	=> l_parent_key_value1,
267 	 p_parent_table_name2	=> 'ben_ler_f',
268 	 p_parent_key_column2	=> 'ler_id',
269 	 p_parent_key_value2	=> l_parent_key_value2,
270 	 p_parent_table_name3	=> 'ben_ler_f',
271 	 p_parent_key_column3	=> 'ler_id',
272 	 p_parent_key_value3	=> l_parent_key_value3,
273 	 p_parent_table_name4	=> 'ben_ler_f',
274 	 p_parent_key_column4	=> 'ler_id',
275 	 p_parent_key_value4	=> l_parent_key_value4,
276 	 p_parent_table_name5	=> 'ben_ler_f',
277 	 p_parent_key_column5	=> 'ler_id',
278 	 p_parent_key_value5	=> l_parent_key_value5,
279 	 p_parent_table_name6	=> 'ben_ler_f',
280 	 p_parent_key_column6	=> 'ler_id',
281 	 p_parent_key_value6	=> l_parent_key_value6,
282 	 p_parent_table_name7	=> 'ben_ler_f',
283 	 p_parent_key_column7	=> 'ler_id',
284 	 p_parent_key_value7	=> l_parent_key_value7,
285 	 p_parent_table_name8	=> 'ben_ler_f',
286 	 p_parent_key_column8	=> 'ler_id',
287 	 p_parent_key_value8	=> l_parent_key_value8,
288 	 p_parent_table_name9	=> 'ben_ler_f',
289 	 p_parent_key_column9	=> 'ler_id',
290 	 p_parent_key_value9	=> l_parent_key_value9,
291 	 p_parent_table_name10	=> 'ben_ler_f',
292 	 p_parent_key_column10	=> 'ler_id',
293 	 p_parent_key_value10	=> l_parent_key_value10,
294 	 p_zap			=> l_zap,
295 	 p_delete		=> l_delete,
296 	 p_future_change	=> l_future_change,
297 	 p_delete_next_change	=> l_delete_next_change);
298   --
299   dt_api.find_dt_del_modes
300 	(p_effective_date	=> p_effective_date,
301 	 p_base_table_name	=> 'ben_clpse_lf_evt_f',
302 	 p_base_key_column	=> 'clpse_lf_evt_id',
303 	 p_base_key_value	=> p_base_key_value,
304 	 p_parent_table_name2 	=> 'ben_ler_f',
305 	 p_parent_key_column2 	=> 'ler_id',
306 	 p_parent_key_value2 	=> l_parent_key_value11,
307 	 p_zap			=> l_zap1,
308 	 p_delete		=> l_delete1,
309 	 p_future_change	=> l_future_change1,
310 	 p_delete_next_change	=> l_delete_next_change1);
311   --
312   if l_zap and l_zap1 then
313     --
314     p_zap := true;
315     --
316   else
317     --
318     p_zap := false;
319     --
320   end if;
321   --
322   if l_delete and l_delete1 then
323     --
324     p_delete := true;
325     --
326   else
327     --
328     p_delete := false;
329     --
330   end if;
331   --
332   if l_future_change and l_future_change1 then
333     --
334     p_future_change := true;
335     --
336   else
337     --
338     p_future_change := false;
339     --
340   end if;
341   --
342   if l_delete_next_change and l_delete_next_change1 then
343     --
344     p_delete_next_change := true;
345     --
346   else
347     --
348     p_delete_next_change := false;
349     --
350   end if;
351   --
352   hr_utility.set_location(' Leaving:'||l_proc, 10);
353   --
354 End find_dt_del_modes;
355 --
356 -- ----------------------------------------------------------------------------
357 -- |--------------------------< find_dt_upd_modes >---------------------------|
358 -- ----------------------------------------------------------------------------
359 Procedure find_dt_upd_modes
360 	(p_effective_date	in  date,
361 	 p_base_key_value	in  number,
362 	 p_correction	 out nocopy boolean,
363 	 p_update	 out nocopy boolean,
364 	 p_update_override out nocopy boolean,
365 	 p_update_change_insert out nocopy boolean) is
366 --
367   l_proc 	varchar2(72) := g_package||'find_dt_upd_modes';
368 --
369 Begin
370   hr_utility.set_location('Entering:'||l_proc, 5);
371   --
372   -- Call the corresponding datetrack api
373   --
374   dt_api.find_dt_upd_modes
375 	(p_effective_date	=> p_effective_date,
376 	 p_base_table_name	=> 'ben_clpse_lf_evt_f',
377 	 p_base_key_column	=> 'clpse_lf_evt_id',
378 	 p_base_key_value	=> p_base_key_value,
379 	 p_correction		=> p_correction,
380 	 p_update		=> p_update,
381 	 p_update_override	=> p_update_override,
382 	 p_update_change_insert	=> p_update_change_insert);
383   --
384   hr_utility.set_location(' Leaving:'||l_proc, 10);
385 End find_dt_upd_modes;
386 --
387 -- ----------------------------------------------------------------------------
388 -- |------------------------< upd_effective_end_date >------------------------|
389 -- ----------------------------------------------------------------------------
390 Procedure upd_effective_end_date
391 	(p_effective_date		in date,
392 	 p_base_key_value		in number,
393 	 p_new_effective_end_date	in date,
394 	 p_validation_start_date	in date,
395 	 p_validation_end_date		in date,
396          p_object_version_number       out nocopy number) is
397 --
398   l_proc 		  varchar2(72) := g_package||'upd_effective_end_date';
399   l_object_version_number number;
400 --
401 Begin
402   hr_utility.set_location('Entering:'||l_proc, 5);
403   --
404   -- Because we are updating a row we must get the next object
405   -- version number.
406   --
407   l_object_version_number :=
408     dt_api.get_object_version_number
409 	(p_base_table_name	=> 'ben_clpse_lf_evt_f',
410 	 p_base_key_column	=> 'clpse_lf_evt_id',
411 	 p_base_key_value	=> p_base_key_value);
412   --
413   hr_utility.set_location(l_proc, 10);
414   g_api_dml := true;  -- Set the api dml status
415   --
416   -- Update the specified datetrack row setting the effective
417   -- end date to the specified new effective end date.
418   --
419   update  ben_clpse_lf_evt_f t
420   set	  t.effective_end_date	  = p_new_effective_end_date,
421 	  t.object_version_number = l_object_version_number
422   where	  t.clpse_lf_evt_id	  = p_base_key_value
423   and	  p_effective_date
424   between t.effective_start_date and t.effective_end_date;
425   --
426   g_api_dml := false;   -- Unset the api dml status
427   p_object_version_number := l_object_version_number;
428   hr_utility.set_location(' Leaving:'||l_proc, 15);
429 --
430 Exception
431   When Others Then
432     g_api_dml := false;   -- Unset the api dml status
433     Raise;
434 End upd_effective_end_date;
435 --
436 -- ----------------------------------------------------------------------------
437 -- |---------------------------------< lck >----------------------------------|
438 -- ----------------------------------------------------------------------------
439 Procedure lck
440 	(p_effective_date	 in  date,
441 	 p_datetrack_mode	 in  varchar2,
442 	 p_clpse_lf_evt_id	 in  number,
443 	 p_object_version_number in  number,
444 	 p_validation_start_date out nocopy date,
445 	 p_validation_end_date	 out nocopy date) is
446 --
447   l_proc		   varchar2(72) := g_package||'lck';
448   l_validation_start_date  date;
449   l_validation_end_date	   date;
450   l_validation_start_date1 date;
451   l_validation_end_date1   date;
452   l_object_invalid 	   exception;
453   l_argument		   varchar2(30);
454   --
458   Cursor C_Sel1 is
455   -- Cursor C_Sel1 selects the current locked row as of session date
456   -- ensuring that the object version numbers match.
457   --
459     select
460 	clpse_lf_evt_id,
461 	effective_start_date,
462 	effective_end_date,
463 	business_group_id,
464 	seq,
465 	ler1_id,
466 	bool1_cd,
467 	ler2_id,
468 	bool2_cd,
469 	ler3_id,
470 	bool3_cd,
471 	ler4_id,
472 	bool4_cd,
473 	ler5_id,
474 	bool5_cd,
475 	ler6_id,
476 	bool6_cd,
477 	ler7_id,
478 	bool7_cd,
479 	ler8_id,
480 	bool8_cd,
481 	ler9_id,
482 	bool9_cd,
483 	ler10_id,
484 	eval_cd,
485 	eval_rl,
486 	tlrnc_dys_num,
487 	eval_ler_id,
488 	eval_ler_det_cd,
489 	eval_ler_det_rl,
490 	clp_attribute_category,
491 	clp_attribute1,
492 	clp_attribute2,
493 	clp_attribute3,
494 	clp_attribute4,
495 	clp_attribute5,
496 	clp_attribute6,
497 	clp_attribute7,
498 	clp_attribute8,
499 	clp_attribute9,
500 	clp_attribute10,
501 	clp_attribute11,
502 	clp_attribute12,
503 	clp_attribute13,
504 	clp_attribute14,
505 	clp_attribute15,
506 	clp_attribute16,
507 	clp_attribute17,
508 	clp_attribute18,
509 	clp_attribute19,
510 	clp_attribute20,
511 	clp_attribute21,
512 	clp_attribute22,
513 	clp_attribute23,
514 	clp_attribute24,
515 	clp_attribute25,
516 	clp_attribute26,
517 	clp_attribute27,
518 	clp_attribute28,
519 	clp_attribute29,
520 	clp_attribute30,
521 	object_version_number
522     from    ben_clpse_lf_evt_f
523     where   clpse_lf_evt_id         = p_clpse_lf_evt_id
524     and	    p_effective_date
525     between effective_start_date and effective_end_date
526     for update nowait;
527   --
528   --
529   --
530 Begin
531   hr_utility.set_location('Entering:'||l_proc, 5);
532   --
533   -- Ensure that all the mandatory arguments are not null
534   --
535   hr_api.mandatory_arg_error(p_api_name       => l_proc,
536                              p_argument       => 'effective_date',
537                              p_argument_value => p_effective_date);
538   --
539   hr_api.mandatory_arg_error(p_api_name       => l_proc,
540                              p_argument       => 'datetrack_mode',
541                              p_argument_value => p_datetrack_mode);
542   --
543   hr_api.mandatory_arg_error(p_api_name       => l_proc,
544                              p_argument       => 'clpse_lf_evt_id',
545                              p_argument_value => p_clpse_lf_evt_id);
546   --
547   hr_api.mandatory_arg_error(p_api_name       => l_proc,
548                              p_argument       => 'object_version_number',
549                              p_argument_value => p_object_version_number);
550   --
551   -- Check to ensure the datetrack mode is not INSERT.
552   --
553   If (p_datetrack_mode <> 'INSERT') then
554     --
555     -- We must select and lock the current row.
556     --
557     Open  C_Sel1;
558     Fetch C_Sel1 Into g_old_rec;
559     If C_Sel1%notfound then
560       Close C_Sel1;
561       --
562       -- The primary key is invalid therefore we must error
563       --
564       hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
565       hr_utility.raise_error;
566     End If;
567     Close C_Sel1;
568     If (p_object_version_number <> g_old_rec.object_version_number) Then
569         hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
570         hr_utility.raise_error;
571       End If;
572     hr_utility.set_location(l_proc, 15);
573     --
574     --
575     -- Validate the datetrack mode mode getting the validation start
576     -- and end dates for the specified datetrack operation.
577     --
578     dt_api.validate_dt_mode
579 	(p_effective_date	   => p_effective_date,
580 	 p_datetrack_mode	   => p_datetrack_mode,
581 	 p_base_table_name	   => 'ben_clpse_lf_evt_f',
582 	 p_base_key_column	   => 'clpse_lf_evt_id',
583 	 p_base_key_value 	   => p_clpse_lf_evt_id,
584 	 p_parent_table_name1      => 'ben_ler_f',
585 	 p_parent_key_column1      => 'ler_id',
586 	 p_parent_key_value1       => g_old_rec.ler1_id,
587 	 p_parent_table_name2      => 'ben_ler_f',
588 	 p_parent_key_column2      => 'ler_id',
589 	 p_parent_key_value2       => g_old_rec.ler2_id,
590 	 p_parent_table_name3      => 'ben_ler_f',
591 	 p_parent_key_column3      => 'ler_id',
592 	 p_parent_key_value3       => g_old_rec.ler3_id,
593 	 p_parent_table_name4      => 'ben_ler_f',
594 	 p_parent_key_column4      => 'ler_id',
595 	 p_parent_key_value4       => g_old_rec.ler4_id,
596 	 p_parent_table_name5      => 'ben_ler_f',
597 	 p_parent_key_column5      => 'ler_id',
598 	 p_parent_key_value5       => g_old_rec.ler5_id,
599 	 p_parent_table_name6      => 'ben_ler_f',
600 	 p_parent_key_column6      => 'ler_id',
601 	 p_parent_key_value6       => g_old_rec.ler6_id,
602 	 p_parent_table_name7      => 'ben_ler_f',
603 	 p_parent_key_column7      => 'ler_id',
604 	 p_parent_key_value7       => g_old_rec.ler7_id,
605 	 p_parent_table_name8      => 'ben_ler_f',
606 	 p_parent_key_column8      => 'ler_id',
610 	 p_parent_key_value9       => g_old_rec.ler9_id,
607 	 p_parent_key_value8       => g_old_rec.ler8_id,
608 	 p_parent_table_name9      => 'ben_ler_f',
609 	 p_parent_key_column9      => 'ler_id',
611 	 p_parent_table_name10     => 'ben_ler_f',
612 	 p_parent_key_column10     => 'ler_id',
613 	 p_parent_key_value10      => g_old_rec.ler10_id,
614          p_enforce_foreign_locking => true,
615 	 p_validation_start_date   => l_validation_start_date,
616  	 p_validation_end_date	   => l_validation_end_date);
617     --
618     dt_api.validate_dt_mode
619 	(p_effective_date	   => p_effective_date,
620 	 p_datetrack_mode	   => p_datetrack_mode,
621 	 p_base_table_name	   => 'ben_clpse_lf_evt_f',
622 	 p_base_key_column	   => 'clpse_lf_evt_id',
623 	 p_base_key_value 	   => p_clpse_lf_evt_id,
624 	 p_parent_table_name1      => 'ben_ler_f',
625 	 p_parent_key_column1      => 'eval_ler_id',
626 	 p_parent_key_value1       => g_old_rec.eval_ler_id,
627          p_enforce_foreign_locking => true,
628 	 p_validation_start_date   => l_validation_start_date1,
629  	 p_validation_end_date	   => l_validation_end_date1);
630     --
631   Else
632     --
633     -- We are doing a datetrack 'INSERT' which is illegal within this
634     -- procedure therefore we must error (note: to lck on insert the
635     -- private procedure ins_lck should be called).
636     --
637     hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
638     hr_utility.set_message_token('PROCEDURE', l_proc);
639     hr_utility.set_message_token('STEP','20');
640     hr_utility.raise_error;
641     --
642   End If;
643   --
644   -- Set the validation start and end date OUT arguments
645   --
646   if l_validation_start_date > l_validation_start_date1 then
647     --
648     p_validation_start_date := l_validation_start_date;
649     --
650   else
651     --
652     p_validation_start_date := l_validation_start_date1;
653     --
654   end if;
655   --
656   if l_validation_end_date > l_validation_end_date1 then
657     --
658     p_validation_end_date := l_validation_end_date;
659     --
660   else
661     --
662     p_validation_end_date := l_validation_end_date1;
663     --
664   end if;
665   --
666   hr_utility.set_location(' Leaving:'||l_proc, 30);
667 --
668 -- We need to trap the ORA LOCK exception
669 --
670 Exception
671   When HR_Api.Object_Locked then
672     --
673     -- The object is locked therefore we need to supply a meaningful
674     -- error message.
675     --
676     hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
677     hr_utility.set_message_token('TABLE_NAME', 'ben_clpse_lf_evt_f');
678     hr_utility.raise_error;
679   When l_object_invalid then
680     --
681     -- The object doesn't exist or is invalid
682     --
683     hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
684     hr_utility.set_message_token('TABLE_NAME', 'ben_clpse_lf_evt_f');
685     hr_utility.raise_error;
686 End lck;
687 --
688 -- ----------------------------------------------------------------------------
689 -- |-----------------------------< convert_args >-----------------------------|
690 -- ----------------------------------------------------------------------------
691 Function convert_args
692 	(
693 	p_clpse_lf_evt_id               in number,
694 	p_effective_start_date          in date,
695 	p_effective_end_date            in date,
696 	p_business_group_id             in number,
697 	p_seq                           in number,
698 	p_ler1_id                       in number,
699 	p_bool1_cd                      in varchar2,
700 	p_ler2_id                       in number,
701 	p_bool2_cd                      in varchar2,
702 	p_ler3_id                       in number,
703 	p_bool3_cd                      in varchar2,
704 	p_ler4_id                       in number,
705 	p_bool4_cd                      in varchar2,
706 	p_ler5_id                       in number,
707 	p_bool5_cd                      in varchar2,
708 	p_ler6_id                       in number,
709 	p_bool6_cd                      in varchar2,
710 	p_ler7_id                       in number,
711 	p_bool7_cd                      in varchar2,
712 	p_ler8_id                       in number,
713 	p_bool8_cd                      in varchar2,
714 	p_ler9_id                       in number,
715 	p_bool9_cd                      in varchar2,
716 	p_ler10_id                      in number,
717 	p_eval_cd                       in varchar2,
718 	p_eval_rl                       in number,
719 	p_tlrnc_dys_num                 in number,
720 	p_eval_ler_id                   in number,
721 	p_eval_ler_det_cd               in varchar2,
722 	p_eval_ler_det_rl               in number,
723 	p_clp_attribute_category        in varchar2,
724 	p_clp_attribute1                in varchar2,
725 	p_clp_attribute2                in varchar2,
726 	p_clp_attribute3                in varchar2,
727 	p_clp_attribute4                in varchar2,
728 	p_clp_attribute5                in varchar2,
729 	p_clp_attribute6                in varchar2,
730 	p_clp_attribute7                in varchar2,
731 	p_clp_attribute8                in varchar2,
732 	p_clp_attribute9                in varchar2,
733 	p_clp_attribute10               in varchar2,
734 	p_clp_attribute11               in varchar2,
735 	p_clp_attribute12               in varchar2,
736 	p_clp_attribute13               in varchar2,
737 	p_clp_attribute14               in varchar2,
738 	p_clp_attribute15               in varchar2,
739 	p_clp_attribute16               in varchar2,
740 	p_clp_attribute17               in varchar2,
741 	p_clp_attribute18               in varchar2,
742 	p_clp_attribute19               in varchar2,
743 	p_clp_attribute20               in varchar2,
744 	p_clp_attribute21               in varchar2,
745 	p_clp_attribute22               in varchar2,
746 	p_clp_attribute23               in varchar2,
747 	p_clp_attribute24               in varchar2,
748 	p_clp_attribute25               in varchar2,
749 	p_clp_attribute26               in varchar2,
750 	p_clp_attribute27               in varchar2,
751 	p_clp_attribute28               in varchar2,
752 	p_clp_attribute29               in varchar2,
753 	p_clp_attribute30               in varchar2,
754 	p_object_version_number         in number
755 	)
756 	Return g_rec_type is
757 --
758   l_rec	  g_rec_type;
759   l_proc  varchar2(72) := g_package||'convert_args';
760 --
761 Begin
762   --
763   hr_utility.set_location('Entering:'||l_proc, 5);
764   --
765   -- Convert arguments into local l_rec structure.
766   --
767   l_rec.clpse_lf_evt_id                  := p_clpse_lf_evt_id;
768   l_rec.effective_start_date             := p_effective_start_date;
769   l_rec.effective_end_date               := p_effective_end_date;
770   l_rec.business_group_id                := p_business_group_id;
771   l_rec.seq                              := p_seq;
772   l_rec.ler1_id                          := p_ler1_id;
773   l_rec.bool1_cd                         := p_bool1_cd;
774   l_rec.ler2_id                          := p_ler2_id;
775   l_rec.bool2_cd                         := p_bool2_cd;
776   l_rec.ler3_id                          := p_ler3_id;
777   l_rec.bool3_cd                         := p_bool3_cd;
778   l_rec.ler4_id                          := p_ler4_id;
779   l_rec.bool4_cd                         := p_bool4_cd;
780   l_rec.ler5_id                          := p_ler5_id;
781   l_rec.bool5_cd                         := p_bool5_cd;
782   l_rec.ler6_id                          := p_ler6_id;
783   l_rec.bool6_cd                         := p_bool6_cd;
784   l_rec.ler7_id                          := p_ler7_id;
785   l_rec.bool7_cd                         := p_bool7_cd;
786   l_rec.ler8_id                          := p_ler8_id;
787   l_rec.bool8_cd                         := p_bool8_cd;
788   l_rec.ler9_id                          := p_ler9_id;
789   l_rec.bool9_cd                         := p_bool9_cd;
790   l_rec.ler10_id                         := p_ler10_id;
791   l_rec.eval_cd                          := p_eval_cd;
792   l_rec.eval_rl                          := p_eval_rl;
793   l_rec.tlrnc_dys_num                    := p_tlrnc_dys_num;
794   l_rec.eval_ler_id                      := p_eval_ler_id;
795   l_rec.eval_ler_det_cd                  := p_eval_ler_det_cd;
796   l_rec.eval_ler_det_rl                  := p_eval_ler_det_rl;
797   l_rec.clp_attribute_category           := p_clp_attribute_category;
798   l_rec.clp_attribute1                   := p_clp_attribute1;
799   l_rec.clp_attribute2                   := p_clp_attribute2;
800   l_rec.clp_attribute3                   := p_clp_attribute3;
801   l_rec.clp_attribute4                   := p_clp_attribute4;
802   l_rec.clp_attribute5                   := p_clp_attribute5;
803   l_rec.clp_attribute6                   := p_clp_attribute6;
804   l_rec.clp_attribute7                   := p_clp_attribute7;
805   l_rec.clp_attribute8                   := p_clp_attribute8;
806   l_rec.clp_attribute9                   := p_clp_attribute9;
807   l_rec.clp_attribute10                  := p_clp_attribute10;
808   l_rec.clp_attribute11                  := p_clp_attribute11;
809   l_rec.clp_attribute12                  := p_clp_attribute12;
810   l_rec.clp_attribute13                  := p_clp_attribute13;
811   l_rec.clp_attribute14                  := p_clp_attribute14;
812   l_rec.clp_attribute15                  := p_clp_attribute15;
813   l_rec.clp_attribute16                  := p_clp_attribute16;
814   l_rec.clp_attribute17                  := p_clp_attribute17;
815   l_rec.clp_attribute18                  := p_clp_attribute18;
816   l_rec.clp_attribute19                  := p_clp_attribute19;
817   l_rec.clp_attribute20                  := p_clp_attribute20;
818   l_rec.clp_attribute21                  := p_clp_attribute21;
819   l_rec.clp_attribute22                  := p_clp_attribute22;
820   l_rec.clp_attribute23                  := p_clp_attribute23;
821   l_rec.clp_attribute24                  := p_clp_attribute24;
822   l_rec.clp_attribute25                  := p_clp_attribute25;
823   l_rec.clp_attribute26                  := p_clp_attribute26;
824   l_rec.clp_attribute27                  := p_clp_attribute27;
825   l_rec.clp_attribute28                  := p_clp_attribute28;
826   l_rec.clp_attribute29                  := p_clp_attribute29;
827   l_rec.clp_attribute30                  := p_clp_attribute30;
828   l_rec.object_version_number            := p_object_version_number;
829   --
830   -- Return the plsql record structure.
831   --
832   hr_utility.set_location(' Leaving:'||l_proc, 10);
833   Return(l_rec);
834 --
835 End convert_args;
836 --
837 end ben_clp_shd;