DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_CTP_SHD

Source


1 Package Body ben_ctp_shd as
2 /* $Header: bectprhi.pkb 120.0.12020000.2 2012/07/03 12:06:46 amnaraya ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ctp_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';
19   --
16 --
17 Begin
18   hr_utility.set_location('Entering:'||l_proc, 5);
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_PTIP_FK1') Then
37     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
38     fnd_message.set_token('PROCEDURE', l_proc);
39     fnd_message.set_token('STEP','5');
40     fnd_message.raise_error;
41   ElsIf (p_constraint_name = 'BEN_PTIP_PK') Then
42     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
43     fnd_message.set_token('PROCEDURE', l_proc);
44     fnd_message.set_token('STEP','10');
45     fnd_message.raise_error;
46   Else
47     fnd_message.set_name('PAY', 'HR_7877_API_INVALID_CONSTRAINT');
48     fnd_message.set_token('PROCEDURE', l_proc);
49     fnd_message.set_token('CONSTRAINT_NAME', p_constraint_name);
50     fnd_message.raise_error;
51   End If;
52   --
53   hr_utility.set_location(' Leaving:'||l_proc, 10);
54 End constraint_error;
55 --
56 -- ----------------------------------------------------------------------------
57 -- |-----------------------------< api_updating >-----------------------------|
58 -- ----------------------------------------------------------------------------
59 Function api_updating
60   (p_effective_date		in date,
61    p_ptip_id		in number,
62    p_object_version_number	in number
63   ) Return Boolean Is
64 --
65   --
66   -- Cursor selects the 'current' row from the HR Schema
67   --
68   Cursor C_Sel1 is
69     select
70 	ptip_id,
71 	effective_start_date,
72 	effective_end_date,
73 	business_group_id,
74 	pgm_id,
75         cmbn_ptip_id,
76         cmbn_ptip_opt_id,
77         acrs_ptip_cvg_id,
78 	pl_typ_id,
79 	coord_cvg_for_all_pls_flag,
80 	dpnt_dsgn_cd,
81         dpnt_cvg_strt_dt_rl,
82         dpnt_cvg_end_dt_rl,
83         postelcn_edit_rl,
84         rt_end_dt_rl,
85         rt_strt_dt_rl,
86         enrt_cvg_end_dt_rl,
87         enrt_cvg_strt_dt_rl,
88         rqd_perd_enrt_nenrt_rl,
89         auto_enrt_mthd_rl,
90         enrt_mthd_cd,
91         enrt_cd,
92         enrt_rl,
93         dflt_enrt_cd,
94         dflt_enrt_det_rl,
95         drvbl_fctr_apls_rts_flag,
96         drvbl_fctr_prtn_elig_flag,
97         elig_apls_flag,
98         prtn_elig_ovrid_alwd_flag,
99         trk_inelig_per_flag,
100         dpnt_cvg_strt_dt_cd,
101         rt_end_dt_cd,
102         rt_strt_dt_cd,
103         enrt_cvg_end_dt_cd,
104         enrt_cvg_strt_dt_cd,
105         dpnt_cvg_end_dt_cd,
106 	crs_this_pl_typ_only_flag,
107 	ptip_stat_cd,
108 	mx_cvg_alwd_amt,
109 	mx_enrd_alwd_ovrid_num,
110 	mn_enrd_rqd_ovrid_num,
111 	no_mx_pl_typ_ovrid_flag,
112 	ordr_num,
113 	prvds_cr_flag,
114 	rqd_perd_enrt_nenrt_val,
115 	rqd_perd_enrt_nenrt_tm_uom,
116 	wvbl_flag,
117         dpnt_adrs_rqd_flag,
118         dpnt_cvg_no_ctfn_rqd_flag,
119         dpnt_dob_rqd_flag,
120         dpnt_legv_id_rqd_flag,
121         susp_if_dpnt_ssn_nt_prv_cd,
122         susp_if_dpnt_dob_nt_prv_cd,
123         susp_if_dpnt_adr_nt_prv_cd,
124         susp_if_ctfn_not_dpnt_flag,
125         dpnt_ctfn_determine_cd,
126 	drvd_fctr_dpnt_cvg_flag,
127 	no_mn_pl_typ_overid_flag,
128       sbj_to_sps_lf_ins_mx_flag,
129       sbj_to_dpnt_lf_ins_mx_flag,
130       use_to_sum_ee_lf_ins_flag,
131       per_cvrd_cd,
132       short_name,
133       short_code,
134             legislation_code,
135             legislation_subgroup,
136       vrfy_fmly_mmbr_cd,
137       vrfy_fmly_mmbr_rl,
138 	ivr_ident,
139         url_ref_name,
140 	rqd_enrt_perd_tco_cd,
141 	ctp_attribute_category,
142 	ctp_attribute1,
143 	ctp_attribute2,
144 	ctp_attribute3,
145 	ctp_attribute4,
146 	ctp_attribute5,
147 	ctp_attribute6,
148 	ctp_attribute7,
149 	ctp_attribute8,
150 	ctp_attribute9,
151 	ctp_attribute10,
152 	ctp_attribute11,
153 	ctp_attribute12,
154 	ctp_attribute13,
155 	ctp_attribute14,
156 	ctp_attribute15,
157 	ctp_attribute16,
158 	ctp_attribute17,
159 	ctp_attribute18,
160 	ctp_attribute19,
161 	ctp_attribute20,
162 	ctp_attribute21,
163 	ctp_attribute22,
164 	ctp_attribute23,
165 	ctp_attribute24,
166 	ctp_attribute25,
167 	ctp_attribute26,
168 	ctp_attribute27,
169 	ctp_attribute28,
170 	ctp_attribute29,
171 	ctp_attribute30,
172 	all_inelig,
173 	object_version_number
174     from	ben_ptip_f
175     where	ptip_id = p_ptip_id
176     and		p_effective_date
177     between	effective_start_date and effective_end_date;
178 --
179   l_proc	varchar2(72)	:= g_package||'api_updating';
180   l_fct_ret	boolean;
181 --
182 Begin
183   hr_utility.set_location('Entering:'||l_proc, 5);
184   --
185   If (p_effective_date is null or
186       p_ptip_id is null or
187       p_object_version_number is null) Then
188     --
189     -- One of the primary key arguments is null therefore we must
190     -- set the returning function value to false
191     --
192     l_fct_ret := false;
193   Else
194     If (p_ptip_id = g_old_rec.ptip_id and
195         p_object_version_number = g_old_rec.object_version_number) Then
196       hr_utility.set_location(l_proc, 10);
197       --
198       -- The g_old_rec is current therefore we must
199       -- set the returning function to true
200       --
201       l_fct_ret := true;
202     Else
203       --
204       -- Select the current row
205       --
206       Open C_Sel1;
207       Fetch C_Sel1 Into g_old_rec;
208       If C_Sel1%notfound Then
209         Close C_Sel1;
210         --
211         -- The primary key is invalid therefore we must error
212         --
213         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
214         fnd_message.raise_error;
215       End If;
216       Close C_Sel1;
217       If (p_object_version_number <> g_old_rec.object_version_number) Then
218         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
219         fnd_message.raise_error;
220       End If;
221       hr_utility.set_location(l_proc, 15);
222       l_fct_ret := true;
223     End If;
224   End If;
225   hr_utility.set_location(' Leaving:'||l_proc, 20);
226   Return (l_fct_ret);
227 --
228 End api_updating;
229 --
230 -- ----------------------------------------------------------------------------
231 -- |--------------------------< find_dt_del_modes >---------------------------|
232 -- ----------------------------------------------------------------------------
233 Procedure find_dt_del_modes
234 	(p_effective_date	in  date,
235 	 p_base_key_value	in  number,
236 	 p_zap		 out nocopy boolean,
237 	 p_delete	 out nocopy boolean,
238 	 p_future_change out nocopy boolean,
239 	 p_delete_next_change out nocopy boolean) is
240 --
241   l_proc 		varchar2(72) 	:= g_package||'find_dt_del_modes';
242 --
243   l_parent_key_value1	number;
244   l_parent_key_value2	number;
245   l_parent_key_value3	number;
246   l_parent_key_value4	number;
247   l_parent_key_value5   number;
248   --
249   Cursor C_Sel1 Is
250     select  t.pgm_id,
251 	    t.pl_typ_id,
252             t.cmbn_ptip_id,
253             t.cmbn_ptip_opt_id,
254             t.acrs_ptip_cvg_id
255     from    ben_ptip_f t
256     where   t.ptip_id = p_base_key_value
257     and     p_effective_date
258     between t.effective_start_date and t.effective_end_date;
259 --
260 Begin
261   hr_utility.set_location('Entering:'||l_proc, 5);
262   Open  C_Sel1;
263   Fetch C_Sel1 Into l_parent_key_value1,
264 		    l_parent_key_value2,
265                     l_parent_key_value3,
266                     l_parent_key_value4,
267                     l_parent_key_value5;
268   If C_Sel1%notfound then
269     Close C_Sel1;
270     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
271     fnd_message.set_token('PROCEDURE', l_proc);
272     fnd_message.set_token('STEP','10');
273     fnd_message.raise_error;
274   End If;
275   Close C_Sel1;
276   --
277   -- Call the corresponding datetrack api
278   --
279   dt_api.find_dt_del_modes
280 	(p_effective_date	=> p_effective_date,
281 	 p_base_table_name	=> 'ben_ptip_f',
282 	 p_base_key_column	=> 'ptip_id',
283 	 p_base_key_value	=> p_base_key_value,
284 	 p_parent_table_name1	=> 'ben_pgm_f',
285 	 p_parent_key_column1	=> 'pgm_id',
286 	 p_parent_key_value1	=> l_parent_key_value1,
287 	 p_parent_table_name2	=> 'ben_pl_typ_f',
288 	 p_parent_key_column2	=> 'pl_typ_id',
289 	 p_parent_key_value2	=> l_parent_key_value2,
290 	 p_parent_table_name3	=> 'ben_cmbn_ptip_f',
291 	 p_parent_key_column3	=> 'cmbn_ptip_id',
292 	 p_parent_key_value3	=> l_parent_key_value3,
293 	 p_parent_table_name4	=> 'ben_cmbn_ptip_opt_f',
294 	 p_parent_key_column4	=> 'cmbn_ptip_opt_id',
295 	 p_parent_key_value4	=> l_parent_key_value4,
296          p_parent_table_name5   => 'ben_acrs_ptip_cvg_f',
297          p_parent_key_column5   => 'acrs_ptip_cvg_id',
298          p_parent_key_value5    => l_parent_key_value5,
299 	 p_zap			=> p_zap,
300 	 p_delete		=> p_delete,
301 	 p_future_change	=> p_future_change,
302 	 p_delete_next_change	=> p_delete_next_change);
303   --
304   hr_utility.set_location(' Leaving:'||l_proc, 10);
305 End find_dt_del_modes;
306 --
307 -- ----------------------------------------------------------------------------
308 -- |--------------------------< find_dt_upd_modes >---------------------------|
309 -- ----------------------------------------------------------------------------
310 Procedure find_dt_upd_modes
311 	(p_effective_date	in  date,
312 	 p_base_key_value	in  number,
313 	 p_correction	 out nocopy boolean,
314 	 p_update	 out nocopy boolean,
315 	 p_update_override out nocopy boolean,
316 	 p_update_change_insert out nocopy boolean) is
317 --
318   l_proc 	varchar2(72) := g_package||'find_dt_upd_modes';
319 --
320 Begin
321   hr_utility.set_location('Entering:'||l_proc, 5);
322   --
323   -- Call the corresponding datetrack api
324   --
325   dt_api.find_dt_upd_modes
326 	(p_effective_date	=> p_effective_date,
327 	 p_base_table_name	=> 'ben_ptip_f',
328 	 p_base_key_column	=> 'ptip_id',
329 	 p_base_key_value	=> p_base_key_value,
330 	 p_correction		=> p_correction,
331 	 p_update		=> p_update,
332 	 p_update_override	=> p_update_override,
333 	 p_update_change_insert	=> p_update_change_insert);
334   --
335   hr_utility.set_location(' Leaving:'||l_proc, 10);
336 End find_dt_upd_modes;
337 --
338 -- ----------------------------------------------------------------------------
339 -- |------------------------< upd_effective_end_date >------------------------|
340 -- ----------------------------------------------------------------------------
341 Procedure upd_effective_end_date
342 	(p_effective_date		in date,
343 	 p_base_key_value		in number,
344 	 p_new_effective_end_date	in date,
345 	 p_validation_start_date	in date,
346 	 p_validation_end_date		in date,
347          p_object_version_number       out nocopy number) is
348 --
349   l_proc 		  varchar2(72) := g_package||'upd_effective_end_date';
350   l_object_version_number number;
351 --
352 Begin
353   hr_utility.set_location('Entering:'||l_proc, 5);
354   --
355   -- Because we are updating a row we must get the next object
356   -- version number.
357   --
358   l_object_version_number :=
359     dt_api.get_object_version_number
360 	(p_base_table_name	=> 'ben_ptip_f',
361 	 p_base_key_column	=> 'ptip_id',
362 	 p_base_key_value	=> p_base_key_value);
363   --
364   hr_utility.set_location(l_proc, 10);
365   g_api_dml := true;  -- Set the api dml status
366   --
367   -- Update the specified datetrack row setting the effective
368   -- end date to the specified new effective end date.
369   --
370   update  ben_ptip_f t
371   set	  t.effective_end_date	  = p_new_effective_end_date,
372 	  t.object_version_number = l_object_version_number
373   where	  t.ptip_id	  = p_base_key_value
374   and	  p_effective_date
375   between t.effective_start_date and t.effective_end_date;
376   --
377   g_api_dml := false;   -- Unset the api dml status
378   p_object_version_number := l_object_version_number;
379   hr_utility.set_location(' Leaving:'||l_proc, 15);
380 --
381 Exception
382   When Others Then
383     g_api_dml := false;   -- Unset the api dml status
384     Raise;
385 End upd_effective_end_date;
386 --
387 -- ----------------------------------------------------------------------------
388 -- |---------------------------------< lck >----------------------------------|
389 -- ----------------------------------------------------------------------------
390 Procedure lck
391 	(p_effective_date	 in  date,
392 	 p_datetrack_mode	 in  varchar2,
393 	 p_ptip_id	 in  number,
394 	 p_object_version_number in  number,
395 	 p_validation_start_date out nocopy date,
396 	 p_validation_end_date	 out nocopy date) is
397 --
398   l_proc		  varchar2(72) := g_package||'lck';
399   l_validation_start_date date;
400   l_validation_end_date	  date;
401   l_object_invalid 	  exception;
402   l_argument		  varchar2(30);
403   --
404   -- Cursor C_Sel1 selects the current locked row as of session date
405   -- ensuring that the object version numbers match.
406   --
407   Cursor C_Sel1 is
408     select
409 	ptip_id,
410 	effective_start_date,
411 	effective_end_date,
412 	coord_cvg_for_all_pls_flag,
413 	dpnt_dsgn_cd,
414         dpnt_cvg_no_ctfn_rqd_flag,
415         dpnt_cvg_strt_dt_cd,
416         rt_end_dt_cd,
417         rt_strt_dt_cd,
418         enrt_cvg_end_dt_cd,
419         enrt_cvg_strt_dt_cd,
420         dpnt_cvg_strt_dt_rl,
421         dpnt_cvg_end_dt_cd,
422         dpnt_cvg_end_dt_rl,
423         dpnt_adrs_rqd_flag,
424         dpnt_legv_id_rqd_flag,
425         susp_if_dpnt_ssn_nt_prv_cd,
426         susp_if_dpnt_dob_nt_prv_cd,
427         susp_if_dpnt_adr_nt_prv_cd,
428         susp_if_ctfn_not_dpnt_flag,
429         dpnt_ctfn_determine_cd,
430         postelcn_edit_rl,
431         rt_end_dt_rl,
432         rt_strt_dt_rl,
433         enrt_cvg_end_dt_rl,
434         enrt_cvg_strt_dt_rl,
435         rqd_perd_enrt_nenrt_rl,
436         auto_enrt_mthd_rl,
437         enrt_mthd_cd,
438         enrt_cd,
439         enrt_rl,
440         dflt_enrt_cd,
441         dflt_enrt_det_rl,
442         drvbl_fctr_apls_rts_flag,
443         drvbl_fctr_prtn_elig_flag,
444         elig_apls_flag,
445         prtn_elig_ovrid_alwd_flag,
446         trk_inelig_per_flag,
447         dpnt_dob_rqd_flag,
448 	crs_this_pl_typ_only_flag,
449 	ptip_stat_cd,
450 	mx_cvg_alwd_amt,
451 	mx_enrd_alwd_ovrid_num,
452 	mn_enrd_rqd_ovrid_num,
453 	no_mx_pl_typ_ovrid_flag,
454 	ordr_num,
455 	prvds_cr_flag,
456 	rqd_perd_enrt_nenrt_val,
457 	rqd_perd_enrt_nenrt_tm_uom,
458 	wvbl_flag,
459 	drvd_fctr_dpnt_cvg_flag,
460 	no_mn_pl_typ_overid_flag,
461         sbj_to_sps_lf_ins_mx_flag,
462         sbj_to_dpnt_lf_ins_mx_flag,
463         use_to_sum_ee_lf_ins_flag,
464         per_cvrd_cd,
465         short_name,
466         short_code,
467                 legislation_code,
468                 legislation_subgroup,
469         vrfy_fmly_mmbr_cd,
470         vrfy_fmly_mmbr_rl,
471 	ivr_ident,
472         url_ref_name,
473 	rqd_enrt_perd_tco_cd,
474 	pgm_id,
475 	pl_typ_id,
476         cmbn_ptip_id,
477         cmbn_ptip_opt_id,
478         acrs_ptip_cvg_id,
479 	business_group_id,
480 	ctp_attribute_category,
481 	ctp_attribute1,
482 	ctp_attribute2,
483 	ctp_attribute3,
484 	ctp_attribute4,
485 	ctp_attribute5,
486 	ctp_attribute6,
487 	ctp_attribute7,
488 	ctp_attribute8,
489 	ctp_attribute9,
490 	ctp_attribute10,
491 	ctp_attribute11,
492 	ctp_attribute12,
493 	ctp_attribute13,
494 	ctp_attribute14,
495 	ctp_attribute15,
496 	ctp_attribute16,
497 	ctp_attribute17,
498 	ctp_attribute18,
499 	ctp_attribute19,
500 	ctp_attribute20,
501 	ctp_attribute21,
502 	ctp_attribute22,
503 	ctp_attribute23,
504 	ctp_attribute24,
505 	ctp_attribute25,
506 	ctp_attribute26,
507 	ctp_attribute27,
508 	ctp_attribute28,
509 	ctp_attribute29,
510 	ctp_attribute30,
511 	all_inelig,
512 	object_version_number
513     from    ben_ptip_f
514     where   ptip_id         = p_ptip_id
515     and	    p_effective_date
516     between effective_start_date and effective_end_date
517     for update nowait;
518   --
519   --
520   --
521 Begin
522   hr_utility.set_location('Entering:'||l_proc, 5);
523   --
524   -- Ensure that all the mandatory arguments are not null
525   --
526   hr_api.mandatory_arg_error(p_api_name       => l_proc,
527                              p_argument       => 'effective_date',
528                              p_argument_value => p_effective_date);
529   --
530   hr_api.mandatory_arg_error(p_api_name       => l_proc,
531                              p_argument       => 'datetrack_mode',
532                              p_argument_value => p_datetrack_mode);
533   --
534   hr_api.mandatory_arg_error(p_api_name       => l_proc,
535                              p_argument       => 'ptip_id',
536                              p_argument_value => p_ptip_id);
537   --
538   hr_api.mandatory_arg_error(p_api_name       => l_proc,
539                              p_argument       => 'object_version_number',
540                              p_argument_value => p_object_version_number);
541   --
542   -- Check to ensure the datetrack mode is not INSERT.
543   --
544   If (p_datetrack_mode <> 'INSERT') then
545     --
546     -- We must select and lock the current row.
547     --
548     Open  C_Sel1;
549     Fetch C_Sel1 Into g_old_rec;
550     If C_Sel1%notfound then
551       Close C_Sel1;
552       --
553       -- The primary key is invalid therefore we must error
554       --
555       fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
556       fnd_message.raise_error;
557     End If;
558     Close C_Sel1;
559     If (p_object_version_number <> g_old_rec.object_version_number) Then
560         fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
561         fnd_message.raise_error;
562       End If;
563     hr_utility.set_location(l_proc, 15);
564     --
565     --
566     -- Validate the datetrack mode mode getting the validation start
567     -- and end dates for the specified datetrack operation.
568     --
569     dt_api.validate_dt_mode
570 	(p_effective_date	   => p_effective_date,
571 	 p_datetrack_mode	   => p_datetrack_mode,
572 	 p_base_table_name	   => 'ben_ptip_f',
573 	 p_base_key_column	   => 'ptip_id',
574 	 p_base_key_value 	   => p_ptip_id,
575 	 p_parent_table_name1      => 'ben_pgm_f',
576 	 p_parent_key_column1      => 'pgm_id',
577 	 p_parent_key_value1       => g_old_rec.pgm_id,
578 	 p_parent_table_name2      => 'ben_pl_typ_f',
579 	 p_parent_key_column2      => 'pl_typ_id',
580 	 p_parent_key_value2       => g_old_rec.pl_typ_id,
581 	 p_parent_table_name3      => 'ben_cmbn_ptip_f',
582 	 p_parent_key_column3      => 'cmbn_ptip_id',
583 	 p_parent_key_value3       => g_old_rec.cmbn_ptip_id,
584 	 p_parent_table_name4      => 'ben_cmbn_ptip_opt_f',
585 	 p_parent_key_column4      => 'cmbn_ptip_opt_id',
586 	 p_parent_key_value4       => g_old_rec.cmbn_ptip_opt_id,
587          p_parent_table_name5      => 'ben_acrs_ptip_cvg_f',
588          p_parent_key_column5      => 'acrs_ptip_cvg_id',
589          p_parent_key_value5       => g_old_rec.acrs_ptip_cvg_id,
590 --	 p_child_table_name1       => 'ben_wv_prtn_rsn_ptip_f',
591 --	 p_child_key_column1       => 'wv_prtn_rsn_ptip_id',
592 --	 p_child_table_name2       => 'ben_ler_chg_dpnt_cvg_f',
593 --	 p_child_key_column2       => 'ler_chg_dpnt_cvg_id',
594 --	 p_child_table_name3       => 'ben_acty_base_rt_f',
595 --	 p_child_key_column3       => 'acty_base_rt_id',
596 --	 p_child_table_name4       => 'ben_apld_dpnt_cvg_elig_prfl_f',
597 --	 p_child_key_column4       => 'apld_dpnt_cvg_elig_prfl_id',
598 --	 p_child_table_name5       => 'ben_ptip_dpnt_cvg_ctfn_f',
599 --	 p_child_key_column5       => 'ptip_dpnt_cvg_ctfn_id',
600 --         p_enforce_foreign_locking => true,  Bug 3198808
601          p_enforce_foreign_locking => false,
602 	 p_validation_start_date   => l_validation_start_date,
603  	 p_validation_end_date	   => l_validation_end_date);
604   Else
605     --
606     -- We are doing a datetrack 'INSERT' which is illegal within this
607     -- procedure therefore we must error (note: to lck on insert the
608     -- private procedure ins_lck should be called).
609     --
610     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
611     fnd_message.set_token('PROCEDURE', l_proc);
612     fnd_message.set_token('STEP','20');
613     fnd_message.raise_error;
614   End If;
615   --
616   -- Set the validation start and end date OUT arguments
617   --
618   p_validation_start_date := l_validation_start_date;
619   p_validation_end_date   := l_validation_end_date;
620   --
621   hr_utility.set_location(' Leaving:'||l_proc, 30);
622 --
623 -- We need to trap the ORA LOCK exception
624 --
625 Exception
626   When HR_Api.Object_Locked then
627     --
628     -- The object is locked therefore we need to supply a meaningful
629     -- error message.
630     --
631     fnd_message.set_name('PAY', 'HR_7165_OBJECT_LOCKED');
632     fnd_message.set_token('TABLE_NAME', 'ben_ptip_f');
633     fnd_message.raise_error;
634   When l_object_invalid then
635     --
636     -- The object doesn't exist or is invalid
637     --
638     fnd_message.set_name('PAY', 'HR_7155_OBJECT_INVALID');
639     fnd_message.set_token('TABLE_NAME', 'ben_ptip_f');
640     fnd_message.raise_error;
641 End lck;
642 --
643 -- ----------------------------------------------------------------------------
644 -- |-----------------------------< convert_args >-----------------------------|
645 -- ----------------------------------------------------------------------------
646 Function convert_args
647 	(
648         p_ptip_id                       in number,
649         p_effective_start_date          in date,
650         p_effective_end_date            in date,
651         p_coord_cvg_for_all_pls_flag    in varchar2,
652         p_dpnt_dsgn_cd                  in varchar2,
653         p_dpnt_cvg_no_ctfn_rqd_flag     in varchar2,
654         p_dpnt_cvg_strt_dt_cd           in varchar2,
655         p_rt_end_dt_cd           in varchar2,
656         p_rt_strt_dt_cd           in varchar2,
657         p_enrt_cvg_end_dt_cd           in varchar2,
658         p_enrt_cvg_strt_dt_cd           in varchar2,
659         p_dpnt_cvg_strt_dt_rl           in number,
660         p_dpnt_cvg_end_dt_cd            in varchar2,
661         p_dpnt_cvg_end_dt_rl            in number,
662         p_dpnt_adrs_rqd_flag            in varchar2,
663         p_dpnt_legv_id_rqd_flag         in varchar2,
664         p_susp_if_dpnt_ssn_nt_prv_cd    in  varchar2,
665         p_susp_if_dpnt_dob_nt_prv_cd    in  varchar2,
666         p_susp_if_dpnt_adr_nt_prv_cd    in  varchar2,
667         p_susp_if_ctfn_not_dpnt_flag    in  varchar2,
668         p_dpnt_ctfn_determine_cd        in  varchar2,
669         p_postelcn_edit_rl              in number,
670         p_rt_end_dt_rl              in number,
671         p_rt_strt_dt_rl              in number,
672         p_enrt_cvg_end_dt_rl              in number,
673         p_enrt_cvg_strt_dt_rl              in number,
674         p_rqd_perd_enrt_nenrt_rl              in number,
675         p_auto_enrt_mthd_rl             in number,
676         p_enrt_mthd_cd                  in varchar2,
677         p_enrt_cd                       in varchar2,
678         p_enrt_rl                       in number,
679         p_dflt_enrt_cd                  in varchar2,
680         p_dflt_enrt_det_rl              in number,
681         p_drvbl_fctr_apls_rts_flag      in varchar2,
682         p_drvbl_fctr_prtn_elig_flag     in varchar2,
683         p_elig_apls_flag                in varchar2,
684         p_prtn_elig_ovrid_alwd_flag     in varchar2,
685         p_trk_inelig_per_flag           in varchar2,
686         p_dpnt_dob_rqd_flag             in varchar2,
687         p_crs_this_pl_typ_only_flag     in varchar2,
688         p_ptip_stat_cd                  in varchar2,
689         p_mx_cvg_alwd_amt               in number,
690         p_mx_enrd_alwd_ovrid_num        in number,
691         p_mn_enrd_rqd_ovrid_num         in number,
692         p_no_mx_pl_typ_ovrid_flag       in varchar2,
693         p_ordr_num                      in number,
694         p_prvds_cr_flag                 in varchar2,
695         p_rqd_perd_enrt_nenrt_val       in number,
696         p_rqd_perd_enrt_nenrt_tm_uom    in varchar2,
697         p_wvbl_flag                     in varchar2,
698         p_drvd_fctr_dpnt_cvg_flag       in varchar2,
699         p_no_mn_pl_typ_overid_flag      in varchar2,
700         p_sbj_to_sps_lf_ins_mx_flag     in varchar2,
701         p_sbj_to_dpnt_lf_ins_mx_flag    in varchar2,
702         p_use_to_sum_ee_lf_ins_flag     in varchar2,
703         p_per_cvrd_cd                   in varchar2,
704         p_short_name                   in varchar2,
705         p_short_code                   in varchar2,
706                 p_legislation_code                   in varchar2,
707                 p_legislation_subgroup                   in varchar2,
708         p_vrfy_fmly_mmbr_cd             in varchar2,
709         p_vrfy_fmly_mmbr_rl             in number,
710         p_ivr_ident                     in varchar2,
711         p_url_ref_name                  in varchar2,
712         p_rqd_enrt_perd_tco_cd          in varchar2,
713         p_pgm_id                        in number,
714         p_pl_typ_id                     in number,
715         p_cmbn_ptip_id                  in number,
716         p_cmbn_ptip_opt_id              in number,
717         p_acrs_ptip_cvg_id              in number,
718         p_business_group_id             in number,
719         p_ctp_attribute_category        in varchar2,
720         p_ctp_attribute1                in varchar2,
721         p_ctp_attribute2                in varchar2,
722         p_ctp_attribute3                in varchar2,
723         p_ctp_attribute4                in varchar2,
724         p_ctp_attribute5                in varchar2,
725         p_ctp_attribute6                in varchar2,
726         p_ctp_attribute7                in varchar2,
727         p_ctp_attribute8                in varchar2,
728         p_ctp_attribute9                in varchar2,
729         p_ctp_attribute10               in varchar2,
730         p_ctp_attribute11               in varchar2,
731         p_ctp_attribute12               in varchar2,
732         p_ctp_attribute13               in varchar2,
733         p_ctp_attribute14               in varchar2,
734         p_ctp_attribute15               in varchar2,
735         p_ctp_attribute16               in varchar2,
736         p_ctp_attribute17               in varchar2,
737         p_ctp_attribute18               in varchar2,
738         p_ctp_attribute19               in varchar2,
739         p_ctp_attribute20               in varchar2,
740         p_ctp_attribute21               in varchar2,
741         p_ctp_attribute22               in varchar2,
742         p_ctp_attribute23               in varchar2,
743         p_ctp_attribute24               in varchar2,
744         p_ctp_attribute25               in varchar2,
745         p_ctp_attribute26               in varchar2,
746         p_ctp_attribute27               in varchar2,
747         p_ctp_attribute28               in varchar2,
748         p_ctp_attribute29               in varchar2,
749         p_ctp_attribute30               in varchar2,
750 	p_all_inelig                   in  varchar2,
751         p_object_version_number         in number
752 	)
753 	Return g_rec_type is
754 --
755   l_rec	  g_rec_type;
756   l_proc  varchar2(72) := g_package||'convert_args';
757 --
758 Begin
759   --
760   hr_utility.set_location('Entering:'||l_proc, 5);
761   --
762   -- Convert arguments into local l_rec structure.
763   --
764   l_rec.ptip_id                          := p_ptip_id;
765   l_rec.effective_start_date             := p_effective_start_date;
766   l_rec.effective_end_date               := p_effective_end_date;
767   l_rec.business_group_id                := p_business_group_id;
768   l_rec.pgm_id                           := p_pgm_id;
769   l_rec.cmbn_ptip_id                     := p_cmbn_ptip_id;
770   l_rec.cmbn_ptip_opt_id                 := p_cmbn_ptip_opt_id;
771   l_rec.acrs_ptip_cvg_id                 := p_acrs_ptip_cvg_id;
772   l_rec.pl_typ_id                        := p_pl_typ_id;
773   l_rec.coord_cvg_for_all_pls_flag       := p_coord_cvg_for_all_pls_flag;
774   l_rec.dpnt_dsgn_cd                     := p_dpnt_dsgn_cd;
775   l_rec.dpnt_cvg_strt_dt_rl              := p_dpnt_cvg_strt_dt_rl;
776   l_rec.dpnt_cvg_end_dt_rl               := p_dpnt_cvg_end_dt_rl;
777   l_rec.postelcn_edit_rl                 := p_postelcn_edit_rl;
778   l_rec.rt_end_dt_rl                     := p_rt_end_dt_rl;
779   l_rec.rt_strt_dt_rl                    := p_rt_strt_dt_rl;
780   l_rec.enrt_cvg_end_dt_rl               := p_enrt_cvg_end_dt_rl;
781   l_rec.enrt_cvg_strt_dt_rl              := p_enrt_cvg_strt_dt_rl;
782   l_rec.rqd_perd_enrt_nenrt_rl           := p_rqd_perd_enrt_nenrt_rl;
783   l_rec.auto_enrt_mthd_rl                := p_auto_enrt_mthd_rl;
784   l_rec.enrt_mthd_cd                     := p_enrt_mthd_cd;
785   l_rec.enrt_cd                          := p_enrt_cd;
786   l_rec.enrt_rl                          := p_enrt_rl;
787   l_rec.dflt_enrt_cd                     := p_dflt_enrt_cd;
788   l_rec.dflt_enrt_det_rl                 := p_dflt_enrt_det_rl;
789   l_rec.drvbl_fctr_apls_rts_flag         := p_drvbl_fctr_apls_rts_flag;
790   l_rec.drvbl_fctr_prtn_elig_flag        := p_drvbl_fctr_prtn_elig_flag;
791   l_rec.elig_apls_flag                   := p_elig_apls_flag;
792   l_rec.prtn_elig_ovrid_alwd_flag        := p_prtn_elig_ovrid_alwd_flag;
793   l_rec.trk_inelig_per_flag              := p_trk_inelig_per_flag;
794   l_rec.dpnt_cvg_strt_dt_cd              := p_dpnt_cvg_strt_dt_cd;
795   l_rec.rt_end_dt_cd                     := p_rt_end_dt_cd;
796   l_rec.rt_strt_dt_cd                    := p_rt_strt_dt_cd;
797   l_rec.enrt_cvg_end_dt_cd               := p_enrt_cvg_end_dt_cd;
798   l_rec.enrt_cvg_strt_dt_cd              := p_enrt_cvg_strt_dt_cd;
799   l_rec.dpnt_cvg_end_dt_cd               := p_dpnt_cvg_end_dt_cd;
800   l_rec.crs_this_pl_typ_only_flag        := p_crs_this_pl_typ_only_flag;
801   l_rec.ptip_stat_cd                     := p_ptip_stat_cd;
802   l_rec.mx_cvg_alwd_amt                  := p_mx_cvg_alwd_amt;
803   l_rec.mx_enrd_alwd_ovrid_num           := p_mx_enrd_alwd_ovrid_num;
804   l_rec.mn_enrd_rqd_ovrid_num            := p_mn_enrd_rqd_ovrid_num;
805   l_rec.no_mx_pl_typ_ovrid_flag          := p_no_mx_pl_typ_ovrid_flag;
806   l_rec.ordr_num                         := p_ordr_num;
807   l_rec.prvds_cr_flag                    := p_prvds_cr_flag;
808   l_rec.rqd_perd_enrt_nenrt_val          := p_rqd_perd_enrt_nenrt_val;
809   l_rec.rqd_perd_enrt_nenrt_tm_uom       := p_rqd_perd_enrt_nenrt_tm_uom;
810   l_rec.wvbl_flag                        := p_wvbl_flag;
811   l_rec.dpnt_adrs_rqd_flag               := p_dpnt_adrs_rqd_flag;
812   l_rec.dpnt_cvg_no_ctfn_rqd_flag        := p_dpnt_cvg_no_ctfn_rqd_flag;
813   l_rec.dpnt_dob_rqd_flag                := p_dpnt_dob_rqd_flag;
814   l_rec.dpnt_legv_id_rqd_flag            := p_dpnt_legv_id_rqd_flag;
815   l_rec.susp_if_dpnt_ssn_nt_prv_cd       := p_susp_if_dpnt_ssn_nt_prv_cd;
816   l_rec.susp_if_dpnt_dob_nt_prv_cd       := p_susp_if_dpnt_dob_nt_prv_cd;
817   l_rec.susp_if_dpnt_adr_nt_prv_cd       := p_susp_if_dpnt_adr_nt_prv_cd;
818   l_rec.susp_if_ctfn_not_dpnt_flag       := p_susp_if_ctfn_not_dpnt_flag;
819   l_rec.dpnt_ctfn_determine_cd           := p_dpnt_ctfn_determine_cd;
820   l_rec.drvd_fctr_dpnt_cvg_flag          := p_drvd_fctr_dpnt_cvg_flag;
821   l_rec.no_mn_pl_typ_overid_flag         := p_no_mn_pl_typ_overid_flag;
822   l_rec.sbj_to_sps_lf_ins_mx_flag      := p_sbj_to_sps_lf_ins_mx_flag;
823   l_rec.sbj_to_dpnt_lf_ins_mx_flag     := p_sbj_to_dpnt_lf_ins_mx_flag;
824   l_rec.use_to_sum_ee_lf_ins_flag        := p_use_to_sum_ee_lf_ins_flag;
825   l_rec.per_cvrd_cd                      := p_per_cvrd_cd;
826   l_rec.short_name                      := p_short_name;
827   l_rec.short_code                      := p_short_code;
828     l_rec.legislation_code                      := p_legislation_code;
829     l_rec.legislation_subgroup                      := p_legislation_subgroup;
830   l_rec.vrfy_fmly_mmbr_cd                := p_vrfy_fmly_mmbr_cd;
831   l_rec.vrfy_fmly_mmbr_rl                := p_vrfy_fmly_mmbr_rl;
832   l_rec.ivr_ident                        := p_ivr_ident;
833   l_rec.url_ref_name                     := p_url_ref_name;
834   l_rec.rqd_enrt_perd_tco_cd             := p_rqd_enrt_perd_tco_cd;
835   l_rec.ctp_attribute_category           := p_ctp_attribute_category;
836   l_rec.ctp_attribute1                   := p_ctp_attribute1;
837   l_rec.ctp_attribute2                   := p_ctp_attribute2;
838   l_rec.ctp_attribute3                   := p_ctp_attribute3;
839   l_rec.ctp_attribute4                   := p_ctp_attribute4;
840   l_rec.ctp_attribute5                   := p_ctp_attribute5;
841   l_rec.ctp_attribute6                   := p_ctp_attribute6;
842   l_rec.ctp_attribute7                   := p_ctp_attribute7;
843   l_rec.ctp_attribute8                   := p_ctp_attribute8;
844   l_rec.ctp_attribute9                   := p_ctp_attribute9;
845   l_rec.ctp_attribute10                  := p_ctp_attribute10;
846   l_rec.ctp_attribute11                  := p_ctp_attribute11;
847   l_rec.ctp_attribute12                  := p_ctp_attribute12;
848   l_rec.ctp_attribute13                  := p_ctp_attribute13;
849   l_rec.ctp_attribute14                  := p_ctp_attribute14;
850   l_rec.ctp_attribute15                  := p_ctp_attribute15;
851   l_rec.ctp_attribute16                  := p_ctp_attribute16;
852   l_rec.ctp_attribute17                  := p_ctp_attribute17;
853   l_rec.ctp_attribute18                  := p_ctp_attribute18;
854   l_rec.ctp_attribute19                  := p_ctp_attribute19;
855   l_rec.ctp_attribute20                  := p_ctp_attribute20;
856   l_rec.ctp_attribute21                  := p_ctp_attribute21;
857   l_rec.ctp_attribute22                  := p_ctp_attribute22;
858   l_rec.ctp_attribute23                  := p_ctp_attribute23;
859   l_rec.ctp_attribute24                  := p_ctp_attribute24;
860   l_rec.ctp_attribute25                  := p_ctp_attribute25;
861   l_rec.ctp_attribute26                  := p_ctp_attribute26;
862   l_rec.ctp_attribute27                  := p_ctp_attribute27;
863   l_rec.ctp_attribute28                  := p_ctp_attribute28;
864   l_rec.ctp_attribute29                  := p_ctp_attribute29;
865   l_rec.ctp_attribute30                  := p_ctp_attribute30;
866   l_rec.object_version_number            := p_object_version_number;
867   l_rec.all_inelig            := p_all_inelig;
868   --
869   -- Return the plsql record structure.
870   --
871   hr_utility.set_location(' Leaving:'||l_proc, 10);
872   Return(l_rec);
873 --
874 End convert_args;
875 --
876 end ben_ctp_shd;