DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_ABC_BUS

Source


1 Package Body per_abc_bus as
2 /* $Header: peabcrhi.pkb 120.1 2005/09/28 05:04 snukala noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  per_abc_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_absence_case_id             number         default null;
15 --
16 --  ---------------------------------------------------------------------------
17 --  |----------------------< set_security_group_id >--------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 Procedure set_security_group_id
21   (p_absence_case_id                      in number
22   ,p_associated_column1                   in varchar2 default null
23   ) is
24   --
25   -- Declare cursor
26   --
27   cursor csr_sec_grp is
28     select pbg.security_group_id,
29            pbg.legislation_code
30       from per_business_groups_perf pbg
31          , per_absence_cases abc
32      where abc.absence_case_id = p_absence_case_id
33        and pbg.business_group_id = abc.business_group_id;
34   --
35   -- Declare local variables
36   --
37   l_security_group_id number;
38   l_proc              varchar2(72)  :=  g_package||'set_security_group_id';
39   l_legislation_code  varchar2(150);
40   --
41 begin
42   --
43   hr_utility.set_location('Entering:'|| l_proc, 10);
44   --
45   -- Ensure that all the mandatory parameter are not null
46   --
47   hr_api.mandatory_arg_error
48     (p_api_name           => l_proc
49     ,p_argument           => 'absence_case_id'
50     ,p_argument_value     => p_absence_case_id
51     );
52   --
53   open csr_sec_grp;
54   fetch csr_sec_grp into l_security_group_id
55                        , l_legislation_code;
56   --
57   if csr_sec_grp%notfound then
58      --
59      close csr_sec_grp;
60      --
61      -- The primary key is invalid therefore we must error
62      --
63      fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
64      hr_multi_message.add
65        (p_associated_column1
66         => nvl(p_associated_column1,'ABSENCE_CASE_ID')
67        );
68      --
69   else
70     close csr_sec_grp;
71     --
72     -- Set the security_group_id in CLIENT_INFO
73     --
74     hr_api.set_security_group_id
75       (p_security_group_id => l_security_group_id
76       );
77     --
78     -- Set the sessions legislation context in HR_SESSION_DATA
79     --
80     hr_api.set_legislation_context(l_legislation_code);
81   end if;
82   --
83   hr_utility.set_location(' Leaving:'|| l_proc, 20);
84   --
85 end set_security_group_id;
86 --
87 --  ---------------------------------------------------------------------------
88 --  |---------------------< return_legislation_code >-------------------------|
89 --  ---------------------------------------------------------------------------
90 --
91 Function return_legislation_code
92   (p_absence_case_id                      in     number
93   )
94   Return Varchar2 Is
95   --
96   -- Declare cursor
97   --
98  cursor csr_leg_code is
99     select pbg.legislation_code
100       from per_business_groups_perf pbg
101          , per_absence_cases pbc
102      where pbc.absence_case_id = p_absence_case_id
103        and pbg.business_group_id = pbc.business_group_id;
104   --
105   -- Declare local variables
106   --
107   l_legislation_code  varchar2(150);
108   l_proc              varchar2(72)  :=  g_package||'return_legislation_code';
109   --
110 Begin
111   --
112   hr_utility.set_location('Entering:'|| l_proc, 10);
113   --
114   -- Ensure that all the mandatory parameter are not null
115   --
116   hr_api.mandatory_arg_error
117     (p_api_name           => l_proc
118     ,p_argument           => 'absence_case_id'
119     ,p_argument_value     => p_absence_case_id
120     );
121   --
122   if ( nvl(per_abc_bus.g_absence_case_id, hr_api.g_number)
123        = p_absence_case_id) then
124     --
125     -- The legislation code has already been found with a previous
126     -- call to this function. Just return the value in the global
127     -- variable.
128     --
129     l_legislation_code := per_abc_bus.g_legislation_code;
130     hr_utility.set_location(l_proc, 20);
131   else
132     --
133     -- The ID is different to the last call to this function
134     -- or this is the first call to this function.
135     --
136     open csr_leg_code;
137     fetch csr_leg_code into l_legislation_code;
138     --
139     if csr_leg_code%notfound then
140       --
141       -- The primary key is invalid therefore we must error
142       --
143       close csr_leg_code;
144       fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
145       fnd_message.raise_error;
146     end if;
147     hr_utility.set_location(l_proc,30);
148     --
149     -- Set the global variables so the values are
150     -- available for the next call to this function.
151     --
152     close csr_leg_code;
153     per_abc_bus.g_absence_case_id             := p_absence_case_id;
154     per_abc_bus.g_legislation_code  := l_legislation_code;
155   end if;
156   hr_utility.set_location(' Leaving:'|| l_proc, 40);
157   return l_legislation_code;
158 end return_legislation_code;
159 
160 --
161 -- ----------------------------------------------------------------------------
162 -- |-----------------------------< chk_ddf >----------------------------------|
163 -- ----------------------------------------------------------------------------
164 --
165 -- Description:
166 --   Validates all the Developer Descriptive Flexfield values.
167 --
168 -- Prerequisites:
169 --   All other columns have been validated.  Must be called as the
170 --   last step from insert_validate and update_validate.
171 --
172 -- In Arguments:
173 --   p_rec
174 --
175 -- Post Success:
176 --   If the Developer Descriptive Flexfield structure column and data values
177 --   are all valid this procedure will end normally and processing will
178 --   continue.
179 --
180 -- Post Failure:
181 --   If the Developer Descriptive Flexfield structure column value or any of
182 --   the data values are invalid then an application error is raised as
183 --   a PL/SQL exception.
184 --
185 -- Access Status:
186 --   Internal Row Handler Use Only.
187 --
188 -- ----------------------------------------------------------------------------
189 procedure chk_ddf
190   (p_rec in per_abc_shd.g_rec_type
191   ) is
192 --
193   l_proc   varchar2(72) := g_package || 'chk_ddf';
194 --
195 begin
196   hr_utility.set_location('Entering:'||l_proc,10);
197   --
198   if ((p_rec.absence_case_id is not null)  and (
199     nvl(per_abc_shd.g_old_rec.ac_information_category, hr_api.g_varchar2) <>
200     nvl(p_rec.ac_information_category, hr_api.g_varchar2)  or
201     nvl(per_abc_shd.g_old_rec.ac_information1, hr_api.g_varchar2) <>
202     nvl(p_rec.ac_information1, hr_api.g_varchar2)  or
203     nvl(per_abc_shd.g_old_rec.ac_information2, hr_api.g_varchar2) <>
204     nvl(p_rec.ac_information2, hr_api.g_varchar2)  or
205     nvl(per_abc_shd.g_old_rec.ac_information3, hr_api.g_varchar2) <>
206     nvl(p_rec.ac_information3, hr_api.g_varchar2)  or
207     nvl(per_abc_shd.g_old_rec.ac_information4, hr_api.g_varchar2) <>
208     nvl(p_rec.ac_information4, hr_api.g_varchar2)  or
209     nvl(per_abc_shd.g_old_rec.ac_information5, hr_api.g_varchar2) <>
210     nvl(p_rec.ac_information5, hr_api.g_varchar2)  or
211     nvl(per_abc_shd.g_old_rec.ac_information6, hr_api.g_varchar2) <>
212     nvl(p_rec.ac_information6, hr_api.g_varchar2)  or
213     nvl(per_abc_shd.g_old_rec.ac_information7, hr_api.g_varchar2) <>
214     nvl(p_rec.ac_information7, hr_api.g_varchar2)  or
215     nvl(per_abc_shd.g_old_rec.ac_information8, hr_api.g_varchar2) <>
216     nvl(p_rec.ac_information8, hr_api.g_varchar2)  or
217     nvl(per_abc_shd.g_old_rec.ac_information9, hr_api.g_varchar2) <>
218     nvl(p_rec.ac_information9, hr_api.g_varchar2)  or
219     nvl(per_abc_shd.g_old_rec.ac_information10, hr_api.g_varchar2) <>
220     nvl(p_rec.ac_information10, hr_api.g_varchar2)  or
221     nvl(per_abc_shd.g_old_rec.ac_information11, hr_api.g_varchar2) <>
222     nvl(p_rec.ac_information11, hr_api.g_varchar2)  or
223     nvl(per_abc_shd.g_old_rec.ac_information12, hr_api.g_varchar2) <>
224     nvl(p_rec.ac_information12, hr_api.g_varchar2)  or
225     nvl(per_abc_shd.g_old_rec.ac_information13, hr_api.g_varchar2) <>
226     nvl(p_rec.ac_information13, hr_api.g_varchar2)  or
227     nvl(per_abc_shd.g_old_rec.ac_information14, hr_api.g_varchar2) <>
228     nvl(p_rec.ac_information14, hr_api.g_varchar2)  or
229     nvl(per_abc_shd.g_old_rec.ac_information15, hr_api.g_varchar2) <>
230     nvl(p_rec.ac_information15, hr_api.g_varchar2)  or
231     nvl(per_abc_shd.g_old_rec.ac_information16, hr_api.g_varchar2) <>
232     nvl(p_rec.ac_information16, hr_api.g_varchar2)  or
233     nvl(per_abc_shd.g_old_rec.ac_information17, hr_api.g_varchar2) <>
234     nvl(p_rec.ac_information17, hr_api.g_varchar2)  or
235     nvl(per_abc_shd.g_old_rec.ac_information18, hr_api.g_varchar2) <>
236     nvl(p_rec.ac_information18, hr_api.g_varchar2)  or
237     nvl(per_abc_shd.g_old_rec.ac_information19, hr_api.g_varchar2) <>
238     nvl(p_rec.ac_information19, hr_api.g_varchar2)  or
239     nvl(per_abc_shd.g_old_rec.ac_information20, hr_api.g_varchar2) <>
240     nvl(p_rec.ac_information20, hr_api.g_varchar2)  or
241     nvl(per_abc_shd.g_old_rec.ac_information21, hr_api.g_varchar2) <>
242     nvl(p_rec.ac_information21, hr_api.g_varchar2)  or
243     nvl(per_abc_shd.g_old_rec.ac_information22, hr_api.g_varchar2) <>
244     nvl(p_rec.ac_information22, hr_api.g_varchar2)  or
245     nvl(per_abc_shd.g_old_rec.ac_information23, hr_api.g_varchar2) <>
246     nvl(p_rec.ac_information23, hr_api.g_varchar2)  or
247     nvl(per_abc_shd.g_old_rec.ac_information24, hr_api.g_varchar2) <>
248     nvl(p_rec.ac_information24, hr_api.g_varchar2)  or
249     nvl(per_abc_shd.g_old_rec.ac_information25, hr_api.g_varchar2) <>
250     nvl(p_rec.ac_information25, hr_api.g_varchar2)  or
251     nvl(per_abc_shd.g_old_rec.ac_information26, hr_api.g_varchar2) <>
252     nvl(p_rec.ac_information26, hr_api.g_varchar2)  or
253     nvl(per_abc_shd.g_old_rec.ac_information27, hr_api.g_varchar2) <>
254     nvl(p_rec.ac_information27, hr_api.g_varchar2)  or
255     nvl(per_abc_shd.g_old_rec.ac_information28, hr_api.g_varchar2) <>
256     nvl(p_rec.ac_information28, hr_api.g_varchar2)  or
257     nvl(per_abc_shd.g_old_rec.ac_information29, hr_api.g_varchar2) <>
258     nvl(p_rec.ac_information29, hr_api.g_varchar2)  or
259     nvl(per_abc_shd.g_old_rec.ac_information30, hr_api.g_varchar2) <>
260     nvl(p_rec.ac_information30, hr_api.g_varchar2) ))
261     or (p_rec.absence_case_id is null)  then
262     --
263     -- Only execute the validation if absolutely necessary:
264     -- a) During update, the structure column value or any
265     --    of the attribute values have actually changed.
266     -- b) During insert.
267     --
268     hr_dflex_utility.ins_or_upd_descflex_attribs
269       (p_appl_short_name                 => 'PER'
270       ,p_descflex_name                   => 'PER_ABS_CASE_DEVELOPER_DF'
271       ,p_attribute_category              => p_rec.ac_information_category
272       ,p_attribute1_name                 => 'AC_INFORMATION1'
273       ,p_attribute1_value                => p_rec.ac_information1
274       ,p_attribute2_name                 => 'AC_INFORMATION2'
275       ,p_attribute2_value                => p_rec.ac_information2
276       ,p_attribute3_name                 => 'AC_INFORMATION3'
277       ,p_attribute3_value                => p_rec.ac_information3
278       ,p_attribute4_name                 => 'AC_INFORMATION4'
279       ,p_attribute4_value                => p_rec.ac_information4
280       ,p_attribute5_name                 => 'AC_INFORMATION5'
281       ,p_attribute5_value                => p_rec.ac_information5
282       ,p_attribute6_name                 => 'AC_INFORMATION6'
283       ,p_attribute6_value                => p_rec.ac_information6
284       ,p_attribute7_name                 => 'AC_INFORMATION7'
285       ,p_attribute7_value                => p_rec.ac_information7
286       ,p_attribute8_name                 => 'AC_INFORMATION8'
287       ,p_attribute8_value                => p_rec.ac_information8
288       ,p_attribute9_name                 => 'AC_INFORMATION9'
289       ,p_attribute9_value                => p_rec.ac_information9
290       ,p_attribute10_name                => 'AC_INFORMATION10'
291       ,p_attribute10_value               => p_rec.ac_information10
292       ,p_attribute11_name                => 'AC_INFORMATION11'
293       ,p_attribute11_value               => p_rec.ac_information11
294       ,p_attribute12_name                => 'AC_INFORMATION12'
295       ,p_attribute12_value               => p_rec.ac_information12
296       ,p_attribute13_name                => 'AC_INFORMATION13'
297       ,p_attribute13_value               => p_rec.ac_information13
298       ,p_attribute14_name                => 'AC_INFORMATION14'
299       ,p_attribute14_value               => p_rec.ac_information14
300       ,p_attribute15_name                => 'AC_INFORMATION15'
301       ,p_attribute15_value               => p_rec.ac_information15
302       ,p_attribute16_name                => 'AC_INFORMATION16'
303       ,p_attribute16_value               => p_rec.ac_information16
304       ,p_attribute17_name                => 'AC_INFORMATION17'
305       ,p_attribute17_value               => p_rec.ac_information17
306       ,p_attribute18_name                => 'AC_INFORMATION18'
307       ,p_attribute18_value               => p_rec.ac_information18
308       ,p_attribute19_name                => 'AC_INFORMATION19'
309       ,p_attribute19_value               => p_rec.ac_information19
310       ,p_attribute20_name                => 'AC_INFORMATION20'
311       ,p_attribute20_value               => p_rec.ac_information20
312       ,p_attribute21_name                => 'AC_INFORMATION21'
313       ,p_attribute21_value               => p_rec.ac_information21
314       ,p_attribute22_name                => 'AC_INFORMATION22'
315       ,p_attribute22_value               => p_rec.ac_information22
316       ,p_attribute23_name                => 'AC_INFORMATION23'
317       ,p_attribute23_value               => p_rec.ac_information23
318       ,p_attribute24_name                => 'AC_INFORMATION24'
319       ,p_attribute24_value               => p_rec.ac_information24
323       ,p_attribute26_value               => p_rec.ac_information26
320       ,p_attribute25_name                => 'AC_INFORMATION25'
321       ,p_attribute25_value               => p_rec.ac_information25
322       ,p_attribute26_name                => 'AC_INFORMATION26'
324       ,p_attribute27_name                => 'AC_INFORMATION27'
325       ,p_attribute27_value               => p_rec.ac_information27
326       ,p_attribute28_name                => 'AC_INFORMATION28'
327       ,p_attribute28_value               => p_rec.ac_information28
328       ,p_attribute29_name                => 'AC_INFORMATION29'
329       ,p_attribute29_value               => p_rec.ac_information29
330       ,p_attribute30_name                => 'AC_INFORMATION30'
331       ,p_attribute30_value               => p_rec.ac_information30
332       );
333   end if;
334   --
335   hr_utility.set_location(' Leaving:'||l_proc,20);
336 end chk_ddf;
337 --
338 -- ----------------------------------------------------------------------------
339 -- |------------------------------< chk_df >----------------------------------|
340 -- ----------------------------------------------------------------------------
341 --
342 -- Description:
343 --   Validates all the Descriptive Flexfield values.
344 --
345 -- Prerequisites:
346 --   All other columns have been validated.  Must be called as the
347 --   last step from insert_validate and update_validate.
348 --
349 -- In Arguments:
350 --   p_rec
351 --
352 -- Post Success:
353 --   If the Descriptive Flexfield structure column and data values are
354 --   all valid this procedure will end normally and processing will
355 --   continue.
356 --
357 -- Post Failure:
358 --   If the Descriptive Flexfield structure column value or any of
359 --   the data values are invalid then an application error is raised as
360 --   a PL/SQL exception.
361 --
362 -- Access Status:
363 --   Internal Row Handler Use Only.
364 --
365 -- ----------------------------------------------------------------------------
366 procedure chk_df
367   (p_rec in per_abc_shd.g_rec_type
368   ) is
369 --
370   l_proc   varchar2(72) := g_package || 'chk_df';
371 --
372 begin
373   hr_utility.set_location('Entering:'||l_proc,10);
374   --
375   if ((p_rec.absence_case_id is not null)  and (
376     nvl(per_abc_shd.g_old_rec.ac_attribute_category, hr_api.g_varchar2) <>
377     nvl(p_rec.ac_attribute_category, hr_api.g_varchar2)  or
378     nvl(per_abc_shd.g_old_rec.attribute1, hr_api.g_varchar2) <>
379     nvl(p_rec.attribute1, hr_api.g_varchar2)  or
380     nvl(per_abc_shd.g_old_rec.attribute2, hr_api.g_varchar2) <>
381     nvl(p_rec.attribute2, hr_api.g_varchar2)  or
382     nvl(per_abc_shd.g_old_rec.attribute3, hr_api.g_varchar2) <>
383     nvl(p_rec.attribute3, hr_api.g_varchar2)  or
384     nvl(per_abc_shd.g_old_rec.attribute4, hr_api.g_varchar2) <>
385     nvl(p_rec.attribute4, hr_api.g_varchar2)  or
386     nvl(per_abc_shd.g_old_rec.attribute5, hr_api.g_varchar2) <>
387     nvl(p_rec.attribute5, hr_api.g_varchar2)  or
388     nvl(per_abc_shd.g_old_rec.attribute6, hr_api.g_varchar2) <>
389     nvl(p_rec.attribute6, hr_api.g_varchar2)  or
390     nvl(per_abc_shd.g_old_rec.attribute7, hr_api.g_varchar2) <>
391     nvl(p_rec.attribute7, hr_api.g_varchar2)  or
392     nvl(per_abc_shd.g_old_rec.attribute8, hr_api.g_varchar2) <>
393     nvl(p_rec.attribute8, hr_api.g_varchar2)  or
394     nvl(per_abc_shd.g_old_rec.attribute9, hr_api.g_varchar2) <>
395     nvl(p_rec.attribute9, hr_api.g_varchar2)  or
396     nvl(per_abc_shd.g_old_rec.attribute10, hr_api.g_varchar2) <>
397     nvl(p_rec.attribute10, hr_api.g_varchar2)  or
398     nvl(per_abc_shd.g_old_rec.attribute11, hr_api.g_varchar2) <>
399     nvl(p_rec.attribute11, hr_api.g_varchar2)  or
400     nvl(per_abc_shd.g_old_rec.attribute12, hr_api.g_varchar2) <>
401     nvl(p_rec.attribute12, hr_api.g_varchar2)  or
402     nvl(per_abc_shd.g_old_rec.attribute13, hr_api.g_varchar2) <>
403     nvl(p_rec.attribute13, hr_api.g_varchar2)  or
404     nvl(per_abc_shd.g_old_rec.attribute14, hr_api.g_varchar2) <>
405     nvl(p_rec.attribute14, hr_api.g_varchar2)  or
406     nvl(per_abc_shd.g_old_rec.attribute15, hr_api.g_varchar2) <>
407     nvl(p_rec.attribute15, hr_api.g_varchar2)  or
408     nvl(per_abc_shd.g_old_rec.attribute16, hr_api.g_varchar2) <>
409     nvl(p_rec.attribute16, hr_api.g_varchar2)  or
410     nvl(per_abc_shd.g_old_rec.attribute17, hr_api.g_varchar2) <>
411     nvl(p_rec.attribute17, hr_api.g_varchar2)  or
412     nvl(per_abc_shd.g_old_rec.attribute18, hr_api.g_varchar2) <>
413     nvl(p_rec.attribute18, hr_api.g_varchar2)  or
414     nvl(per_abc_shd.g_old_rec.attribute19, hr_api.g_varchar2) <>
415     nvl(p_rec.attribute19, hr_api.g_varchar2)  or
416     nvl(per_abc_shd.g_old_rec.attribute20, hr_api.g_varchar2) <>
417     nvl(p_rec.attribute20, hr_api.g_varchar2)  or
418     nvl(per_abc_shd.g_old_rec.attribute21, hr_api.g_varchar2) <>
419     nvl(p_rec.attribute21, hr_api.g_varchar2)  or
420     nvl(per_abc_shd.g_old_rec.attribute22, hr_api.g_varchar2) <>
421     nvl(p_rec.attribute22, hr_api.g_varchar2)  or
422     nvl(per_abc_shd.g_old_rec.attribute23, hr_api.g_varchar2) <>
423     nvl(p_rec.attribute23, hr_api.g_varchar2)  or
424     nvl(per_abc_shd.g_old_rec.attribute24, hr_api.g_varchar2) <>
425     nvl(p_rec.attribute24, hr_api.g_varchar2)  or
426     nvl(per_abc_shd.g_old_rec.attribute25, hr_api.g_varchar2) <>
427     nvl(p_rec.attribute25, hr_api.g_varchar2)  or
428     nvl(per_abc_shd.g_old_rec.attribute26, hr_api.g_varchar2) <>
429     nvl(p_rec.attribute26, hr_api.g_varchar2)  or
430     nvl(per_abc_shd.g_old_rec.attribute27, hr_api.g_varchar2) <>
431     nvl(p_rec.attribute27, hr_api.g_varchar2)  or
432     nvl(per_abc_shd.g_old_rec.attribute28, hr_api.g_varchar2) <>
433     nvl(p_rec.attribute28, hr_api.g_varchar2)  or
434     nvl(per_abc_shd.g_old_rec.attribute29, hr_api.g_varchar2) <>
435     nvl(p_rec.attribute29, hr_api.g_varchar2)  or
439     --
436     nvl(per_abc_shd.g_old_rec.attribute30, hr_api.g_varchar2) <>
437     nvl(p_rec.attribute30, hr_api.g_varchar2) ))
438     or (p_rec.absence_case_id is null)  then
440     -- Only execute the validation if absolutely necessary:
441     -- a) During update, the structure column value or any
442     --    of the attribute values have actually changed.
443     -- b) During insert.
444     --
445     hr_dflex_utility.ins_or_upd_descflex_attribs
446       (p_appl_short_name                 => 'PER'
447       ,p_descflex_name                   => 'PER_ABSENCE_CASES'
448       ,p_attribute_category              => p_rec.ac_attribute_category
449       ,p_attribute1_name                 => 'ATTRIBUTE1'
450       ,p_attribute1_value                => p_rec.attribute1
451       ,p_attribute2_name                 => 'ATTRIBUTE2'
452       ,p_attribute2_value                => p_rec.attribute2
453       ,p_attribute3_name                 => 'ATTRIBUTE3'
454       ,p_attribute3_value                => p_rec.attribute3
455       ,p_attribute4_name                 => 'ATTRIBUTE4'
456       ,p_attribute4_value                => p_rec.attribute4
457       ,p_attribute5_name                 => 'ATTRIBUTE5'
458       ,p_attribute5_value                => p_rec.attribute5
459       ,p_attribute6_name                 => 'ATTRIBUTE6'
460       ,p_attribute6_value                => p_rec.attribute6
461       ,p_attribute7_name                 => 'ATTRIBUTE7'
462       ,p_attribute7_value                => p_rec.attribute7
463       ,p_attribute8_name                 => 'ATTRIBUTE8'
464       ,p_attribute8_value                => p_rec.attribute8
465       ,p_attribute9_name                 => 'ATTRIBUTE9'
466       ,p_attribute9_value                => p_rec.attribute9
467       ,p_attribute10_name                => 'ATTRIBUTE10'
468       ,p_attribute10_value               => p_rec.attribute10
469       ,p_attribute11_name                => 'ATTRIBUTE11'
470       ,p_attribute11_value               => p_rec.attribute11
471       ,p_attribute12_name                => 'ATTRIBUTE12'
472       ,p_attribute12_value               => p_rec.attribute12
473       ,p_attribute13_name                => 'ATTRIBUTE13'
474       ,p_attribute13_value               => p_rec.attribute13
475       ,p_attribute14_name                => 'ATTRIBUTE14'
476       ,p_attribute14_value               => p_rec.attribute14
477       ,p_attribute15_name                => 'ATTRIBUTE15'
478       ,p_attribute15_value               => p_rec.attribute15
479       ,p_attribute16_name                => 'ATTRIBUTE16'
480       ,p_attribute16_value               => p_rec.attribute16
481       ,p_attribute17_name                => 'ATTRIBUTE17'
482       ,p_attribute17_value               => p_rec.attribute17
483       ,p_attribute18_name                => 'ATTRIBUTE18'
484       ,p_attribute18_value               => p_rec.attribute18
485       ,p_attribute19_name                => 'ATTRIBUTE19'
486       ,p_attribute19_value               => p_rec.attribute19
487       ,p_attribute20_name                => 'ATTRIBUTE20'
488       ,p_attribute20_value               => p_rec.attribute20
489       ,p_attribute21_name                => 'ATTRIBUTE21'
490       ,p_attribute21_value               => p_rec.attribute21
491       ,p_attribute22_name                => 'ATTRIBUTE22'
492       ,p_attribute22_value               => p_rec.attribute22
493       ,p_attribute23_name                => 'ATTRIBUTE23'
494       ,p_attribute23_value               => p_rec.attribute23
495       ,p_attribute24_name                => 'ATTRIBUTE24'
496       ,p_attribute24_value               => p_rec.attribute24
497       ,p_attribute25_name                => 'ATTRIBUTE25'
498       ,p_attribute25_value               => p_rec.attribute25
499       ,p_attribute26_name                => 'ATTRIBUTE26'
500       ,p_attribute26_value               => p_rec.attribute26
501       ,p_attribute27_name                => 'ATTRIBUTE27'
502       ,p_attribute27_value               => p_rec.attribute27
503       ,p_attribute28_name                => 'ATTRIBUTE28'
504       ,p_attribute28_value               => p_rec.attribute28
505       ,p_attribute29_name                => 'ATTRIBUTE29'
506       ,p_attribute29_value               => p_rec.attribute29
507       ,p_attribute30_name                => 'ATTRIBUTE30'
508       ,p_attribute30_value               => p_rec.attribute30
509       );
510   end if;
511   --
512   hr_utility.set_location(' Leaving:'||l_proc,20);
513 end chk_df;
514 --
515 -- ----------------------------------------------------------------------------
516 -- |-----------------------< chk_non_updateable_args >------------------------|
517 -- ----------------------------------------------------------------------------
518 -- {Start Of Comments}
519 --
520 -- Description:
521 --   This procedure is used to ensure that non updateable attributes have
522 --   not been updated. If an attribute has been updated an error is generated.
523 --
524 -- Pre Conditions:
525 --   g_old_rec has been populated with details of the values currently in
526 --   the database.
527 --
528 -- In Arguments:
529 --   p_rec has been populated with the updated values the user would like the
530 --   record set to.
531 --
532 -- Post Success:
533 --   Processing continues if all the non updateable attributes have not
534 --   changed.
535 --
536 -- Post Failure:
537 --   An application error is raised if any of the non updatable attributes
538 --   have been altered.
539 --
540 -- {End Of Comments}
541 -- ----------------------------------------------------------------------------
542 Procedure chk_non_updateable_args
543   (p_rec in per_abc_shd.g_rec_type
544   ) IS
545 --
546   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
547   l_error    EXCEPTION;
548   l_argument varchar2(30);
549 --
550 Begin
551   --
555   IF NOT per_abc_shd.api_updating
552   -- Only proceed with the validation if a row exists for the current
553   -- record in the HR Schema.
554   --
556       (p_absence_case_id                   => p_rec.absence_case_id
557       ,p_object_version_number             => p_rec.object_version_number
558       ) THEN
559      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
560      fnd_message.set_token('PROCEDURE ', l_proc);
561      fnd_message.set_token('STEP ', '5');
562      fnd_message.raise_error;
563   END IF;
564   --
565   hr_utility.set_location(l_proc, 2);
566   if nvl(p_rec.absence_case_id,hr_api.g_number) <>
567      per_abc_shd.g_old_rec.absence_case_id then
568      l_argument := 'absence_case_id';
569      raise l_error;
570   end if;
571   --
572   hr_utility.set_location(l_proc, 3);
573   if nvl(p_rec.business_group_id, hr_api.g_number) <>
574      per_abc_shd.g_old_rec.business_group_id then
575      l_argument := 'business_group_id';
576      raise l_error;
577   end if;
578   --
579   hr_utility.set_location(l_proc, 4);
580   if nvl(p_rec.person_id, hr_api.g_number) <>
581      per_abc_shd.g_old_rec.person_id then
582      l_argument := 'person_id';
583      raise l_error;
584   end if;
585   --
586    EXCEPTION
587     WHEN l_error THEN
588        hr_api.argument_changed_error
589          (p_api_name => l_proc
590          ,p_argument => l_argument);
591     WHEN OTHERS THEN
592      RAISE;
593 End chk_non_updateable_args;
594 --
595 -- ----------------------------------------------------------------------------
596 -- |---------------------------< insert_validate >----------------------------|
597 -- ----------------------------------------------------------------------------
598 Procedure insert_validate
599   (p_rec                          in per_abc_shd.g_rec_type
600   ) is
601 --
602   l_proc  varchar2(72) := g_package||'insert_validate';
603 --
604 Begin
605   hr_utility.set_location('Entering:'||l_proc, 5);
606   --
607   -- Call all supporting business operations
608   --
609   hr_api.validate_bus_grp_id
610     (p_business_group_id => p_rec.business_group_id
611     ,p_associated_column1 => per_abc_shd.g_tab_nam
612                               || '.BUSINESS_GROUP_ID');
613   --
614   -- After validating the set of important attributes,
615   -- if Multiple Message detection is enabled and at least
616   -- one error has been found then abort further validation.
617   --
618   hr_multi_message.end_validation_set;
619   --
620   -- Validate Dependent Attributes
621   --
622   --
623   per_abc_bus.chk_ddf(p_rec);
624   --
625   per_abc_bus.chk_df(p_rec);
626   --
627   hr_utility.set_location(' Leaving:'||l_proc, 10);
628 End insert_validate;
629 --
630 -- ----------------------------------------------------------------------------
631 -- |---------------------------< update_validate >----------------------------|
632 -- ----------------------------------------------------------------------------
633 Procedure update_validate
634   (p_rec                          in per_abc_shd.g_rec_type
635   ) is
636 --
637   l_proc  varchar2(72) := g_package||'update_validate';
638 --
639 Begin
640   hr_utility.set_location('Entering:'||l_proc, 5);
641   --
642   -- Call all supporting business operations
643   --
644   hr_api.validate_bus_grp_id
645     (p_business_group_id => p_rec.business_group_id
646     ,p_associated_column1 => per_abc_shd.g_tab_nam
647                               || '.BUSINESS_GROUP_ID');
648   --
649   -- After validating the set of important attributes,
650   -- if Multiple Message detection is enabled and at least
651   -- one error has been found then abort further validation.
652   --
653   hr_multi_message.end_validation_set;
654   --
655   -- Validate Dependent Attributes
656   --
657   chk_non_updateable_args
658     (p_rec              => p_rec
659     );
660   --
661   --
662   per_abc_bus.chk_ddf(p_rec);
663   --
664   per_abc_bus.chk_df(p_rec);
665   --
666   hr_utility.set_location(' Leaving:'||l_proc, 10);
667 End update_validate;
668 --
669 -- ----------------------------------------------------------------------------
670 -- |---------------------------< delete_validate >----------------------------|
671 -- ----------------------------------------------------------------------------
672 Procedure delete_validate
673   (p_rec                          in per_abc_shd.g_rec_type
674   ) is
675 --
676   l_proc  varchar2(72) := g_package||'delete_validate';
677 --
678 Begin
679   hr_utility.set_location('Entering:'||l_proc, 5);
680   --
681   -- Call all supporting business operations
682   --
683   hr_utility.set_location(' Leaving:'||l_proc, 10);
684 End delete_validate;
685 --
686 --
687 -- ----------------------------------------------------------------------------
688 -- |------------------------< get_min_abs_start_date >-------------------------|
689 -- ----------------------------------------------------------------------------
690 --
691 function get_min_abs_start_date
692       (p_absence_case_id                   number
693        ) return date as
694 --
695       cursor c_abs_case_exists is
696         select absence_case_id
697         from   per_absence_cases
698         where  absence_case_id = p_absence_case_id;
699 --
700       cursor c_abs_list is
701         select min(date_start)
702         from   per_absence_attendances
703         where  absence_case_id = p_absence_case_id;
704 --
705       temp date;
706       temp2 number(15);
707       l_proc  varchar2(72) := g_package||'get_min_abs_start_date';
708 --
709 Begin
710    hr_utility.set_location('Entering:'||l_proc, 5);
711    --
712    open c_abs_case_exists;
713    fetch c_abs_case_exists into temp2;
714    --
715    If c_abs_case_exists%notfound Then
716         close c_abs_case_exists;
717         --
718         -- The primary key is invalid therefore we must error
719         --
720         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
721         fnd_message.raise_error;
722    End If;
723    close c_abs_case_exists;
724    --
725    open c_abs_list;
726    fetch c_abs_list into temp;
727    close c_abs_list;
728    --
729    hr_utility.set_location(' Leaving:'||l_proc, 10);
730    return temp;
731 End get_min_abs_start_date;
732 --
733 --
734 --
735 -- ----------------------------------------------------------------------------
736 -- |------------------------< get_max_abs_end_date >---------------------------|
737 -- ----------------------------------------------------------------------------
738 --
739 function get_max_abs_end_date
740       (p_absence_case_id                   number
741        ) return date as
742 --
743       cursor c_abs_case_exists is
744         select absence_case_id
745         from   per_absence_cases
746         where  absence_case_id = p_absence_case_id;
747 --
748       cursor c_abs_list is
749         select max(date_end)
750         from   per_absence_attendances
751         where  absence_case_id = p_absence_case_id;
752 --
753       temp date;
754       temp2 number(15);
755       l_proc  varchar2(72) := g_package||'get_min_abs_end_date';
756 --
757 Begin
758    hr_utility.set_location('Entering:'||l_proc, 5);
759    --
760    open c_abs_case_exists;
761    fetch c_abs_case_exists into temp2;
762    --
763    If c_abs_case_exists%notfound Then
764         close c_abs_case_exists;
765         --
766         -- The primary key is invalid therefore we must error
767         --
768         fnd_message.set_name('PAY', 'HR_7220_INVALID_PRIMARY_KEY');
769         fnd_message.raise_error;
770    End If;
771    close c_abs_case_exists;
772    --
773    open c_abs_list;
774    fetch c_abs_list into temp;
775    close c_abs_list;
776    --
777    hr_utility.set_location(' Leaving:'||l_proc, 10);
778    return temp;
779 End get_max_abs_end_date;
780 --
781 end per_abc_bus;