DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_EHS_BUS

Source


1 Package Body ben_ehs_bus as
2 /* $Header: beehsrhi.pkb 120.1 2006/02/28 06:47:29 rtagarra noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_ehs_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------< chk_elig_hrly_slrd_prte_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 --   elig_hrly_slrd_prte_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_elig_hrly_slrd_prte_id(p_elig_hrly_slrd_prte_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_elig_hrly_slrd_prte_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_ehs_shd.api_updating
49     (p_effective_date              => p_effective_date,
50      p_elig_hrly_slrd_prte_id                => p_elig_hrly_slrd_prte_id,
51      p_object_version_number       => p_object_version_number);
52   --
53   if (l_api_updating
54      and nvl(p_elig_hrly_slrd_prte_id,hr_api.g_number)
55      <>  ben_ehs_shd.g_old_rec.elig_hrly_slrd_prte_id) then
56     --
57     -- raise error as PK has changed
58     --
59     ben_ehs_shd.constraint_error('BEN_ELIG_HRLY_SLD_PK');
60     --
61   elsif not l_api_updating then
62     --
63     -- check if PK is null
64     --
65     if p_elig_hrly_slrd_prte_id is not null then
66       --
67       -- raise error as PK is not null
68       --
69       ben_ehs_shd.constraint_error('BEN_ELIG_HRLY_SLD_PK');
70       --
71     end if;
72     --
73   end if;
74   --
75   hr_utility.set_location('Leaving:'||l_proc, 10);
76   --
77 End chk_elig_hrly_slrd_prte_id;
78 --
79 -- ----------------------------------------------------------------------------
80 -- |------< chk_excld_flag >------|
81 -- ----------------------------------------------------------------------------
82 --
83 -- Description
84 --   This procedure is used to check that the lookup value is valid.
85 --
86 -- Pre Conditions
87 --   None.
88 --
89 -- In Parameters
90 --   elig_hrly_slrd_prte_id PK of record being inserted or updated.
91 --   excld_flag Value of lookup code.
92 --   effective_date effective date
93 --   object_version_number Object version number of record being
94 --                         inserted or updated.
95 --
96 -- Post Success
97 --   Processing continues
98 --
99 -- Post Failure
100 --   Error handled by procedure
101 --
102 -- Access Status
103 --   Internal table handler use only.
104 --
105 Procedure chk_excld_flag(p_elig_hrly_slrd_prte_id                in number,
106                             p_excld_flag               in varchar2,
107                             p_effective_date              in date,
108                             p_object_version_number       in number) is
109   --
110   l_proc         varchar2(72) := g_package||'chk_excld_flag';
111   l_api_updating boolean;
112   --
113 Begin
114   --
115   hr_utility.set_location('Entering:'||l_proc, 5);
116   --
117   l_api_updating := ben_ehs_shd.api_updating
118     (p_elig_hrly_slrd_prte_id                => p_elig_hrly_slrd_prte_id,
119      p_effective_date              => p_effective_date,
120      p_object_version_number       => p_object_version_number);
121   --
122   if (l_api_updating
123       and p_excld_flag
124       <> nvl(ben_ehs_shd.g_old_rec.excld_flag,hr_api.g_varchar2)
125       or not l_api_updating) then
126     --
127     -- check if value of lookup falls within lookup type.
128     --
129     --
130     if hr_api.not_exists_in_hr_lookups
131           (p_lookup_type    => 'YES_NO',
132            p_lookup_code    => p_excld_flag,
133            p_effective_date => p_effective_date) then
134       --
135       -- raise error as does not exist as lookup
136       --
137       fnd_message.set_name('PAY','HR_LOOKUP_DOES_NOT_EXIST');
138       fnd_message.raise_error;
139       --
140     end if;
141     --
142   end if;
143   --
144   hr_utility.set_location('Leaving:'||l_proc,10);
145   --
146 end chk_excld_flag;
147 --
148 -- ----------------------------------------------------------------------------
149 -- |------< chk_hrly_slrd_cd >------|
150 -- ----------------------------------------------------------------------------
151 --
152 -- Description
153 --   This procedure is used to check that the lookup value is valid.
154 --
155 -- Pre Conditions
156 --   None.
157 --
158 -- In Parameters
159 --   elig_hrly_slrd_prte_id PK of record being inserted or updated.
160 --   hrly_slrd_cd Value of lookup code.
161 --   effective_date effective date
162 --   object_version_number Object version number of record being
163 --                         inserted or updated.
164 --
165 -- Post Success
166 --   Processing continues
167 --
168 -- Post Failure
169 --   Error handled by procedure
170 --
171 -- Access Status
172 --   Internal table handler use only.
173 --
174 Procedure chk_hrly_slrd_cd(p_elig_hrly_slrd_prte_id   in number,
175                            p_hrly_slrd_cd             in varchar2,
176                            p_eligy_prfl_id            in number,
177                            p_validation_start_date    in date,
178                            p_validation_end_date      in date,
179                            p_business_group_id        in number,
180                            p_effective_date           in date,
181                            p_object_version_number    in number) is
182   --
183   l_proc         varchar2(72) := g_package||'chk_hrly_slrd_cd';
184   l_api_updating boolean;
185   l_exists       varchar2(1);
186   --
187   --
188   cursor c3 is
189      select null
190        from ben_elig_hrly_slrd_prte_f
191          where hrly_slrd_cd = p_hrly_slrd_cd
192            and eligy_prfl_id = p_eligy_prfl_id
193            and elig_hrly_slrd_prte_id <> nvl(p_elig_hrly_slrd_prte_id,hr_api.g_number)
194            and business_group_id + 0 = p_business_group_id
195            and p_validation_start_date <= effective_end_date
196            and p_validation_end_date >= effective_start_date
197            ;
198   --
199 Begin
200   --
201   hr_utility.set_location('Entering:'||l_proc, 5);
202   --
203   l_api_updating := ben_ehs_shd.api_updating
204     (p_elig_hrly_slrd_prte_id                => p_elig_hrly_slrd_prte_id,
205      p_effective_date              => p_effective_date,
206      p_object_version_number       => p_object_version_number);
207   --
208   if (l_api_updating
209       and p_hrly_slrd_cd
210       <> nvl(ben_ehs_shd.g_old_rec.hrly_slrd_cd,hr_api.g_varchar2)
211       or not l_api_updating) then
212     --
213     -- check if value of lookup falls within lookup type.
214     --
215     --
216     if hr_api.not_exists_in_hr_lookups
217           (p_lookup_type    => 'HOURLY_SALARIED_CODE',
218            p_lookup_code    => p_hrly_slrd_cd,
219            p_effective_date => p_effective_date) then
220       --
221       -- raise error as does not exist as lookup
222       --
223       fnd_message.set_name('PAY','HR_LOOKUP_DOES_NOT_EXIST');
224       fnd_message.raise_error;
225       --
226     end if;
227  --
228     open c3;
229     fetch c3 into l_exists;
230     if c3%found then
231       close c3;
232       --
233       -- raise error as this job already exists for this profile
234     --
235      fnd_message.set_name('BEN', 'BEN_91349_DUP_ELIG_CRITERIA');
236      fnd_message.raise_error;
237     --
238     end if;
239     close c3;
240     --
241 
242     --
243   end if;
244   --
245   hr_utility.set_location('Leaving:'||l_proc,10);
246   --
247 end chk_hrly_slrd_cd;
248 --
249 --Bug:5054189
250 -- ---------------------------------------------------------------------------
251 -- |-----------------------< chk_duplicate_ordr_num >---------------------------|
252 -- ---------------------------------------------------------------------------
253 --
254 -- Description
255 --   Ensure that the Sequence Number is unique
256 --   within business_group
257 --
258 -- Pre Conditions
259 --   None.
260 --
261 -- In Parameters
262 --   p_elig_hrly_slrd_prte_id    elig_hrly_slrd_prte_id
263 --   p_eligy_prfl_id             eligy_prfl_id
264 --   p_ordr_num                  Sequence Number
265 --   p_business_group_id
266 --
267 -- Post Success
268 --   Processing continues
269 --
270 -- Post Failure
271 --   Errors handled by the procedure
272 --
273 -- Access Status
274 --   Internal table handler use only
275 --
276 
277 Procedure chk_duplicate_ordr_num
278           ( p_elig_hrly_slrd_prte_id      in   number
279            ,p_eligy_prfl_id               in   number
280            ,p_ordr_num                    in   number
281            ,p_business_group_id           in   number)
282 is
283   l_proc     varchar2(72) := g_package||'chk_duplicate_ordr_num';
284   l_dummy    char(1);
285   cursor c1 is
286     select null
287     from   ben_elig_hrly_slrd_prte_f
288     where  elig_hrly_slrd_prte_id <> nvl(p_elig_hrly_slrd_prte_id,-1)
289     and    eligy_prfl_id = p_eligy_prfl_id
290     and    ordr_num = p_ordr_num
291     and    business_group_id = p_business_group_id;
292 --
293 Begin
294   hr_utility.set_location('Entering:'||l_proc, 5);
295   --
296   open c1;
297   fetch c1 into l_dummy;
298   if c1%found then
299     close c1;
300     fnd_message.set_name('BEN','BEN_91001_SEQ_NOT_UNIQUE');
301     fnd_message.raise_error;
302   end if;
303   close c1;
304   --
305   hr_utility.set_location('Leaving:'||l_proc, 15);
306 End chk_duplicate_ordr_num;
307 -- ----------------------------------------------------------------------------
308 -- |--------------------------< dt_update_validate >--------------------------|
309 -- ----------------------------------------------------------------------------
310 -- {Start Of Comments}
311 --
312 -- Description:
313 --   This procedure is used for referential integrity of datetracked
314 --   parent entities when a datetrack update operation is taking place
315 --   and where there is no cascading of update defined for this entity.
316 --
317 -- Prerequisites:
318 --   This procedure is called from the update_validate.
319 --
320 -- In Parameters:
321 --
322 -- Post Success:
323 --   Processing continues.
324 --
325 -- Post Failure:
326 --
327 -- Developer Implementation Notes:
328 --   This procedure should not need maintenance unless the HR Schema model
329 --   changes.
330 --
331 -- Access Status:
332 --   Internal Row Handler Use Only.
333 --
334 -- {End Of Comments}
335 -- ----------------------------------------------------------------------------
336 Procedure dt_update_validate
337             (p_eligy_prfl_id                 in number default hr_api.g_number,
338 	     p_datetrack_mode		     in varchar2,
339              p_validation_start_date	     in date,
340 	     p_validation_end_date	     in date) Is
341 --
342   l_proc	    varchar2(72) := g_package||'dt_update_validate';
343   l_integrity_error Exception;
344   l_table_name	    all_tables.table_name%TYPE;
345 --
346 Begin
347   hr_utility.set_location('Entering:'||l_proc, 5);
348   --
349   -- Ensure that the p_datetrack_mode argument is not null
350   --
351   hr_api.mandatory_arg_error
352     (p_api_name       => l_proc,
353      p_argument       => 'datetrack_mode',
354      p_argument_value => p_datetrack_mode);
355   --
356   -- Only perform the validation if the datetrack update mode is valid
357   --
358   If (dt_api.validate_dt_upd_mode(p_datetrack_mode => p_datetrack_mode)) then
359     --
360     --
361     -- Ensure the arguments are not null
362     --
363     hr_api.mandatory_arg_error
364       (p_api_name       => l_proc,
365        p_argument       => 'validation_start_date',
366        p_argument_value => p_validation_start_date);
367     --
368     hr_api.mandatory_arg_error
369       (p_api_name       => l_proc,
370        p_argument       => 'validation_end_date',
371        p_argument_value => p_validation_end_date);
372     --
373     If ((nvl(p_eligy_prfl_id, hr_api.g_number) <> hr_api.g_number) and
374       NOT (dt_api.check_min_max_dates
375             (p_base_table_name => 'ben_eligy_prfl_f',
376              p_base_key_column => 'eligy_prfl_id',
377              p_base_key_value  => p_eligy_prfl_id,
378              p_from_date       => p_validation_start_date,
379              p_to_date         => p_validation_end_date)))  Then
380       l_table_name := 'ben_eligy_prfl_f';
381       Raise l_integrity_error;
382     End If;
383     --
384   End If;
385   --
386   hr_utility.set_location(' Leaving:'||l_proc, 10);
387 Exception
388   When l_integrity_error Then
389     --
390     -- A referential integrity check was violated therefore
391     -- we must error
392     --
393        ben_utility.parent_integrity_error(p_table_name => l_table_name);
394     --
395   When Others Then
396     --
397     -- An unhandled or unexpected error has occurred which
398     -- we must report
399     --
400     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
401     fnd_message.set_token('PROCEDURE', l_proc);
402     fnd_message.set_token('STEP','15');
403     fnd_message.raise_error;
404 End dt_update_validate;
405 --
406 -- ----------------------------------------------------------------------------
407 -- |--------------------------< dt_delete_validate >--------------------------|
408 -- ----------------------------------------------------------------------------
409 -- {Start Of Comments}
410 --
411 -- Description:
412 --   This procedure is used for referential integrity of datetracked
413 --   child entities when either a datetrack DELETE or ZAP is in operation
414 --   and where there is no cascading of delete defined for this entity.
415 --   For the datetrack mode of DELETE or ZAP we must ensure that no
416 --   datetracked child rows exist between the validation start and end
417 --   dates.
418 --
419 -- Prerequisites:
420 --   This procedure is called from the delete_validate.
421 --
422 -- In Parameters:
423 --
424 -- Post Success:
425 --   Processing continues.
426 --
427 -- Post Failure:
428 --   If a row exists by determining the returning Boolean value from the
429 --   generic dt_api.rows_exist function then we must supply an error via
430 --   the use of the local exception handler l_rows_exist.
431 --
435 --
432 -- Developer Implementation Notes:
433 --   This procedure should not need maintenance unless the HR Schema model
434 --   changes.
436 -- Access Status:
437 --   Internal Row Handler Use Only.
438 --
439 -- {End Of Comments}
440 -- ----------------------------------------------------------------------------
441 Procedure dt_delete_validate
442             (p_elig_hrly_slrd_prte_id		in number,
443              p_datetrack_mode		in varchar2,
444 	     p_validation_start_date	in date,
445 	     p_validation_end_date	in date) Is
446 --
447   l_proc	varchar2(72) 	:= g_package||'dt_delete_validate';
448   l_rows_exist	Exception;
449   l_table_name	all_tables.table_name%TYPE;
450 --
451 Begin
452   hr_utility.set_location('Entering:'||l_proc, 5);
453   --
454   -- Ensure that the p_datetrack_mode argument is not null
455   --
456   hr_api.mandatory_arg_error
457     (p_api_name       => l_proc,
458      p_argument       => 'datetrack_mode',
459      p_argument_value => p_datetrack_mode);
460   --
461   -- Only perform the validation if the datetrack mode is either
462   -- DELETE or ZAP
463   --
464   If (p_datetrack_mode = 'DELETE' or
465       p_datetrack_mode = 'ZAP') then
466     --
467     --
468     -- Ensure the arguments are not null
469     --
470     hr_api.mandatory_arg_error
471       (p_api_name       => l_proc,
472        p_argument       => 'validation_start_date',
473        p_argument_value => p_validation_start_date);
474     --
475     hr_api.mandatory_arg_error
476       (p_api_name       => l_proc,
477        p_argument       => 'validation_end_date',
478        p_argument_value => p_validation_end_date);
479     --
480     hr_api.mandatory_arg_error
481       (p_api_name       => l_proc,
482        p_argument       => 'elig_hrly_slrd_prte_id',
483        p_argument_value => p_elig_hrly_slrd_prte_id);
484     --
485     --
486     --
487   End If;
488   --
489   hr_utility.set_location(' Leaving:'||l_proc, 10);
490 Exception
491   When l_rows_exist Then
492     --
493     -- A referential integrity check was violated therefore
494     -- we must error
495     --
496        ben_utility.child_exists_error(p_table_name => l_table_name);
497     --
498   When Others Then
499     --
500     -- An unhandled or unexpected error has occurred which
501     -- we must report
502     --
503     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
504     fnd_message.set_token('PROCEDURE', l_proc);
505     fnd_message.set_token('STEP','15');
506     fnd_message.raise_error;
507 End dt_delete_validate;
508 --
509 -- ----------------------------------------------------------------------------
510 -- |---------------------------< insert_validate >----------------------------|
511 -- ----------------------------------------------------------------------------
512 Procedure insert_validate
513 	(p_rec 			 in ben_ehs_shd.g_rec_type,
514 	 p_effective_date	 in date,
515 	 p_datetrack_mode	 in varchar2,
516 	 p_validation_start_date in date,
517 	 p_validation_end_date	 in date) is
518 --
519   l_proc	varchar2(72) := g_package||'insert_validate';
520 --
521 Begin
522   hr_utility.set_location('Entering:'||l_proc, 5);
523   --
524   -- Call all supporting business operations
525   --
526   --
527   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
528   --
529   chk_elig_hrly_slrd_prte_id
530   (p_elig_hrly_slrd_prte_id          => p_rec.elig_hrly_slrd_prte_id,
531    p_effective_date        => p_effective_date,
532    p_object_version_number => p_rec.object_version_number);
533   --
534   chk_excld_flag
535   (p_elig_hrly_slrd_prte_id          => p_rec.elig_hrly_slrd_prte_id,
536    p_excld_flag         => p_rec.excld_flag,
537    p_effective_date        => p_effective_date,
538    p_object_version_number => p_rec.object_version_number);
539   --
540   chk_hrly_slrd_cd
541   (p_elig_hrly_slrd_prte_id          => p_rec.elig_hrly_slrd_prte_id,
542    p_hrly_slrd_cd          => p_rec.hrly_slrd_cd,
543    p_eligy_prfl_id         => p_rec.eligy_prfl_id,
544    p_validation_start_date => p_validation_start_date,
545    p_validation_end_date   => p_validation_end_date,
546    p_business_group_id     => p_rec.business_group_id,
547    p_effective_date        => p_effective_date,
548    p_object_version_number => p_rec.object_version_number);
549   --
550  chk_duplicate_ordr_num
551 ( p_elig_hrly_slrd_prte_id       => p_rec.elig_hrly_slrd_prte_id
552  ,p_eligy_prfl_id             	 => p_rec.eligy_prfl_id
553  ,p_ordr_num                  	 => p_rec.ordr_num
554  ,p_business_group_id         	 => p_rec.business_group_id);
555  --
556   hr_utility.set_location(' Leaving:'||l_proc, 10);
557 End insert_validate;
558 --
559 -- ----------------------------------------------------------------------------
560 -- |---------------------------< update_validate >----------------------------|
561 -- ----------------------------------------------------------------------------
562 Procedure update_validate
563 	(p_rec 			 in ben_ehs_shd.g_rec_type,
564 	 p_effective_date	 in date,
565 	 p_datetrack_mode	 in varchar2,
566 	 p_validation_start_date in date,
567 	 p_validation_end_date	 in date) is
568 --
569   l_proc	varchar2(72) := g_package||'update_validate';
570 --
571 Begin
572   hr_utility.set_location('Entering:'||l_proc, 5);
573   --
574   -- Call all supporting business operations
575   --
576   --
577   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
578   --
579   chk_elig_hrly_slrd_prte_id
580   (p_elig_hrly_slrd_prte_id          => p_rec.elig_hrly_slrd_prte_id,
581    p_effective_date        => p_effective_date,
582    p_object_version_number => p_rec.object_version_number);
583   --
584   chk_excld_flag
585   (p_elig_hrly_slrd_prte_id          => p_rec.elig_hrly_slrd_prte_id,
586    p_excld_flag         => p_rec.excld_flag,
587    p_effective_date        => p_effective_date,
588    p_object_version_number => p_rec.object_version_number);
589   --
590   --
591   chk_hrly_slrd_cd
592   (p_elig_hrly_slrd_prte_id          => p_rec.elig_hrly_slrd_prte_id,
593    p_hrly_slrd_cd          => p_rec.hrly_slrd_cd,
594    p_eligy_prfl_id         => p_rec.eligy_prfl_id,
595    p_validation_start_date => p_validation_start_date,
596    p_validation_end_date   => p_validation_end_date,
597    p_business_group_id     => p_rec.business_group_id,
598    p_effective_date        => p_effective_date,
599    p_object_version_number => p_rec.object_version_number);
600   --
601  chk_duplicate_ordr_num
602 ( p_elig_hrly_slrd_prte_id       => p_rec.elig_hrly_slrd_prte_id
603  ,p_eligy_prfl_id             	 => p_rec.eligy_prfl_id
604  ,p_ordr_num                  	 => p_rec.ordr_num
605  ,p_business_group_id         	 => p_rec.business_group_id);
606   --
607   -- Call the datetrack update integrity operation
608   --
609   dt_update_validate
610     (p_eligy_prfl_id                 => p_rec.eligy_prfl_id,
611      p_datetrack_mode                => p_datetrack_mode,
612      p_validation_start_date	     => p_validation_start_date,
613      p_validation_end_date	     => p_validation_end_date);
614   --
615   hr_utility.set_location(' Leaving:'||l_proc, 10);
616 End update_validate;
617 --
618 -- ----------------------------------------------------------------------------
619 -- |---------------------------< delete_validate >----------------------------|
620 -- ----------------------------------------------------------------------------
621 Procedure delete_validate
622 	(p_rec 			 in ben_ehs_shd.g_rec_type,
623 	 p_effective_date	 in date,
624 	 p_datetrack_mode	 in varchar2,
625 	 p_validation_start_date in date,
626 	 p_validation_end_date	 in date) is
627 --
628   l_proc	varchar2(72) := g_package||'delete_validate';
629 --
630 Begin
631   hr_utility.set_location('Entering:'||l_proc, 5);
632   --
633   -- Call all supporting business operations
634   --
635   dt_delete_validate
636     (p_datetrack_mode		=> p_datetrack_mode,
637      p_validation_start_date	=> p_validation_start_date,
638      p_validation_end_date	=> p_validation_end_date,
639      p_elig_hrly_slrd_prte_id		=> p_rec.elig_hrly_slrd_prte_id);
640   --
641   hr_utility.set_location(' Leaving:'||l_proc, 10);
642 End delete_validate;
643 --
644 --
645 --  ---------------------------------------------------------------------------
646 --  |---------------------< return_legislation_code >-------------------------|
647 --  ---------------------------------------------------------------------------
648 --
649 function return_legislation_code
650   (p_elig_hrly_slrd_prte_id in number) return varchar2 is
651   --
652   -- Declare cursor
653   --
654   cursor csr_leg_code is
655     select a.legislation_code
656     from   per_business_groups a,
657            ben_elig_hrly_slrd_prte_f b
658     where b.elig_hrly_slrd_prte_id      = p_elig_hrly_slrd_prte_id
659     and   a.business_group_id = b.business_group_id;
660   --
661   -- Declare local variables
662   --
663   l_legislation_code  varchar2(150);
664   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
665   --
666 begin
667   --
668   hr_utility.set_location('Entering:'|| l_proc, 10);
669   --
670   -- Ensure that all the mandatory parameter are not null
671   --
672   hr_api.mandatory_arg_error(p_api_name       => l_proc,
673                              p_argument       => 'elig_hrly_slrd_prte_id',
674                              p_argument_value => p_elig_hrly_slrd_prte_id);
675   --
676   open csr_leg_code;
677     --
678     fetch csr_leg_code into l_legislation_code;
679     --
680     if csr_leg_code%notfound then
681       --
682       close csr_leg_code;
683       --
684       -- The primary key is invalid therefore we must error
685       --
686       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
687       fnd_message.raise_error;
688       --
689     end if;
690     --
691   close csr_leg_code;
692   --
693   hr_utility.set_location(' Leaving:'|| l_proc, 20);
694   --
695   return l_legislation_code;
696   --
697 end return_legislation_code;
698 --
699 end ben_ehs_bus;