DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_ABC_BUS

Source


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