DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_RHA_BUS

Source


1 Package Body pqh_rha_bus as
2 /* $Header: pqrharhi.pkb 120.1 2005/08/03 13:43:25 nsanghal noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  pqh_rha_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_routing_hist_attrib_id      number         default null;
15 --
16 --
17 -- ----------------------------------------------------------------------------
18 -- |-----------------------< chk_non_updateable_args >------------------------|
19 -- ----------------------------------------------------------------------------
20 -- {Start Of Comments}
21 --
22 -- Description:
23 --   This procedure is used to ensure that non updateable attributes have
24 --   not been updated. If an attribute has been updated an error is generated.
25 --
26 -- Pre Conditions:
27 --   g_old_rec has been populated with details of the values currently in
28 --   the database.
29 --
30 -- In Arguments:
31 --   p_rec has been populated with the updated values the user would like the
32 --   record set to.
33 --
34 -- Post Success:
35 --   Processing continues if all the non updateable attributes have not
36 --   changed.
37 --
38 -- Post Failure:
39 --   An application error is raised if any of the non updatable attributes
40 --   have been altered.
41 --
42 -- {End Of Comments}
43 -- ----------------------------------------------------------------------------
44 Procedure chk_non_updateable_args
45   (p_effective_date               in date
46   ,p_rec in pqh_rha_shd.g_rec_type
47   ) IS
48 --
49   l_proc     varchar2(72) := g_package || 'chk_non_updateable_args';
50   l_error    EXCEPTION;
51   l_argument varchar2(30);
52 --
53 Begin
54   --
55   -- Only proceed with the validation if a row exists for the current
56   -- record in the HR Schema.
57   --
58   IF NOT pqh_rha_shd.api_updating
59       (p_routing_hist_attrib_id               => p_rec.routing_hist_attrib_id
60       ,p_object_version_number                => p_rec.object_version_number
61       ) THEN
62      fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
63      fnd_message.set_token('PROCEDURE ', l_proc);
64      fnd_message.set_token('STEP ', '5');
65      fnd_message.raise_error;
66   END IF;
67   --
68   -- EDIT_HERE: Add checks to ensure non-updateable args have
69   --            not been updated.
70   --
71   EXCEPTION
72     WHEN l_error THEN
73        hr_api.argument_changed_error
74          (p_api_name => l_proc
75          ,p_argument => l_argument);
76     WHEN OTHERS THEN
77        RAISE;
78 End chk_non_updateable_args;
79 --
80 -- ----------------------------------------------------------------------------
81 -- |---------------------------< insert_validate >----------------------------|
82 -- ----------------------------------------------------------------------------
83 Procedure insert_validate
84   (p_effective_date               in date
85   ,p_rec                          in pqh_rha_shd.g_rec_type
86   ) is
87 --
88   l_proc  varchar2(72) := g_package||'insert_validate';
89 --
90 Begin
91   hr_utility.set_location('Entering:'||l_proc, 5);
92   --
93   -- No business group context.
94   --
95   hr_utility.set_location(' Leaving:'||l_proc, 10);
96 End insert_validate;
97 --
98 -- ----------------------------------------------------------------------------
99 -- |---------------------------< update_validate >----------------------------|
100 -- ----------------------------------------------------------------------------
101 Procedure update_validate
102   (p_effective_date               in date
103   ,p_rec                          in pqh_rha_shd.g_rec_type
104   ) is
105 --
106   l_proc  varchar2(72) := g_package||'update_validate';
107 --
108 Begin
109   hr_utility.set_location('Entering:'||l_proc, 5);
110   --
111   -- No business group context.
112   --
113   chk_non_updateable_args
114     (p_effective_date              => p_effective_date
115       ,p_rec              => p_rec
116     );
117   --
118   --
119   hr_utility.set_location(' Leaving:'||l_proc, 10);
120 End update_validate;
121 --
122 -- ----------------------------------------------------------------------------
123 -- |---------------------------< delete_validate >----------------------------|
124 -- ----------------------------------------------------------------------------
125 Procedure delete_validate
126   (p_rec                          in pqh_rha_shd.g_rec_type
127   ) is
128 --
129   l_proc  varchar2(72) := g_package||'delete_validate';
130 --
131 Begin
132   hr_utility.set_location('Entering:'||l_proc, 5);
133   --
134   -- Call all supporting business operations
135   --
136   hr_utility.set_location(' Leaving:'||l_proc, 10);
137 End delete_validate;
138 --
139 end pqh_rha_bus;