DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_ELP_BUS

Source


1 Package Body ben_elp_bus as
2 /* $Header: beelprhi.pkb 120.6 2011/12/16 11:40:39 amnaraya ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_elp_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< chk_eligy_prfl_id >--------------------------|
12 -- ----------------------------------------------------------------------------
13 --
14 -- Description
15 --   This procedure is used to check that the primary key for the table
16 --   is created properly. It should be null on insert and
17 --   should not be able to be updated.
18 --
19 -- Pre Conditions
20 --   None.
21 --
22 -- In Parameters
23 --   eligy_prfl_id PK of record being inserted or updated.
24 --   effective_date Effective Date of session
25 --   object_version_number Object version number of record being
26 --                         inserted or updated.
27 --
28 -- Post Success
29 --   Processing continues
30 --
31 -- Post Failure
32 --   Errors handled by the procedure
33 --
34 -- Access Status
35 --   Internal table handler use only.
36 --
37 Procedure chk_eligy_prfl_id(p_eligy_prfl_id               in number,
38                             p_effective_date              in date,
39                             p_object_version_number       in number) is
40   --
41   l_proc         varchar2(72) := g_package||'chk_eligy_prfl_id';
42   l_api_updating boolean;
43   --
47   --
44 Begin
45   --
46   hr_utility.set_location('Entering:'||l_proc, 5);
48   l_api_updating := ben_elp_shd.api_updating
49     (p_effective_date              => p_effective_date,
50      p_eligy_prfl_id               => p_eligy_prfl_id,
51      p_object_version_number       => p_object_version_number);
52   --
53   if (l_api_updating
54      and nvl(p_eligy_prfl_id,hr_api.g_number)
55      <>  ben_elp_shd.g_old_rec.eligy_prfl_id) then
56     --
57     -- raise error as PK has changed
58     --
59     ben_elp_shd.constraint_error('BEN_ELIGY_PRFL_PK');
60     --
61   elsif not l_api_updating then
62     --
63     -- check if PK is null
64     --
65     if p_eligy_prfl_id is not null then
66       --
67       -- raise error as PK is not null
68       --
69       ben_elp_shd.constraint_error('BEN_ELIGY_PRFL_PK');
70       --
71     end if;
72     --
73   end if;
74   --
75   hr_utility.set_location('Leaving:'||l_proc, 10);
76   --
77 End chk_eligy_prfl_id;
78 --
79 -- ---------------------------------------------------------------------------
80 -- |-----------------------------< chk_name >--------------------------------|
81 -- ---------------------------------------------------------------------------
82 --
83 -- Description
84 --   This procedure is used to check that the name field is unique
85 --   on insert and on update.
86 --
87 -- Pre Conditions
88 --   None.
89 --
90 -- In Parameters
91 --   eligy_prfl_id PK of record being inserted or updated.
92 --   name that is beeing inserted ot updated to.
93 --   effective_date Effective Date of session
94 --   business group ID
95 --   object_version_number Object version number of record being
96 --                         inserted or updated.
97 --
98 -- Post Success
99 --   Processing continues
100 --
101 -- Post Failure
102 --   Errors handled by the procedure
103 --
104 -- Access Status
105 --   HR Development Internal use only.
106 --
107 Procedure chk_name(p_eligy_prfl_id               in number,
108                    p_name                        in varchar2,
109                    p_effective_date              in date,
110                    p_validation_start_date       in date,
111                    p_validation_end_date         in date,
112                    p_business_group_id           in number,
113                    p_object_version_number       in number) is
114   --
115   l_proc         varchar2(72) := g_package||'chk_name';
116   l_api_updating boolean;
117   l_exists       varchar2(1);
118   --
119   --
120   cursor csr_name is
121     select null
122     from   ben_eligy_prfl_f
123     where  name = p_name
124     and    eligy_prfl_id <> nvl(p_eligy_prfl_id, hr_api.g_number)
125     and    business_group_id + 0 = p_business_group_id
126     and    p_validation_start_date <= effective_end_date
127     and    p_validation_end_date >= effective_start_date;
128   --
129   --
130 Begin
131   --
132   hr_utility.set_location('Entering:'||l_proc, 5);
133   --
134   l_api_updating := ben_elp_shd.api_updating
135     (p_effective_date              => p_effective_date,
136      p_eligy_prfl_id               => p_eligy_prfl_id,
137      p_object_version_number       => p_object_version_number);
138   --
139   if (l_api_updating
140       and p_name <> ben_elp_shd.g_old_rec.name) or
141       not l_api_updating then
142     --
143     hr_utility.set_location('Entering:'||l_proc, 10);
144     --
145     -- check if this name already exist
146     --
147     open csr_name;
148     fetch csr_name into l_exists;
149     if csr_name%found then
150       close csr_name;
151       --
152       -- raise error as UK1 is violated
153       --
154       ben_elp_shd.constraint_error('BEN_ELIGY_PRFL_UK1');
155       --
156     end if;
157     --
158   end if;
159   --
160   hr_utility.set_location('Leaving:'||l_proc, 20);
161   --
162 End chk_name;
163 --
164 -- ----------------------------------------------------------------------------
165 -- |-------------------------------< chk_stat_cd >----------------------------|
166 -- ----------------------------------------------------------------------------
167 --
168 -- Description
169 --   This procedure is used to check that the lookup value is valid.
170 --
171 -- Pre Conditions
172 --   None.
173 --
174 -- In Parameters
175 --   eligy_prfl_id PK of record being inserted or updated.
176 --   stat_cd Value of lookup code.
177 --   effective_date effective date
178 --   object_version_number Object version number of record being
179 --                         inserted or updated.
180 --
181 -- Post Success
182 --   Processing continues
183 --
184 -- Post Failure
185 --   Error handled by procedure
186 --
187 -- Access Status
188 --   Internal table handler use only.
189 --
190 Procedure chk_stat_cd(p_eligy_prfl_id         in number,
191                       p_stat_cd               in varchar2,
192                       p_effective_date        in date,
193                       p_object_version_number in number) is
194   --
195   l_proc         varchar2(72) := g_package||'chk_stat_cd';
196   l_api_updating boolean;
197   --
198 Begin
199   --
200   hr_utility.set_location('Entering:'||l_proc, 5);
201   --
202   l_api_updating := ben_elp_shd.api_updating
203     (p_eligy_prfl_id               => p_eligy_prfl_id,
207   if (l_api_updating
204      p_effective_date              => p_effective_date,
205      p_object_version_number       => p_object_version_number);
206   --
208       and p_stat_cd
209       <> nvl(ben_elp_shd.g_old_rec.stat_cd,hr_api.g_varchar2)
210       or not l_api_updating) then
211     --
212     -- check if value of lookup falls within lookup type.
213     --
214     --
215     if hr_api.not_exists_in_hr_lookups
216           (p_lookup_type    => 'BEN_STAT',
217            p_lookup_code    => p_stat_cd,
218            p_effective_date => p_effective_date) then
219       --
220       -- raise error as does not exist as lookup
221       --
222       fnd_message.set_name('BEN','BEN_91626_STATUS_CD_INVALID');
223       fnd_message.raise_error;
224       --
225     end if;
226     --
227   end if;
228   --
229   hr_utility.set_location('Leaving:'||l_proc,10);
230   --
231 end chk_stat_cd;
232 --
233 -- ----------------------------------------------------------------------------
234 -- |-------------------------------< chk_asmt_to_use_cd >---------------------|
235 -- ----------------------------------------------------------------------------
236 --
237 -- Description
238 --   This procedure is used to check that the lookup value is valid.
239 --
240 -- Pre Conditions
241 --   None.
242 --
243 -- In Parameters
244 --   eligy_prfl_id PK of record being inserted or updated.
245 --   asmt_to_use_cd Value of lookup code.
246 --   effective_date effective date
247 --   object_version_number Object version number of record being
248 --                         inserted or updated.
249 --
250 -- Post Success
251 --   Processing continues
252 --
253 -- Post Failure
254 --   Error handled by procedure
255 --
256 -- Access Status
257 --   Internal table handler use only.
258 --
259 Procedure chk_asmt_to_use_cd(p_eligy_prfl_id         in number,
260                              p_asmt_to_use_cd        in varchar2,
261                              p_effective_date        in date,
262                              p_object_version_number in number) is
263   --
264   l_proc         varchar2(72) := g_package||'chk_asmt_to_use_cd';
265   l_api_updating boolean;
266   --
267 Begin
268   --
269   hr_utility.set_location('Entering:'||l_proc, 5);
270   --
271   l_api_updating := ben_elp_shd.api_updating
272     (p_eligy_prfl_id               => p_eligy_prfl_id,
273      p_effective_date              => p_effective_date,
274      p_object_version_number       => p_object_version_number);
275   --
276   if (l_api_updating
277       and p_asmt_to_use_cd
278       <> nvl(ben_elp_shd.g_old_rec.asmt_to_use_cd,hr_api.g_varchar2)
279       or not l_api_updating) then
280     --
281     -- check if value of lookup falls within lookup type.
282     --
283     --
284     if hr_api.not_exists_in_hr_lookups
285           (p_lookup_type    => 'BEN_ASMT_TO_USE',
286            p_lookup_code    => p_asmt_to_use_cd,
287            p_effective_date => p_effective_date) then
288       --
289       -- raise error as does not exist as lookup
290       --
291       fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
292       fnd_message.set_token('FIELD','p_asmt_to_use_cd');
293       fnd_message.set_token('TYPE','BEN_ASMT_TO_USE');
294       fnd_message.raise_error;
295       --
296     end if;
297     --
298   end if;
299   --
300   hr_utility.set_location('Leaving:'||l_proc,10);
301   --
302 end chk_asmt_to_use_cd;
303 --
304 --Bug#5248048
305 -- ----------------------------------------------------------------------------
306 -- |-------------------------------< chk_cagr_exists >----------------------------|
307 -- ----------------------------------------------------------------------------
308 
309 Procedure chk_cagr_exists(   p_eligy_prfl_id               in number,
310                              p_effective_date              in date,
311                              p_validation_start_date       in date,
312 	                     p_validation_end_date         in date
313                          ) is
314   --
315   Cursor c_cagr_exists
316     is
317     select 1
318     from   per_cagr_entitlement_lines_f cagr
319     where  cagr.eligy_prfl_id=p_eligy_prfl_id
320  /*   and    p_effective_date between cagr.effective_start_date
321            and cagr.effective_end_date;*/   --For date track updates it wont work.
322     and    p_validation_start_date <= effective_end_date
323     and    p_validation_end_date >= effective_start_date;
324   --
325   l_proc         varchar2(72) := g_package||'chk_cagr_exists';
326   l_cagr_exists  number(1);
327   l_return              VARCHAR2(240);
328   --
329   Begin
330    --
331    hr_utility.set_location('Entering:'||l_proc, 5);
332    --
333    open c_cagr_exists;
334     fetch c_cagr_exists into l_cagr_exists;
335    --
336    if c_cagr_exists%found then
337      close c_cagr_exists;
338      --Start Bug 5753149
339      l_return := fnd_message.get_string('BEN','BEN_94881_PCE_EXISTS');
340      fnd_message.set_name('BEN','BEN_94630_PCE_EXISTS');
341       fnd_message.set_token('ENTITY_NAME',l_return);
342       --End Bug 5753149
343       fnd_message.raise_error;
344 
345    end if;
346      close c_cagr_exists;
347    --
348   hr_utility.set_location('Leaving:'||l_proc, 5);
349 
350 end chk_cagr_exists;
351 --
352 --Bug#5248048
353 
354 --Start Bug 5753149
358 
355 -- ----------------------------------------------------------------------------
356 -- |-------------------------------< chk_eoep_exists >----------------------------|
357 -- ----------------------------------------------------------------------------
359 Procedure chk_eoep_exists(   p_eligy_prfl_id               in number,
360 			     p_elp_name  in varchar2,
361                              p_validation_start_date       in date,
362 	                     p_validation_end_date         in date
363                          ) is
364   --
365   Cursor c_eoep_exists
366     is
367     select 1
368     from   BEN_ELIG_OBJ_ELIG_PROFL_F eoep
369     where  eoep.elig_prfl_id=p_eligy_prfl_id
370     and    p_validation_start_date <= effective_end_date
371     and    p_validation_end_date >= effective_start_date;
372   --
373   l_proc         varchar2(72) := g_package||'chk_eoep_exists';
374   l_eoep_exists  number(1);
375   l_return              VARCHAR2(240);
376   --
377   --Start  Enh: 13478736 - Learner Access Eligibility Enhancement
378   Cursor c_lrnr_group
379 	is
380 	SELECT  'Y'
381 	FROM    ben_eligy_prfl_f
382 	WHERE   eligy_prfl_id = p_eligy_prfl_id
383 	AND     p_validation_start_date <= effective_end_date
384 	AND     p_validation_end_date >= effective_start_date
385 	AND     bnft_cagr_prtn_cd = 'LRNR';
386     l_lrnr_group  varchar2(1);
387   --End  Enh: 13478736
388   Begin
389    --
390    hr_utility.set_location('Entering:'||l_proc, 5);
391    --
392    open c_eoep_exists;
393     fetch c_eoep_exists into l_eoep_exists;
394    --
395    if c_eoep_exists%found then
396      close c_eoep_exists;
397 	 --Start  Enh: 13478736 - Learner Access Eligibility Enhancement
398 	 open c_lrnr_group;
399      fetch c_lrnr_group into l_lrnr_group;
400 	 if c_lrnr_group%found then
401 		SELECT  meaning
402 		INTO	l_return
403 		FROM    fnd_lookup_values
404 		WHERE   lookup_type = 'BEN_BNFT_CAGR_PRTN'
405 		AND     lookup_code = 'LRNR'
406 		AND     language = userenv ('lang');
407 	 else
408 		l_return := fnd_message.get_string('BEN','BEN_94882_CSC_EXISTS');
409 	 end if;
410 	 close c_lrnr_group;
411 	 --End  Enh: 13478736
412      fnd_message.set_name('BEN','BEN_94630_PCE_EXISTS');
413       fnd_message.set_token('ENTITY_NAME',l_return);
414       fnd_message.raise_error;
415    end if;
416      close c_eoep_exists;
417    --
418   hr_utility.set_location('Leaving:'||l_proc, 5);
419 
420 end chk_eoep_exists;
421 --End Bug 5753149
422 -- ----------------------------------------------------------------------------
423 -- |-------------------------------< chk_lookups >----------------------------|
424 -- ----------------------------------------------------------------------------
425 --
426 -- Description
427 --   This procedure is used to check that the lookup value is valid.
428 --
429 -- Pre Conditions
430 --   None.
431 --
432 -- In Parameters
433 --   eligy_prfl_id PK of record being inserted or updated.
434 --   elig_enrld_plip_flag Value of lookup code
435 --   elig_cbr_quald_bnf_flag Value of lookup code
436 --   elig_enrld_ptip_flag Value of lookup code
437 --   elig_dpnt_cvrd_plip_flag Value of lookup code
438 --   elig_dpnt_cvrd_ptip_flag Value of lookup code
439 --   elig_dpnt_cvrd_pgm_flag Value of lookup code
440 --   elig_job_flag Value of lookup code
441 --   elig_hrly_slrd_flag Value of lookup code
442 --   elig_pstl_cd_flag  Value of lookup code
443 --   elig_lbr_mmbr_flag Value of lookup code
444 --   elig_lgl_enty_flag Value of lookup code
445 --   elig_benfts_grp_flag Value of lookup code
446 --   elig_wk_loc_flag Value of lookup code
447 --   elig_brgng_unit_flag Value of lookup code
448 --   elig_age_flag Value of lookup code
449 --   elig_los_flag Value of lookup code
450 --   elig_per_typ_flag Value of lookup code
451 --   elig_fl_tm_pt_tm_flag Value of lookup code
452 --   elig_ee_stat_flag Value of lookup code
453 --   elig_grd_flag Value of lookup code
454 --   elig_pct_fl_tm_flag Value of lookup code
455 --   elig_asnt_set_flag Value of lookup code
456 --   elig_hrs_wkd_flag Value of lookup code
457 --   elig_comp_lvl_flag Value of lookup code
458 --   elig_org_unit_flag Value of lookup code
459 --   elig_loa_rsn_flag Value of lookup code
460 --   elig_pyrl_flag Value of lookup code
461 --   elig_schedd_hrs_flag Value of lookup code
462 --   elig_py_bss_flag Value of lookup code
463 --   eligy_prfl_rl_flag Value of lookup code
464 --   elig_cmbn_age_los_flag Value of lookup code
465 --   cntng_prtn_elig_prfl_flag Value of lookup code
466 --   elig_prtt_pl_flag Value of lookup code
467 --   elig_ppl_grp_flag Value of lookup code
468 --   elig_svc_area_flag Value of lookup code
469 --   elig_ptip_prte_flag Value of lookup code
470 --   elig_no_othr_cvg_flag Value of lookup code
471 --   elig_enrld_pl_flag Value of lookup code
472 --   elig_enrld_oipl_flag Value of lookup code
473 --   elig_enrld_pgm_flag Value of lookup code
474 --   elig_dpnt_cvrd_pl_flag Value of lookup code
475 --   elig_lvg_rsn_flag Value of lookup code
476 --   elig_optd_mdcr_flag Value of lookup code
477 --   elig_tbco_use_flag Value of lookup code
478 --   asmt_to_use_cd Value of lookup code.
479 --   elig_dsbld_flag Value of lookup code
480 --   elig_ttl_cvg_vol_flag Value of lookup code
481 --   elig_ttl_prtt_flag Value of lookup code
482 --   elig_comptncy_flag Value of lookup code
483 --   elig_hlth_cvg_flag Value of lookup code
484 --   elig_anthr_pl_flag Value of lookup code
485 --   elig_qua_in_gr_flag  Value of lookup code
486 --   elig_perf_rtng_flag  Value of lookup code
487 --   elig_crit_values_flag Value of lookup code   /* RBC */
488 --   effective_date effective date
489 --   object_version_number Object version number of record being
493 --   Processing continues
490 --                         inserted or updated.
491 --
492 -- Post Success
494 --
495 -- Post Failure
496 --   Error handled by procedure
497 --
498 -- Access Status
499 --   Internal table handler use only.
500 --
501 Procedure chk_lookups(p_eligy_prfl_id             in number,
502                       p_elig_enrld_plip_flag      in varchar2,
503                       p_elig_cbr_quald_bnf_flag   in varchar2,
504                       p_elig_enrld_ptip_flag      in varchar2,
505                       p_elig_dpnt_cvrd_plip_flag  in varchar2,
506                       p_elig_dpnt_cvrd_ptip_flag  in varchar2,
507                       p_elig_dpnt_cvrd_pgm_flag   in varchar2,
508                       p_elig_job_flag             in varchar2,
509                       p_elig_hrly_slrd_flag       in varchar2,
510                       p_elig_pstl_cd_flag         in varchar2,
511                       p_elig_lbr_mmbr_flag        in varchar2,
512                       p_elig_lgl_enty_flag        in varchar2,
513                       p_elig_benfts_grp_flag      in varchar2,
514                       p_elig_wk_loc_flag          in varchar2,
515                       p_elig_brgng_unit_flag      in varchar2,
516                       p_elig_age_flag             in varchar2,
517                       p_elig_los_flag             in varchar2,
518                       p_elig_per_typ_flag         in varchar2,
519                       p_elig_fl_tm_pt_tm_flag     in varchar2,
520                       p_elig_ee_stat_flag         in varchar2,
521                       p_elig_grd_flag             in varchar2,
522                       p_elig_pct_fl_tm_flag       in varchar2,
523                       p_elig_asnt_set_flag        in varchar2,
524                       p_elig_hrs_wkd_flag         in varchar2,
525                       p_elig_comp_lvl_flag        in varchar2,
526                       p_elig_org_unit_flag        in varchar2,
527                       p_elig_loa_rsn_flag         in varchar2,
528                       p_elig_pyrl_flag            in varchar2,
529                       p_elig_schedd_hrs_flag      in varchar2,
530                       p_elig_py_bss_flag          in varchar2,
531                       p_eligy_prfl_rl_flag        in varchar2,
532                       p_elig_cmbn_age_los_flag    in varchar2,
533                       p_cntng_prtn_elig_prfl_flag in varchar2,
534                       p_elig_prtt_pl_flag         in varchar2,
535                       p_elig_ppl_grp_flag         in varchar2,
536                       p_elig_svc_area_flag        in varchar2,
537                       p_elig_ptip_prte_flag       in varchar2,
538                       p_elig_no_othr_cvg_flag     in varchar2,
539                       p_elig_enrld_pl_flag        in varchar2,
540                       p_elig_enrld_oipl_flag      in varchar2,
541                       p_elig_enrld_pgm_flag       in varchar2,
542                       p_elig_dpnt_cvrd_pl_flag    in varchar2,
543                       p_elig_lvg_rsn_flag         in varchar2,
544                       p_elig_optd_mdcr_flag       in varchar2,
545                       p_elig_tbco_use_flag        in varchar2,
546                       p_elig_dpnt_othr_ptip_flag  in varchar2,
547                       p_elig_mrtl_sts_flag        in varchar2,
548                       p_elig_gndr_flag            in varchar2,
549                       p_elig_dsblty_ctg_flag      in varchar2,
550                       p_elig_dsblty_rsn_flag      in varchar2,
551                       p_elig_dsblty_dgr_flag      in varchar2,
552                       p_elig_suppl_role_flag      in varchar2,
553                       p_elig_qual_titl_flag       in varchar2,
554                       p_elig_pstn_flag            in varchar2,
555                       p_elig_prbtn_perd_flag      in varchar2,
556                       p_elig_sp_clng_prg_pt_flag  in varchar2,
557                       p_bnft_cagr_prtn_cd         in varchar2,
558  	              p_elig_dsbld_flag           in varchar2,
559 	              p_elig_ttl_cvg_vol_flag     in varchar2,
560 	              p_elig_ttl_prtt_flag        in varchar2,
561 	              p_elig_comptncy_flag        in varchar2,
562 	              p_elig_hlth_cvg_flag	  in varchar2,
563 	              p_elig_anthr_pl_flag	  in varchar2,
564 		      p_elig_qua_in_gr_flag	  in varchar2,
565 		      p_elig_perf_rtng_flag	  in varchar2,
566                       p_elig_crit_values_flag     in varchar2,   /* RBC */
567                       p_effective_date            in date,
568                       p_object_version_number     in number) is
569   --
570   l_proc         varchar2(72) := g_package||'chk_lookups';
571   l_api_updating boolean;
572   --
573 Begin
574   --
575   hr_utility.set_location('Entering:'||l_proc, 5);
576   --
577   l_api_updating := ben_elp_shd.api_updating
578     (p_eligy_prfl_id               => p_eligy_prfl_id,
579      p_effective_date              => p_effective_date,
580      p_object_version_number       => p_object_version_number);
581   --
582   -- We are testing flags only, it makes no sense to do tests whether an
583   -- update has occurred since its probably quicker to just call the routine
584   -- since no select is done for YES_NO lookups.
585   --
586   if hr_api.not_exists_in_hr_lookups
587         (p_lookup_type    => 'YES_NO',
588          p_lookup_code    => p_elig_enrld_plip_flag,
589          p_effective_date => p_effective_date) then
590     --
591     -- raise error as does not exist as lookup
592     --
593     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
594     fnd_message.set_token('TYPE','YES_NO');
595     fnd_message.set_token('FIELD','p_elig_enrld_plip_flag');
596     fnd_message.raise_error;
597     --
598   end if;
599   --
600   if hr_api.not_exists_in_hr_lookups
601         (p_lookup_type    => 'YES_NO',
605     -- raise error as does not exist as lookup
602          p_lookup_code    => p_elig_cbr_quald_bnf_flag,
603          p_effective_date => p_effective_date) then
604     --
606     --
607     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
608     fnd_message.set_token('TYPE','YES_NO');
609     fnd_message.set_token('FIELD','p_elig_cbr_quald_bnf_flag');
610     fnd_message.raise_error;
611     --
612   end if;
613   --
614   if hr_api.not_exists_in_hr_lookups
615         (p_lookup_type    => 'YES_NO',
616          p_lookup_code    => p_elig_enrld_ptip_flag,
617          p_effective_date => p_effective_date) then
618     --
619     -- raise error as does not exist as lookup
620     --
621     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
622     fnd_message.set_token('TYPE','YES_NO');
623     fnd_message.set_token('FIELD','p_elig_enrld_ptip_flag');
624     fnd_message.raise_error;
625     --
626   end if;
627   --
628   if hr_api.not_exists_in_hr_lookups
629         (p_lookup_type    => 'YES_NO',
630          p_lookup_code    => p_elig_dpnt_cvrd_plip_flag,
631          p_effective_date => p_effective_date) then
632     --
633     -- raise error as does not exist as lookup
634     --
635     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
636     fnd_message.set_token('TYPE','YES_NO');
637     fnd_message.set_token('FIELD','p_elig_dpnt_cvrd_plip_flag');
638     fnd_message.raise_error;
639     --
640   end if;
641   --
642   if hr_api.not_exists_in_hr_lookups
643         (p_lookup_type    => 'YES_NO',
644          p_lookup_code    => p_elig_dpnt_cvrd_ptip_flag,
645          p_effective_date => p_effective_date) then
646     --
647     -- raise error as does not exist as lookup
648     --
649     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
650     fnd_message.set_token('TYPE','YES_NO');
651     fnd_message.set_token('FIELD','p_elig_dpnt_cvrd_ptip_flag');
652     fnd_message.raise_error;
653     --
654   end if;
655   --
656   if hr_api.not_exists_in_hr_lookups
657         (p_lookup_type    => 'YES_NO',
658          p_lookup_code    => p_elig_dpnt_cvrd_pgm_flag,
659          p_effective_date => p_effective_date) then
660     --
661     -- raise error as does not exist as lookup
662     --
663     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
664     fnd_message.set_token('TYPE','YES_NO');
665     fnd_message.set_token('FIELD','p_elig_dpnt_cvrd_pgm_flag');
666     fnd_message.raise_error;
667     --
668   end if;
669   --
670   if hr_api.not_exists_in_hr_lookups
671         (p_lookup_type    => 'YES_NO',
672          p_lookup_code    => p_elig_job_flag,
673          p_effective_date => p_effective_date) then
674     --
675     -- raise error as does not exist as lookup
676     --
677     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
678     fnd_message.set_token('TYPE','YES_NO');
679     fnd_message.set_token('FIELD','p_elig_job_flag');
680     fnd_message.raise_error;
681     --
682   end if;
683   --
684   if hr_api.not_exists_in_hr_lookups
685         (p_lookup_type    => 'YES_NO',
686          p_lookup_code    => p_elig_hrly_slrd_flag,
687          p_effective_date => p_effective_date) then
688     --
689     -- raise error as does not exist as lookup
690     --
691     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
692     fnd_message.set_token('TYPE','YES_NO');
693     fnd_message.set_token('FIELD','p_elig_hrly_slrd_flag');
694     fnd_message.raise_error;
695     --
696   end if;
697   --
698   if hr_api.not_exists_in_hr_lookups
699         (p_lookup_type    => 'YES_NO',
700          p_lookup_code    => p_elig_pstl_cd_flag,
701          p_effective_date => p_effective_date) then
702     --
703     -- raise error as does not exist as lookup
704     --
705     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
706     fnd_message.set_token('TYPE','YES_NO');
707     fnd_message.set_token('FIELD','p_elig_pstl_cd_flag');
708     fnd_message.raise_error;
709     --
710   end if;
711   --
712   if hr_api.not_exists_in_hr_lookups
713         (p_lookup_type    => 'YES_NO',
714          p_lookup_code    => p_elig_lbr_mmbr_flag,
715          p_effective_date => p_effective_date) then
716     --
717     -- raise error as does not exist as lookup
718     --
719     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
720     fnd_message.set_token('TYPE','YES_NO');
721     fnd_message.set_token('FIELD','p_elig_lbr_mmbr_flag');
722     fnd_message.raise_error;
723     --
724   end if;
725   --
726   if hr_api.not_exists_in_hr_lookups
727         (p_lookup_type    => 'YES_NO',
728          p_lookup_code    => p_elig_lgl_enty_flag,
729          p_effective_date => p_effective_date) then
730     --
731     -- raise error as does not exist as lookup
732     --
733     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
734     fnd_message.set_token('TYPE','YES_NO');
735     fnd_message.set_token('FIELD','p_elig_lgl_enty_flag');
736     fnd_message.raise_error;
737     --
738   end if;
739   --
740   if hr_api.not_exists_in_hr_lookups
741         (p_lookup_type    => 'YES_NO',
742          p_lookup_code    => p_elig_benfts_grp_flag,
743          p_effective_date => p_effective_date) then
744     --
745     -- raise error as does not exist as lookup
746     --
747     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
748     fnd_message.set_token('TYPE','YES_NO');
749     fnd_message.set_token('FIELD','p_elig_benfts_grp_flag');
750     fnd_message.raise_error;
751     --
752   end if;
753   --
754   if hr_api.not_exists_in_hr_lookups
755         (p_lookup_type    => 'YES_NO',
756          p_lookup_code    => p_elig_wk_loc_flag,
757          p_effective_date => p_effective_date) then
758     --
759     -- raise error as does not exist as lookup
760     --
761     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
762     fnd_message.set_token('TYPE','YES_NO');
763     fnd_message.set_token('FIELD','p_elig_wk_loc_flag');
764     fnd_message.raise_error;
765     --
766   end if;
767   --
768   if hr_api.not_exists_in_hr_lookups
769         (p_lookup_type    => 'YES_NO',
770          p_lookup_code    => p_elig_brgng_unit_flag,
771          p_effective_date => p_effective_date) then
772     --
773     -- raise error as does not exist as lookup
774     --
775     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
776     fnd_message.set_token('TYPE','YES_NO');
777     fnd_message.set_token('FIELD','p_elig_brgng_unit_flag');
778     fnd_message.raise_error;
779     --
780   end if;
781   --
782   if hr_api.not_exists_in_hr_lookups
783         (p_lookup_type    => 'YES_NO',
784          p_lookup_code    => p_elig_age_flag,
785          p_effective_date => p_effective_date) then
786     --
787     -- raise error as does not exist as lookup
788     --
789     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
790     fnd_message.set_token('TYPE','YES_NO');
791     fnd_message.set_token('FIELD','p_elig_age_flag');
792     fnd_message.raise_error;
793     --
794   end if;
795   --
796   if hr_api.not_exists_in_hr_lookups
797         (p_lookup_type    => 'YES_NO',
798          p_lookup_code    => p_elig_los_flag,
799          p_effective_date => p_effective_date) then
800     --
801     -- raise error as does not exist as lookup
802     --
803     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
804     fnd_message.set_token('TYPE','YES_NO');
805     fnd_message.set_token('FIELD','p_elig_los_flag');
806     fnd_message.raise_error;
807     --
808   end if;
809   --
810   if hr_api.not_exists_in_hr_lookups
811         (p_lookup_type    => 'YES_NO',
812          p_lookup_code    => p_elig_per_typ_flag,
813          p_effective_date => p_effective_date) then
814     --
815     -- raise error as does not exist as lookup
816     --
817     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
818     fnd_message.set_token('TYPE','YES_NO');
819     fnd_message.set_token('FIELD','p_elig_per_typ_flag');
820     fnd_message.raise_error;
821     --
822   end if;
823   --
824   if hr_api.not_exists_in_hr_lookups
825         (p_lookup_type    => 'YES_NO',
826          p_lookup_code    => p_elig_fl_tm_pt_tm_flag,
827          p_effective_date => p_effective_date) then
828     --
829     -- raise error as does not exist as lookup
830     --
831     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
832     fnd_message.set_token('TYPE','YES_NO');
833     fnd_message.set_token('FIELD','p_elig_fl_tm_pt_tm_flag');
834     fnd_message.raise_error;
835     --
836   end if;
837   --
838   if hr_api.not_exists_in_hr_lookups
839         (p_lookup_type    => 'YES_NO',
840          p_lookup_code    => p_elig_ee_stat_flag,
841          p_effective_date => p_effective_date) then
842     --
843     -- raise error as does not exist as lookup
847     fnd_message.set_token('FIELD','p_elig_ee_stat_flag');
844     --
845     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
846     fnd_message.set_token('TYPE','YES_NO');
848     fnd_message.raise_error;
849     --
850   end if;
851   --
852   if hr_api.not_exists_in_hr_lookups
853         (p_lookup_type    => 'YES_NO',
854          p_lookup_code    => p_elig_grd_flag,
855          p_effective_date => p_effective_date) then
856     --
857     -- raise error as does not exist as lookup
858     --
859     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
860     fnd_message.set_token('TYPE','YES_NO');
861     fnd_message.set_token('FIELD','p_elig_grd_flag');
862     fnd_message.raise_error;
863     --
864   end if;
865   --
866   if hr_api.not_exists_in_hr_lookups
867         (p_lookup_type    => 'YES_NO',
868          p_lookup_code    => p_elig_pct_fl_tm_flag,
869          p_effective_date => p_effective_date) then
870     --
871     -- raise error as does not exist as lookup
872     --
873     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
874     fnd_message.set_token('TYPE','YES_NO');
875     fnd_message.set_token('FIELD','p_elig_pct_fl_tm_flag');
876     fnd_message.raise_error;
877     --
878   end if;
879   --
880   if hr_api.not_exists_in_hr_lookups
881         (p_lookup_type    => 'YES_NO',
882          p_lookup_code    => p_elig_asnt_set_flag,
883          p_effective_date => p_effective_date) then
884     --
885     -- raise error as does not exist as lookup
886     --
887     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
888     fnd_message.set_token('TYPE','YES_NO');
889     fnd_message.set_token('FIELD','p_elig_asnt_set_flag');
890     fnd_message.raise_error;
891     --
892   end if;
893   --
894   if hr_api.not_exists_in_hr_lookups
895         (p_lookup_type    => 'YES_NO',
896          p_lookup_code    => p_elig_hrs_wkd_flag,
897          p_effective_date => p_effective_date) then
898     --
899     -- raise error as does not exist as lookup
900     --
901     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
902     fnd_message.set_token('TYPE','YES_NO');
903     fnd_message.set_token('FIELD','p_elig_hrs_wkd_flag');
904     fnd_message.raise_error;
905     --
906   end if;
907   --
908   if hr_api.not_exists_in_hr_lookups
909         (p_lookup_type    => 'YES_NO',
910          p_lookup_code    => p_elig_comp_lvl_flag,
911          p_effective_date => p_effective_date) then
912     --
913     -- raise error as does not exist as lookup
914     --
915     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
916     fnd_message.set_token('TYPE','YES_NO');
917     fnd_message.set_token('FIELD','p_elig_comp_lvl_flag');
918     fnd_message.raise_error;
919     --
920   end if;
921   --
922   if hr_api.not_exists_in_hr_lookups
923         (p_lookup_type    => 'YES_NO',
924          p_lookup_code    => p_elig_org_unit_flag,
925          p_effective_date => p_effective_date) then
926     --
927     -- raise error as does not exist as lookup
928     --
929     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
930     fnd_message.set_token('TYPE','YES_NO');
931     fnd_message.set_token('FIELD','p_elig_org_unit_flag');
932     fnd_message.raise_error;
933     --
934   end if;
935   --
936   if hr_api.not_exists_in_hr_lookups
937         (p_lookup_type    => 'YES_NO',
938          p_lookup_code    => p_elig_loa_rsn_flag,
939          p_effective_date => p_effective_date) then
940     --
941     -- raise error as does not exist as lookup
942     --
943     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
944     fnd_message.set_token('TYPE','YES_NO');
945     fnd_message.set_token('FIELD','p_elig_loa_rsn_flag');
946     fnd_message.raise_error;
947     --
948   end if;
949   --
950   if hr_api.not_exists_in_hr_lookups
951         (p_lookup_type    => 'YES_NO',
952          p_lookup_code    => p_elig_pyrl_flag,
953          p_effective_date => p_effective_date) then
954     --
955     -- raise error as does not exist as lookup
956     --
957     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
958     fnd_message.set_token('TYPE','YES_NO');
959     fnd_message.set_token('FIELD','p_elig_pyrl_flag');
960     fnd_message.raise_error;
961     --
962   end if;
963   --
964   if hr_api.not_exists_in_hr_lookups
965         (p_lookup_type    => 'YES_NO',
966          p_lookup_code    => p_elig_schedd_hrs_flag,
967          p_effective_date => p_effective_date) then
968     --
969     -- raise error as does not exist as lookup
970     --
971     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
972     fnd_message.set_token('TYPE','YES_NO');
973     fnd_message.set_token('FIELD','p_elig_schedd_hrs_flag');
974     fnd_message.raise_error;
975     --
976   end if;
977   --
978   if hr_api.not_exists_in_hr_lookups
979         (p_lookup_type    => 'YES_NO',
980          p_lookup_code    => p_elig_py_bss_flag,
981          p_effective_date => p_effective_date) then
982     --
983     -- raise error as does not exist as lookup
984     --
985     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
986     fnd_message.set_token('TYPE','YES_NO');
987     fnd_message.set_token('FIELD','p_elig_py_bss_flag');
988     fnd_message.raise_error;
989     --
990   end if;
991   --
992   if hr_api.not_exists_in_hr_lookups
996     --
993         (p_lookup_type    => 'YES_NO',
994          p_lookup_code    => p_eligy_prfl_rl_flag,
995          p_effective_date => p_effective_date) then
997     -- raise error as does not exist as lookup
998     --
999     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1000     fnd_message.set_token('TYPE','YES_NO');
1001     fnd_message.set_token('FIELD','p_eligy_prfl_rl_flag');
1002     fnd_message.raise_error;
1003     --
1004   end if;
1005   --
1006   if hr_api.not_exists_in_hr_lookups
1007         (p_lookup_type    => 'YES_NO',
1008          p_lookup_code    => p_elig_cmbn_age_los_flag,
1009          p_effective_date => p_effective_date) then
1010     --
1011     -- raise error as does not exist as lookup
1012     --
1013     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1014     fnd_message.set_token('TYPE','YES_NO');
1015     fnd_message.set_token('FIELD','p_elig_cmbn_age_los_flag');
1016     fnd_message.raise_error;
1017     --
1018   end if;
1019   --
1020   if hr_api.not_exists_in_hr_lookups
1021         (p_lookup_type    => 'YES_NO',
1022          p_lookup_code    => p_cntng_prtn_elig_prfl_flag,
1023          p_effective_date => p_effective_date) then
1024     --
1025     -- raise error as does not exist as lookup
1026     --
1027     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1028     fnd_message.set_token('TYPE','YES_NO');
1029     fnd_message.set_token('FIELD','p_cntng_prtn_elig_prfl_flag');
1030     fnd_message.raise_error;
1031     --
1032   end if;
1033   --
1034   if hr_api.not_exists_in_hr_lookups
1035         (p_lookup_type    => 'YES_NO',
1036          p_lookup_code    => p_elig_prtt_pl_flag,
1037          p_effective_date => p_effective_date) then
1038     --
1039     -- raise error as does not exist as lookup
1040     --
1041     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1042     fnd_message.set_token('TYPE','YES_NO');
1043     fnd_message.set_token('FIELD','p_elig_prtt_pl_flag');
1044     fnd_message.raise_error;
1045     --
1046   end if;
1047   --
1048   if hr_api.not_exists_in_hr_lookups
1049         (p_lookup_type    => 'YES_NO',
1050          p_lookup_code    => p_elig_ppl_grp_flag,
1051          p_effective_date => p_effective_date) then
1052     --
1053     -- raise error as does not exist as lookup
1054     --
1055     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1056     fnd_message.set_token('TYPE','YES_NO');
1057     fnd_message.set_token('FIELD','p_elig_ppl_grp_flag');
1058     fnd_message.raise_error;
1059     --
1060   end if;
1061   --
1062   if hr_api.not_exists_in_hr_lookups
1063         (p_lookup_type    => 'YES_NO',
1064          p_lookup_code    => p_elig_svc_area_flag,
1065          p_effective_date => p_effective_date) then
1066     --
1067     -- raise error as does not exist as lookup
1068     --
1069     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1070     fnd_message.set_token('TYPE','YES_NO');
1071     fnd_message.set_token('FIELD','p_elig_svc_area_flag');
1072     fnd_message.raise_error;
1073     --
1074   end if;
1075   --
1076   if hr_api.not_exists_in_hr_lookups
1077         (p_lookup_type    => 'YES_NO',
1078          p_lookup_code    => p_elig_ptip_prte_flag,
1079          p_effective_date => p_effective_date) then
1080     --
1081     -- raise error as does not exist as lookup
1082     --
1083     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1084     fnd_message.set_token('TYPE','YES_NO');
1085     fnd_message.set_token('FIELD','p_elig_ptip_prte_flag');
1086     fnd_message.raise_error;
1087     --
1088   end if;
1089   --
1090   if hr_api.not_exists_in_hr_lookups
1091         (p_lookup_type    => 'YES_NO',
1092          p_lookup_code    => p_elig_no_othr_cvg_flag,
1093          p_effective_date => p_effective_date) then
1094     --
1095     -- raise error as does not exist as lookup
1096     --
1097     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1098     fnd_message.set_token('TYPE','YES_NO');
1099     fnd_message.set_token('FIELD','p_elig_no_othr_cvg_flag');
1100     fnd_message.raise_error;
1101     --
1102   end if;
1103   --
1104   if hr_api.not_exists_in_hr_lookups
1105         (p_lookup_type    => 'YES_NO',
1106          p_lookup_code    => p_elig_enrld_pl_flag,
1107          p_effective_date => p_effective_date) then
1108     --
1109     -- raise error as does not exist as lookup
1110     --
1111     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1112     fnd_message.set_token('TYPE','YES_NO');
1113     fnd_message.set_token('FIELD','p_elig_enrld_pl_flag');
1114     fnd_message.raise_error;
1115     --
1116   end if;
1117   --
1118   if hr_api.not_exists_in_hr_lookups
1119         (p_lookup_type    => 'YES_NO',
1120          p_lookup_code    => p_elig_enrld_oipl_flag,
1121          p_effective_date => p_effective_date) then
1122     --
1123     -- raise error as does not exist as lookup
1124     --
1125     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1126     fnd_message.set_token('TYPE','YES_NO');
1127     fnd_message.set_token('FIELD','p_elig_enrld_oipl_flag');
1128     fnd_message.raise_error;
1129     --
1130   end if;
1131   --
1132   if hr_api.not_exists_in_hr_lookups
1133         (p_lookup_type    => 'YES_NO',
1134          p_lookup_code    => p_elig_enrld_pgm_flag,
1135          p_effective_date => p_effective_date) then
1136     --
1137     -- raise error as does not exist as lookup
1138     --
1139     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1140     fnd_message.set_token('TYPE','YES_NO');
1141     fnd_message.set_token('FIELD','p_elig_enrld_pgm_flag');
1145   --
1142     fnd_message.raise_error;
1143     --
1144   end if;
1146   if hr_api.not_exists_in_hr_lookups
1147         (p_lookup_type    => 'YES_NO',
1148          p_lookup_code    => p_elig_dpnt_cvrd_pl_flag,
1149          p_effective_date => p_effective_date) then
1150     --
1151     -- raise error as does not exist as lookup
1152     --
1153     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1154     fnd_message.set_token('TYPE','YES_NO');
1155     fnd_message.set_token('FIELD','p_elig_dpnt_cvrd_pl_flag');
1156     fnd_message.raise_error;
1157     --
1158   end if;
1159   --
1160   if hr_api.not_exists_in_hr_lookups
1161         (p_lookup_type    => 'YES_NO',
1162          p_lookup_code    => p_elig_lvg_rsn_flag,
1163          p_effective_date => p_effective_date) then
1164     --
1165     -- raise error as does not exist as lookup
1166     --
1167     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1168     fnd_message.set_token('TYPE','YES_NO');
1169     fnd_message.set_token('FIELD','p_elig_lvg_rsn_flag');
1170     fnd_message.raise_error;
1171     --
1172   end if;
1173   --
1174   if hr_api.not_exists_in_hr_lookups
1175         (p_lookup_type    => 'YES_NO',
1176          p_lookup_code    => p_elig_optd_mdcr_flag,
1177          p_effective_date => p_effective_date) then
1178     --
1179     -- raise error as does not exist as lookup
1180     --
1181     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1182     fnd_message.set_token('TYPE','YES_NO');
1183     fnd_message.set_token('FIELD','p_elig_optd_mdcr_flag');
1184     fnd_message.raise_error;
1185     --
1186   end if;
1187   --
1188   if hr_api.not_exists_in_hr_lookups
1189         (p_lookup_type    => 'YES_NO',
1190          p_lookup_code    => p_elig_tbco_use_flag,
1191          p_effective_date => p_effective_date) then
1192     --
1193     -- raise error as does not exist as lookup
1194     --
1195     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1196     fnd_message.set_token('TYPE','YES_NO');
1197     fnd_message.set_token('FIELD','p_elig_tbco_use_flag');
1198     fnd_message.raise_error;
1199     --
1200   end if;
1201   --
1202   if hr_api.not_exists_in_hr_lookups
1203         (p_lookup_type    => 'YES_NO',
1204          p_lookup_code    => p_elig_dpnt_othr_ptip_flag,
1205          p_effective_date => p_effective_date) then
1206     --
1207     -- raise error as does not exist as lookup
1208     --
1209     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1210     fnd_message.set_token('TYPE','YES_NO');
1211     fnd_message.set_token('FIELD','p_elig_dpnt_othr_ptip_flag');
1212     fnd_message.raise_error;
1213     --
1214   end if;
1215   --
1216   if hr_api.not_exists_in_hr_lookups
1217         (p_lookup_type    => 'YES_NO',
1218          p_lookup_code    => p_elig_dsbld_flag,
1219          p_effective_date => p_effective_date) then
1220     --
1221     -- raise error as does not exist as lookup
1222     --
1223     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1224     fnd_message.set_token('TYPE','YES_NO');
1225     fnd_message.set_token('FIELD','p_elig_dsbld_flag');
1226     fnd_message.raise_error;
1227     --
1228   end if;
1229   --
1230   if hr_api.not_exists_in_hr_lookups
1231         (p_lookup_type    => 'YES_NO',
1232          p_lookup_code    => p_elig_ttl_cvg_vol_flag,
1233          p_effective_date => p_effective_date) then
1234     --
1235     -- raise error as does not exist as lookup
1236     --
1237     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1238     fnd_message.set_token('TYPE','YES_NO');
1239     fnd_message.set_token('FIELD','p_elig_ttl_cvg_vol_flag');
1240     fnd_message.raise_error;
1241     --
1242   end if;
1243   --
1244   if hr_api.not_exists_in_hr_lookups
1245         (p_lookup_type    => 'YES_NO',
1246          p_lookup_code    => p_elig_ttl_prtt_flag,
1247          p_effective_date => p_effective_date) then
1248     --
1249     -- raise error as does not exist as lookup
1250     --
1251     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1252     fnd_message.set_token('TYPE','YES_NO');
1253     fnd_message.set_token('FIELD','p_elig_ttl_prtt_flag');
1254     fnd_message.raise_error;
1255     --
1256   end if;
1257   --
1258   if hr_api.not_exists_in_hr_lookups
1259         (p_lookup_type    => 'YES_NO',
1260          p_lookup_code    => p_elig_comptncy_flag,
1261          p_effective_date => p_effective_date) then
1262     --
1263     -- raise error as does not exist as lookup
1264     --
1265     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1266     fnd_message.set_token('TYPE','YES_NO');
1267     fnd_message.set_token('FIELD','p_elig_comptncy_flag');
1268     fnd_message.raise_error;
1269     --
1270   end if;
1271   --
1272   if hr_api.not_exists_in_hr_lookups
1273         (p_lookup_type    => 'YES_NO',
1274          p_lookup_code    => p_elig_hlth_cvg_flag,
1275          p_effective_date => p_effective_date) then
1276     --
1277     -- raise error as does not exist as lookup
1278     --
1279     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1280     fnd_message.set_token('TYPE','YES_NO');
1281     fnd_message.set_token('FIELD','p_elig_hlth_cvg_flag');
1282     fnd_message.raise_error;
1283     --
1284   end if;
1285   --
1286   if hr_api.not_exists_in_hr_lookups
1287         (p_lookup_type    => 'YES_NO',
1288          p_lookup_code    => p_elig_anthr_pl_flag,
1289          p_effective_date => p_effective_date) then
1290     --
1291     -- raise error as does not exist as lookup
1292     --
1293     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1297     --
1294     fnd_message.set_token('TYPE','YES_NO');
1295     fnd_message.set_token('FIELD','p_elig_anthr_pl_flag');
1296     fnd_message.raise_error;
1298   end if;
1299   --
1300   if hr_api.not_exists_in_hr_lookups
1301         (p_lookup_type    => 'YES_NO',
1302          p_lookup_code    => p_elig_qua_in_gr_flag,
1303          p_effective_date => p_effective_date) then
1304     --
1305     -- raise error as does not exist as lookup
1306     --
1307     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1308     fnd_message.set_token('TYPE','YES_NO');
1309     fnd_message.set_token('FIELD','p_elig_qua_in_gr_flag');
1310     fnd_message.raise_error;
1311     --
1312   end if;
1313   --
1314   if hr_api.not_exists_in_hr_lookups
1315         (p_lookup_type    => 'YES_NO',
1316          p_lookup_code    => p_elig_perf_rtng_flag,
1317          p_effective_date => p_effective_date) then
1318     --
1319     -- raise error as does not exist as lookup
1320     --
1321     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1322     fnd_message.set_token('TYPE','YES_NO');
1323     fnd_message.set_token('FIELD','p_elig_perf_rtng_flag');
1324     fnd_message.raise_error;
1325     --
1326   end if;
1327   --
1328   --
1329   if hr_api.not_exists_in_hr_lookups
1330         (p_lookup_type    => 'YES_NO',
1331          p_lookup_code    => p_elig_crit_values_flag,
1332          p_effective_date => p_effective_date) then
1333     --
1334     -- raise error as does not exist as lookup
1335     --
1336     fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
1337     fnd_message.set_token('TYPE','YES_NO');
1338     fnd_message.set_token('FIELD','p_elig_crit_values_flag');
1339     fnd_message.raise_error;
1340     --
1341   end if;
1342   hr_utility.set_location('Leaving:'||l_proc,10);
1343   --
1344 end chk_lookups;
1345 -- ----------------------------------------------------------------------------
1346 -- |--------------------------< dt_update_validate >--------------------------|
1347 -- ----------------------------------------------------------------------------
1348 -- {Start Of Comments}
1349 --
1350 -- Description:
1351 --   This procedure is used for referential integrity of datetracked
1352 --   parent entities when a datetrack update operation is taking place
1353 --   and where there is no cascading of update defined for this entity.
1354 --
1355 -- Prerequisites:
1356 --   This procedure is called from the update_validate.
1357 --
1358 -- In Parameters:
1359 --
1360 -- Post Success:
1361 --   Processing continues.
1362 --
1363 -- Post Failure:
1364 --
1365 -- Developer Implementation Notes:
1366 --   This procedure should not need maintenance unless the HR Schema model
1367 --   changes.
1368 --
1369 -- Access Status:
1370 --   Internal Row Handler Use Only.
1371 --
1372 -- {End Of Comments}
1373 -- ----------------------------------------------------------------------------
1374 Procedure dt_update_validate
1375             (p_datetrack_mode		     in varchar2,
1376              p_validation_start_date	     in date,
1377 	     p_validation_end_date	     in date) Is
1378 --
1379   l_proc	    varchar2(72) := g_package||'dt_update_validate';
1380   l_integrity_error Exception;
1381   l_table_name	    all_tables.table_name%TYPE;
1382 --
1383 Begin
1384   hr_utility.set_location('Entering:'||l_proc, 5);
1385   --
1386   -- Ensure that the p_datetrack_mode argument is not null
1387   --
1388   hr_api.mandatory_arg_error
1389     (p_api_name       => l_proc,
1390      p_argument       => 'datetrack_mode',
1391      p_argument_value => p_datetrack_mode);
1392   --
1393   -- Only perform the validation if the datetrack update mode is valid
1394   --
1395   If (dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode)) then
1396     --
1397     --
1398     -- Ensure the arguments are not null
1399     --
1400     hr_api.mandatory_arg_error
1401       (p_api_name       => l_proc,
1402        p_argument       => 'validation_start_date',
1403        p_argument_value => p_validation_start_date);
1404     --
1405     hr_api.mandatory_arg_error
1406       (p_api_name       => l_proc,
1407        p_argument       => 'validation_end_date',
1408        p_argument_value => p_validation_end_date);
1409     --
1410     --
1411     --
1412   End If;
1413   --
1414   hr_utility.set_location(' Leaving:'||l_proc, 10);
1415 Exception
1416   When l_integrity_error Then
1417     --
1418     -- A referential integrity check was violated therefore
1419     -- we must error
1420     --
1421     fnd_message.set_name('PAY', 'HR_7216_DT_UPD_INTEGRITY_ERR');
1422     fnd_message.set_token('TABLE_NAME', l_table_name);
1423     fnd_message.raise_error;
1424   When Others Then
1425     --
1426     -- An unhandled or unexpected error has occurred which
1427     -- we must report
1428     --
1429     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
1430     fnd_message.set_token('PROCEDURE', l_proc);
1431     fnd_message.set_token('STEP','15');
1432     fnd_message.raise_error;
1433 End dt_update_validate;
1434 --
1435 -- ----------------------------------------------------------------------------
1436 -- |--------------------------< dt_delete_validate >--------------------------|
1437 -- ----------------------------------------------------------------------------
1438 -- {Start Of Comments}
1439 --
1440 -- Description:
1441 --   This procedure is used for referential integrity of datetracked
1442 --   child entities when either a datetrack DELETE or ZAP is in operation
1443 --   and where there is no cascading of delete defined for this entity.
1447 --
1444 --   For the datetrack mode of DELETE or ZAP we must ensure that no
1445 --   datetracked child rows exist between the validation start and end
1446 --   dates.
1448 -- Prerequisites:
1449 --   This procedure is called from the delete_validate.
1450 --
1451 -- In Parameters:
1452 --
1453 -- Post Success:
1454 --   Processing continues.
1455 --
1456 -- Post Failure:
1457 --   If a row exists by determining the returning Boolean value from the
1458 --   generic dt_api.rows_exist function then we must supply an error via
1459 --   the use of the local exception handler l_rows_exist.
1460 --
1461 -- Developer Implementation Notes:
1462 --   This procedure should not need maintenance unless the HR Schema model
1463 --   changes.
1464 --
1465 -- Access Status:
1466 --   Internal Row Handler Use Only.
1467 --
1468 -- {End Of Comments}
1469 -- ----------------------------------------------------------------------------
1470 Procedure dt_delete_validate
1471             (p_eligy_prfl_id		in number,
1472              p_datetrack_mode		in varchar2,
1473 	     p_validation_start_date	in date,
1474 	     p_validation_end_date	in date,
1475              p_name                     in varchar2) Is
1476 --
1477   l_proc	varchar2(72) 	:= g_package||'dt_delete_validate';
1478   l_rows_exist	Exception;
1479   l_table_name	all_tables.table_name%TYPE;
1480 --
1481 Begin
1482   hr_utility.set_location('Entering:'||l_proc, 5);
1483   --
1484   -- Ensure that the p_datetrack_mode argument is not null
1485   --
1486   hr_api.mandatory_arg_error
1487     (p_api_name       => l_proc,
1488      p_argument       => 'datetrack_mode',
1489      p_argument_value => p_datetrack_mode);
1490   --
1491   -- Only perform the validation if the datetrack mode is either
1492   -- DELETE or ZAP
1493   --
1494   If (p_datetrack_mode = 'DELETE' or
1495       p_datetrack_mode = 'ZAP') then
1496     --
1497     --
1498     -- Ensure the arguments are not null
1499     --
1500     hr_api.mandatory_arg_error
1501       (p_api_name       => l_proc,
1502        p_argument       => 'validation_start_date',
1503        p_argument_value => p_validation_start_date);
1504     --
1505     hr_api.mandatory_arg_error
1506       (p_api_name       => l_proc,
1507        p_argument       => 'validation_end_date',
1508        p_argument_value => p_validation_end_date);
1509     --
1510     hr_api.mandatory_arg_error
1511       (p_api_name       => l_proc,
1512        p_argument       => 'eligy_prfl_id',
1513        p_argument_value => p_eligy_prfl_id);
1514     --
1515      If (dt_api.rows_exist
1516           (p_base_table_name => 'BEN_VRBL_RT_ELIG_PRFL_F',
1517            p_base_key_column => 'eligy_prfl_id',
1518            p_base_key_value  => p_eligy_prfl_id,
1519            p_from_date       => p_validation_start_date,
1520            p_to_date         => p_validation_end_date)) Then
1521       l_table_name := 'BEN_VRBL_RT_ELIG_PRFL_F';
1522       Raise l_rows_exist;
1523     End If;
1524     --
1525   End If;
1526   --
1527   hr_utility.set_location(' Leaving:'||l_proc, 10);
1528 Exception
1529     --
1530   When l_rows_exist Then
1531     --
1532     -- A referential integrity check was violated therefore
1533     -- we must error
1534     --
1535     ben_utility.child_exists_error(p_table_name               => l_table_name,
1536                                    p_parent_table_name        => 'BEN_ELIGY_PRFL_F',      /* Bug 4057566 */
1537                                    p_parent_entity_name       => p_name);                 /* Bug 4057566 */
1538     --
1539   When Others Then
1540     --
1541     -- An unhandled or unexpected error has occurred which
1542     -- we must report
1543     --
1544     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
1545     fnd_message.set_token('PROCEDURE', l_proc);
1546     fnd_message.set_token('STEP','15');
1547     fnd_message.raise_error;
1548 End dt_delete_validate;
1549 --
1550 -- ----------------------------------------------------------------------------
1551 -- |---------------------------< insert_validate >----------------------------|
1552 -- ----------------------------------------------------------------------------
1553 Procedure insert_validate
1554 	(p_rec 			 in ben_elp_shd.g_rec_type,
1555 	 p_effective_date	 in date,
1556 	 p_datetrack_mode	 in varchar2,
1557 	 p_validation_start_date in date,
1558 	 p_validation_end_date	 in date) is
1559 --
1560   l_proc	varchar2(72) := g_package||'insert_validate';
1561 --
1562 Begin
1563   hr_utility.set_location('Entering:'||l_proc, 5);
1564   --
1565   -- Call all supporting business operations
1566   --
1567   --
1568   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
1569   --
1570   chk_eligy_prfl_id
1571   (p_eligy_prfl_id         => p_rec.eligy_prfl_id,
1572    p_effective_date        => p_effective_date,
1573    p_object_version_number => p_rec.object_version_number);
1574   --
1575   chk_name
1576   (p_eligy_prfl_id         => p_rec.eligy_prfl_id,
1577    p_name                  => p_rec.name,
1578    p_effective_date        => p_effective_date,
1579    p_validation_start_date => p_validation_start_date,
1580    p_validation_end_date   => p_validation_end_date,
1581    p_business_group_id     => p_rec.business_group_id,
1582    p_object_version_number => p_rec.object_version_number);
1583   --
1584   chk_stat_cd
1585   (p_eligy_prfl_id         => p_rec.eligy_prfl_id,
1586    p_stat_cd               => p_rec.stat_cd,
1587    p_effective_date        => p_effective_date,
1588    p_object_version_number => p_rec.object_version_number);
1589   --
1590   chk_asmt_to_use_cd
1594    p_object_version_number => p_rec.object_version_number);
1591   (p_eligy_prfl_id         => p_rec.eligy_prfl_id,
1592    p_asmt_to_use_cd        => p_rec.asmt_to_use_cd,
1593    p_effective_date        => p_effective_date,
1595   --
1596   hr_utility.set_location(' Leaving:'||l_proc, 10);
1597 End insert_validate;
1598 --
1599 -- ----------------------------------------------------------------------------
1600 -- |---------------------------< update_validate >----------------------------|
1601 -- ----------------------------------------------------------------------------
1602 Procedure update_validate
1603 	(p_rec 			 in ben_elp_shd.g_rec_type,
1604 	 p_effective_date	 in date,
1605 	 p_datetrack_mode	 in varchar2,
1606 	 p_validation_start_date in date,
1607 	 p_validation_end_date	 in date) is
1608 --
1609   l_proc	varchar2(72) := g_package||'update_validate';
1610 --
1611 Begin
1612   hr_utility.set_location('Entering:'||l_proc, 5);
1613   --
1614   -- Call all supporting business operations
1615   --
1616   --
1617   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
1618   --
1619   chk_eligy_prfl_id
1620   (p_eligy_prfl_id         => p_rec.eligy_prfl_id,
1621    p_effective_date        => p_effective_date,
1622    p_object_version_number => p_rec.object_version_number);
1623   --
1624   chk_stat_cd
1625   (p_eligy_prfl_id         => p_rec.eligy_prfl_id,
1626    p_stat_cd               => p_rec.stat_cd,
1627    p_effective_date        => p_effective_date,
1628    p_object_version_number => p_rec.object_version_number);
1629   --
1630   chk_asmt_to_use_cd
1631   (p_eligy_prfl_id         => p_rec.eligy_prfl_id,
1632    p_asmt_to_use_cd        => p_rec.asmt_to_use_cd,
1633    p_effective_date        => p_effective_date,
1634    p_object_version_number => p_rec.object_version_number);
1635   --
1636   chk_name
1637   (p_eligy_prfl_id         => p_rec.eligy_prfl_id,
1638    p_name                  => p_rec.name,
1639    p_effective_date        => p_effective_date,
1640    p_validation_start_date => p_validation_start_date,
1641    p_validation_end_date   => p_validation_end_date,
1642    p_business_group_id     => p_rec.business_group_id,
1643    p_object_version_number => p_rec.object_version_number);
1644   --
1645   -- Call the datetrack update integrity operation
1646   --
1647   dt_update_validate
1648     (p_datetrack_mode                => p_datetrack_mode,
1649      p_validation_start_date	     => p_validation_start_date,
1650      p_validation_end_date	     => p_validation_end_date);
1651   --
1652   hr_utility.set_location(' Leaving:'||l_proc, 10);
1653 End update_validate;
1654 --
1655 -- ----------------------------------------------------------------------------
1656 -- |---------------------------< delete_validate >----------------------------|
1657 -- ----------------------------------------------------------------------------
1658 Procedure delete_validate
1659 	(p_rec 			 in ben_elp_shd.g_rec_type,
1660 	 p_effective_date	 in date,
1661 	 p_datetrack_mode	 in varchar2,
1662 	 p_validation_start_date in date,
1663 	 p_validation_end_date	 in date) is
1664 --
1665   l_proc	varchar2(72) := g_package||'delete_validate';
1666    --
1667    CURSOR c_elp_name
1668    IS
1669       SELECT elp.NAME
1670         FROM ben_eligy_prfl_f elp
1671        WHERE elp.eligy_prfl_id = p_rec.eligy_prfl_id
1672          AND p_effective_date BETWEEN elp.effective_start_date
1673                                   AND elp.effective_end_date;
1674    --
1675    l_elp_name            ben_eligy_prfl_f.name%type;
1676 --
1677 Begin
1678   hr_utility.set_location('Entering:'||l_proc, 5);
1679   --
1680   OPEN c_elp_name;
1681     --
1682     FETCH c_elp_name INTO l_elp_name;
1683     --
1684   CLOSE c_elp_name;
1685   --
1686 --Bug#5248048
1687   chk_cagr_exists
1688       (p_eligy_prfl_id =>  p_rec.eligy_prfl_id,
1689        p_effective_date => p_effective_date,
1690        p_validation_start_date => p_validation_start_date,
1691        p_validation_end_date   => p_validation_end_date
1692       );
1693 --Bug#5248048
1694 
1695 --Start Bug 5753149
1696 --Restrict deletion of ELPRO if attached to a work schedule
1697   chk_eoep_exists
1698       (p_eligy_prfl_id =>  p_rec.eligy_prfl_id,
1699        p_elp_name =>  l_elp_name,
1700        p_validation_start_date => p_validation_start_date,
1701        p_validation_end_date   => p_validation_end_date
1702       );
1703 --End Bug 5753149
1704 
1705   -- Call all supporting business operations
1706   --
1707   dt_delete_validate
1708     (p_datetrack_mode		=> p_datetrack_mode,
1709      p_validation_start_date	=> p_validation_start_date,
1710      p_validation_end_date	=> p_validation_end_date,
1711      p_eligy_prfl_id		=> p_rec.eligy_prfl_id,
1712      p_name                     => l_elp_name);
1713   --
1714   --
1715   -- Only perform the validation if the datetrack mode is either
1716   -- DELETE or ZAP
1717   --
1718    IF (p_datetrack_mode = 'DELETE' OR p_datetrack_mode = 'ZAP')
1719    THEN
1720       --
1721       IF (   p_rec.elig_enrld_plip_flag = 'Y'
1722           OR p_rec.elig_cbr_quald_bnf_flag = 'Y'
1723           OR p_rec.elig_enrld_ptip_flag = 'Y'
1724           OR p_rec.elig_dpnt_cvrd_plip_flag = 'Y'
1725           OR p_rec.elig_dpnt_cvrd_ptip_flag = 'Y'
1726           OR p_rec.elig_dpnt_cvrd_pgm_flag = 'Y'
1727           OR p_rec.elig_job_flag = 'Y'
1728           OR p_rec.elig_hrly_slrd_flag = 'Y'
1729           OR p_rec.elig_pstl_cd_flag = 'Y'
1730           OR p_rec.elig_lbr_mmbr_flag = 'Y'
1731           OR p_rec.elig_lgl_enty_flag = 'Y'
1735           OR p_rec.elig_age_flag = 'Y'
1732           OR p_rec.elig_benfts_grp_flag = 'Y'
1733           OR p_rec.elig_wk_loc_flag = 'Y'
1734           OR p_rec.elig_brgng_unit_flag = 'Y'
1736           OR p_rec.elig_los_flag = 'Y'
1737           OR p_rec.elig_per_typ_flag = 'Y'
1738           OR p_rec.elig_fl_tm_pt_tm_flag = 'Y'
1739           OR p_rec.elig_ee_stat_flag = 'Y'
1740           OR p_rec.elig_grd_flag = 'Y'
1741           OR p_rec.elig_pct_fl_tm_flag = 'Y'
1742           OR p_rec.elig_asnt_set_flag = 'Y'
1743           OR p_rec.elig_hrs_wkd_flag = 'Y'
1744           OR p_rec.elig_comp_lvl_flag = 'Y'
1745           OR p_rec.elig_org_unit_flag = 'Y'
1746           OR p_rec.elig_loa_rsn_flag = 'Y'
1747           OR p_rec.elig_pyrl_flag = 'Y'
1748           OR p_rec.elig_schedd_hrs_flag = 'Y'
1749           OR p_rec.elig_py_bss_flag = 'Y'
1750           OR p_rec.eligy_prfl_rl_flag = 'Y'
1751           OR p_rec.elig_cmbn_age_los_flag = 'Y'
1752           OR p_rec.cntng_prtn_elig_prfl_flag = 'Y'
1753           OR p_rec.elig_prtt_pl_flag = 'Y'
1754           OR p_rec.elig_ppl_grp_flag = 'Y'
1755           OR p_rec.elig_svc_area_flag = 'Y'
1756           OR p_rec.elig_ptip_prte_flag = 'Y'
1757           OR p_rec.elig_no_othr_cvg_flag = 'Y'
1758           OR p_rec.elig_enrld_pl_flag = 'Y'
1759           OR p_rec.elig_enrld_oipl_flag = 'Y'
1760           OR p_rec.elig_enrld_pgm_flag = 'Y'
1761           OR p_rec.elig_dpnt_cvrd_pl_flag = 'Y'
1762           OR p_rec.elig_lvg_rsn_flag = 'Y'
1763           OR p_rec.elig_optd_mdcr_flag = 'Y'
1764           OR p_rec.elig_tbco_use_flag = 'Y'
1765           OR p_rec.elig_dpnt_othr_ptip_flag = 'Y'
1766           OR p_rec.elig_gndr_flag = 'Y'
1767           OR p_rec.elig_dsblty_ctg_flag = 'Y'
1768           OR p_rec.elig_dsblty_dgr_flag = 'Y'
1769           OR p_rec.elig_dsblty_rsn_flag = 'Y'
1770           OR p_rec.elig_mrtl_sts_flag = 'Y'
1771           OR p_rec.elig_prbtn_perd_flag = 'Y'
1772           OR p_rec.elig_sp_clng_prg_pt_flag = 'Y'
1773           OR p_rec.elig_suppl_role_flag = 'Y'
1774           OR p_rec.elig_qual_titl_flag = 'Y'
1775           OR p_rec.elig_pstn_flag = 'Y'
1776           OR p_rec.elig_dsbld_flag = 'Y'
1777           OR p_rec.elig_ttl_cvg_vol_flag = 'Y'
1778           OR p_rec.elig_ttl_prtt_flag = 'Y'
1779           OR p_rec.elig_comptncy_flag = 'Y'
1780           OR p_rec.elig_hlth_cvg_flag = 'Y'
1781           OR p_rec.elig_anthr_pl_flag = 'Y'
1782           OR p_rec.elig_perf_rtng_flag = 'Y'
1783           OR p_rec.elig_qua_in_gr_flag = 'Y'
1784           OR p_rec.elig_crit_values_flag = 'Y'
1785          )
1786       THEN
1787          --
1788          -- Bug 4057566
1789          --
1790          -- hr_utility.set_message (801, 'PAY_52681_BHT_CHILD_EXISTS');
1791          -- hr_utility.raise_error;
1792          ben_utility.child_exists_error(p_table_name               => 'BEN_ELIGY_PRFL_CRITERIA',
1793                                         p_parent_table_name        => 'BEN_ELIGY_PRFL_F',
1794                                         p_parent_entity_name       => l_elp_name);
1795          --
1796          -- Bug 4057566
1797          --
1798       END IF;
1799       --
1800    END IF;
1801    --
1802   hr_utility.set_location(' Leaving:'||l_proc, 10);
1803 End delete_validate;
1804 --
1805 --
1806 --  ---------------------------------------------------------------------------
1807 --  |---------------------< return_legislation_code >-------------------------|
1808 --  ---------------------------------------------------------------------------
1809 --
1810 function return_legislation_code
1811   (p_eligy_prfl_id in number) return varchar2 is
1812   --
1813   -- Declare cursor
1814   --
1815   cursor csr_leg_code is
1816     select a.legislation_code
1817     from   per_business_groups a,
1818            ben_eligy_prfl_f b
1819     where b.eligy_prfl_id      = p_eligy_prfl_id
1820     and   a.business_group_id = b.business_group_id;
1821   --
1822   -- Declare local variables
1823   --
1824   l_legislation_code  varchar2(150);
1825   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
1826   --
1827 begin
1828   --
1829   hr_utility.set_location('Entering:'|| l_proc, 10);
1830   --
1831   -- Ensure that all the mandatory parameter are not null
1832   --
1833   hr_api.mandatory_arg_error(p_api_name       => l_proc,
1834                              p_argument       => 'eligy_prfl_id',
1835                              p_argument_value => p_eligy_prfl_id);
1836   --
1837   open csr_leg_code;
1838     --
1839     fetch csr_leg_code into l_legislation_code;
1840     --
1841     if csr_leg_code%notfound then
1842       --
1843       close csr_leg_code;
1844       --
1845       -- The primary key is invalid therefore we must error
1846       --
1847       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
1848       fnd_message.raise_error;
1849       --
1850     end if;
1851     --
1852   close csr_leg_code;
1853   --
1854   hr_utility.set_location(' Leaving:'|| l_proc, 20);
1855   --
1856   return l_legislation_code;
1857   --
1858 end return_legislation_code;
1859 --
1860 end ben_elp_bus;