DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_ECP_BUS

Source


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