DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_ELP_BUS

Source


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