[Home] [Help]
PACKAGE BODY: APPS.BEN_ENB_BUS
Source
1 Package Body ben_enb_bus as
2 /* $Header: beenbrhi.pkb 115.15 2002/12/16 07:02:08 rpgupta ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Private Global Definitions |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package varchar2(33) := ' ben_enb_bus.'; -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------< chk_enrt_bnft_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 -- enrt_bnft_id PK of record being inserted or updated.
24 -- object_version_number Object version number of record being
25 -- inserted or updated.
26 --
27 -- Post Success
28 -- Processing continues
29 --
30 -- Post Failure
31 -- Errors handled by the procedure
32 --
33 -- Access Status
34 -- Internal table handler use only.
35 --
36 Procedure chk_enrt_bnft_id(p_enrt_bnft_id in number,
37 p_object_version_number in number) is
38 --
39 l_proc varchar2(72) := g_package||'chk_enrt_bnft_id';
40 l_api_updating boolean;
41 --
42 Begin
43 --
44 hr_utility.set_location('Entering:'||l_proc, 5);
45 --
46 l_api_updating := ben_enb_shd.api_updating
47 (p_enrt_bnft_id => p_enrt_bnft_id,
48 p_object_version_number => p_object_version_number);
49 --
50 if (l_api_updating
51 and nvl(p_enrt_bnft_id,hr_api.g_number)
52 <> ben_enb_shd.g_old_rec.enrt_bnft_id) then
53 --
54 -- raise error as PK has changed
55 --
56 ben_enb_shd.constraint_error('BEN_ENRT_BNFT_PK');
57 --
58 elsif not l_api_updating then
59 --
60 -- check if PK is null
61 --
62 if p_enrt_bnft_id is not null then
63 --
64 -- raise error as PK is not null
65 --
66 ben_enb_shd.constraint_error('BEN_ENRT_BNFT_PK');
67 --
68 end if;
69 --
70 end if;
71 --
72 hr_utility.set_location('Leaving:'||l_proc, 10);
73 --
74 End chk_enrt_bnft_id;
75 --
76 -- ----------------------------------------------------------------------------
77 -- |------< chk_bndry_perd_cd >------|
78 -- ----------------------------------------------------------------------------
79 --
80 -- Description
81 -- This procedure is used to check that the lookup value is valid.
82 --
83 -- Pre Conditions
84 -- None.
85 --
86 -- In Parameters
87 -- enrt_bnft_id PK of record being inserted or updated.
88 -- bndry_perd_cd Value of lookup code.
89 -- effective_date effective date
90 -- object_version_number Object version number of record being
91 -- inserted or updated.
92 --
93 -- Post Success
94 -- Processing continues
95 --
96 -- Post Failure
97 -- Error handled by procedure
98 --
99 -- Access Status
100 -- Internal table handler use only.
101 --
102 Procedure chk_bndry_perd_cd(p_enrt_bnft_id in number,
103 p_bndry_perd_cd in varchar2,
104 p_effective_date in date,
105 p_object_version_number in number) is
106 --
107 l_proc varchar2(72) := g_package||'chk_bndry_perd_cd';
108 l_api_updating boolean;
109 --
110 Begin
111 --
112 hr_utility.set_location('Entering:'||l_proc, 5);
113 --
114 l_api_updating := ben_enb_shd.api_updating
115 (p_enrt_bnft_id => p_enrt_bnft_id,
116 p_object_version_number => p_object_version_number);
117 --
118 if (l_api_updating
119 and p_bndry_perd_cd
120 <> nvl(ben_enb_shd.g_old_rec.bndry_perd_cd,hr_api.g_varchar2)
121 or not l_api_updating)
122 and p_bndry_perd_cd is not null then
123 --
124 -- check if value of lookup falls within lookup type.
125 --
126 if hr_api.not_exists_in_hr_lookups
127 (p_lookup_type => 'BEN_BNDRY_PERD',
128 p_lookup_code => p_bndry_perd_cd,
129 p_effective_date => p_effective_date) then
130 --
131 -- raise error as does not exist as lookup
132 --
133 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
134 fnd_message.set_token('FIELD', 'p_bndry_perd_cd');
135 fnd_message.set_token('TYPE', 'BEN_BNDRY_PERD');
136 fnd_message.raise_error;
137 --
138 end if;
139 --
140 end if;
141 --
142 hr_utility.set_location('Leaving:'||l_proc,10);
143 --
144 end chk_bndry_perd_cd;
145 --
146 -- ----------------------------------------------------------------------------
147 -- |------< chk_cvg_mlt_cd >------|
148 -- ----------------------------------------------------------------------------
149 --
150 -- Description
151 -- This procedure is used to check that the lookup value is valid.
152 --
153 -- Pre Conditions
154 -- None.
155 --
156 -- In Parameters
157 -- enrt_bnft_id PK of record being inserted or updated.
158 -- cvg_mlt_cd Value of lookup code.
159 -- effective_date effective date
160 -- object_version_number Object version number of record being
161 -- inserted or updated.
162 --
163 -- Post Success
164 -- Processing continues
165 --
166 -- Post Failure
167 -- Error handled by procedure
168 --
169 -- Access Status
170 -- Internal table handler use only.
171 --
172 Procedure chk_cvg_mlt_cd(p_enrt_bnft_id in number,
173 p_cvg_mlt_cd in varchar2,
174 p_effective_date in date,
175 p_object_version_number in number) is
176 --
177 l_proc varchar2(72) := g_package||'chk_cvg_mlt_cd';
178 l_api_updating boolean;
179 --
180 Begin
181 --
182 hr_utility.set_location('Entering:'||l_proc, 5);
183 --
184 l_api_updating := ben_enb_shd.api_updating
185 (p_enrt_bnft_id => p_enrt_bnft_id,
186 p_object_version_number => p_object_version_number);
187 --
188 if (l_api_updating
189 and p_cvg_mlt_cd
190 <> nvl(ben_enb_shd.g_old_rec.cvg_mlt_cd,hr_api.g_varchar2)
191 or not l_api_updating)
192 and p_cvg_mlt_cd is not null then
193 --
194 -- check if value of lookup falls within lookup type.
195 --
196 if hr_api.not_exists_in_hr_lookups
197 (p_lookup_type => 'BEN_CVG_MLT',
198 p_lookup_code => p_cvg_mlt_cd,
199 p_effective_date => p_effective_date) then
200 --
201 -- raise error as does not exist as lookup
202 --
203 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
204 fnd_message.set_token('FIELD', 'p_cvg_mlt_cd');
205 fnd_message.set_token('TYPE', 'BEN_CVG_MLT');
206 fnd_message.raise_error;
207 --
208 end if;
209 --
210 end if;
211 --
212 hr_utility.set_location('Leaving:'||l_proc,10);
213 --
214 end chk_cvg_mlt_cd;
215 --
216 -- ----------------------------------------------------------------------------
217 -- |------< chk_crntly_enrld_flag >------|
218 -- ----------------------------------------------------------------------------
219 --
220 -- Description
221 -- This procedure is used to check that the lookup value is valid.
222 --
223 -- Pre Conditions
224 -- None.
225 --
226 -- In Parameters
227 -- enrt_bnft_id PK of record being inserted or updated.
228 -- crntly_enrld_flag Value of lookup code.
229 -- effective_date effective date
230 -- object_version_number Object version number of record being
231 -- inserted or updated.
232 --
233 -- Post Success
234 -- Processing continues
235 --
236 -- Post Failure
237 -- Error handled by procedure
238 --
239 -- Access Status
240 -- Internal table handler use only.
241 --
242 Procedure chk_crntly_enrld_flag(p_enrt_bnft_id in number,
243 p_crntly_enrld_flag in varchar2,
244 p_effective_date in date,
245 p_object_version_number in number) is
246 --
247 l_proc varchar2(72) := g_package||'chk_crntly_enrld_flag';
248 l_api_updating boolean;
249 --
250 Begin
251 --
252 hr_utility.set_location('Entering:'||l_proc, 5);
253 --
254 l_api_updating := ben_enb_shd.api_updating
255 (p_enrt_bnft_id => p_enrt_bnft_id,
256 p_object_version_number => p_object_version_number);
257 --
258 if (l_api_updating
259 and p_crntly_enrld_flag
260 <> nvl(ben_enb_shd.g_old_rec.crntly_enrld_flag,hr_api.g_varchar2)
261 or not l_api_updating) then
262 --
263 -- check if value of lookup falls within lookup type.
264 --
265 --
266 if hr_api.not_exists_in_hr_lookups
267 (p_lookup_type => 'YES_NO',
268 p_lookup_code => p_crntly_enrld_flag,
269 p_effective_date => p_effective_date) then
270 --
271 -- raise error as does not exist as lookup
272 --
273 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
274 fnd_message.set_token('FIELD', 'p_crntly_enrld_flag');
275 fnd_message.set_token('TYPE', 'YES_NO');
276 fnd_message.raise_error;
277 --
278 end if;
279 --
280 end if;
281 --
282 hr_utility.set_location('Leaving:'||l_proc,10);
283 --
284 end chk_crntly_enrld_flag;
285 -- ----------------------------------------------------------------------------
286 -- |------< chk_val_has_bn_prortd_flag >------|
287 -- ----------------------------------------------------------------------------
288 --
289 -- Description
290 -- This procedure is used to check that the lookup value is valid.
291 --
292 -- Pre Conditions
293 -- None.
294 --
295 -- In Parameters
296 -- enrt_bnft_id PK of record being inserted or updated.
297 -- val_has_bn_prortd_flag Value of lookup code.
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_val_has_bn_prortd_flag(p_enrt_bnft_id in number,
312 p_val_has_bn_prortd_flag in varchar2,
313 p_effective_date in date,
314 p_object_version_number in number) is
315 --
316 l_proc varchar2(72) := g_package||'chk_val_has_bn_prortd_flag';
317 l_api_updating boolean;
318 --
319 Begin
320 --
321 hr_utility.set_location('Entering:'||l_proc, 5);
322 --
323 l_api_updating := ben_enb_shd.api_updating
324 (p_enrt_bnft_id => p_enrt_bnft_id,
325 p_object_version_number => p_object_version_number);
326 --
327 if (l_api_updating
328 and p_val_has_bn_prortd_flag
329 <> nvl(ben_enb_shd.g_old_rec.val_has_bn_prortd_flag,hr_api.g_varchar2)
330 or not l_api_updating) then
331 --
332 -- check if value of lookup falls within lookup type.
333 --
334 --
335 if hr_api.not_exists_in_hr_lookups
336 (p_lookup_type => 'YES_NO',
337 p_lookup_code => p_val_has_bn_prortd_flag,
338 p_effective_date => p_effective_date) then
339 --
340 -- raise error as does not exist as lookup
341 --
342 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
343 fnd_message.set_token('FIELD', 'p_val_has_bn_prortd_flag');
344 fnd_message.set_token('TYPE', 'YES_NO');
345 fnd_message.raise_error;
346 --
347 end if;
348 --
349 end if;
350 --
351 hr_utility.set_location('Leaving:'||l_proc,10);
352 --
353 end chk_val_has_bn_prortd_flag;
354 --
355 -- ----------------------------------------------------------------------------
356 -- |------< chk_dflt_flag >------|
357 -- ----------------------------------------------------------------------------
358 --
359 -- Description
360 -- This procedure is used to check that the lookup value is valid.
361 --
362 -- Pre Conditions
363 -- None.
364 --
365 -- In Parameters
366 -- enrt_bnft_id PK of record being inserted or updated.
367 -- dflt_flag Value of lookup code.
368 -- effective_date effective date
369 -- object_version_number Object version number of record being
370 -- inserted or updated.
371 --
372 -- Post Success
373 -- Processing continues
374 --
375 -- Post Failure
376 -- Error handled by procedure
377 --
378 -- Access Status
379 -- Internal table handler use only.
380 --
381 Procedure chk_dflt_flag(p_enrt_bnft_id in number,
382 p_dflt_flag in varchar2,
383 p_effective_date in date,
384 p_object_version_number in number) is
385 --
386 l_proc varchar2(72) := g_package||'chk_dflt_flag';
387 l_api_updating boolean;
388 --
389 Begin
390 --
391 hr_utility.set_location('Entering:'||l_proc, 5);
392 --
393 l_api_updating := ben_enb_shd.api_updating
394 (p_enrt_bnft_id => p_enrt_bnft_id,
395 p_object_version_number => p_object_version_number);
396 --
397 if (l_api_updating
398 and p_dflt_flag
399 <> nvl(ben_enb_shd.g_old_rec.dflt_flag,hr_api.g_varchar2)
400 or not l_api_updating) then
401 --
402 -- check if value of lookup falls within lookup type.
403 --
404 --
405 if hr_api.not_exists_in_hr_lookups
406 (p_lookup_type => 'YES_NO',
407 p_lookup_code => p_dflt_flag,
408 p_effective_date => p_effective_date) then
409 --
410 -- raise error as does not exist as lookup
411 --
412 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
413 fnd_message.set_token('FIELD', 'p_dflt_flag');
414 fnd_message.set_token('TYPE', 'YES_NO');
415 fnd_message.raise_error;
416 --
417 end if;
418 --
419 end if;
420 --
421 hr_utility.set_location('Leaving:'||l_proc,10);
422 --
423 end chk_dflt_flag;
424 --
425 -- ----------------------------------------------------------------------------
426 -- |------< chk_bnft_typ_cd >------|
427 -- ----------------------------------------------------------------------------
428 --
429 -- Description
430 -- This procedure is used to check that the lookup value is valid.
431 --
432 -- Pre Conditions
433 -- None.
434 --
435 -- In Parameters
436 -- enrt_bnft_id PK of record being inserted or updated.
437 -- bnft_typ_cd Value of lookup code.
438 -- effective_date effective date
439 -- object_version_number Object version number of record being
440 -- inserted or updated.
444 --
441 --
442 -- Post Success
443 -- Processing continues
445 -- Post Failure
446 -- Error handled by procedure
447 --
448 -- Access Status
449 -- Internal table handler use only.
450 --
451 Procedure chk_bnft_typ_cd(p_enrt_bnft_id in number,
452 p_bnft_typ_cd in varchar2,
453 p_effective_date in date,
454 p_object_version_number in number) is
455 --
456 l_proc varchar2(72) := g_package||'chk_bnft_typ_cd';
457 l_api_updating boolean;
458 --
459 Begin
460 --
461 hr_utility.set_location('Entering:'||l_proc, 5);
462 --
463 l_api_updating := ben_enb_shd.api_updating
464 (p_enrt_bnft_id => p_enrt_bnft_id,
465 p_object_version_number => p_object_version_number);
466 --
467 if (l_api_updating
468 and p_bnft_typ_cd
469 <> nvl(ben_enb_shd.g_old_rec.bnft_typ_cd,hr_api.g_varchar2)
470 or not l_api_updating)
471 and p_bnft_typ_cd is not null then
472 --
473 -- check if value of lookup falls within lookup type.
474 --
475 if hr_api.not_exists_in_hr_lookups
476 (p_lookup_type => 'BEN_BNFT_TYP',
477 p_lookup_code => p_bnft_typ_cd,
478 p_effective_date => p_effective_date) then
479 --
480 -- raise error as does not exist as lookup
481 --
482 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
483 fnd_message.set_token('FIELD', 'p_bnft_typ_cd');
484 fnd_message.set_token('TYPE', 'BEN_BNFT_TYP');
485 fnd_message.raise_error;
486 --
487 end if;
488 --
489 end if;
490 --
491 hr_utility.set_location('Leaving:'||l_proc,10);
492 --
493 end chk_bnft_typ_cd;
494 --
495 -- ----------------------------------------------------------------------------
496 -- |------< chk_nnmntry_uom >------|
497 -- ----------------------------------------------------------------------------
498 --
499 -- Description
500 -- This procedure is used to check that the lookup value is valid.
501 --
502 -- Pre Conditions
503 -- None.
504 --
505 -- In Parameters
506 -- enrt_bnft_id PK of record being inserted or updated.
507 -- nnmntry_uom Value of lookup code.
508 -- effective_date effective date
509 -- object_version_number Object version number of record being
510 -- inserted or updated.
511 --
512 -- Post Success
513 -- Processing continues
514 --
515 -- Post Failure
516 -- Error handled by procedure
517 --
518 -- Access Status
519 -- Internal table handler use only.
520 --
521 Procedure chk_nnmntry_uom(p_enrt_bnft_id in number,
522 p_nnmntry_uom in varchar2,
523 p_effective_date in date,
524 p_object_version_number in number) is
525 --
526 l_proc varchar2(72) := g_package||'chk_nnmntry_uom';
527 l_api_updating boolean;
528 --
529 Begin
530 --
531 hr_utility.set_location('Entering:'||l_proc, 5);
532 --
533 l_api_updating := ben_enb_shd.api_updating
534 (p_enrt_bnft_id => p_enrt_bnft_id,
535 p_object_version_number => p_object_version_number);
536 --
537 if (l_api_updating
538 and p_nnmntry_uom
539 <> nvl(ben_enb_shd.g_old_rec.nnmntry_uom,hr_api.g_varchar2)
540 or not l_api_updating)
541 and p_nnmntry_uom is not null then
542 --
543 -- check if value of lookup falls within lookup type.
544 --
545 if hr_api.not_exists_in_hr_lookups
546 (p_lookup_type => 'BEN_NNMNTRY_UOM',
547 p_lookup_code => p_nnmntry_uom,
548 p_effective_date => p_effective_date) then
549 --
550 -- raise error as does not exist as lookup
551 --
552 fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
553 fnd_message.set_token('FIELD', 'p_nnmntry_uom');
554 fnd_message.set_token('TYPE', 'BEN_NNMNTRY_UOM');
555 fnd_message.raise_error;
556 --
557 end if;
558 --
559 end if;
560 --
561 hr_utility.set_location('Leaving:'||l_proc,10);
562 --
563 end chk_nnmntry_uom;
564 --
565 -- ----------------------------------------------------------------------------
566 -- |---------------------------< insert_validate >----------------------------|
567 -- ----------------------------------------------------------------------------
568 Procedure insert_validate(p_rec in ben_enb_shd.g_rec_type
569 ,p_effective_date in date) is
570 --
571 l_proc varchar2(72) := g_package||'insert_validate';
572 --
573 Begin
574 hr_utility.set_location('Entering:'||l_proc, 5);
575 --
576 -- Call all supporting business operations
577 --
578 --
579 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
580 --
581 chk_enrt_bnft_id
582 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
583 p_object_version_number => p_rec.object_version_number);
584 --
588 p_effective_date => p_effective_date,
585 chk_bndry_perd_cd
586 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
587 p_bndry_perd_cd => p_rec.bndry_perd_cd,
589 p_object_version_number => p_rec.object_version_number);
590 --
591 chk_cvg_mlt_cd
592 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
593 p_cvg_mlt_cd => p_rec.cvg_mlt_cd,
594 p_effective_date => p_effective_date,
595 p_object_version_number => p_rec.object_version_number);
596 --
597 chk_val_has_bn_prortd_flag
598 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
599 p_val_has_bn_prortd_flag => p_rec.val_has_bn_prortd_flag,
600 p_effective_date => p_effective_date,
601 p_object_version_number => p_rec.object_version_number);
602 --
603 chk_crntly_enrld_flag
604 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
605 p_crntly_enrld_flag => p_rec.crntly_enrld_flag,
606 p_effective_date => p_effective_date,
607 p_object_version_number => p_rec.object_version_number);
608 --
609 chk_dflt_flag
610 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
611 p_dflt_flag => p_rec.dflt_flag,
612 p_effective_date => p_effective_date,
613 p_object_version_number => p_rec.object_version_number);
614 --
615 chk_bnft_typ_cd
616 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
617 p_bnft_typ_cd => p_rec.bnft_typ_cd,
618 p_effective_date => p_effective_date,
619 p_object_version_number => p_rec.object_version_number);
620 --
621 chk_nnmntry_uom
622 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
623 p_nnmntry_uom => p_rec.nnmntry_uom,
624 p_effective_date => p_effective_date,
625 p_object_version_number => p_rec.object_version_number);
626 --
627 hr_utility.set_location(' Leaving:'||l_proc, 10);
628 End insert_validate;
629 --
630 -- ----------------------------------------------------------------------------
631 -- |---------------------------< update_validate >----------------------------|
632 -- ----------------------------------------------------------------------------
633 Procedure update_validate(p_rec in ben_enb_shd.g_rec_type
634 ,p_effective_date in date) is
635 --
636 l_proc varchar2(72) := g_package||'update_validate';
637 --
638 Begin
639 hr_utility.set_location('Entering:'||l_proc, 5);
640 --
641 -- Call all supporting business operations
642 --
643 --
644 hr_api.validate_bus_grp_id(p_rec.business_group_id); -- Validate Bus Grp
645 --
646 chk_enrt_bnft_id
647 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
648 p_object_version_number => p_rec.object_version_number);
649 --
650 chk_bndry_perd_cd
651 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
652 p_bndry_perd_cd => p_rec.bndry_perd_cd,
653 p_effective_date => p_effective_date,
654 p_object_version_number => p_rec.object_version_number);
655 --
656 chk_cvg_mlt_cd
657 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
658 p_cvg_mlt_cd => p_rec.cvg_mlt_cd,
659 p_effective_date => p_effective_date,
660 p_object_version_number => p_rec.object_version_number);
661 --
662 chk_val_has_bn_prortd_flag
663 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
664 p_val_has_bn_prortd_flag => p_rec.val_has_bn_prortd_flag,
665 p_effective_date => p_effective_date,
666 p_object_version_number => p_rec.object_version_number);
667 --
668 chk_crntly_enrld_flag
669 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
670 p_crntly_enrld_flag => p_rec.crntly_enrld_flag,
671 p_effective_date => p_effective_date,
672 p_object_version_number => p_rec.object_version_number);
673 --
674 chk_dflt_flag
675 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
676 p_dflt_flag => p_rec.dflt_flag,
677 p_effective_date => p_effective_date,
678 p_object_version_number => p_rec.object_version_number);
679 --
680 chk_bnft_typ_cd
681 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
682 p_bnft_typ_cd => p_rec.bnft_typ_cd,
683 p_effective_date => p_effective_date,
684 p_object_version_number => p_rec.object_version_number);
685 --
686 chk_nnmntry_uom
687 (p_enrt_bnft_id => p_rec.enrt_bnft_id,
688 p_nnmntry_uom => p_rec.nnmntry_uom,
689 p_effective_date => p_effective_date,
690 p_object_version_number => p_rec.object_version_number);
691 --
692 hr_utility.set_location(' Leaving:'||l_proc, 10);
693 End update_validate;
694 --
695 -- ----------------------------------------------------------------------------
696 -- |---------------------------< delete_validate >----------------------------|
697 -- ----------------------------------------------------------------------------
698 Procedure delete_validate(p_rec in ben_enb_shd.g_rec_type
699 ,p_effective_date in date) is
700 --
701 l_proc varchar2(72) := g_package||'delete_validate';
702 --
703 Begin
704 hr_utility.set_location('Entering:'||l_proc, 5);
705 --
706 -- Call all supporting business operations
707 --
708 hr_utility.set_location(' Leaving:'||l_proc, 10);
709 End delete_validate;
710 --
711 --
715 --
712 -- ---------------------------------------------------------------------------
713 -- |---------------------< return_legislation_code >-------------------------|
714 -- ---------------------------------------------------------------------------
716 function return_legislation_code
717 (p_enrt_bnft_id in number) return varchar2 is
718 --
719 -- Declare cursor
720 --
721 cursor csr_leg_code is
722 select a.legislation_code
723 from per_business_groups a,
724 ben_enrt_bnft b
725 where b.enrt_bnft_id = p_enrt_bnft_id
726 and a.business_group_id = b.business_group_id;
727 --
728 -- Declare local variables
729 --
730 l_legislation_code varchar2(150);
731 l_proc varchar2(72) := g_package||'return_legislation_code';
732 --
733 begin
734 --
735 hr_utility.set_location('Entering:'|| l_proc, 10);
736 --
737 -- Ensure that all the mandatory parameter are not null
738 --
739 hr_api.mandatory_arg_error(p_api_name => l_proc,
740 p_argument => 'enrt_bnft_id',
741 p_argument_value => p_enrt_bnft_id);
742 --
743 open csr_leg_code;
744 --
745 fetch csr_leg_code into l_legislation_code;
746 --
747 if csr_leg_code%notfound then
748 --
749 close csr_leg_code;
750 --
751 -- The primary key is invalid therefore we must error
752 --
753 hr_utility.set_message(801,'HR_7220_INVALID_PRIMARY_KEY');
754 hr_utility.raise_error;
755 --
756 end if;
757 --
758 close csr_leg_code;
759 --
760 hr_utility.set_location(' Leaving:'|| l_proc, 20);
761 --
762 return l_legislation_code;
763 --
764 end return_legislation_code;
765 --
766 end ben_enb_bus;