DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_BAL_ATTRIBUTE_DEFAULT_API

Source


1 Package Body PAY_BAL_ATTRIBUTE_DEFAULT_API as
2 /* $Header: pypbdapi.pkb 115.1 2002/12/11 15:11:55 exjones noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  PAY_BAL_ATTRIBUTE_DEFAULT_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |----------------< create_bal_attribute_default >-----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_bal_attribute_default
13   (p_validate                      in     boolean  default false
14   ,p_balance_category_id           in     number
15   ,p_balance_dimension_id          in     number
16   ,p_attribute_id                  in     number
17   ,p_business_group_id             in     number   default null
18   ,p_legislation_code              in     varchar2 default null
19   ,p_bal_attribute_default_id         out nocopy number
20   ) is
21   --
22   -- Declare cursors and local variables
23   --
24   l_proc           varchar2(72) := g_package||'create_bal_attribute_default';
25   --
26   -- Declare OUT variables
27   --
28   l_bal_attribute_default_id pay_bal_attribute_defaults.bal_attribute_default_id%type;
29   --
30 begin
31   hr_utility.set_location('Entering:'|| l_proc, 10);
32   --
33   -- Issue a savepoint
34   --
35   savepoint create_bal_attribute_default;
36   --
37   -- Truncate the time portion from all IN date parameters
38   --
39     hr_utility.set_location(l_proc, 20);
40   --
41   -- Call Before Process User Hook
42   --
43   begin
44     PAY_BAL_ATTRIBUTE_DEFAULT_BK1.create_bal_attribute_default_b
45       (p_balance_category_id           => p_balance_category_id
46       ,p_balance_dimension_id          => p_balance_dimension_id
47       ,p_attribute_id                  => p_attribute_id
48       ,p_business_group_id             => p_business_group_id
49       ,p_legislation_code              => p_legislation_code
50       );
51   exception
52     when hr_api.cannot_find_prog_unit then
53       hr_api.cannot_find_prog_unit_error
54         (p_module_name => 'create_bal_attribute_default'
55         ,p_hook_type   => 'BP'
56         );
57   end;
58   --
59   hr_utility.set_location(l_proc, 25);
60   --
61   -- Validation in addition to Row Handlers
62   --
63   -- Process Logic
64   --
65     pay_pbd_ins.ins
66        (p_attribute_id             => p_attribute_id
67        ,p_balance_dimension_id     => p_balance_dimension_id
68        ,p_balance_category_id      => p_balance_category_id
69        ,p_legislation_code         => p_legislation_code
70        ,p_business_group_id        => p_business_group_id
71        ,p_bal_attribute_default_id => l_bal_attribute_default_id
72        );
73     --
74     hr_utility.set_location(l_proc, 30);
75   --
76   -- Call After Process User Hook
77   --
78   begin
79     PAY_BAL_ATTRIBUTE_DEFAULT_BK1.create_bal_attribute_default_a
80       (p_balance_category_id      => p_balance_category_id
81       ,p_balance_dimension_id     => p_balance_dimension_id
82       ,p_attribute_id             => p_attribute_id
83       ,p_business_group_id        => p_business_group_id
84       ,p_legislation_code         => p_legislation_code
85       ,p_bal_attribute_default_id => l_bal_attribute_default_id
86       );
87   exception
88     when hr_api.cannot_find_prog_unit then
89       hr_api.cannot_find_prog_unit_error
90         (p_module_name => 'create_bal_attribute_default'
91         ,p_hook_type   => 'AP'
92         );
93   end;
94   --
95     hr_utility.set_location(l_proc, 40);
96   --
97   -- When in validation only mode raise the Validate_Enabled exception
98   --
99   if p_validate then
100     raise hr_api.validate_enabled;
101   end if;
102   --
103   -- Set all output arguments
104   --
105   p_bal_attribute_default_id     := l_bal_attribute_default_id;
106   --
107   hr_utility.set_location(' Leaving:'||l_proc, 70);
108 exception
109   when hr_api.validate_enabled then
110     --
111     -- As the Validate_Enabled exception has been raised
112     -- we must rollback to the savepoint
113     --
114     rollback to create_bal_attribute_default;
115     --
116     -- Only set output warning arguments
117     -- (Any key or derived arguments must be set to null
118     -- when validation only mode is being used.)
119     --
120     p_bal_attribute_default_id := null;
121     hr_utility.set_location(' Leaving:'||l_proc, 80);
122   when others then
123     --
124     -- A validation or unexpected error has occured
125     --
126     rollback to create_bal_attribute_default;
127     hr_utility.set_location(' Leaving:'||l_proc, 90);
128     raise;
129 end create_bal_attribute_default;
130 --
131 -- ----------------------------------------------------------------------------
132 -- |----------------< delete_bal_attribute_default >-----------------------|
133 -- ----------------------------------------------------------------------------
134 --
135 procedure delete_bal_attribute_default
136   (p_validate                      in     boolean  default false
137   ,p_bal_attribute_default_id      in     number
138   ,p_business_group_id             in     number   default null
139   ,p_legislation_code              in     varchar2 default null
140   ) is
141   --
142   -- Declare cursors and local variables
143   --
144   l_proc           varchar2(72) := g_package||'create_bal_attribute_default';
145   --
146 begin
147   hr_utility.set_location('Entering:'|| l_proc, 10);
148   --
149   -- Issue a savepoint
150   --
151   savepoint delete_bal_attribute_default;
152   --
153     hr_utility.set_location(l_proc, 20);
154   --
155   -- Call Before Process User Hook
156   --
157   begin
158     PAY_BAL_ATTRIBUTE_DEFAULT_BK2.delete_bal_attribute_default_b
159       (p_bal_attribute_default_id      => p_bal_attribute_default_id
160       ,p_business_group_id             => p_business_group_id
161       ,p_legislation_code              => p_legislation_code
162       );
163   exception
164     when hr_api.cannot_find_prog_unit then
165       hr_api.cannot_find_prog_unit_error
166         (p_module_name => 'delete_bal_attribute_default'
167         ,p_hook_type   => 'BP'
168         );
169   end;
170   hr_utility.set_location(l_proc, 25);
171   --
172   -- Validation in addition to Row Handlers
173   --
174   -- Process Logic
175   --
176     pay_pbd_del.del
177        (p_bal_attribute_default_id    => p_bal_attribute_default_id
178        );
179     --
180     hr_utility.set_location(l_proc, 30);
181   --
182   -- Call After Process User Hook
183   --
184   begin
185     PAY_BAL_ATTRIBUTE_DEFAULT_BK2.delete_bal_attribute_default_a
186       (p_bal_attribute_default_id      => p_bal_attribute_default_id
187       ,p_business_group_id             => p_business_group_id
188       ,p_legislation_code              => p_legislation_code
189       );
190   exception
191     when hr_api.cannot_find_prog_unit then
192       hr_api.cannot_find_prog_unit_error
193         (p_module_name => 'delete_bal_attribute_default'
194         ,p_hook_type   => 'AP'
195         );
196   end;
197   --
198     hr_utility.set_location(l_proc, 40);
199   --
200   -- When in validation only mode raise the Validate_Enabled exception
201   --
202   if p_validate then
203     raise hr_api.validate_enabled;
204   end if;
205   --
206   -- Set all output arguments
207   --
208   --
209   hr_utility.set_location(' Leaving:'||l_proc, 70);
210 exception
211   when hr_api.validate_enabled then
212     --
213     -- As the Validate_Enabled exception has been raised
214     -- we must rollback to the savepoint
215     --
216     rollback to delete_bal_attribute_default;
217     --
218   when others then
219     --
220     -- A validation or unexpected error has occured
221     --
222     rollback to delete_bal_attribute_default;
223     hr_utility.set_location(' Leaving:'||l_proc, 90);
224     raise;
225 end delete_bal_attribute_default;
226 --
227 end PAY_BAL_ATTRIBUTE_DEFAULT_API;