DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PEN_SHD

Source


1 Package Body ben_pen_shd as
2 /* $Header: bepenrhi.pkb 120.23.12020000.2 2012/07/03 14:17:34 amnaraya ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_pen_shd.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------------------------< return_api_dml_status >-------------------------|
12 -- ----------------------------------------------------------------------------
13 Function return_api_dml_status Return Boolean Is
14   l_proc 	varchar2(72) := g_package||'return_api_dml_status';
15 Begin
16   hr_utility.set_location('Entering:'||l_proc, 5);
17   Return (nvl(g_api_dml, false));
18   hr_utility.set_location(' Leaving:'||l_proc, 10);
19 End return_api_dml_status;
20 --
21 -- ----------------------------------------------------------------------------
22 -- |---------------------------< constraint_error >---------------------------|
23 -- ----------------------------------------------------------------------------
24 Procedure constraint_error
25             (p_constraint_name in all_constraints.constraint_name%TYPE) Is
26   l_proc 	varchar2(72) := g_package||'constraint_error';
27 Begin
28   hr_utility.set_location('Entering:'||l_proc, 5);
29   If (p_constraint_name = 'BEN_PRTT_ENRT_RSLT_PK') Then
30     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
31     fnd_message.set_token('PROCEDURE', l_proc);
32     fnd_message.set_token('STEP','5');
33     fnd_message.raise_error;
34   ElsIf (p_constraint_name = 'BEN_PRTT_ENR_RSLT_FK6') Then
35     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
36     fnd_message.set_token('PROCEDURE', l_proc);
37     fnd_message.set_token('STEP','10');
38     fnd_message.raise_error;
39   Else
40     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
41     fnd_message.set_token('PROCEDURE', l_proc);
42     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
43     fnd_message.raise_error;
44   End If;
45   hr_utility.set_location(' Leaving:'||l_proc, 10);
46 End constraint_error;
47 --
48 -- ----------------------------------------------------------------------------
49 -- |-----------------------------< api_updating >-----------------------------|
50 -- ----------------------------------------------------------------------------
51 --
52 Function api_updating
53   (p_effective_date		in date,
54    p_prtt_enrt_rslt_id		in number,
55    p_object_version_number	in number
56   ) Return Boolean Is
57   --
58   -- Cursor selects the 'current' row from the HR Schema
59   --
60   Cursor C_Sel1 is
61     select prtt_enrt_rslt_id
62            ,effective_start_date
63            ,effective_end_date
64            ,business_group_id
65            ,oipl_id
66            ,person_id
67            ,assignment_id
68            ,pgm_id
69            ,pl_id
70            ,rplcs_sspndd_rslt_id
71            ,ptip_id
72            ,pl_typ_id
73            ,ler_id
74            ,sspndd_flag
75            ,prtt_is_cvrd_flag
76            ,bnft_amt
77            ,uom
78            ,orgnl_enrt_dt
79            ,enrt_mthd_cd
80            ,no_lngr_elig_flag
81            ,enrt_ovridn_flag
82            ,enrt_ovrid_rsn_cd
83            ,erlst_deenrt_dt
84            ,enrt_cvg_strt_dt
85            ,enrt_cvg_thru_dt
86            ,enrt_ovrid_thru_dt
87            ,pl_ordr_num
88            ,plip_ordr_num
89            ,ptip_ordr_num
90            ,oipl_ordr_num
91            ,pen_attribute_category
92            ,pen_attribute1
93            ,pen_attribute2
94            ,pen_attribute3
95            ,pen_attribute4
96            ,pen_attribute5
97            ,pen_attribute6
98            ,pen_attribute7
99            ,pen_attribute8
100            ,pen_attribute9
101            ,pen_attribute10
102            ,pen_attribute11
103            ,pen_attribute12
104            ,pen_attribute13
105            ,pen_attribute14
106            ,pen_attribute15
107            ,pen_attribute16
108            ,pen_attribute17
109            ,pen_attribute18
110            ,pen_attribute19
111            ,pen_attribute20
112            ,pen_attribute21
113            ,pen_attribute22
114            ,pen_attribute23
115            ,pen_attribute24
116            ,pen_attribute25
117            ,pen_attribute26
118            ,pen_attribute27
119            ,pen_attribute28
120            ,pen_attribute29
121            ,pen_attribute30
122            ,request_id
123            ,program_application_id
124            ,program_id
125            ,program_update_date
126            ,object_version_number
127            ,per_in_ler_id
128            ,bnft_typ_cd
129            ,bnft_ordr_num
130            ,prtt_enrt_rslt_stat_cd
131            ,bnft_nnmntry_uom
132            ,comp_lvl_cd
133       from ben_prtt_enrt_rslt_f
134      where prtt_enrt_rslt_id = p_prtt_enrt_rslt_id
135        and p_effective_date between
136               effective_start_date and effective_end_date;
137   l_proc	varchar2(72)	:= g_package||'api_updating';
138   l_fct_ret	boolean;
139 Begin
140   hr_utility.set_location('Entering:'||l_proc, 5);
141   If (p_effective_date is null or
142       p_prtt_enrt_rslt_id is null or
143       p_object_version_number is null) Then
144       --
145       -- One of the primary key arguments is null therefore we must
146       -- set the returning function value to false
147       --
148       l_fct_ret := false;
149   Else
150       If (p_prtt_enrt_rslt_id = g_old_rec.prtt_enrt_rslt_id
151           and p_object_version_number = g_old_rec.object_version_number) Then
152           hr_utility.set_location(l_proc, 10);
153           --
154           -- The g_old_rec is current therefore we must
155           -- set the returning function to true
156           --
157           l_fct_ret := true;
158       Else
159           --
160           -- Select the current row
161           --
162           Open C_Sel1;
163           Fetch C_Sel1 Into g_old_rec;
164           If C_Sel1%notfound Then
165               Close C_Sel1;
166               --
167               -- The primary key is invalid therefore we must error
168               --
169               fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
170               fnd_message.raise_error;
171           End If;
172           Close C_Sel1;
173           If (p_object_version_number <> g_old_rec.object_version_number) Then
174               fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
175               fnd_message.raise_error;
176           End If;
177           hr_utility.set_location(l_proc, 15);
178           l_fct_ret := true;
179       End If;
180   End If;
181   hr_utility.set_location(' Leaving:'||l_proc, 20);
182   Return (l_fct_ret);
183 End api_updating;
184 --
185 -- ----------------------------------------------------------------------------
186 -- |--------------------------< find_dt_del_modes >---------------------------|
187 -- ----------------------------------------------------------------------------
188 Procedure find_dt_del_modes
189     (p_effective_date	in     date
190     ,p_base_key_value	in     number
191     ,p_zap			       out nocopy boolean
192     ,p_delete		       out nocopy boolean
193     ,p_future_change	   out nocopy boolean
194     ,p_delete_next_change  out nocopy boolean
195     ) is
196   l_proc 		varchar2(72) 	:= g_package||'find_dt_del_modes';
197   l_parent_key_value1	number;
198   l_parent_key_value2	number;
199   l_parent_key_value3	number;
200   l_parent_key_value4	number;
201   l_parent_key_value5	number;
202   l_parent_key_value6	number;
203   l_parent_key_value7   number;
204   Cursor C_Sel1 Is
205     select t.pgm_id
206            ,t.oipl_id
207            ,t.pl_id
208            ,t.pl_typ_id
209            ,t.prtt_enrt_rslt_id
210            ,t.ptip_id
211            ,t.ler_id
212       from ben_prtt_enrt_rslt_f t
213      where t.prtt_enrt_rslt_id = p_base_key_value
214        and p_effective_date between
215                 t.effective_start_date and t.effective_end_date;
216 --
217 Begin
218     hr_utility.set_location('Entering:'||l_proc, 5);
219     Open  C_Sel1;
220     Fetch C_Sel1 Into l_parent_key_value1
221               ,l_parent_key_value2
222       	      ,l_parent_key_value3
223               ,l_parent_key_value4
224               ,l_parent_key_value5
228         Close C_Sel1;
225               ,l_parent_key_value6
226               ,l_parent_key_value7;
227     If C_Sel1%notfound then
229         fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
230         fnd_message.set_token('PROCEDURE', l_proc);
231         fnd_message.set_token('STEP','10');
232         fnd_message.raise_error;
233     End If;
234     Close C_Sel1;
235     --
236     -- Call the corresponding datetrack api
237     --
238     dt_api.find_dt_del_modes
239           (p_effective_date     => p_effective_date
240           ,p_base_table_name    => 'ben_prtt_enrt_rslt_f'
241           ,p_base_key_column    => 'prtt_enrt_rslt_id'
242           ,p_base_key_value	    => p_base_key_value
243           ,p_parent_table_name1	=> 'ben_pgm_f'
244           ,p_parent_key_column1	=> 'pgm_id'
245           ,p_parent_key_value1	=> l_parent_key_value1
246           ,p_parent_table_name2	=> 'ben_oipl_f'
247           ,p_parent_key_column2	=> 'oipl_id'
248           ,p_parent_key_value2	=> l_parent_key_value2
249           ,p_parent_table_name3	=> 'ben_pl_f'
250           ,p_parent_key_column3	=> 'pl_id'
251           ,p_parent_key_value3	=> l_parent_key_value3
252           ,p_parent_table_name4	=> 'ben_pl_typ_f'
253           ,p_parent_key_column4	=> 'pl_typ_id'
254           ,p_parent_key_value4	=> l_parent_key_value4
255           ,p_parent_table_name5	=> 'ben_prtt_enrt_rslt_f'
256           ,p_parent_key_column5	=> 'prtt_enrt_rslt_id'
257           ,p_parent_key_value5	=> l_parent_key_value5
258           ,p_parent_table_name6 => 'ben_ptip_f'
259           ,p_parent_key_column6 => 'ptip_id'
260           ,p_parent_key_value6  => l_parent_key_value6
261           ,p_parent_table_name7 => 'ben_ler_f'
262           ,p_parent_key_column7 => 'ler_id'
263           ,p_parent_key_value7  => l_parent_key_value7
264           ,p_zap                => p_zap
265           ,p_delete             => p_delete
266           ,p_future_change      => p_future_change
267           ,p_delete_next_change	=> p_delete_next_change
268         );
269   hr_utility.set_location(' Leaving:'||l_proc, 10);
270 End find_dt_del_modes;
271 --
272 -- ----------------------------------------------------------------------------
273 -- |--------------------------< find_dt_upd_modes >---------------------------|
274 -- ----------------------------------------------------------------------------
275 --
276 Procedure find_dt_upd_modes
277     (p_effective_date	in     date
278     ,p_base_key_value	in     number
279     ,p_correction		   out nocopy boolean
280     ,p_update		   out nocopy boolean
281     ,p_update_override	   out nocopy boolean
282     ,p_update_change_insert	   out nocopy boolean
283         ) is
284   l_proc 	varchar2(72) := g_package||'find_dt_upd_modes';
285 Begin
286     hr_utility.set_location('Entering:'||l_proc, 5);
287     --
288     -- Call the corresponding datetrack api
289     --
290     dt_api.find_dt_upd_modes
291          (p_effective_date	=> p_effective_date
292          ,p_base_table_name	=> 'ben_prtt_enrt_rslt_f'
293          ,p_base_key_column	=> 'prtt_enrt_rslt_id'
294          ,p_base_key_value	=> p_base_key_value
295          ,p_correction		=> p_correction
296          ,p_update		=> p_update
297          ,p_update_override	=> p_update_override
298          ,p_update_change_insert	=> p_update_change_insert
299          );
300   hr_utility.set_location(' Leaving:'||l_proc, 10);
301 End find_dt_upd_modes;
302 --
303 -- ----------------------------------------------------------------------------
304 -- |------------------------< upd_effective_end_date >------------------------|
305 -- ----------------------------------------------------------------------------
306 -- *** THIS PROCEDURE IS OVERLOADED. PLEASE MAKE CHANGES TO BOTH PROCEDURES *****
307 Procedure upd_effective_end_date
308     (p_effective_date		in     date
309     ,p_base_key_value		in     number
310     ,p_new_effective_end_date	in     date
311     ,p_validation_start_date	in     date
312     ,p_validation_end_date		in     date
313         ,p_object_version_number           out nocopy number) is
314   l_proc 		  varchar2(72) := g_package||'upd_effective_end_date';
315   l_object_version_number number;
316 Begin
317     hr_utility.set_location('Entering:'||l_proc, 5);
318     --
319     -- Because we are updating a row we must get the next object
320     -- version number.
321     --
322     l_object_version_number :=
323               dt_api.get_object_version_number
324                       (p_base_table_name   => 'ben_prtt_enrt_rslt_f'
325                       ,p_base_key_column   => 'prtt_enrt_rslt_id'
326                       ,p_base_key_value    => p_base_key_value
327                           );
328     hr_utility.set_location(l_proc, 10);
329     g_api_dml := true;  -- Set the api dml status
330     --
331     -- Update the specified datetrack row setting the effective
332     -- end date to the specified new effective end date.
333     --
334     update ben_prtt_enrt_rslt_f t
335         set t.effective_end_date = p_new_effective_end_date
336             ,t.object_version_number = l_object_version_number
337       where t.prtt_enrt_rslt_id = p_base_key_value
338         and p_effective_date between
339                 t.effective_start_date and t.effective_end_date;
340     g_api_dml := false;          -- Unset the api dml status
341     p_object_version_number := l_object_version_number;
342     hr_utility.set_location(' Leaving:'||l_proc, 15);
343 Exception
344     When Others Then
345         g_api_dml := false;   -- Unset the api dml status
346         Raise;
347 End upd_effective_end_date;
348 --
352 -- *** THIS PROCEDURE IS OVERLOADED. PLEASE MAKE CHANGES TO BOTH PROCEDURES *****
349 -- ----------------------------------------------------------------------------
350 -- |------------------------< upd_effective_end_date >------------------------|
351 -- ----------------------------------------------------------------------------
353 -- 3843657: When PEN record is date-track VOID-ed,
354 -- both the new and old records' prtt_enrt_rslt_stat_cd is set to VOIDD.
355 --
356 Procedure upd_effective_end_date
357     (p_effective_date		in     date
358     ,p_base_key_value		in     number
359     ,p_new_effective_end_date	in     date
360     ,p_validation_start_date	in     date
361     ,p_validation_end_date		in     date
362     ,p_prtt_enrt_rslt_stat_cd    in varchar2
363     ,p_object_version_number    out nocopy number) is
364   l_proc 		  varchar2(72) := g_package||'upd_effective_end_date';
365   l_object_version_number number;
366 Begin
367     hr_utility.set_location('Entering:'||l_proc, 5);
368     --
369     -- Because we are updating a row we must get the next object
370     -- version number.
371     --
372     l_object_version_number :=
373               dt_api.get_object_version_number
374                       (p_base_table_name   => 'ben_prtt_enrt_rslt_f'
375                       ,p_base_key_column   => 'prtt_enrt_rslt_id'
376                       ,p_base_key_value    => p_base_key_value
377                           );
378     hr_utility.set_location(l_proc, 10);
379     g_api_dml := true;  -- Set the api dml status
380     --
381     -- Update the specified datetrack row setting the effective
382     -- end date to the specified new effective end date.
383     --
384     update ben_prtt_enrt_rslt_f t
385         set t.effective_end_date = p_new_effective_end_date
386             ,t.object_version_number = l_object_version_number
387             ,t.prtt_enrt_rslt_stat_cd = p_prtt_enrt_rslt_stat_cd
388       where t.prtt_enrt_rslt_id = p_base_key_value
389         and p_effective_date between
390                 t.effective_start_date and t.effective_end_date;
391     g_api_dml := false;          -- Unset the api dml status
392     p_object_version_number := l_object_version_number;
393     hr_utility.set_location(' Leaving:'||l_proc, 15);
394 Exception
395     When Others Then
396         g_api_dml := false;   -- Unset the api dml status
397         Raise;
398 End upd_effective_end_date;
399 -- 3843657 Ends
400 
401 
402 -- ----------------------------------------------------------------------------
403 -- |---------------------------------< lck >----------------------------------|
404 -- ----------------------------------------------------------------------------
405 --
406 Procedure lck
407     (p_effective_date	 in     date
408     ,p_datetrack_mode	 in     varchar2
409     ,p_prtt_enrt_rslt_id	 in     number
410     ,p_object_version_number in     number
411     ,p_validation_start_date    out nocopy date
412     ,p_validation_end_date	    out nocopy date) is
413 --
414   l_proc		  varchar2(72) := g_package||'lck';
415   l_validation_start_date date;
416   l_validation_end_date	  date;
417   l_object_invalid 	  exception;
418   l_argument		  varchar2(30);
419   --
420   -- Cursor C_Sel1 selects the current locked row as of session date
421   -- ensuring that the object version numbers match.
422   --
423   Cursor C_Sel1 is
424     select prtt_enrt_rslt_id
425            ,effective_start_date
426            ,effective_end_date
427            ,business_group_id
428            ,oipl_id
429            ,person_id
430            ,assignment_id
431            ,pgm_id
432            ,pl_id
433            ,rplcs_sspndd_rslt_id
434            ,ptip_id
435            ,pl_typ_id
436            ,ler_id
437            ,sspndd_flag
438            ,prtt_is_cvrd_flag
439            ,bnft_amt
440            ,uom
441            ,orgnl_enrt_dt
442            ,enrt_mthd_cd
443            ,no_lngr_elig_flag
444            ,enrt_ovridn_flag
445            ,enrt_ovrid_rsn_cd
446            ,erlst_deenrt_dt
447            ,enrt_cvg_strt_dt
448            ,enrt_cvg_thru_dt
449            ,enrt_ovrid_thru_dt
450            ,pl_ordr_num
451            ,plip_ordr_num
452            ,ptip_ordr_num
453            ,oipl_ordr_num
454            ,pen_attribute_category
455            ,pen_attribute1
456            ,pen_attribute2
457            ,pen_attribute3
458            ,pen_attribute4
459            ,pen_attribute5
460            ,pen_attribute6
461            ,pen_attribute7
462            ,pen_attribute8
463            ,pen_attribute9
464            ,pen_attribute10
465            ,pen_attribute11
466            ,pen_attribute12
467            ,pen_attribute13
468            ,pen_attribute14
469            ,pen_attribute15
470            ,pen_attribute16
471            ,pen_attribute17
472            ,pen_attribute18
473            ,pen_attribute19
474            ,pen_attribute20
475            ,pen_attribute21
476            ,pen_attribute22
477            ,pen_attribute23
478            ,pen_attribute24
479            ,pen_attribute25
480            ,pen_attribute26
481            ,pen_attribute27
482            ,pen_attribute28
483            ,pen_attribute29
484            ,pen_attribute30
485            ,request_id
486            ,program_application_id
487            ,program_id
488            ,program_update_date
489            ,object_version_number
490            ,per_in_ler_id
491            ,bnft_typ_cd
495            ,comp_lvl_cd
492            ,bnft_ordr_num
493            ,prtt_enrt_rslt_stat_cd
494            ,bnft_nnmntry_uom
496       from ben_prtt_enrt_rslt_f
497      where prtt_enrt_rslt_id = p_prtt_enrt_rslt_id
498        and p_effective_date between
499                effective_start_date and effective_end_date
500     for update nowait;
501 Begin
502     hr_utility.set_location('Entering:'||l_proc, 5);
503     hr_utility.set_location('Prtt enrt rslt id:'||p_prtt_enrt_rslt_id, 5);
504     hr_utility.set_location('OVN:'||p_object_version_number, 5);
505     hr_utility.set_location('EFD:'||p_effective_date, 5);
506     hr_utility.set_location('DM:'||p_datetrack_mode, 5);
507     hr_utility.set_location('Entering:'||l_proc, 5);
508     --
509     -- Ensure that all the mandatory arguments are not null
510     --
511     hr_api.mandatory_arg_error(p_api_name       => l_proc
512                               ,p_argument       => 'effective_date'
513                               ,p_argument_value => p_effective_date
514                               );
515     hr_api.mandatory_arg_error(p_api_name       => l_proc
516                               ,p_argument       => 'datetrack_mode'
517                               ,p_argument_value => p_datetrack_mode
518                               );
519     hr_api.mandatory_arg_error(p_api_name       => l_proc
520                               ,p_argument       => 'prtt_enrt_rslt_id'
521                               ,p_argument_value => p_prtt_enrt_rslt_id
522                               );
523     hr_api.mandatory_arg_error(p_api_name       => l_proc
524                               ,p_argument       => 'object_version_number'
525                               ,p_argument_value => p_object_version_number
526                               );    --
527     -- Check to ensure the datetrack mode is not INSERT.
528     --
529     If (p_datetrack_mode <> 'INSERT') then
530         --
531         -- We must select and lock the current row.
532         --
533         Open  C_Sel1;
534         Fetch C_Sel1 Into g_old_rec;
535         If C_Sel1%notfound then
536             Close C_Sel1;
537             --
538             -- The primary key is invalid therefore we must error
539             --
540             fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
541             fnd_message.raise_error;
542         End If;
543         Close C_Sel1;
544         If (p_object_version_number <> g_old_rec.object_version_number) Then
545             fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
546             fnd_message.raise_error;
547         End If;
548         hr_utility.set_location(l_proc, 15);
549         --
550         --
551         -- Validate the datetrack mode mode getting the validation start
552         -- and end dates for the specified datetrack operation.
553         --
554     hr_utility.set_location('Here:',5);
555 
556         dt_api.validate_dt_mode
557         (p_effective_date	       => p_effective_date
558         ,p_datetrack_mode	       => p_datetrack_mode
559         ,p_base_table_name	       => 'ben_prtt_enrt_rslt_f'
560         ,p_base_key_column	       => 'prtt_enrt_rslt_id'
561         ,p_base_key_value 	       => p_prtt_enrt_rslt_id
562         ,p_parent_table_name1      => 'ben_pgm_f'
563         ,p_parent_key_column1      => 'pgm_id'
564         ,p_parent_key_value1       => g_old_rec.pgm_id
565         ,p_parent_table_name2      => 'ben_oipl_f'
566         ,p_parent_key_column2      => 'oipl_id'
567         ,p_parent_key_value2       => g_old_rec.oipl_id
568         ,p_parent_table_name3      => 'ben_pl_f'
569         ,p_parent_key_column3      => 'pl_id'
570         ,p_parent_key_value3       => g_old_rec.pl_id
571         ,p_parent_table_name4      => 'ben_pl_typ_f'
572         ,p_parent_key_column4      => 'pl_typ_id'
573         ,p_parent_key_value4       => g_old_rec.pl_typ_id
574         ,p_parent_table_name5      => 'ben_ptip_f'
575         ,p_parent_key_column5      => 'ptip_id'
576         ,p_parent_key_value5       => g_old_rec.ptip_id
577         ,p_parent_table_name6      => 'ben_ler_f'
578         ,p_parent_key_column6      => 'ler_id'
579         ,p_parent_key_value6       => g_old_rec.ler_id
580         ,p_child_table_name1       => 'ben_pl_bnf_f'
581         ,p_child_key_column1       => 'pl_bnf_id'
582         ,p_child_table_name2       => 'ben_elig_cvrd_dpnt_f'
583         ,p_child_key_column2       => 'elig_cvrd_dpnt_id'
584         ,p_child_table_name3       => 'ben_prtt_enrt_actn_f'
585         ,p_child_key_column3       => 'prtt_enrt_actn_id'
586         ,p_child_table_name4       => 'ben_prtt_enrt_ctfn_prvdd_f'
587         ,p_child_key_column4       => 'prtt_enrt_ctfn_prvdd_id'
588         ,p_child_table_name5       => 'ben_bnft_prvdd_ldgr_f'
589         ,p_child_key_column5       => 'bnft_prvdd_ldgr_id'
590         ,p_child_table_name6       => 'ben_prmry_care_prvdr_f'
591         ,p_child_key_column6       => 'prmry_care_prvdr_id'
592         ,p_child_table_name7       => 'ben_prtt_prem_f'
593         ,p_child_key_column7       => 'prtt_prem_id'
594         ,p_enforce_foreign_locking => false
595         ,p_validation_start_date   => l_validation_start_date
596  	    ,p_validation_end_date     => l_validation_end_date
597         );
598     hr_utility.set_location('Now heer:',5);
599     Else
600         --
601         -- We are doing a datetrack 'INSERT' which is illegal within this
602         -- procedure therefore we must error (note: to lck on insert the
603         -- private procedure ins_lck should be called).
604         --
605         fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
606         fnd_message.set_token('PROCEDURE', l_proc);
607         fnd_message.set_token('STEP','20');
608         fnd_message.raise_error;
609     End If;
610     --
611     -- Set the validation start and end date OUT arguments
615     hr_utility.set_location(' Leaving:'||l_proc, 30);
612     --
613     p_validation_start_date := l_validation_start_date;
614     p_validation_end_date   := l_validation_end_date;
616     --
617     -- We need to trap the ORA LOCK exception
618     --
619 Exception
620     When HR_Api.Object_Locked then
621         --
622         -- The object is locked therefore we need to supply a meaningful
623         -- error message.
624         --
625         fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
626         fnd_message.set_token('TABLE_NAME', 'ben_prtt_enrt_rslt_f');
627         fnd_message.raise_error;
628     When l_object_invalid then
629         --
630         -- The object doesn't exist or is invalid
631         --
632         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
633         fnd_message.set_token('TABLE_NAME', 'ben_prtt_enrt_rslt_f');
634         fnd_message.raise_error;
635 End lck;
636 --
637 -- ----------------------------------------------------------------------------
638 -- |-----------------------------< convert_args >-----------------------------|
639 -- ----------------------------------------------------------------------------
640 --
641 Function convert_args
642     (
643     p_prtt_enrt_rslt_id             in number,
644     p_effective_start_date          in date,
645     p_effective_end_date            in date,
646     p_business_group_id             in number,
647     p_oipl_id                       in number,
648     p_person_id                     in number,
649     p_assignment_id                 in number,
650     p_pgm_id                        in number,
651     p_pl_id                         in number,
652     p_rplcs_sspndd_rslt_id          in number,
653     p_ptip_id                       in number,
654     p_pl_typ_id                     in number,
655     p_ler_id                        in number,
656     p_sspndd_flag                   in varchar2,
657     p_prtt_is_cvrd_flag             in varchar2,
658     p_bnft_amt                      in number,
659     p_uom                           in varchar2,
660     p_orgnl_enrt_dt                 in date,
661     p_enrt_mthd_cd                  in varchar2,
662         p_no_lngr_elig_flag             in varchar2,
663     p_enrt_ovridn_flag              in varchar2,
664     p_enrt_ovrid_rsn_cd             in varchar2,
665     p_erlst_deenrt_dt               in date,
666     p_enrt_cvg_strt_dt              in date,
667     p_enrt_cvg_thru_dt              in date,
668     p_enrt_ovrid_thru_dt            in date,
669     p_pl_ordr_num                   in number,
670     p_plip_ordr_num                 in number,
671     p_ptip_ordr_num                 in number,
672     p_oipl_ordr_num                 in number,
673     p_pen_attribute_category        in varchar2,
674     p_pen_attribute1                in varchar2,
675     p_pen_attribute2                in varchar2,
676     p_pen_attribute3                in varchar2,
677     p_pen_attribute4                in varchar2,
678     p_pen_attribute5                in varchar2,
679     p_pen_attribute6                in varchar2,
680     p_pen_attribute7                in varchar2,
681     p_pen_attribute8                in varchar2,
682     p_pen_attribute9                in varchar2,
683     p_pen_attribute10               in varchar2,
684     p_pen_attribute11               in varchar2,
685     p_pen_attribute12               in varchar2,
686     p_pen_attribute13               in varchar2,
687     p_pen_attribute14               in varchar2,
688     p_pen_attribute15               in varchar2,
689     p_pen_attribute16               in varchar2,
690     p_pen_attribute17               in varchar2,
691     p_pen_attribute18               in varchar2,
692     p_pen_attribute19               in varchar2,
693     p_pen_attribute20               in varchar2,
694     p_pen_attribute21               in varchar2,
695     p_pen_attribute22               in varchar2,
696     p_pen_attribute23               in varchar2,
697     p_pen_attribute24               in varchar2,
698     p_pen_attribute25               in varchar2,
699     p_pen_attribute26               in varchar2,
700     p_pen_attribute27               in varchar2,
701     p_pen_attribute28               in varchar2,
702     p_pen_attribute29               in varchar2,
703     p_pen_attribute30               in varchar2,
704     p_request_id                    in number,
705     p_program_application_id        in number,
706     p_program_id                    in number,
707     p_program_update_date           in date,
708     p_object_version_number         in number,
709   	p_per_in_ler_id                 in number,
710     p_bnft_typ_cd                   in varchar2,
711       p_bnft_ordr_num                 in number,
712       p_prtt_enrt_rslt_stat_cd        in varchar2,
713     p_bnft_nnmntry_uom              in varchar2,
714       p_comp_lvl_cd                   in varchar2
715     )
716     Return g_rec_type is
717 --
718   l_rec	  g_rec_type;
719   l_proc  varchar2(72) := g_package||'convert_args';
720 --
721 Begin
722   --
723   hr_utility.set_location('Entering:'||l_proc, 5);
724   --
725   -- Convert arguments into local l_rec structure.
726   --
727   l_rec.prtt_enrt_rslt_id                := p_prtt_enrt_rslt_id;
728   l_rec.effective_start_date             := p_effective_start_date;
729   l_rec.effective_end_date               := p_effective_end_date;
730   l_rec.business_group_id                := p_business_group_id;
731   l_rec.oipl_id                          := p_oipl_id;
732   l_rec.person_id                        := p_person_id;
733   l_rec.assignment_id                    := p_assignment_id;
734   l_rec.pgm_id                           := p_pgm_id;
735   l_rec.pl_id                            := p_pl_id;
736   l_rec.rplcs_sspndd_rslt_id             := p_rplcs_sspndd_rslt_id;
737   l_rec.ptip_id                          := p_ptip_id;
738   l_rec.pl_typ_id                        := p_pl_typ_id;
739   l_rec.ler_id                           := p_ler_id;
740   l_rec.sspndd_flag                      := p_sspndd_flag;
741   l_rec.prtt_is_cvrd_flag                := p_prtt_is_cvrd_flag;
742   l_rec.bnft_amt                         := p_bnft_amt;
743   l_rec.uom                              := p_uom     ;
744   l_rec.orgnl_enrt_dt                    := p_orgnl_enrt_dt;
745   l_rec.enrt_mthd_cd                     := p_enrt_mthd_cd;
746   l_rec.no_lngr_elig_flag                := p_no_lngr_elig_flag;
747   l_rec.enrt_ovridn_flag                 := p_enrt_ovridn_flag;
748   l_rec.enrt_ovrid_rsn_cd                := p_enrt_ovrid_rsn_cd;
749   l_rec.erlst_deenrt_dt                  := p_erlst_deenrt_dt;
750   l_rec.enrt_cvg_strt_dt                 := p_enrt_cvg_strt_dt;
751   l_rec.enrt_cvg_thru_dt                 := p_enrt_cvg_thru_dt;
752   l_rec.enrt_ovrid_thru_dt               := p_enrt_ovrid_thru_dt;
753   l_rec.pl_ordr_num                      := p_pl_ordr_num;
754   l_rec.plip_ordr_num                    := p_plip_ordr_num;
755   l_rec.ptip_ordr_num                    := p_ptip_ordr_num;
756   l_rec.oipl_ordr_num                    := p_oipl_ordr_num;
757   l_rec.pen_attribute_category           := p_pen_attribute_category;
758   l_rec.pen_attribute1                   := p_pen_attribute1;
759   l_rec.pen_attribute2                   := p_pen_attribute2;
760   l_rec.pen_attribute3                   := p_pen_attribute3;
761   l_rec.pen_attribute4                   := p_pen_attribute4;
762   l_rec.pen_attribute5                   := p_pen_attribute5;
763   l_rec.pen_attribute6                   := p_pen_attribute6;
764   l_rec.pen_attribute7                   := p_pen_attribute7;
765   l_rec.pen_attribute8                   := p_pen_attribute8;
766   l_rec.pen_attribute9                   := p_pen_attribute9;
767   l_rec.pen_attribute10                  := p_pen_attribute10;
768   l_rec.pen_attribute11                  := p_pen_attribute11;
769   l_rec.pen_attribute12                  := p_pen_attribute12;
770   l_rec.pen_attribute13                  := p_pen_attribute13;
771   l_rec.pen_attribute14                  := p_pen_attribute14;
772   l_rec.pen_attribute15                  := p_pen_attribute15;
773   l_rec.pen_attribute16                  := p_pen_attribute16;
774   l_rec.pen_attribute17                  := p_pen_attribute17;
775   l_rec.pen_attribute18                  := p_pen_attribute18;
776   l_rec.pen_attribute19                  := p_pen_attribute19;
777   l_rec.pen_attribute20                  := p_pen_attribute20;
778   l_rec.pen_attribute21                  := p_pen_attribute21;
779   l_rec.pen_attribute22                  := p_pen_attribute22;
780   l_rec.pen_attribute23                  := p_pen_attribute23;
781   l_rec.pen_attribute24                  := p_pen_attribute24;
782   l_rec.pen_attribute25                  := p_pen_attribute25;
783   l_rec.pen_attribute26                  := p_pen_attribute26;
784   l_rec.pen_attribute27                  := p_pen_attribute27;
785   l_rec.pen_attribute28                  := p_pen_attribute28;
786   l_rec.pen_attribute29                  := p_pen_attribute29;
787   l_rec.pen_attribute30                  := p_pen_attribute30;
788   l_rec.request_id                       := p_request_id;
789   l_rec.program_application_id           := p_program_application_id;
790   l_rec.program_id                       := p_program_id;
791   l_rec.program_update_date              := p_program_update_date;
792   l_rec.object_version_number            := p_object_version_number;
793   l_rec.per_in_ler_id                    := p_per_in_ler_id;
794   l_rec.bnft_typ_cd                      := p_bnft_typ_cd;
795   l_rec.bnft_ordr_num                    := p_bnft_ordr_num;
796   l_rec.prtt_enrt_rslt_stat_cd           := p_prtt_enrt_rslt_stat_cd;
797   l_rec.bnft_nnmntry_uom                 := p_bnft_nnmntry_uom;
798   l_rec.comp_lvl_cd                      := p_comp_lvl_cd;
799 
800   --
801   -- Return the plsql record structure.
802   --
803   hr_utility.set_location(' Leaving:'||l_proc, 10);
804   Return(l_rec);
805 --
806 End convert_args;
807 --
808 end ben_pen_shd;