DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_PTY_BUS

Source


1 Package Body ben_pty_bus as
2 /* $Header: beptyrhi.pkb 115.7 2002/12/10 15:22:41 bmanyam noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ben_pty_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_pl_pcp_typ_id               number         default null;
15 --
16 -- ----------------------------------------------------------------------------
17 -- |------< chk_pl_pcp_typ_id >------|
18 -- ----------------------------------------------------------------------------
19 --
20 -- Description
21 --   This procedure is used to check that the primary key for the table
22 --   is created properly. It should be null on insert and
23 --   should not be able to be updated.
24 --
25 -- Pre Conditions
26 --   None.
27 --
28 -- In Parameters
29 --   pl_pcp_typ_id PK of record being inserted or updated.
30 --   object_version_number Object version number of record being
31 --                         inserted or updated.
32 --
33 -- Post Success
34 --   Processing continues
35 --
36 -- Post Failure
37 --   Errors handled by the procedure
38 --
39 -- Access Status
40 --   Internal table handler use only.
41 --
42 Procedure chk_pl_pcp_typ_id(p_pl_pcp_typ_id                      in number,
43                            p_object_version_number       in number) is
44   --
45   l_proc         varchar2(72) := g_package||'chk_pl_pcp_typ_id';
46   l_api_updating boolean;
47   --
48 Begin
49   --
50   hr_utility.set_location('Entering:'||l_proc, 5);
51   --
52   l_api_updating := ben_pty_shd.api_updating
53     (p_pl_pcp_typ_id                   => p_pl_pcp_typ_id,
54      p_object_version_number       => p_object_version_number);
55   --
56   if (l_api_updating
57      and nvl(p_pl_pcp_typ_id,hr_api.g_number)
58      <>  ben_pty_shd.g_old_rec.pl_pcp_typ_id) then
59     --
60     -- raise error as PK has changed
61     --
62     ben_pty_shd.constraint_error('BEN_PL_PCP_TYP_PK');
63     --
64   elsif not l_api_updating then
65     --
66     -- check if PK is null
67     --
68     if p_pl_pcp_typ_id is not null then
69       --
70       -- raise error as PK is not null
71       --
72       ben_pty_shd.constraint_error('BEN_PL_PCP_TYP_PK');
73       --
74     end if;
75     --
76   end if;
77   --
78   hr_utility.set_location('Leaving:'||l_proc, 10);
79   --
80 End chk_pl_pcp_typ_id;
81 --
82 -- ----------------------------------------------------------------------------
83 -- |------< chk_pl_pcp_id >------|
84 -- ----------------------------------------------------------------------------
85 --
86 -- Description
87 --   This procedure checks that a referenced foreign key actually exists
88 --   in the referenced table.
89 --
90 -- Pre-Conditions
91 --   None.
92 --
93 -- In Parameters
94 --   p_pl_pcp_typ_id PK
95 --   p_pl_pcp ID of FK column
96 --   p_object_version_number object version number
97 --
98 -- Post Success
99 --   Processing continues
100 --
101 -- Post Failure
102 --   Error raised.
103 --
104 -- Access Status
105 --   Internal table handler use only.
106 --
107 Procedure chk_pl_pcp_id (p_pl_pcp_typ_id          in number,
108                             p_pl_pcp_id          in number,
109                             p_object_version_number in number) is
110   --
111   l_proc         varchar2(72) := g_package||'chk_pl_pcp_id';
112   l_api_updating boolean;
113   l_dummy        varchar2(1);
114   --
115   cursor c1 is
116     select null
117     from   ben_pl_pcp a
118     where  a.pl_pcp_id = p_pl_pcp_id;
119   --
120 Begin
121   --
122   hr_utility.set_location('Entering:'||l_proc,5);
123   --
124  l_api_updating := ben_pty_shd.api_updating
125      (p_pl_pcp_typ_id            => p_pl_pcp_typ_id,
126       p_object_version_number   => p_object_version_number);
127   --
128   if (l_api_updating
129      and nvl(p_pl_pcp_id,hr_api.g_number)
130      <> nvl(ben_pty_shd.g_old_rec.pl_pcp_id,hr_api.g_number)
131      or not l_api_updating) then
132     --
133     -- check if pl_pcp_id value exists in ben_pl_pcp table
134     --
135     open c1;
136       --
137       fetch c1 into l_dummy;
138       if c1%notfound then
139         --
140         close c1;
141         --
142         -- raise error as FK does not relate to PK in ben_pl_pcp
143         -- table.
144         --
145         ben_pty_shd.constraint_error('BEN_PL_PCP_TYP_FK2');
146         --
147       end if;
148       --
149     close c1;
150     --
151   end if;
152   --
153   hr_utility.set_location('Leaving:'||l_proc,10);
154   --
155 End chk_pl_pcp_id;
156 --
157 -- ----------------------------------------------------------------------------
158 -- |------< chk_pcp_typ_cd >------|
159 -- ----------------------------------------------------------------------------
160 --
161 -- Description
162 --   This procedure is used to check that the lookup value is valid.
163 --
164 -- Pre Conditions
165 --   None.
166 --
167 -- In Parameters
168 --   p_pl_pcp_typ_id PK of record being inserted or updated.
169 --   pcp_typ_cd Value of lookup code.
170 --   effective_date effective date
171 --   object_version_number Object version number of record being
172 --                         inserted or updated.
173 --
174 -- Post Success
175 --   Processing continues
176 --
177 -- Post Failure
178 --   Error handled by procedure
179 --
180 -- Access Status
181 --   Internal table handler use only.
182 --
183 Procedure chk_pcp_typ_cd (p_pl_pcp_typ_id                in number,
184                             p_pcp_typ_cd         in varchar2,
185                             p_effective_date              in date,
186                             p_object_version_number       in number) is
187   --
188   l_proc         varchar2(72) := g_package||'chk_pcp_typ_cd ';
189   l_api_updating boolean;
190   --
191 Begin
192   --
193   hr_utility.set_location('Entering:'||l_proc, 5);
194   --
195   l_api_updating := ben_pty_shd.api_updating
196     (p_pl_pcp_typ_id                   => p_pl_pcp_typ_id,
197      p_object_version_number       => p_object_version_number);
198   --
199  if p_pcp_typ_cd is null then
200       fnd_message.set_name('BEN','BEN_92593_DATA_NULL');
201       fnd_message.set_token('FIELD', 'PCP Type');
202       fnd_message.raise_error;
203   end if;
204   if (l_api_updating
205       and p_pcp_typ_cd      <>       nvl(ben_pty_shd.g_old_rec.pcp_typ_cd,hr_api.g_varchar2)
206       or not l_api_updating)
207       and p_pcp_typ_cd is not null then
208     --
209     -- check if value of lookup falls within lookup type.
210     --
211     if hr_api.not_exists_in_hr_lookups
212           (p_lookup_type    => 'BEN_PCP_SPCLTY',
213            p_lookup_code    => p_pcp_typ_cd,
214            p_effective_date => p_effective_date) then
215       --
216       -- raise error as does not exist as lookup
217       --
218       fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
219       fnd_message.set_token('FIELD','p_pcp_typ_cd');
220       fnd_message.set_token('TYPE','BEN_PCP_TYP_CD');
221       fnd_message.raise_error;
222       --
223     end if;
224     --
225   end if;
226   --
227   hr_utility.set_location('Leaving:'||l_proc,10);
228   --
229 end chk_pcp_typ_cd ;
230 --
231 --
232 -- ----------------------------------------------------------------------------
233 -- |------< chk_gndr_alwd_cd >------|
234 -- ----------------------------------------------------------------------------
235 --
236 -- Description
237 --   This procedure is used to check that the lookup value is valid.
238 --
239 -- Pre Conditions
240 --   None.
241 --
242 -- In Parameters
243 --   p_pl_pcp_typ_id PK of record being inserted or updated.
244 --   gndr_alwd_cd Value of lookup code.
245 --   effective_date effective date
246 --   object_version_number Object version number of record being
247 --                         inserted or updated.
248 --
249 -- Post Success
250 --   Processing continues
251 --
252 -- Post Failure
253 --   Error handled by procedure
254 --
255 -- Access Status
256 --   Internal table handler use only.
257 --
258 Procedure chk_gndr_alwd_cd (p_pl_pcp_typ_id                in number,
259                             p_gndr_alwd_cd         in varchar2,
260                             p_min_age              in number,
261                             p_max_age              in number,
262                             p_effective_date              in date,
263                             p_object_version_number       in number) is
264   --
265   l_proc         varchar2(72) := g_package||'chk_gndr_alwd_cd ';
266   l_api_updating boolean;
267   --
268 Begin
269   --
270   hr_utility.set_location('Entering:'||l_proc, 5);
271   --
272   l_api_updating := ben_pty_shd.api_updating
273     (p_pl_pcp_typ_id                   => p_pl_pcp_typ_id,
274      p_object_version_number       => p_object_version_number);
275   --
276   if p_gndr_alwd_cd is null and p_min_age is null and p_max_age is null
277   then
278       fnd_message.set_name('BEN','BEN_92593_DATA_NULL');
279       fnd_message.set_token('FIELD', 'Maximum Age or Minimum Age or Gender');
280       fnd_message.raise_error;
281   end if;
282   if (l_api_updating
283       and p_gndr_alwd_cd      <>       nvl(ben_pty_shd.g_old_rec.gndr_alwd_cd,hr_api.g_varchar2)
284       or not l_api_updating)
285       and p_gndr_alwd_cd is not null then
286     --
287     -- check if value of lookup falls within lookup type.
288     --
289     if hr_api.not_exists_in_hr_lookups
290           (p_lookup_type    => 'SEX',
291            p_lookup_code    => p_gndr_alwd_cd,
292            p_effective_date => p_effective_date) then
293       --
294       -- raise error as does not exist as lookup
295       --
296       fnd_message.set_name('BEN','BEN_91628_LOOKUP_TYPE_GENERIC');
297       fnd_message.set_token('FIELD','p_gndr_alwd_cd');
298       fnd_message.set_token('TYPE','SEX');
299       fnd_message.raise_error;
300       --
301     end if;
302     --
303   end if;
304   --
305   hr_utility.set_location('Leaving:'||l_proc,10);
306   --
307 end chk_gndr_alwd_cd ;
308 --
309 --
310 -- ----------------------------------------------------------------------------
311 -- |------<  chk_pl_pcp_typ_record >------|
312 -- ----------------------------------------------------------------------------
313 --
314 -- Description
315 -- This procedure is used to check that the ben_pl_pcp_type record could not be created
316 -- unless the pcp_rpstry_flag = 'Y'
317 --
318 -- Pre Conditions
319 --   None.
320 --
321 -- In Parameters
322 --   pl_pcp_id FK of record
323 --
324 -- Post Success
325 --   Processing continues
326 --
327 -- Post Failure
328 --   Errors handled by the procedure
329 --
330 -- Access Status
331 --   Internal table handler use only.
332 --
333 
334 Procedure chk_pl_pcp_typ_record
335           ( p_pl_pcp_id            in   varchar2) is
336 
337 l_proc     varchar2(72) := g_package|| ' chk_pl_pcp_typ_record';
338 l_dummy    varchar(30);
339 --l_name     ben_acty_base_rt_f.name%type ;
340 
341 --cursor to check the pcp_rpstry_flag
342 cursor c1 is select pcp_rpstry_flag
343        from   ben_pl_pcp
344        Where  pl_pcp_id = p_pl_pcp_id;
345 
346 --
347 Begin
348      hr_utility.set_location('Entering:'||l_proc, 5);
349      --
350      --- when the rate is imputing chek the plan in imputing
351      open c1;
352      fetch c1 into l_dummy;
353      if c1%found and l_dummy <> 'Y' then
354 	 fnd_message.set_name('BEN','BEN_92561_RPSTRY_FLG');
355        fnd_message.raise_error;
356     end if;
357     close c1;
358 
359   hr_utility.set_location('Leaving:'||l_proc, 15);
360 End chk_pl_pcp_typ_record;
361 --
362 --  ---------------------------------------------------------------------------
363 --  |----------------------< set_security_group_id >--------------------------|
364 --  ---------------------------------------------------------------------------
365 --
366 Procedure set_security_group_id
367   (p_pl_pcp_typ_id                        in number
368   ) is
369   --
370   -- Declare cursor
371   --
372   cursor csr_sec_grp is
373     select pbg.security_group_id
374       from per_business_groups pbg
375          , ben_pl_pcp_typ pty
376      where pty.pl_pcp_typ_id = p_pl_pcp_typ_id
377        and pbg.business_group_id = pty.business_group_id;
378   --
379   -- Declare local variables
380   --
381   l_security_group_id number;
382   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
383   --
384 begin
385   --
386   hr_utility.set_location('Entering:'|| l_proc, 10);
387   --
388   -- Ensure that all the mandatory parameter are not null
389   --
390   hr_api.mandatory_arg_error
391     (p_api_name           => l_proc
392     ,p_argument           => 'pl_pcp_typ_id'
393     ,p_argument_value     => p_pl_pcp_typ_id
394     );
395   --
396   open csr_sec_grp;
397   fetch csr_sec_grp into l_security_group_id;
398   --
399   if csr_sec_grp%notfound then
400      --
401      close csr_sec_grp;
402      --
403      -- The primary key is invalid therefore we must error
404      --
405      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
406      fnd_message.raise_error;
407      --
408   end if;
409   close csr_sec_grp;
410   --
411   -- Set the security_group_id in CLIENT_INFO
412   --
413   hr_api.set_security_group_id
414     (p_security_group_id => l_security_group_id
415     );
416   --
417   hr_utility.set_location(' Leaving:'|| l_proc, 20);
418   --
419 end set_security_group_id;
420 --
421 --  ---------------------------------------------------------------------------
422 --  |---------------------< return_legislation_code >-------------------------|
423 --  ---------------------------------------------------------------------------
424 --
425 Function return_legislation_code
426   (p_pl_pcp_typ_id                        in     number
427   )
428   Return Varchar2 Is
429   --
430   -- Declare cursor
431   --
432   cursor csr_leg_code is
433     select pbg.legislation_code
434       from per_business_groups pbg
435          , ben_pl_pcp_typ pty
436      where pty.pl_pcp_typ_id = p_pl_pcp_typ_id
437        and pbg.business_group_id = pty.business_group_id;
438   --
439   -- Declare local variables
440   --
441   l_legislation_code  varchar2(150);
442   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
443   --
444 Begin
445   --
446   hr_utility.set_location('Entering:'|| l_proc, 10);
447   --
448   -- Ensure that all the mandatory parameter are not null
449   --
450   hr_api.mandatory_arg_error
451     (p_api_name           => l_proc
452     ,p_argument           => 'pl_pcp_typ_id'
453     ,p_argument_value     => p_pl_pcp_typ_id
454     );
455   --
456   if ( nvl(ben_pty_bus.g_pl_pcp_typ_id, hr_api.g_number)
457        = p_pl_pcp_typ_id) then
458     --
459     -- The legislation code has already been found with a previous
460     -- call to this function. Just return the value in the global
461     -- variable.
462     --
463     l_legislation_code := ben_pty_bus.g_legislation_code;
464     hr_utility.set_location(l_proc, 20);
465   else
466     --
467     -- The ID is different to the last call to this function
468     -- or this is the first call to this function.
469     --
470     open csr_leg_code;
471     fetch csr_leg_code into l_legislation_code;
472     --
473     if csr_leg_code%notfound then
474       --
475       -- The primary key is invalid therefore we must error
476       --
477       close csr_leg_code;
478       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
479       fnd_message.raise_error;
480     end if;
481     hr_utility.set_location(l_proc,30);
482     --
483     -- Set the global variables so the values are
484     -- available for the next call to this function.
485     --
486     close csr_leg_code;
487     ben_pty_bus.g_pl_pcp_typ_id     := p_pl_pcp_typ_id;
488     ben_pty_bus.g_legislation_code  := l_legislation_code;
489   end if;
490   hr_utility.set_location(' Leaving:'|| l_proc, 40);
491   return l_legislation_code;
492 end return_legislation_code;
493 --
494 -- ----------------------------------------------------------------------------
495 -- |------------------------------< chk_df >----------------------------------|
496 -- ----------------------------------------------------------------------------
497 --
498 -- Description:
499 --   Validates all the Descriptive Flexfield values.
500 --
501 -- Prerequisites:
502 --   All other columns have been validated.  Must be called as the
503 --   last step from insert_validate and update_validate.
504 --
505 -- In Arguments:
506 --   p_rec
507 --
508 -- Post Success:
509 --   If the Descriptive Flexfield structure column and data values are
510 --   all valid this procedure will end normally and processing will
511 --   continue.
512 --
513 -- Post Failure:
514 --   If the Descriptive Flexfield structure column value or any of
515 --   the data values are invalid then an application error is raised as
516 --   a PL/SQL exception.
517 --
518 -- Access Status:
519 --   Internal Row Handler Use Only.
520 --
521 -- ----------------------------------------------------------------------------
522 procedure chk_df
523   (p_rec in ben_pty_shd.g_rec_type
524   ) is
525 --
526   l_proc   varchar2(72) := g_package || 'chk_df';
527 --
528 begin
529   hr_utility.set_location('Entering:'||l_proc,10);
530   --
531   if ((p_rec.pl_pcp_typ_id is not null)  and (
532     nvl(ben_pty_shd.g_old_rec.pty_attribute_category, hr_api.g_varchar2) <>
533     nvl(p_rec.pty_attribute_category, hr_api.g_varchar2)  or
534     nvl(ben_pty_shd.g_old_rec.pty_attribute1, hr_api.g_varchar2) <>
535     nvl(p_rec.pty_attribute1, hr_api.g_varchar2)  or
536     nvl(ben_pty_shd.g_old_rec.pty_attribute2, hr_api.g_varchar2) <>
537     nvl(p_rec.pty_attribute2, hr_api.g_varchar2)  or
538     nvl(ben_pty_shd.g_old_rec.pty_attribute3, hr_api.g_varchar2) <>
539     nvl(p_rec.pty_attribute3, hr_api.g_varchar2)  or
540     nvl(ben_pty_shd.g_old_rec.pty_attribute4, hr_api.g_varchar2) <>
541     nvl(p_rec.pty_attribute4, hr_api.g_varchar2)  or
542     nvl(ben_pty_shd.g_old_rec.pty_attribute5, hr_api.g_varchar2) <>
543     nvl(p_rec.pty_attribute5, hr_api.g_varchar2)  or
544     nvl(ben_pty_shd.g_old_rec.pty_attribute6, hr_api.g_varchar2) <>
545     nvl(p_rec.pty_attribute6, hr_api.g_varchar2)  or
546     nvl(ben_pty_shd.g_old_rec.pty_attribute7, hr_api.g_varchar2) <>
547     nvl(p_rec.pty_attribute7, hr_api.g_varchar2)  or
548     nvl(ben_pty_shd.g_old_rec.pty_attribute8, hr_api.g_varchar2) <>
549     nvl(p_rec.pty_attribute8, hr_api.g_varchar2)  or
550     nvl(ben_pty_shd.g_old_rec.pty_attribute9, hr_api.g_varchar2) <>
551     nvl(p_rec.pty_attribute9, hr_api.g_varchar2)  or
552     nvl(ben_pty_shd.g_old_rec.pty_attribute10, hr_api.g_varchar2) <>
553     nvl(p_rec.pty_attribute10, hr_api.g_varchar2)  or
554     nvl(ben_pty_shd.g_old_rec.pty_attribute11, hr_api.g_varchar2) <>
555     nvl(p_rec.pty_attribute11, hr_api.g_varchar2)  or
556     nvl(ben_pty_shd.g_old_rec.pty_attribute12, hr_api.g_varchar2) <>
557     nvl(p_rec.pty_attribute12, hr_api.g_varchar2)  or
558     nvl(ben_pty_shd.g_old_rec.pty_attribute13, hr_api.g_varchar2) <>
559     nvl(p_rec.pty_attribute13, hr_api.g_varchar2)  or
560     nvl(ben_pty_shd.g_old_rec.pty_attribute14, hr_api.g_varchar2) <>
561     nvl(p_rec.pty_attribute14, hr_api.g_varchar2)  or
562     nvl(ben_pty_shd.g_old_rec.pty_attribute15, hr_api.g_varchar2) <>
563     nvl(p_rec.pty_attribute15, hr_api.g_varchar2)  or
564     nvl(ben_pty_shd.g_old_rec.pty_attribute16, hr_api.g_varchar2) <>
565     nvl(p_rec.pty_attribute16, hr_api.g_varchar2)  or
566     nvl(ben_pty_shd.g_old_rec.pty_attribute17, hr_api.g_varchar2) <>
567     nvl(p_rec.pty_attribute17, hr_api.g_varchar2)  or
568     nvl(ben_pty_shd.g_old_rec.pty_attribute18, hr_api.g_varchar2) <>
569     nvl(p_rec.pty_attribute18, hr_api.g_varchar2)  or
570     nvl(ben_pty_shd.g_old_rec.pty_attribute19, hr_api.g_varchar2) <>
571     nvl(p_rec.pty_attribute19, hr_api.g_varchar2)  or
572     nvl(ben_pty_shd.g_old_rec.pty_attribute20, hr_api.g_varchar2) <>
573     nvl(p_rec.pty_attribute20, hr_api.g_varchar2)  or
574     nvl(ben_pty_shd.g_old_rec.pty_attribute21, hr_api.g_varchar2) <>
575     nvl(p_rec.pty_attribute21, hr_api.g_varchar2)  or
576     nvl(ben_pty_shd.g_old_rec.pty_attribute22, hr_api.g_varchar2) <>
577     nvl(p_rec.pty_attribute22, hr_api.g_varchar2)  or
578     nvl(ben_pty_shd.g_old_rec.pty_attribute23, hr_api.g_varchar2) <>
579     nvl(p_rec.pty_attribute23, hr_api.g_varchar2)  or
580     nvl(ben_pty_shd.g_old_rec.pty_attribute24, hr_api.g_varchar2) <>
581     nvl(p_rec.pty_attribute24, hr_api.g_varchar2)  or
582     nvl(ben_pty_shd.g_old_rec.pty_attribute25, hr_api.g_varchar2) <>
583     nvl(p_rec.pty_attribute25, hr_api.g_varchar2)  or
584     nvl(ben_pty_shd.g_old_rec.pty_attribute26, hr_api.g_varchar2) <>
585     nvl(p_rec.pty_attribute26, hr_api.g_varchar2)  or
586     nvl(ben_pty_shd.g_old_rec.pty_attribute27, hr_api.g_varchar2) <>
587     nvl(p_rec.pty_attribute27, hr_api.g_varchar2)  or
588     nvl(ben_pty_shd.g_old_rec.pty_attribute28, hr_api.g_varchar2) <>
589     nvl(p_rec.pty_attribute28, hr_api.g_varchar2)  or
590     nvl(ben_pty_shd.g_old_rec.pty_attribute29, hr_api.g_varchar2) <>
591     nvl(p_rec.pty_attribute29, hr_api.g_varchar2)  or
592     nvl(ben_pty_shd.g_old_rec.pty_attribute30, hr_api.g_varchar2) <>
593     nvl(p_rec.pty_attribute30, hr_api.g_varchar2) ))
594     or (p_rec.pl_pcp_typ_id is null)  then
595     --
596     -- Only execute the validation if absolutely necessary:
597     -- a) During update, the structure column value or any
598     --    of the attribute values have actually changed.
599     -- b) During insert.
600     --
601     hr_dflex_utility.ins_or_upd_descflex_attribs
602       (p_appl_short_name                 => 'BEN'
603       ,p_descflex_name                   => 'EDIT_HERE: Enter descflex name'
604       ,p_attribute_category              => 'PTY_ATTRIBUTE_CATEGORY'
605       ,p_attribute1_name                 => 'PTY_ATTRIBUTE1'
606       ,p_attribute1_value                => p_rec.pty_attribute1
607       ,p_attribute2_name                 => 'PTY_ATTRIBUTE2'
608       ,p_attribute2_value                => p_rec.pty_attribute2
609       ,p_attribute3_name                 => 'PTY_ATTRIBUTE3'
610       ,p_attribute3_value                => p_rec.pty_attribute3
611       ,p_attribute4_name                 => 'PTY_ATTRIBUTE4'
612       ,p_attribute4_value                => p_rec.pty_attribute4
613       ,p_attribute5_name                 => 'PTY_ATTRIBUTE5'
614       ,p_attribute5_value                => p_rec.pty_attribute5
615       ,p_attribute6_name                 => 'PTY_ATTRIBUTE6'
616       ,p_attribute6_value                => p_rec.pty_attribute6
617       ,p_attribute7_name                 => 'PTY_ATTRIBUTE7'
618       ,p_attribute7_value                => p_rec.pty_attribute7
619       ,p_attribute8_name                 => 'PTY_ATTRIBUTE8'
620       ,p_attribute8_value                => p_rec.pty_attribute8
621       ,p_attribute9_name                 => 'PTY_ATTRIBUTE9'
622       ,p_attribute9_value                => p_rec.pty_attribute9
623       ,p_attribute10_name                => 'PTY_ATTRIBUTE10'
624       ,p_attribute10_value               => p_rec.pty_attribute10
625       ,p_attribute11_name                => 'PTY_ATTRIBUTE11'
626       ,p_attribute11_value               => p_rec.pty_attribute11
627       ,p_attribute12_name                => 'PTY_ATTRIBUTE12'
628       ,p_attribute12_value               => p_rec.pty_attribute12
629       ,p_attribute13_name                => 'PTY_ATTRIBUTE13'
630       ,p_attribute13_value               => p_rec.pty_attribute13
631       ,p_attribute14_name                => 'PTY_ATTRIBUTE14'
632       ,p_attribute14_value               => p_rec.pty_attribute14
633       ,p_attribute15_name                => 'PTY_ATTRIBUTE15'
634       ,p_attribute15_value               => p_rec.pty_attribute15
635       ,p_attribute16_name                => 'PTY_ATTRIBUTE16'
636       ,p_attribute16_value               => p_rec.pty_attribute16
637       ,p_attribute17_name                => 'PTY_ATTRIBUTE17'
638       ,p_attribute17_value               => p_rec.pty_attribute17
639       ,p_attribute18_name                => 'PTY_ATTRIBUTE18'
640       ,p_attribute18_value               => p_rec.pty_attribute18
641       ,p_attribute19_name                => 'PTY_ATTRIBUTE19'
642       ,p_attribute19_value               => p_rec.pty_attribute19
643       ,p_attribute20_name                => 'PTY_ATTRIBUTE20'
644       ,p_attribute20_value               => p_rec.pty_attribute20
645       ,p_attribute21_name                => 'PTY_ATTRIBUTE21'
646       ,p_attribute21_value               => p_rec.pty_attribute21
647       ,p_attribute22_name                => 'PTY_ATTRIBUTE22'
648       ,p_attribute22_value               => p_rec.pty_attribute22
649       ,p_attribute23_name                => 'PTY_ATTRIBUTE23'
650       ,p_attribute23_value               => p_rec.pty_attribute23
651       ,p_attribute24_name                => 'PTY_ATTRIBUTE24'
652       ,p_attribute24_value               => p_rec.pty_attribute24
653       ,p_attribute25_name                => 'PTY_ATTRIBUTE25'
654       ,p_attribute25_value               => p_rec.pty_attribute25
655       ,p_attribute26_name                => 'PTY_ATTRIBUTE26'
656       ,p_attribute26_value               => p_rec.pty_attribute26
657       ,p_attribute27_name                => 'PTY_ATTRIBUTE27'
658       ,p_attribute27_value               => p_rec.pty_attribute27
659       ,p_attribute28_name                => 'PTY_ATTRIBUTE28'
660       ,p_attribute28_value               => p_rec.pty_attribute28
661       ,p_attribute29_name                => 'PTY_ATTRIBUTE29'
662       ,p_attribute29_value               => p_rec.pty_attribute29
663       ,p_attribute30_name                => 'PTY_ATTRIBUTE30'
664       ,p_attribute30_value               => p_rec.pty_attribute30
665       );
666   end if;
667   --
668   hr_utility.set_location(' Leaving:'||l_proc,20);
669 end chk_df;
670 --
671 -- ----------------------------------------------------------------------------
672 -- |-----------------------< chk_non_updateable_args >------------------------|
673 -- ----------------------------------------------------------------------------
674 -- {Start Of Comments}
675 --
676 -- Description:
677 --   This procedure is used to ensure that non updateable attributes have
678 --   not been updated. If an attribute has been updated an error is generated.
679 --
680 -- Pre Conditions:
681 --   g_old_rec has been populated with details of the values currently in
682 --   the database.
683 --
684 -- In Arguments:
685 --   p_rec has been populated with the updated values the user would like the
686 --   record set to.
687 --
688 -- Post Success:
689 --   Processing continues if all the non updateable attributes have not
690 --   changed.
691 --
692 -- Post Failure:
693 --   An application error is raised if any of the non updatable attributes
694 --   have been altered.
695 --
696 -- {End Of Comments}
697 -- ----------------------------------------------------------------------------
698 Procedure chk_non_updateable_args
699   (p_rec in ben_pty_shd.g_rec_type
700   ) IS
701 --
702   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
703   l_error    EXCEPTION;
704   l_argument varchar2(30);
705 --
706 Begin
707   --
708   -- Only proceed with the validation if a row exists for the current
709   -- record in the HR Schema.
710   --
711   IF NOT ben_pty_shd.api_updating
712       (p_pl_pcp_typ_id                        => p_rec.pl_pcp_typ_id
713       ,p_object_version_number                => p_rec.object_version_number
714       ) THEN
715      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
716      fnd_message.set_token('PROCEDURE ', l_proc);
717      fnd_message.set_token('STEP ', '5');
718      fnd_message.raise_error;
719   END IF;
720   --
721   -- EDIT_HERE: Add checks to ensure non-updateable args have
722   --            not been updated.
723   --
724   EXCEPTION
725     WHEN l_error THEN
726        hr_api.argument_changed_error
727          (p_api_name => l_proc
728          ,p_argument => l_argument);
729     WHEN OTHERS THEN
730        RAISE;
731 End chk_non_updateable_args;
732 --
733 -- ----------------------------------------------------------------------------
734 -- |---------------------------< insert_validate >----------------------------|
735 -- ----------------------------------------------------------------------------
736 Procedure insert_validate
737   (p_rec                          in ben_pty_shd.g_rec_type ,
738    p_effective_date in date) is
739 --
740   l_proc  varchar2(72) := g_package||'insert_validate';
741 --
742 Begin
743   hr_utility.set_location('Entering:'||l_proc, 5);
744   --
745   -- Call all supporting business operations
746   --
747 
748   chk_pl_pcp_typ_id(p_pl_pcp_typ_id               =>  p_rec.pl_pcp_typ_id
749                  ,p_object_version_number       => p_rec.object_version_number);
750 
751   chk_pl_pcp_id(p_pl_pcp_typ_id               =>  p_rec.pl_pcp_typ_id
752                  ,p_pl_pcp_id                   => p_rec.pl_pcp_id
753                  ,p_object_version_number       => p_rec.object_version_number);
754 
755   chk_pcp_typ_cd (p_pl_pcp_typ_id                 => p_rec.pl_pcp_typ_id,
756                 p_pcp_typ_cd                    => p_rec.pcp_typ_cd,
757                 p_effective_date                => p_effective_date,
758                 p_object_version_number         => p_rec.object_version_number);
759 
760 
761   chk_gndr_alwd_cd (p_pl_pcp_typ_id                => p_rec.pl_pcp_typ_id,
762                   p_gndr_alwd_cd                 => p_rec.gndr_alwd_cd,
763                   p_min_age                      => p_rec.min_age,
764                   p_max_age                      => p_rec.max_age,
765                   p_effective_date               => p_effective_date,
766                   p_object_version_number        => p_rec.object_version_number);
767 
768   chk_pl_pcp_typ_record ( p_pl_pcp_id   => p_rec.pl_pcp_id);
769 
770   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
771   --
772   --
773   --ben_pty_bus.chk_df(p_rec);
774   --
775   hr_utility.set_location(' Leaving:'||l_proc, 10);
776 End insert_validate;
777 --
778 -- ----------------------------------------------------------------------------
779 -- |---------------------------< update_validate >----------------------------|
780 -- ----------------------------------------------------------------------------
781 Procedure update_validate
782   (p_rec                          in ben_pty_shd.g_rec_type
783   ,p_effective_date in date) is
784 --
785   l_proc  varchar2(72) := g_package||'update_validate';
786 --
787 Begin
788   hr_utility.set_location('Entering:'||l_proc, 5);
789   --
790   -- Call all supporting business operations
791   --
792   chk_pl_pcp_typ_id(p_pl_pcp_typ_id               =>  p_rec.pl_pcp_typ_id
793                  ,p_object_version_number       => p_rec.object_version_number);
794 
795   chk_pl_pcp_id(p_pl_pcp_typ_id               =>  p_rec.pl_pcp_typ_id
796                  ,p_pl_pcp_id                   => p_rec.pl_pcp_id
797                  ,p_object_version_number       => p_rec.object_version_number);
798 
799   chk_pcp_typ_cd (p_pl_pcp_typ_id                 => p_rec.pl_pcp_typ_id,
800                 p_pcp_typ_cd                    => p_rec.pcp_typ_cd,
801                 p_effective_date                => p_effective_date,
802                 p_object_version_number         => p_rec.object_version_number);
803 
804 
805   chk_gndr_alwd_cd (p_pl_pcp_typ_id                => p_rec.pl_pcp_typ_id,
806                   p_gndr_alwd_cd                 => p_rec.gndr_alwd_cd,
807                   p_min_age                      => p_rec.min_age,
808                   p_max_age                      => p_rec.max_age,
809                   p_effective_date               => p_effective_date,
810                   p_object_version_number        => p_rec.object_version_number);
811 
812   chk_pl_pcp_typ_record ( p_pl_pcp_id   => p_rec.pl_pcp_id);
813 
814   hr_api.validate_bus_grp_id(p_rec.business_group_id);  -- Validate Bus Grp
815   --
816   chk_non_updateable_args
817     (p_rec              => p_rec
818     );
819   --
820   --
821   --ben_pty_bus.chk_df(p_rec);
822   --
823   hr_utility.set_location(' Leaving:'||l_proc, 10);
824 End update_validate;
825 --
826 -- ----------------------------------------------------------------------------
827 -- |---------------------------< delete_validate >----------------------------|
828 -- ----------------------------------------------------------------------------
829 Procedure delete_validate
830   (p_rec                          in ben_pty_shd.g_rec_type
831   ) is
832 --
833   l_proc  varchar2(72) := g_package||'delete_validate';
834 --
835 Begin
836   hr_utility.set_location('Entering:'||l_proc, 5);
837   --
838   -- Call all supporting business operations
839   --
840   hr_utility.set_location(' Leaving:'||l_proc, 10);
841 End delete_validate;
842 --
843 end ben_pty_bus;