DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_RFI_BUS

Source


1 Package Body pay_rfi_bus as
2 /* $Header: pyrfirhi.pkb 120.0 2005/05/29 08:19 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33) := '  pay_rfi_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |-----------------------------< chk_unique_key >---------------------------|
12 -- ----------------------------------------------------------------------------
13 -- {Start Of Comments}
14 --
15 -- Description:
16 --   This procedure is used to check the uniqueness of the combination
17 --   report type, report qualifier, report category and user_entity_id
18 --   which forms the true key.
19 --
20 --
21 -- Pre Conditions:
22 --   Should be called only while insert. Since these columns are non-updatable
23 --   it is not required to check the uniqueness while update.
24 --
25 -- In Arguments:
26 --
27 --
28 --
29 -- Post Success:
30 --   Processing Continues.
31 --
32 --
33 -- Post Failure:
34 --   Failure might occur if any of the parameters are null or the combination
35 --   already exists for a different report format item.
36 --   Errors are trapped and reported.
37 --
38 -- {End Of Comments}
39 -- ----------------------------------------------------------------------------
40 Procedure chk_unique_key
41   ( p_report_type      in  varchar2
42    ,p_report_qualifier in  varchar2
43    ,p_report_category  in  varchar2
44    ,p_user_entity_id   in  number
45   ) IS
46 --
47 cursor csr_unique_key  is
48   select null
49   from   pay_report_format_items_f
50   where  report_type = p_report_type
51   and    report_qualifier = p_report_qualifier
52   and    report_category  = p_report_category
53   and    user_entity_id   = p_user_entity_id ;
54 --
55   l_proc     varchar2(72) := g_package || 'chk_unique_key';
56   l_exists   varchar2(1);
57 --
58 Begin
59   --
60   hr_utility.set_location('Entering:'|| l_proc, 10);
61   --
62         hr_api.mandatory_arg_error
63               ( p_api_name       =>  l_proc
64                ,p_argument       =>  'REPORT_TYPE'
65                ,p_argument_value =>  p_report_type
66               );
67 
68         hr_api.mandatory_arg_error
69               ( p_api_name       =>  l_proc
70                ,p_argument       =>  'REPORT_QUALIFIER'
71                ,p_argument_value =>  p_report_qualifier
72               );
73 
74         hr_api.mandatory_arg_error
75               ( p_api_name       =>  l_proc
76                ,p_argument       =>  'REPORT_CATEGORY'
77                ,p_argument_value =>  p_report_category
78               );
79 
80         hr_api.mandatory_arg_error
81               ( p_api_name       =>  l_proc
82                ,p_argument       =>  'USER_ENTITY_ID'
83                ,p_argument_value =>  p_user_entity_id
84               );
85 
86         open csr_unique_key;
87         fetch csr_unique_key into l_exists;
88 
89         if csr_unique_key%found then
90 
91              close csr_unique_key;
92 
93              fnd_message.set_name( 'PAY' , 'PAY_33258_INV_UKEY3' );
94              fnd_message.set_token( 'COL1' , 'REPORT_TYPE');
95              fnd_message.set_token( 'COL2' , 'REPORT_QUALIFIER');
96              fnd_message.set_token( 'COL3' , 'REPORT_CATEGORY');
97              fnd_message.set_token( 'COL4' , 'USER_ENTITY_ID');
98              fnd_message.set_token( 'COL1_VAL', p_report_type);
99              fnd_message.set_token( 'COL2_VAL', p_report_qualifier);
100              fnd_message.set_token( 'COL3_VAL', p_report_category);
101              fnd_message.set_token( 'COL4_VAL', p_user_entity_id);
102              fnd_message.raise_error ;
103 
104         end if ;
105 
106         close csr_unique_key;
107   --
108   hr_utility.set_location(' Leaving:'|| l_proc, 20);
109   --
110 End chk_unique_key;
111 --
112 -- ----------------------------------------------------------------------------
113 -- |--------------------------< chk_report_format_mapping >-------------------|
114 -- ----------------------------------------------------------------------------
115 -- {Start Of Comments}
116 --
117 -- Description:
118 --   This procedure is used to check whether the report format mapping that
119 --   is being used in the report format item  exists or not.
120 --   It is necessary that the report format mapping exists before the report
121 --   format items for that are created
122 --
123 -- Pre Conditions:
124 --   None
125 --
126 --
127 -- In Arguments:
128 --
129 --
130 --
131 -- Post Success:
132 --   Processing Continues.
133 --
134 --
135 -- Post Failure:
136 --   Failure might occur if the arguments are null or the report
137 --   format mapping does not exists. Errors are trapped and reported.
138 --
139 -- {End Of Comments}
140 -- ----------------------------------------------------------------------------
141 Procedure chk_report_format_mapping
142   ( p_report_type      in  varchar2
143    ,p_report_qualifier in  varchar2
144    ,p_report_category  in  varchar2
145   ) IS
146 --
147 cursor csr_report_format_mapping  is
148   select null
149   from   pay_report_format_mappings_f
150   where  report_type = p_report_type
151   and    report_qualifier = p_report_qualifier
152   and    report_category  = p_report_category;
153 --
154   l_proc     varchar2(72) := g_package || 'chk_report_format_mapping';
155   l_exists   varchar2(1);
156 --
157 Begin
158   --
159   hr_utility.set_location('Entering:'|| l_proc, 10);
160   --
161         hr_api.mandatory_arg_error
162               ( p_api_name       =>  l_proc
163                ,p_argument       =>  'REPORT_TYPE'
164                ,p_argument_value =>  p_report_type
165               );
166 
167         hr_api.mandatory_arg_error
168               ( p_api_name       =>  l_proc
169                ,p_argument       =>  'REPORT_QUALIFIER'
170                ,p_argument_value =>  p_report_qualifier
171               );
172 
173         hr_api.mandatory_arg_error
174               ( p_api_name       =>  l_proc
175                ,p_argument       =>  'REPORT_CATEGORY'
176                ,p_argument_value =>  p_report_category
177               );
178 
179         open csr_report_format_mapping;
180         fetch csr_report_format_mapping into l_exists;
181 
182         if csr_report_format_mapping%notfound then
183 
184              close csr_report_format_mapping;
185 
186              fnd_message.set_name( 'PAY' , 'PAY_33260_INVALID_RFM' );
187              fnd_message.set_token( 'COL1' , p_report_type);
188              fnd_message.set_token( 'COL2' , p_report_qualifier);
189              fnd_message.set_token( 'COL3' , p_report_category);
190              fnd_message.raise_error ;
191 
192         end if ;
193 
194         close csr_report_format_mapping;
195   --
196   hr_utility.set_location(' Leaving:'|| l_proc, 20);
197   --
198 End chk_report_format_mapping;
199 --
200 -- ----------------------------------------------------------------------------
201 -- |-----------------------------< chk_user_entity_id >-----------------------|
202 -- ----------------------------------------------------------------------------
203 -- {Start Of Comments}
204 --
205 -- Description:
206 --   This procedure is used to check whether the user entity that
207 --   is being used in the report format item  exists or not.
208 --   It is necessary that the user entity exists before the report
209 --   format item can use that.
210 --
211 -- Pre Conditions:
212 --   None
213 --
214 --
215 -- In Arguments:
216 --   user_entity_id
217 --
218 --
219 -- Post Success:
220 --   Processing Continues.
221 --
222 --
223 -- Post Failure:
224 --   Failure might occur if the user_entity_id is null or the user_entity_id
225 --   does not exists. Errors are trapped and reported.
226 --
227 -- {End Of Comments}
228 -- ----------------------------------------------------------------------------
229 Procedure chk_user_entity_id
230   ( p_user_entity_id      in  number
231   ) IS
232 --
233 cursor csr_user_entity_id  is
234   select null
235   from   ff_user_entities
236   where  user_entity_id = p_user_entity_id ;
237 --
238   l_proc     varchar2(72) := g_package || 'chk_user_entity_id';
239   l_exists   varchar2(1);
240 --
241 Begin
242   --
243   hr_utility.set_location('Entering:'|| l_proc, 10);
244   --
245 
246         hr_api.mandatory_arg_error
247               ( p_api_name       =>  l_proc
248                ,p_argument       =>  'USER_ENTITY_ID'
249                ,p_argument_value =>  p_user_entity_id
250               );
251 
252         open  csr_user_entity_id;
253         fetch csr_user_entity_id into l_exists;
254 
255         if csr_user_entity_id%notfound then
256 
257              close csr_user_entity_id;
258 
259              fnd_message.set_name('PAY', 'PAY_33174_PARENT_ID_INVALID');
260              fnd_message.set_token('PARENT' , 'User Entity Id' );
261              fnd_message.raise_error;
262 
263         end if ;
264 
265         close csr_user_entity_id;
266   --
267   hr_utility.set_location(' Leaving:'|| l_proc, 20);
268   --
269 End chk_user_entity_id;
270 --
271 -- ----------------------------------------------------------------------------
272 -- |---------------------------< chk_updatable_flag >-------------------------|
273 -- ----------------------------------------------------------------------------
274 -- {Start Of Comments}
275 --
276 -- Description:
277 --   Checks the validity of updatable_flag.
278 --   If updatable_flag is not null then it must be either 'Y' or 'N'
279 --
280 -- Pre Conditions:
281 --   None
282 --
283 --
284 -- In Arguments:
285 --   updatable_flag
286 --
287 --
288 -- Post Success:
289 --   Processing Continues.
290 --
291 --
292 -- Post Failure:
293 --   Failure might occur if updatabale_flag is not valid.
294 --   Errors are trapped and reported.
295 --
296 -- {End Of Comments}
297 -- ----------------------------------------------------------------------------
298 Procedure chk_updatable_flag
299   ( p_updatable_flag     in  varchar2  ) IS
300 --
301   l_proc     varchar2(72) := g_package || 'chk_updatable_flag';
302 --
303 Begin
304   --
305   hr_utility.set_location('Entering:'|| l_proc, 10);
306   --
307 
308         if  p_updatable_flag is not null and
309                   p_updatable_flag not in ('Y', 'N') then
310 
311              fnd_message.set_name( 'PAY' , 'PAY_33259_INVALID_UFLAG' );
312              fnd_message.raise_error ;
313 
314         end if;
315   --
316   hr_utility.set_location(' Leaving:'|| l_proc, 20);
317   --
318 End chk_updatable_flag;
319 --
320 -- ----------------------------------------------------------------------------
321 -- |-----------------------< chk_non_updateable_args >------------------------|
322 -- ----------------------------------------------------------------------------
323 -- {Start Of Comments}
324 --
325 -- Description:
326 --   This procedure is used to ensure that non updateable attributes have
327 --   not been updated. If an attribute has been updated an error is generated.
328 --
329 -- Pre Conditions:
330 --   g_old_rec has been populated with details of the values currently in
331 --   the database.
332 --
333 -- In Arguments:
334 --   p_rec has been populated with the updated values the user would like the
335 --   record set to.
336 --
337 -- Post Success:
338 --   Processing continues if all the non updateable attributes have not
339 --   changed.
340 --
341 -- Post Failure:
342 --   An application error is raised if any of the non updatable attributes
343 --   have been altered.
344 --
345 -- {End Of Comments}
346 -- ----------------------------------------------------------------------------
347 Procedure chk_non_updateable_args
348   (p_effective_date  in date
349   ,p_rec             in pay_rfi_shd.g_rec_type
350   ) IS
351 --
352   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
353 --
354 Begin
355   --
356   -- Only proceed with the validation if a row exists for the current
357   -- record in the HR Schema.
358   --
359   IF NOT pay_rfi_shd.api_updating
363       ) THEN
360       (p_report_format_item_id            => p_rec.report_format_item_id
361       ,p_effective_date                   => p_effective_date
362       ,p_object_version_number            => p_rec.object_version_number
364      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
365      fnd_message.set_token('PROCEDURE ', l_proc);
366      fnd_message.set_token('STEP ', '5');
367      fnd_message.raise_error;
368   END IF;
369   --
370   --
371   if nvl(p_rec.report_type, hr_api.g_varchar2) <>
372      pay_rfi_shd.g_old_rec.report_type then
373      hr_api.argument_changed_error
374      (p_api_name => l_proc
375      ,p_argument => 'REPORT_TYPE'
376      ,p_base_table => pay_rfi_shd.g_tab_nam
377      );
378   end if;
379   --
380   if nvl(p_rec.report_qualifier, hr_api.g_varchar2) <>
381      pay_rfi_shd.g_old_rec.report_qualifier then
382      hr_api.argument_changed_error
383      (p_api_name => l_proc
384      ,p_argument => 'REPORT_QUALIFIER'
385      ,p_base_table => pay_rfi_shd.g_tab_nam
386      );
387   end if;
388   --
389   if nvl(p_rec.report_category, hr_api.g_varchar2) <>
390      pay_rfi_shd.g_old_rec.report_category then
391      hr_api.argument_changed_error
392      (p_api_name => l_proc
393      ,p_argument => 'REPORT_CATEGORY'
394      ,p_base_table => pay_rfi_shd.g_tab_nam
395      );
396   end if;
397   --
398   if nvl(p_rec.user_entity_id, hr_api.g_number) <>
399      pay_rfi_shd.g_old_rec.user_entity_id then
400      hr_api.argument_changed_error
401      (p_api_name => l_proc
402      ,p_argument => 'USER_ENTITY_ID'
403      ,p_base_table => pay_rfi_shd.g_tab_nam
404      );
405   end if;
406   --
407 End chk_non_updateable_args;
408 --
409 -- ----------------------------------------------------------------------------
410 -- |--------------------------< dt_update_validate >--------------------------|
411 -- ----------------------------------------------------------------------------
412 -- {Start Of Comments}
413 --
414 -- Description:
415 --   This procedure is used for referential integrity of datetracked
416 --   parent entities when a datetrack update operation is taking place
417 --   and where there is no cascading of update defined for this entity.
418 --
419 -- Prerequisites:
420 --   This procedure is called from the update_validate.
421 --
422 -- In Parameters:
423 --
424 -- Post Success:
425 --   Processing continues.
426 --
427 -- Post Failure:
428 --
429 -- Developer Implementation Notes:
430 --   This procedure should not need maintenance unless the HR Schema model
431 --   changes.
432 --
433 -- Access Status:
434 --   Internal Row Handler Use Only.
435 --
436 -- {End Of Comments}
437 -- ----------------------------------------------------------------------------
438 Procedure dt_update_validate
439   (p_report_format_mapping_id      in number default hr_api.g_number
440   ,p_datetrack_mode                in varchar2
441   ,p_validation_start_date         in date
442   ,p_validation_end_date           in date
443   ) Is
444 --
445   l_proc  varchar2(72) := g_package||'dt_update_validate';
446 --
447 Begin
448   --
449   -- Ensure that the p_datetrack_mode argument is not null
450   --
451   hr_api.mandatory_arg_error
452     (p_api_name       => l_proc
453     ,p_argument       => 'datetrack_mode'
454     ,p_argument_value => p_datetrack_mode
455     );
456   --
457   -- Mode will be valid, as this is checked at the start of the upd.
458   --
459   -- Ensure the arguments are not null
460   --
461   hr_api.mandatory_arg_error
462     (p_api_name       => l_proc
463     ,p_argument       => 'validation_start_date'
464     ,p_argument_value => p_validation_start_date
465     );
466   --
467   hr_api.mandatory_arg_error
468     (p_api_name       => l_proc
469     ,p_argument       => 'validation_end_date'
470     ,p_argument_value => p_validation_end_date
471     );
472   --
473   If ((nvl(p_report_format_mapping_id, hr_api.g_number) <> hr_api.g_number) and
474       NOT (dt_api.check_min_max_dates
475             (p_base_table_name => 'pay_report_format_mappings_f'
476             ,p_base_key_column => 'REPORT_FORMAT_MAPPING_ID'
477             ,p_base_key_value  => p_report_format_mapping_id
478             ,p_from_date       => p_validation_start_date
479             ,p_to_date         => p_validation_end_date))) Then
480      fnd_message.set_name('PAY', 'HR_7216_DT_UPD_INTEGRITY_ERR');
481      fnd_message.set_token('TABLE_NAME','report format mappings');
482      hr_multi_message.add
483        (p_associated_column1 => pay_rfi_shd.g_tab_nam || '.REPORT_FORMAT_MAPPING
484 _ID');
485   End If;
486   --
487 Exception
488   When Others Then
489     --
490     -- An unhandled or unexpected error has occurred which
491     -- we must report
492     --
493     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
494     fnd_message.set_token('PROCEDURE', l_proc);
495     fnd_message.set_token('STEP','15');
496     fnd_message.raise_error;
497 End dt_update_validate;
498 --
499 -- ----------------------------------------------------------------------------
500 -- |--------------------------< dt_delete_validate >--------------------------|
501 -- ----------------------------------------------------------------------------
502 -- {Start Of Comments}
503 --
504 -- Description:
505 --   This procedure is used for referential integrity of datetracked
506 --   child entities when either a datetrack DELETE or ZAP is in operation
507 --   and where there is no cascading of delete defined for this entity.
508 --   For the datetrack mode of DELETE or ZAP we must ensure that no
512 -- Prerequisites:
509 --   datetracked child rows exist between the validation start and end
510 --   dates.
511 --
513 --   This procedure is called from the delete_validate.
514 --
515 -- In Parameters:
516 --
517 -- Post Success:
518 --   Processing continues.
519 --
520 -- Post Failure:
521 --   If a row exists by determining the returning Boolean value from the
522 --   generic dt_api.rows_exist function then we must supply an error via
523 --   the use of the local exception handler l_rows_exist.
524 --
525 -- Developer Implementation Notes:
526 --   This procedure should not need maintenance unless the HR Schema model
527 --   changes.
528 --
529 -- Access Status:
530 --   Internal Row Handler Use Only.
531 --
532 -- {End Of Comments}
533 -- ----------------------------------------------------------------------------
534 Procedure dt_delete_validate
535   (p_report_format_item_id            in number
536   ,p_datetrack_mode                   in varchar2
537   ,p_validation_start_date            in date
538   ,p_validation_end_date              in date
539   ) Is
540 --
541   l_proc        varchar2(72)    := g_package||'dt_delete_validate';
542 --
543 Begin
544   --
545   -- Ensure that the p_datetrack_mode argument is not null
546   --
547   hr_api.mandatory_arg_error
548     (p_api_name       => l_proc
549     ,p_argument       => 'datetrack_mode'
550     ,p_argument_value => p_datetrack_mode
551     );
552   --
553   -- Only perform the validation if the datetrack mode is either
554   -- DELETE or ZAP
555   --
556   If (p_datetrack_mode = hr_api.g_delete or
557       p_datetrack_mode = hr_api.g_zap) then
558     --
559     --
560     -- Ensure the arguments are not null
561     --
562     hr_api.mandatory_arg_error
563       (p_api_name       => l_proc
564       ,p_argument       => 'validation_start_date'
565       ,p_argument_value => p_validation_start_date
566       );
567     --
568     hr_api.mandatory_arg_error
569       (p_api_name       => l_proc
570       ,p_argument       => 'validation_end_date'
571       ,p_argument_value => p_validation_end_date
572       );
573     --
574     hr_api.mandatory_arg_error
575       (p_api_name       => l_proc
576       ,p_argument       => 'report_format_item_id'
577       ,p_argument_value => p_report_format_item_id
578       );
579     --
580   --
581     --
582   End If;
583   --
584 Exception
585   When Others Then
586     --
587     -- An unhandled or unexpected error has occurred which
588     -- we must report
589     --
590     fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
591     fnd_message.set_token('PROCEDURE', l_proc);
592     fnd_message.set_token('STEP','15');
593     fnd_message.raise_error;
594   --
595 End dt_delete_validate;
596 --
597 -- ----------------------------------------------------------------------------
598 -- |---------------------------< insert_validate >----------------------------|
599 -- ----------------------------------------------------------------------------
600 Procedure insert_validate
601   (p_rec                   in pay_rfi_shd.g_rec_type
602   ,p_effective_date        in date
603   ,p_datetrack_mode        in varchar2
604   ,p_validation_start_date in date
605   ,p_validation_end_date   in date
606   ) is
607 --
608   l_proc        varchar2(72) := g_package||'insert_validate';
609 --
610 Begin
611   hr_utility.set_location('Entering:'||l_proc, 5);
612   --
613   -- Call all supporting business operations
614   --
615   -- CLIENT_INFO not set.  No lookup validation or joins to HR_LOOKUPS.
616   --
617   --
618   -- Validate Dependent Attributes
619   --
620     chk_unique_key
621      ( p_report_type      => p_rec.report_type
622       ,p_report_qualifier => p_rec.report_qualifier
623       ,p_report_category  => p_rec.report_category
624       ,p_user_entity_id   => p_rec.user_entity_id
625      );
626   --
627     chk_report_format_mapping
628      ( p_report_type      => p_rec.report_type
629       ,p_report_qualifier => p_rec.report_qualifier
630       ,p_report_category  => p_rec.report_category
631      );
632   --
633     chk_user_entity_id
634      ( p_user_entity_id   => p_rec.user_entity_id );
635   --
636     chk_updatable_flag
637      ( p_updatable_flag   => p_rec.updatable_flag );
638   --
639   hr_utility.set_location(' Leaving:'||l_proc, 10);
640 End insert_validate;
641 --
642 -- ----------------------------------------------------------------------------
643 -- |---------------------------< update_validate >----------------------------|
644 -- ----------------------------------------------------------------------------
645 Procedure update_validate
646   (p_rec                     in pay_rfi_shd.g_rec_type
647   ,p_effective_date          in date
648   ,p_datetrack_mode          in varchar2
649   ,p_validation_start_date   in date
650   ,p_validation_end_date     in date
651   ) is
652 --
653   l_proc        varchar2(72) := g_package||'update_validate';
654 --
655 Begin
656   hr_utility.set_location('Entering:'||l_proc, 5);
657   --
658   -- Call all supporting business operations
659   --
660   -- CLIENT_INFO not set.  No lookup validation or joins to HR_LOOKUPS.
661   --
662   --
663   -- Validate Dependent Attributes
664   --
665   -- Call the datetrack update integrity operation
666   --
667   dt_update_validate
668     (p_report_format_mapping_id       => p_rec.report_format_mapping_id
669     ,p_datetrack_mode                 => p_datetrack_mode
673   --
670     ,p_validation_start_date          => p_validation_start_date
671     ,p_validation_end_date            => p_validation_end_date
672     );
674   chk_non_updateable_args
675     (p_effective_date  => p_effective_date
676     ,p_rec             => p_rec
677     );
678   --
679   chk_updatable_flag
680      ( p_updatable_flag   => p_rec.updatable_flag );
681   --
682   hr_utility.set_location(' Leaving:'||l_proc, 10);
683 End update_validate;
684 --
685 -- ----------------------------------------------------------------------------
686 -- |---------------------------< delete_validate >----------------------------|
687 -- ----------------------------------------------------------------------------
688 Procedure delete_validate
689   (p_rec                    in pay_rfi_shd.g_rec_type
690   ,p_effective_date         in date
691   ,p_datetrack_mode         in varchar2
692   ,p_validation_start_date  in date
693   ,p_validation_end_date    in date
694   ) is
695 --
696   l_proc        varchar2(72) := g_package||'delete_validate';
697 --
698 Begin
699   hr_utility.set_location('Entering:'||l_proc, 5);
700   --
701   -- Call all supporting business operations
702   --
703   dt_delete_validate
704     (p_datetrack_mode                   => p_datetrack_mode
705     ,p_validation_start_date            => p_validation_start_date
706     ,p_validation_end_date              => p_validation_end_date
707     ,p_report_format_item_id            => p_rec.report_format_item_id
708     );
709   --
710   hr_utility.set_location(' Leaving:'||l_proc, 10);
711 End delete_validate;
712 --
713 --  ---------------------------------------------------------------------------
714 --  |----------------------< chk_report_format_item_id >----------------------|
715 --  ---------------------------------------------------------------------------
716 --
717 Procedure chk_report_format_item_id
718   ( p_report_format_item_id  in  number ) IS
719 --
720 cursor csr_unique_id  is
721   select null
722   from   pay_report_format_items_f
723   where  report_format_item_id = p_report_format_item_id;
724 --
725   l_proc     varchar2(72) := g_package || 'chk_report_format_item_id';
726   l_exists   varchar2(1);
727 --
728 Begin
729   --
730   hr_utility.set_location('Entering:'|| l_proc, 10);
731   --
732         hr_api.mandatory_arg_error
733                    ( p_api_name       =>  l_proc
734                     ,p_argument       =>  'REPORT_FORMAT_ITEM_ID'
735                     ,p_argument_value =>  p_report_format_item_id
736                    );
737 
738         open csr_unique_id;
739         fetch csr_unique_id into l_exists;
740 
741         if csr_unique_id%found then
742 
743              close csr_unique_id;
744 
745              pay_rfi_shd.constraint_error
746                     (p_constraint_name => 'PAY_REPORT_FORMAT_ITEMS_PK');
747 
748         end if ;
749 
750         close csr_unique_id;
751   --
752   hr_utility.set_location(' Leaving:'|| l_proc, 20);
753   --
754 End chk_report_format_item_id;
755 --
756 end pay_rfi_bus;