DBA Data[Home] [Help]

PACKAGE BODY: APPS.FF_FFP_BUS

Source


4 -- ----------------------------------------------------------------------------
1 Package Body ff_ffp_bus as
2 /* $Header: ffffprhi.pkb 120.1 2005/10/05 01:51 adkumar noship $ */
3 --
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  ff_ffp_bus.';  -- Global package name
9 --
10 -- The following two global variables are only to be
11 -- used by the return_legislation_code function.
12 --
13 g_legislation_code            varchar2(150)  default null;
14 g_function_id                 number         default null;
15 g_sequence_number             number         default null;
16 --
17 --  ---------------------------------------------------------------------------
18 --  |----------------------< set_security_group_id >--------------------------|
19 --  ---------------------------------------------------------------------------
20 --
21 Procedure set_security_group_id
22   (p_function_id                          in number
23   ,p_sequence_number                      in number
24   ,p_associated_column1                   in varchar2 default null
25   ,p_associated_column2                   in varchar2 default null
26   ) is
27   --
28   -- Declare cursor
29   --
30   -- EDIT_HERE  In the following cursor statement add join(s) between
31   -- ff_function_parameters and PER_BUSINESS_GROUPS_PERF
32   -- so that the security_group_id for
33   -- the current business group context can be derived.
34   -- Remove this comment when the edit has been completed.
35   cursor csr_sec_grp is
36     select pbg.security_group_id,
37            pbg.legislation_code
38       from per_business_groups_perf pbg
39          , ff_function_parameters ffp
40          , ff_functions fff
41      where ffp.function_id = fff.function_id
42        and ffp.function_id = p_function_id
43        and ffp.sequence_number = p_sequence_number
44        and pbg.business_group_id = fff.business_group_id;
45   --
46   -- Declare local variables
47   --
48   l_security_group_id number;
49   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
50   l_legislation_code  varchar2(150);
51   --
52 begin
53   --
54   hr_utility.set_location('Entering:'|| l_proc, 10);
55   --
56   -- Ensure that all the mandatory parameter are not null
57   --
58   hr_api.mandatory_arg_error
59     (p_api_name           => l_proc
60     ,p_argument           => 'function_id'
61     ,p_argument_value     => p_function_id
62     );
63   hr_api.mandatory_arg_error
64     (p_api_name           => l_proc
65     ,p_argument           => 'sequence_number'
66     ,p_argument_value     => p_sequence_number
67     );
68   --
69   open csr_sec_grp;
70   fetch csr_sec_grp into l_security_group_id
71                        , l_legislation_code;
72   --
73   if csr_sec_grp%notfound then
74      --
75      close csr_sec_grp;
76      --
77      -- The primary key is invalid therefore we must error
78      --
79      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
80      hr_multi_message.add
81        (p_associated_column1
82         => nvl(p_associated_column1,'FUNCTION_ID')
83       ,p_associated_column2
84         => nvl(p_associated_column2,'SEQUENCE_NUMBER')
85        );
86      --
87   else
88     close csr_sec_grp;
89     --
90     -- Set the security_group_id in CLIENT_INFO
91     --
92     hr_api.set_security_group_id
93       (p_security_group_id => l_security_group_id
94       );
95     --
96     -- Set the sessions legislation context in HR_SESSION_DATA
97     --
98     hr_api.set_legislation_context(l_legislation_code);
99   end if;
100   --
101   hr_utility.set_location(' Leaving:'|| l_proc, 20);
102   --
103 end set_security_group_id;
104 --
105 --  ---------------------------------------------------------------------------
106 --  |---------------------< return_legislation_code >-------------------------|
107 --  ---------------------------------------------------------------------------
108 --
109 Function return_legislation_code
110   (p_function_id                          in     number
111   ,p_sequence_number                      in     number
112   )
113   Return Varchar2 Is
114   --
115   -- Declare cursor
116   --
117   -- EDIT_HERE  In the following cursor statement add join(s) between
118   -- ff_function_parameters and PER_BUSINESS_GROUPS_PERF
119   -- so that the legislation_code for
120   -- the current business group context can be derived.
121   -- Remove this comment when the edit has been completed.
122   cursor csr_leg_code is
123     select pbg.legislation_code
124       from per_business_groups_perf     pbg
125          , ff_function_parameters ffp
126          , ff_functions fff
127      where ffp.function_id = fff.function_id
128        and ffp.function_id = p_function_id
129        and ffp.sequence_number = p_sequence_number
133   --
130        and pbg.business_group_id = fff.business_group_id;
131   --
132   -- Declare local variables
134   l_legislation_code  varchar2(150);
135   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
136   --
137 Begin
138   --
139   hr_utility.set_location('Entering:'|| l_proc, 10);
140   --
141   -- Ensure that all the mandatory parameter are not null
142   --
143   hr_api.mandatory_arg_error
144     (p_api_name           => l_proc
145     ,p_argument           => 'function_id'
146     ,p_argument_value     => p_function_id
147     );
148   hr_api.mandatory_arg_error
149     (p_api_name           => l_proc
150     ,p_argument           => 'sequence_number'
151     ,p_argument_value     => p_sequence_number
152     );
153   --
154   if (( nvl(ff_ffp_bus.g_function_id, hr_api.g_number)
155        = p_function_id)
156   and ( nvl(ff_ffp_bus.g_sequence_number, hr_api.g_number)
157        = p_sequence_number)) then
158     --
159     -- The legislation code has already been found with a previous
160     -- call to this function. Just return the value in the global
161     -- variable.
162     --
163     l_legislation_code := ff_ffp_bus.g_legislation_code;
164     hr_utility.set_location(l_proc, 20);
165   else
166     --
167     -- The ID is different to the last call to this function
168     -- or this is the first call to this function.
169     --
170     open csr_leg_code;
171     fetch csr_leg_code into l_legislation_code;
172     --
173     if csr_leg_code%notfound then
174       --
175       -- The primary key is invalid therefore we must error
176       --
180     end if;
177       close csr_leg_code;
178       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
179       fnd_message.raise_error;
181     hr_utility.set_location(l_proc,30);
182     --
183     -- Set the global variables so the values are
184     -- available for the next call to this function.
185     --
186     close csr_leg_code;
187     ff_ffp_bus.g_function_id                 := p_function_id;
188     ff_ffp_bus.g_sequence_number             := p_sequence_number;
189     ff_ffp_bus.g_legislation_code  := l_legislation_code;
190   end if;
191   hr_utility.set_location(' Leaving:'|| l_proc, 40);
192   return l_legislation_code;
193 end return_legislation_code;
194 --
195 -- ----------------------------------------------------------------------------
196 -- |-----------------------< chk_non_updateable_args >------------------------|
197 -- ----------------------------------------------------------------------------
198 -- {Start Of Comments}
199 --
200 -- Description:
201 --   This procedure is used to ensure that non updateable attributes have
202 --   not been updated. If an attribute has been updated an error is generated.
203 --
204 -- Pre Conditions:
205 --   g_old_rec has been populated with details of the values currently in
206 --   the database.
207 --
208 -- In Arguments:
209 --   p_rec has been populated with the updated values the user would like the
210 --   record set to.
211 --
212 -- Post Success:
213 --   Processing continues if all the non updateable attributes have not
214 --   changed.
215 --
216 -- Post Failure:
217 --   An application error is raised if any of the non updatable attributes
218 --   have been altered.
219 --
220 -- {End Of Comments}
221 -- ----------------------------------------------------------------------------
222 Procedure chk_non_updateable_args
223   (p_effective_date               in date
224   ,p_rec in ff_ffp_shd.g_rec_type
225   ) IS
226 --
227   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
228 --
229 Begin
230   --
231   -- Only proceed with the validation if a row exists for the current
232   -- record in the HR Schema.
233   --
234   IF NOT ff_ffp_shd.api_updating
235       (p_function_id                       => p_rec.function_id
236       ,p_sequence_number                   => p_rec.sequence_number
237       ,p_object_version_number             => p_rec.object_version_number
238       ) THEN
239      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
240      fnd_message.set_token('PROCEDURE ', l_proc);
241      fnd_message.set_token('STEP ', '5');
242      fnd_message.raise_error;
243   END IF;
244   --
245   -- EDIT_HERE: Add checks to ensure non-updateable args have
246   --            not been updated.
247   --
248 End chk_non_updateable_args;
249 --
250 --
251 -- ----------------------------------------------------------------------------
252 -- |--------------------------< chk_function_id >-----------------------------|
253 -- ----------------------------------------------------------------------------
254 procedure chk_function_id
258 cursor csr_function_id is
255 (p_function_id     in number
256 ) is
257 --
259 select NULL
260 from   FF_FUNCTIONS ffn
261 where  ffn.function_id = p_function_id;
262 --
263 l_proc   varchar2(100) := g_package || 'chk_function_id';
264 l_exists varchar2(1);
265 
266 begin
267   --
268   hr_utility.set_location('Entering:'|| l_proc, 10);
269   --
270   -- FUNCTION_ID is mandatory.
271   --
272   hr_api.mandatory_arg_error
273   (p_api_name       =>  l_proc
274   ,p_argument       =>  'FUNCTION_ID'
275   ,p_argument_value =>  p_function_id
276   );
277   --
278   open csr_function_id;
279   fetch csr_function_id into l_exists;
280   if csr_function_id%notfound then
281     close csr_function_id;
282     ff_ffp_shd.constraint_error('FF_FUNCTION_PARAMETERS_FK1');
283   end if;
284   close csr_function_id;
285   --
286   hr_utility.set_location('Entering:'|| l_proc, 20);
287   --
288 exception
289   when app_exception.application_exception then
290     if hr_multi_message.exception_add
291        (p_associated_column1 => 'FF_FUNCTION_PARAMETERS.FUNCTION_ID'
292        ) then
293       raise;
294     end if;
295   when others then
296     if csr_function_id%isopen then
297       close csr_function_id;
298     end if;
299     raise;
300 end chk_function_id;
301 --
302 -- ----------------------------------------------------------------------------
303 -- |--------------------------< chk_class >-----------------------------------|
304 -- ----------------------------------------------------------------------------
305 procedure chk_class
306 (p_effective_date               in date
307 ,p_class                        in varchar2
308 ) is
309 --
310 l_proc   varchar2(100) := g_package || 'chk_class';
311 --
312 begin
313   --
314   hr_utility.set_location('Entering:'|| l_proc, 10);
315   --
316   -- CLASS is mandatory.
317   --
318   hr_api.mandatory_arg_error
319   (p_api_name       =>  l_proc
320   ,p_argument       =>  'CLASS'
321   ,p_argument_value =>  p_class
322   );
323 
324   if hr_api.not_exists_in_hrstanlookups
325     (p_effective_date => p_effective_date
326     ,p_lookup_type    => 'PARAMETER_CLASS'
327     ,p_lookup_code    => p_class
328        ) then
329       ff_ffp_shd.constraint_error('FF_FP_CLASS_CHK');
330   end if;
331   --
332   hr_utility.set_location('Entering:'|| l_proc, 20);
333   --
334 exception
335   when app_exception.application_exception then
336     if hr_multi_message.exception_add
337        (p_associated_column1 => 'FF_FUNCTION_PARAMETERS.CLASS'
338        ) then
339       raise;
340     end if;
341 end chk_class;
342 --
343 -- ----------------------------------------------------------------------------
344 -- |--------------------------< chk_data_type >-------------------------------|
345 -- ----------------------------------------------------------------------------
346 procedure chk_data_type
347 (p_effective_date               in date
348 ,p_data_type                    in varchar2
349 ) is
350 --
351 l_proc   varchar2(100) := g_package || 'chk_data_type';
352 --
353 begin
354   --
355   hr_utility.set_location('Entering:'|| l_proc, 10);
356   --
357   -- DATA_TYPE is mandatory.
358   --
359   hr_api.mandatory_arg_error
360   (p_api_name       =>  l_proc
361   ,p_argument       =>  'DATA_TYPE'
362   ,p_argument_value =>  p_data_type
363   );
364 
365   if hr_api.not_exists_in_hrstanlookups
366     (p_effective_date => p_effective_date
367     ,p_lookup_type    => 'DATA_TYPE'
368     ,p_lookup_code    => p_data_type
369        ) then
370       ff_ffp_shd.constraint_error('FF_FP_DATA_TYPE_CHK');
371   end if;
372   --
373   hr_utility.set_location('Entering:'|| l_proc, 20);
374   --
375 exception
376   when app_exception.application_exception then
377     if hr_multi_message.exception_add
378        (p_associated_column1 => 'FF_FUNCTION_PARAMETERS.DATA_TYPE'
379        ) then
380       raise;
381     end if;
382 end chk_data_type;
383 --
384 -- ----------------------------------------------------------------------------
385 -- |--------------------------< chk_name >------------------------------------|
386 -- ----------------------------------------------------------------------------
387 procedure chk_name
388 (p_name                        in varchar2
389 ) is
390 --
391 l_proc   varchar2(100) := g_package || 'chk_name';
392 dummy    varchar2(80);
393 l_name   varchar2(80);
394 --
395 begin
396   --
397   hr_utility.set_location('Entering:'|| l_proc, 10);
398   --
399   -- NAME is mandatory.
400   --
401   hr_api.mandatory_arg_error
402   (p_api_name       =>  l_proc
403   ,p_argument       =>  'NAME'
404   ,p_argument_value =>  p_name
405   );
406   --
407    if (p_name is not null) then
408       l_name := p_name;
409       hr_chkfmt.checkformat (l_name,
410 	                    'PAY_NAME',
411 		             dummy,
412                              null,
413                              null,
414                              'N',
415                              dummy,
416                              null);
417    end if;
418   --
419   hr_utility.set_location('Entering:'|| l_proc, 20);
420   --
421 exception
422   when app_exception.application_exception then
423     if hr_multi_message.exception_add
424        (p_associated_column1 => 'FF_FUNCTION_PARAMETERS.NAME'
425        ) then
426       raise;
427     end if;
431 -- |--------------------------< chk_optional >--------------------------------|
428 end chk_name;
429 --
430 -- ----------------------------------------------------------------------------
432 -- ----------------------------------------------------------------------------
433 procedure chk_optional
434 (p_effective_date               in date
435 ,p_class                        in varchar2
436 ,p_optional                     in varchar2
437 ) is
438 --
439 l_proc   varchar2(100) := g_package || 'chk_optional';
440 --
441 begin
442   --
443   hr_utility.set_location('Entering:'|| l_proc, 10);
444   --
445   -- OPTIONAL is mandatory.
446   --
447   hr_api.mandatory_arg_error
448   (p_api_name       =>  l_proc
449   ,p_argument       =>  'OPTIONAL'
450   ,p_argument_value =>  p_optional
451   );
452 
453   --
454   if hr_multi_message.no_exclusive_error
455      (p_check_column1      => 'FF_FUNCTION_PARAMETERS.CLASS'
456      ,p_associated_column1 => 'FF_FUNCTION_PARAMETERS.OPTIONAL'
457      ) then
458 
459      if hr_api.not_exists_in_hrstanlookups
460        (p_effective_date => p_effective_date
461        ,p_lookup_type    => 'YES_NO'
462        ,p_lookup_code    => p_optional
463        ) then
464       ff_ffp_shd.constraint_error('FF_FP_OPTIONAL_CHK');
465      end if;
466      -- if parameter class is 'OUT' or 'IN/OUT' type then optional must be 'N'
467      if (p_class <> 'I' and p_optional <> 'N' ) then
468          ff_ffp_shd.constraint_error('FF_FP_OPTIONAL_CHK');
469      end if;
470 
471   end if;
472   --
473   hr_utility.set_location('Entering:'|| l_proc, 20);
474   --
475 exception
476   when app_exception.application_exception then
477     if hr_multi_message.exception_add
478        (p_associated_column1 => 'FF_FUNCTION_PARAMETERS.OPTIONAL'
479        ) then
480       raise;
481     end if;
482 end chk_optional;
483 --
484 --
485 -- ----------------------------------------------------------------------------
486 -- |--------------------------< chk_continuing_parameter >--------------------|
487 -- ----------------------------------------------------------------------------
488 procedure chk_continuing_parameter
489 (p_effective_date               in date
490 ,p_class                        in varchar2
491 ,p_continuing_parameter         in varchar2
492 ) is
493 --
494 l_proc   varchar2(100) := g_package || 'chk_continuing_parameter';
495 --
496 begin
497   --
498   hr_utility.set_location('Entering:'|| l_proc, 10);
499   --
500   -- CONTINUING_PARAMETER is mandatory.
501   --
502   hr_api.mandatory_arg_error
503   (p_api_name       =>  l_proc
504   ,p_argument       =>  'CONTINUING_PARAMETER'
505   ,p_argument_value =>  p_continuing_parameter
506   );
507 
508   --
509   if hr_multi_message.no_exclusive_error
510      (p_check_column1      => 'FF_FUNCTION_PARAMETERS.CLASS'
511      ,p_associated_column1 => 'FF_FUNCTION_PARAMETERS.CONTINUING_PARAMETER'
512      ) then
513 
514      if hr_api.not_exists_in_hrstanlookups
515        (p_effective_date => p_effective_date
516        ,p_lookup_type    => 'YES_NO'
517        ,p_lookup_code    => p_continuing_parameter
518        ) then
519       ff_ffp_shd.constraint_error('FF_FP_CONTINUING_PARAMETER_CHK');
520      end if;
521      -- if parameter class is 'OUT' or 'IN/OUT' type then continuing_parameter must be 'N'
522      if (p_class <> 'I' and p_continuing_parameter <> 'N') then
523         ff_ffp_shd.constraint_error('FF_FP_CONTINUING_PARAMETER_CHK');
524      end if;
525 
526   end if;
527   --
528   hr_utility.set_location('Entering:'|| l_proc, 20);
529   --
530 exception
531   when app_exception.application_exception then
532     if hr_multi_message.exception_add
533        (p_associated_column1 => 'FF_FUNCTION_PARAMETERS.CONTINUING_PARAMETER'
534        ) then
535       raise;
536     end if;
537 end chk_continuing_parameter;
538 --
539 -- ----------------------------------------------------------------------------
540 -- |--------------------------< chk_unique >----------------------------------|
541 -- ----------------------------------------------------------------------------
542 procedure chk_unique
543 (p_function_id     in number
544 ,p_name            in varchar2
545 ,p_sequence_number in number
546 ) is
547 --
548 cursor csr_unique_parameter
549 is
550 select NULL
551 from ff_function_parameters ffp
552 where ffp.function_id = p_function_id
553 and ffp.name like p_name
557 l_exists varchar2(1);
554 and sequence_number <> nvl(p_sequence_number,-1);
555 --
556 l_proc   varchar2(100) := g_package || 'chk_unique';
558 
559 begin
560   --
561   --
562   if hr_multi_message.no_exclusive_error
563      (p_check_column1      => 'FF_FUNCTION_PARAMETERS.FUNCTION_ID'
567      ) then
564      ,p_check_column2      => 'FF_FUNCTION_PARAMETERS.NAME'
565      ,p_associated_column1 => 'FF_FUNCTION_PARAMETERS.FUNCTION_ID'
566      ,p_associated_column2 => 'FF_FUNCTION_PARAMETERS.NAME'
568 
569     open csr_unique_parameter;
570     fetch csr_unique_parameter into l_exists;
571     if csr_unique_parameter%found then
572       close csr_unique_parameter;
573       ff_ffp_shd.constraint_error('FF_FUNCTION_PARAMETERS_UK2');
574     end if;
575     close csr_unique_parameter;
576   end if;
577 
578 exception
579   when app_exception.application_exception then
580     if hr_multi_message.exception_add
581        (p_same_associated_columns => 'Y'
582        ) then
583       raise;
584     end if;
585   when others then
586     if csr_unique_parameter%isopen then
587       close csr_unique_parameter;
588     end if;
589     raise;
590 end chk_unique;
591 --
592 -- ----------------------------------------------------------------------------
593 -- |----------------------< chk_startup_action >------------------------------|
594 -- ----------------------------------------------------------------------------
595 --
596 -- Description:
597 --  This procedure will check that the current action is allowed according
598 --  to the current startup mode.
599 --
600 -- ----------------------------------------------------------------------------
601 PROCEDURE chk_startup_action
602   (p_insert               IN boolean
603   ,p_business_group_id    IN number
604   ,p_legislation_code     IN varchar2
605   ,p_legislation_subgroup IN varchar2 DEFAULT NULL) IS
606 --
607 BEGIN
608   --
609   -- Call the supporting procedure to check startup mode
610 
611   IF (p_insert) THEN
612 
613 	if p_business_group_id is not null and p_legislation_code is not null then
614         fnd_message.set_name('PAY', 'PAY_33179_BGLEG_INVALID');
615         fnd_message.raise_error;
616     end if;
617 
618     hr_startup_data_api_support.chk_startup_action
619       (p_generic_allowed   => TRUE
620       ,p_startup_allowed   => TRUE
621       ,p_user_allowed      => TRUE
622       ,p_business_group_id => p_business_group_id
623       ,p_legislation_code  => p_legislation_code
624       ,p_legislation_subgroup => p_legislation_subgroup
625       );
626   ELSE
627     hr_startup_data_api_support.chk_upd_del_startup_action
628       (p_generic_allowed   => TRUE
629       ,p_startup_allowed   => TRUE
630       ,p_user_allowed      => TRUE
631       ,p_business_group_id => p_business_group_id
632       ,p_legislation_code  => p_legislation_code
633       ,p_legislation_subgroup => p_legislation_subgroup
634       );
635   END IF;
636   --
637 END chk_startup_action;
638 --
639 -- ----------------------------------------------------------------------------
640 -- |---------------------------< insert_validate >----------------------------|
641 -- ----------------------------------------------------------------------------
642 Procedure insert_validate
643   (p_effective_date               in date
644   ,p_rec                          in ff_ffp_shd.g_rec_type
645   ) is
646 --
647   cursor csr_business_group is
648   select  business_group_id
649         , legislation_code
650     from FF_FUNCTIONS ffn
651    where ffn.function_id = p_rec.function_id;
652 --
653   l_proc  varchar2(72) := g_package||'insert_validate';
654   l_business_group_id ff_functions.business_group_id%type;
655   l_legislation_code  ff_functions.legislation_code%type;
656 --
657 Begin
658   hr_utility.set_location('Entering:'||l_proc, 5);
659   --
660    -- Call all supporting business operations
661   --
662   -----------------------------------------------------------------------------
663   chk_function_id(p_rec.function_id);
664   -----------------------------------------------------------------------------
665   open csr_business_group;
666   fetch csr_business_group into l_business_group_id,l_legislation_code;
667   close csr_business_group;
668 
669   chk_startup_action(true
670                     ,l_business_group_id
671                     ,l_legislation_code
672                     );
673 
674   -----------------------------------------------------------------------------
675   chk_class(p_effective_date  => p_effective_date
676            ,p_class           => p_rec.class
677            );
678   -----------------------------------------------------------------------------
679   chk_data_type(p_effective_date => p_effective_date
680                ,p_data_type      => p_rec.data_type
681                );
682 
683   -----------------------------------------------------------------------------
684   chk_name(p_name  => p_rec.name);
685 
686   -----------------------------------------------------------------------------
687   chk_unique(p_function_id  => p_rec.function_id
688             ,p_name         => p_rec.name
689 	    ,p_sequence_number => p_rec.sequence_number);
690 
691   -----------------------------------------------------------------------------
692   chk_optional(p_effective_date => p_effective_date
693               ,p_class          => p_rec.class
694               ,p_optional       => p_rec.optional
695               );
696   -----------------------------------------------------------------------------
697   chk_continuing_parameter(p_effective_date       => p_effective_date
698                           ,p_class                => p_rec.class
699                           ,p_continuing_parameter => p_rec.continuing_parameter
703   hr_utility.set_location(' Leaving:'||l_proc, 10);
700                           );
701 
702   --
704 End insert_validate;
705 --
706 -- ----------------------------------------------------------------------------
707 -- |---------------------------< update_validate >----------------------------|
708 -- ----------------------------------------------------------------------------
709 Procedure update_validate
710   (p_effective_date               in date
711   ,p_rec                          in ff_ffp_shd.g_rec_type
712   ) is
713 --
714   cursor csr_business_group is
715   select  business_group_id
716         , legislation_code
717     from FF_FUNCTIONS ffn
718    where ffn.function_id = p_rec.function_id;
719 --
720   l_business_group_id ff_functions.business_group_id%type;
721   l_legislation_code  ff_functions.legislation_code%type;
725   hr_utility.set_location('Entering:'||l_proc, 5);
722   l_proc  varchar2(72) := g_package||'update_validate';
723 --
724 Begin
726   --
727   -- Call all supporting business operations
728   --
729    -----------------------------------------------------------------------------
730   chk_function_id(p_rec.function_id);
731   -----------------------------------------------------------------------------
732   open csr_business_group;
733   fetch csr_business_group into l_business_group_id,l_legislation_code;
734   close csr_business_group;
735 
736   chk_startup_action(true
737                     ,l_business_group_id
738                     ,l_legislation_code
739                     );
740 
741   -----------------------------------------------------------------------------
742   chk_class(p_effective_date  => p_effective_date
743            ,p_class           => p_rec.class
744            );
745   -----------------------------------------------------------------------------
746   chk_data_type(p_effective_date => p_effective_date
747                ,p_data_type      => p_rec.data_type
748                );
749 
750   -----------------------------------------------------------------------------
751   chk_name(p_name  => p_rec.name);
752 
753   -----------------------------------------------------------------------------
754   chk_unique(p_function_id  => p_rec.function_id
755             ,p_name         => p_rec.name
756    	    ,p_sequence_number => p_rec.sequence_number);
757 
758   -----------------------------------------------------------------------------
759   chk_optional(p_effective_date => p_effective_date
760               ,p_class          => p_rec.class
761               ,p_optional       => p_rec.optional
762               );
763   -----------------------------------------------------------------------------
764   chk_continuing_parameter(p_effective_date       => p_effective_date
765                           ,p_class                => p_rec.class
766                           ,p_continuing_parameter => p_rec.continuing_parameter
767                           );
768  --
769   chk_non_updateable_args
770     (p_effective_date     => p_effective_date
771       ,p_rec              => p_rec
772     );
773   --
774   --
775   hr_utility.set_location(' Leaving:'||l_proc, 10);
776 End update_validate;
777 --
778 -- ----------------------------------------------------------------------------
779 -- |---------------------------< delete_validate >----------------------------|
780 -- ----------------------------------------------------------------------------
781 Procedure delete_validate
782   (p_rec                          in ff_ffp_shd.g_rec_type
783   ) is
784 --
785   cursor csr_business_group is
786   select  business_group_id
787         , legislation_code
788     from FF_FUNCTIONS ffn
789    where ffn.function_id = p_rec.function_id;
790 --
791   l_business_group_id ff_functions.business_group_id%type;
792   l_legislation_code  ff_functions.legislation_code%type;
793   l_proc  varchar2(72) := g_package||'delete_validate';
794 --
795 Begin
796   hr_utility.set_location('Entering:'||l_proc, 5);
797   --
798     -----------------------------------------------------------------------------
799   chk_function_id(p_function_id  => p_rec.function_id);
800   -----------------------------------------------------------------------------
801   open csr_business_group;
802   fetch csr_business_group into l_business_group_id,l_legislation_code;
803   close csr_business_group;
804 
805   chk_startup_action(true
806                     ,l_business_group_id
807                     ,l_legislation_code
808                     );
809 
810   --
811   -- Call all supporting business operations
812   --
813   hr_utility.set_location(' Leaving:'||l_proc, 10);
814 End delete_validate;
815 --
816 end ff_ffp_bus;