[Home] [Help]
PACKAGE BODY: APPS.PSP_SALARY_CAPS_SWI
Source
1 Package Body psp_salary_caps_swi As
2 /* $Header: PSPSCSWB.pls 120.0 2005/11/20 23:56 dpaudel noship $ */
3 --
4 -- Package variables
5 --
6 g_package varchar2(33) := 'psp_salary_caps_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |---------------------------< create_salary_cap >--------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_salary_cap
12 (p_validate in number default hr_api.g_false_num
13 ,p_funding_source_code in varchar2
14 ,p_start_date in date
15 ,p_end_date in date
16 ,p_currency_code in varchar2
17 ,p_annual_salary_cap in number
18 ,p_seed_flag in varchar2
19 ,p_object_version_number in out nocopy number
20 ,p_salary_cap_id in number
21 ,p_return_status out nocopy varchar2
22 ) is
23 --
24 -- Variables for API Boolean parameters
25 l_validate boolean;
26 l_return_status boolean;
27 --
28 -- Variables for IN/OUT parameters
29 l_object_version_number number;
30 --
31 -- Other variables
32 l_salary_cap_id number;
33 l_proc varchar2(72) := g_package ||'create_salary_cap';
34 Begin
35 hr_utility.set_location(' Entering:' || l_proc,10);
36 --
37 -- Issue a savepoint
38 --
39 savepoint create_salary_cap_swi;
40 --
41 -- Initialise Multiple Message Detection
42 --
43 hr_multi_message.enable_message_list;
44 --
45 -- Remember IN OUT parameter IN values
46 --
47 l_object_version_number := p_object_version_number;
48 --
49 -- Convert constant values to their corresponding boolean value
50 --
51 l_validate :=
52 hr_api.constant_to_boolean
53 (p_constant_value => p_validate);
54 l_return_status :=
55 hr_api.constant_to_boolean
56 (p_constant_value => p_return_status);
57 --
58 -- Register Surrogate ID or user key values
59 --
60 psp_psc_ins.set_base_key_value
61 (p_salary_cap_id => p_salary_cap_id
62 );
63 --
64 -- Call API
65 --
66 psp_salary_caps_api.create_salary_cap
67 (p_validate => l_validate
68 ,p_funding_source_code => p_funding_source_code
69 ,p_start_date => p_start_date
70 ,p_end_date => p_end_date
71 ,p_currency_code => p_currency_code
72 ,p_annual_salary_cap => p_annual_salary_cap
73 ,p_seed_flag => p_seed_flag
74 ,p_object_version_number => p_object_version_number
75 ,p_salary_cap_id => l_salary_cap_id
76 ,p_return_status => l_return_status
77 );
78 --
79 -- Convert API warning boolean parameter values to specific
80 -- messages and add them to Multiple Message List
81 --
82 --
83 -- Convert API non-warning boolean parameter values
84 --
85 p_return_status :=
86 hr_api.boolean_to_constant
87 (p_boolean_value => l_return_status
88 );
89 --
90 -- Derive the API return status value based on whether
91 -- messages of any type exist in the Multiple Message List.
92 -- Also disable Multiple Message Detection.
93 --
94 p_return_status := hr_multi_message.get_return_status_disable;
95 hr_utility.set_location(' Leaving:' || l_proc,20);
96 --
97 exception
98 when hr_multi_message.error_message_exist then
99 --
100 -- Catch the Multiple Message List exception which
101 -- indicates API processing has been aborted because
102 -- at least one message exists in the list.
103 --
104 rollback to create_salary_cap_swi;
105 --
106 -- Reset IN OUT parameters and set OUT parameters
107 --
108 p_object_version_number := l_object_version_number;
109 p_return_status := null;
110 p_return_status := hr_multi_message.get_return_status_disable;
111 hr_utility.set_location(' Leaving:' || l_proc, 30);
112 when others then
113 --
114 -- When Multiple Message Detection is enabled catch
115 -- any Application specific or other unexpected
116 -- exceptions. Adding appropriate details to the
117 -- Multiple Message List. Otherwise re-raise the
118 -- error.
119 --
120 rollback to create_salary_cap_swi;
121 if hr_multi_message.unexpected_error_add(l_proc) then
122 hr_utility.set_location(' Leaving:' || l_proc,40);
123 raise;
124 end if;
125 --
126 -- Reset IN OUT and set OUT parameters
127 --
128 p_object_version_number := l_object_version_number;
129 p_return_status := null;
130 p_return_status := hr_multi_message.get_return_status_disable;
131 hr_utility.set_location(' Leaving:' || l_proc,50);
132 end create_salary_cap;
133 -- ----------------------------------------------------------------------------
134 -- |---------------------------< delete_salary_cap >--------------------------|
135 -- ----------------------------------------------------------------------------
136 PROCEDURE delete_salary_cap
137 (p_validate in number default hr_api.g_false_num
138 ,p_salary_cap_id in number
139 ,p_object_version_number in out nocopy number
140 ,p_return_status out nocopy varchar2
141 ) is
142 --
143 -- Variables for API Boolean parameters
144 l_validate boolean;
145 l_return_status boolean;
146 --
147 -- Variables for IN/OUT parameters
148 l_object_version_number number;
149 --
150 -- Other variables
151 l_proc varchar2(72) := g_package ||'delete_salary_cap';
152 Begin
153 hr_utility.set_location(' Entering:' || l_proc,10);
154 --
155 -- Issue a savepoint
156 --
157 savepoint delete_salary_cap_swi;
158 --
159 -- Initialise Multiple Message Detection
160 --
161 hr_multi_message.enable_message_list;
162 --
163 -- Remember IN OUT parameter IN values
164 --
165 l_object_version_number := p_object_version_number;
166 --
167 -- Convert constant values to their corresponding boolean value
168 --
169 l_validate :=
170 hr_api.constant_to_boolean
171 (p_constant_value => p_validate);
172 l_return_status :=
173 hr_api.constant_to_boolean
174 (p_constant_value => p_return_status);
175 --
176 -- Register Surrogate ID or user key values
177 --
178 --
179 -- Call API
180 --
181 psp_salary_caps_api.delete_salary_cap
182 (p_validate => l_validate
183 ,p_salary_cap_id => p_salary_cap_id
184 ,p_object_version_number => p_object_version_number
185 ,p_return_status => l_return_status
186 );
187 --
188 -- Convert API warning boolean parameter values to specific
189 -- messages and add them to Multiple Message List
190 --
191 --
192 -- Convert API non-warning boolean parameter values
193 --
194 p_return_status :=
195 hr_api.boolean_to_constant
196 (p_boolean_value => l_return_status
197 );
198 --
199 -- Derive the API return status value based on whether
200 -- messages of any type exist in the Multiple Message List.
201 -- Also disable Multiple Message Detection.
202 --
203 p_return_status := hr_multi_message.get_return_status_disable;
204 hr_utility.set_location(' Leaving:' || l_proc,20);
205 --
206 exception
207 when hr_multi_message.error_message_exist then
208 --
209 -- Catch the Multiple Message List exception which
210 -- indicates API processing has been aborted because
211 -- at least one message exists in the list.
212 --
213 rollback to delete_salary_cap_swi;
214 --
215 -- Reset IN OUT parameters and set OUT parameters
216 --
217 p_object_version_number := l_object_version_number;
218 p_return_status := null;
219 p_return_status := hr_multi_message.get_return_status_disable;
220 hr_utility.set_location(' Leaving:' || l_proc, 30);
221 when others then
222 --
223 -- When Multiple Message Detection is enabled catch
224 -- any Application specific or other unexpected
225 -- exceptions. Adding appropriate details to the
226 -- Multiple Message List. Otherwise re-raise the
227 -- error.
228 --
229 rollback to delete_salary_cap_swi;
230 if hr_multi_message.unexpected_error_add(l_proc) then
231 hr_utility.set_location(' Leaving:' || l_proc,40);
232 raise;
233 end if;
234 --
235 -- Reset IN OUT and set OUT parameters
236 --
237 p_object_version_number := l_object_version_number;
238 p_return_status := null;
239 p_return_status := hr_multi_message.get_return_status_disable;
240 hr_utility.set_location(' Leaving:' || l_proc,50);
241 end delete_salary_cap;
242 -- ----------------------------------------------------------------------------
243 -- |---------------------------< update_salary_cap >--------------------------|
244 -- ----------------------------------------------------------------------------
245 PROCEDURE update_salary_cap
246 (p_validate in number default hr_api.g_false_num
247 ,p_salary_cap_id in number
248 ,p_funding_source_code in varchar2
249 ,p_start_date in date
250 ,p_end_date in date
251 ,p_currency_code in varchar2
252 ,p_annual_salary_cap in number
253 ,p_seed_flag in varchar2
254 ,p_object_version_number in out nocopy number
255 ,p_return_status out nocopy varchar2
256 ) is
257 --
258 -- Variables for API Boolean parameters
259 l_validate boolean;
260 l_return_status boolean;
261 --
262 -- Variables for IN/OUT parameters
263 l_object_version_number number;
264 --
265 -- Other variables
266 l_proc varchar2(72) := g_package ||'update_salary_cap';
267 Begin
268 hr_utility.set_location(' Entering:' || l_proc,10);
269 --
270 -- Issue a savepoint
271 --
272 savepoint update_salary_cap_swi;
273 --
274 -- Initialise Multiple Message Detection
275 --
276 hr_multi_message.enable_message_list;
277 --
278 -- Remember IN OUT parameter IN values
279 --
280 l_object_version_number := p_object_version_number;
281 --
282 -- Convert constant values to their corresponding boolean value
283 --
284 l_validate :=
285 hr_api.constant_to_boolean
286 (p_constant_value => p_validate);
287 l_return_status :=
288 hr_api.constant_to_boolean
289 (p_constant_value => p_return_status);
290 --
291 -- Register Surrogate ID or user key values
292 --
293 --
294 -- Call API
295 --
296 psp_salary_caps_api.update_salary_cap
297 (p_validate => l_validate
298 ,p_salary_cap_id => p_salary_cap_id
299 ,p_funding_source_code => p_funding_source_code
300 ,p_start_date => p_start_date
301 ,p_end_date => p_end_date
302 ,p_currency_code => p_currency_code
303 ,p_annual_salary_cap => p_annual_salary_cap
304 ,p_seed_flag => p_seed_flag
305 ,p_object_version_number => p_object_version_number
306 ,p_return_status => l_return_status
307 );
308 --
309 -- Convert API warning boolean parameter values to specific
310 -- messages and add them to Multiple Message List
311 --
312 --
313 -- Convert API non-warning boolean parameter values
314 --
315 p_return_status :=
316 hr_api.boolean_to_constant
317 (p_boolean_value => l_return_status
318 );
319 --
320 -- Derive the API return status value based on whether
321 -- messages of any type exist in the Multiple Message List.
322 -- Also disable Multiple Message Detection.
323 --
324 p_return_status := hr_multi_message.get_return_status_disable;
325 hr_utility.set_location(' Leaving:' || l_proc,20);
326 --
327 exception
328 when hr_multi_message.error_message_exist then
329 --
330 -- Catch the Multiple Message List exception which
331 -- indicates API processing has been aborted because
332 -- at least one message exists in the list.
333 --
334 rollback to update_salary_cap_swi;
335 --
336 -- Reset IN OUT parameters and set OUT parameters
337 --
338 p_object_version_number := l_object_version_number;
339 p_return_status := null;
340 p_return_status := hr_multi_message.get_return_status_disable;
341 hr_utility.set_location(' Leaving:' || l_proc, 30);
342 when others then
343 --
344 -- When Multiple Message Detection is enabled catch
345 -- any Application specific or other unexpected
346 -- exceptions. Adding appropriate details to the
347 -- Multiple Message List. Otherwise re-raise the
348 -- error.
349 --
350 rollback to update_salary_cap_swi;
351 if hr_multi_message.unexpected_error_add(l_proc) then
352 hr_utility.set_location(' Leaving:' || l_proc,40);
353 raise;
354 end if;
355 --
356 -- Reset IN OUT and set OUT parameters
357 --
358 p_object_version_number := l_object_version_number;
359 p_return_status := null;
360 p_return_status := hr_multi_message.get_return_status_disable;
361 hr_utility.set_location(' Leaving:' || l_proc,50);
362 end update_salary_cap;
363 end psp_salary_caps_swi;