[Home] [Help]
PACKAGE BODY: APPS.PQH_BUDGET_FUND_SRCS_API
Source
1 Package Body pqh_budget_fund_srcs_api as
2 /* $Header: pqbfsapi.pkb 115.5 2002/11/27 04:42:44 rpasapul ship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' pqh_budget_fund_srcs_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_budget_fund_src >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_budget_fund_src
13 (p_validate in boolean default false
14 ,p_budget_fund_src_id out nocopy number
15 ,p_budget_element_id in number default null
16 ,p_cost_allocation_keyflex_id in number default null
17 ,p_project_id in number default null
18 ,p_award_id in number default null
19 ,p_task_id in number default null
20 ,p_expenditure_type in varchar2 default null
21 ,p_organization_id in number default null
22 ,p_distribution_percentage in number default null
23 ,p_object_version_number out nocopy number
24 ) is
25 --
26 -- Declare cursors and local variables
27 --
28 l_budget_fund_src_id pqh_budget_fund_srcs.budget_fund_src_id%TYPE;
29 l_proc varchar2(72) := g_package||'create_budget_fund_src';
30 l_object_version_number pqh_budget_fund_srcs.object_version_number%TYPE;
31 --
32 begin
33 --
34 hr_utility.set_location('Entering:'|| l_proc, 10);
35 --
36 -- Issue a savepoint if operating in validation only mode
37 --
38 savepoint create_budget_fund_src;
39 --
40 hr_utility.set_location(l_proc, 20);
41 --
42 -- Process Logic
43 --
44 begin
45 --
46 -- Start of API User Hook for the before hook of create_budget_fund_src
47 --
48 pqh_budget_fund_srcs_bk1.create_budget_fund_src_b
49 (
50 p_budget_element_id => p_budget_element_id
51 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
52 ,p_project_id => p_project_id
53 ,p_award_id => p_award_id
54 ,p_task_id => p_task_id
55 ,p_expenditure_type => p_expenditure_type
56 ,p_organization_id => p_organization_id
57 ,p_distribution_percentage => p_distribution_percentage
58 );
59 exception
60 when hr_api.cannot_find_prog_unit then
61 hr_api.cannot_find_prog_unit_error
62 (
63 p_module_name => 'create_budget_fund_src'
64 ,p_hook_type => 'BP'
65 );
66 --
67 -- End of API User Hook for the before hook of create_budget_fund_src
68 --
69 end;
70 --
71 pqh_bfs_ins.ins
72 (
73 p_budget_fund_src_id => l_budget_fund_src_id
74 ,p_budget_element_id => p_budget_element_id
75 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
76 ,p_project_id => p_project_id
77 ,p_award_id => p_award_id
78 ,p_task_id => p_task_id
79 ,p_expenditure_type => p_expenditure_type
80 ,p_organization_id => p_organization_id
81 ,p_distribution_percentage => p_distribution_percentage
82 ,p_object_version_number => l_object_version_number
83 );
84 --
85 begin
86 --
87 -- Start of API User Hook for the after hook of create_budget_fund_src
88 --
89 pqh_budget_fund_srcs_bk1.create_budget_fund_src_a
90 (
91 p_budget_fund_src_id => l_budget_fund_src_id
92 ,p_budget_element_id => p_budget_element_id
93 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
94 ,p_project_id => p_project_id
95 ,p_award_id => p_award_id
96 ,p_task_id => p_task_id
97 ,p_expenditure_type => p_expenditure_type
98 ,p_organization_id => p_organization_id
99 ,p_distribution_percentage => p_distribution_percentage
100 ,p_object_version_number => l_object_version_number
101 );
102 exception
103 when hr_api.cannot_find_prog_unit then
104 hr_api.cannot_find_prog_unit_error
105 (p_module_name => 'create_budget_fund_src'
106 ,p_hook_type => 'AP'
107 );
108 --
109 -- End of API User Hook for the after hook of create_budget_fund_src
110 --
111 end;
112 --
113 hr_utility.set_location(l_proc, 60);
114 --
115 -- When in validation only mode raise the Validate_Enabled exception
116 --
117 if p_validate then
118 raise hr_api.validate_enabled;
119 end if;
120 --
121 -- Set all output arguments
122 --
123 p_budget_fund_src_id := l_budget_fund_src_id;
124 p_object_version_number := l_object_version_number;
125 --
126 hr_utility.set_location(' Leaving:'||l_proc, 70);
127 --
128 exception
129 --
130 when hr_api.validate_enabled then
131 --
132 -- As the Validate_Enabled exception has been raised
133 -- we must rollback to the savepoint
134 --
135 ROLLBACK TO create_budget_fund_src;
136 --
137 -- Only set output warning arguments
138 -- (Any key or derived arguments must be set to null
139 -- when validation only mode is being used.)
140 --
141 p_budget_fund_src_id := null;
142 p_object_version_number := null;
143 hr_utility.set_location(' Leaving:'||l_proc, 80);
144 --
145 when others then
146 p_budget_fund_src_id := null;
147 p_object_version_number := null;
148
149 --
150 -- A validation or unexpected error has occured
151 --
152 ROLLBACK TO create_budget_fund_src;
153 raise;
154 --
155 end create_budget_fund_src;
156 -- ----------------------------------------------------------------------------
157 -- |------------------------< update_budget_fund_src >--- ------------------|
158 -- ----------------------------------------------------------------------------
159 --
160 procedure update_budget_fund_src
161 (p_validate in boolean default false
162 ,p_budget_fund_src_id in number
163 ,p_budget_element_id in number default hr_api.g_number
164 ,p_cost_allocation_keyflex_id in number default hr_api.g_number
165 ,p_project_id in number default hr_api.g_number
166 ,p_award_id in number default hr_api.g_number
167 ,p_task_id in number default hr_api.g_number
168 ,p_expenditure_type in varchar2 default hr_api.g_varchar2
169 ,p_organization_id in number default hr_api.g_number
170 ,p_distribution_percentage in number default hr_api.g_number
171 ,p_object_version_number in out nocopy number
172 ) is
173 --
174 -- Declare cursors and local variables
175 --
176 l_proc varchar2(72) := g_package||'update_budget_fund_src';
177 l_object_version_number pqh_budget_fund_srcs.object_version_number%TYPE ;
178 --
179 begin
180 --
181 hr_utility.set_location('Entering:'|| l_proc, 10);
182 --
183 -- Issue a savepoint if operating in validation only mode
184 --
185 savepoint update_budget_fund_src;
186 --
187 hr_utility.set_location(l_proc, 20);
188 --
189 -- Process Logic
190 --
191 l_object_version_number := p_object_version_number;
192 --
193 begin
194 --
195 -- Start of API User Hook for the before hook of update_budget_fund_src
196 --
197 pqh_budget_fund_srcs_bk2.update_budget_fund_src_b
198 (
199 p_budget_fund_src_id => p_budget_fund_src_id
200 ,p_budget_element_id => p_budget_element_id
201 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
202 ,p_project_id => p_project_id
203 ,p_award_id => p_award_id
204 ,p_task_id => p_task_id
205 ,p_expenditure_type => p_expenditure_type
206 ,p_organization_id => p_organization_id
207 ,p_distribution_percentage => p_distribution_percentage
208 ,p_object_version_number => p_object_version_number
209 );
210 exception
211 when hr_api.cannot_find_prog_unit then
212 hr_api.cannot_find_prog_unit_error
213 (p_module_name => 'update_budget_fund_src'
214 ,p_hook_type => 'BP'
215 );
216 --
217 -- End of API User Hook for the before hook of update_budget_fund_src
218 --
219 end;
220 --
221 pqh_bfs_upd.upd
222 (
223 p_budget_fund_src_id => p_budget_fund_src_id
224 ,p_budget_element_id => p_budget_element_id
225 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
226 ,p_project_id => p_project_id
227 ,p_award_id => p_award_id
228 ,p_task_id => p_task_id
229 ,p_expenditure_type => p_expenditure_type
230 ,p_organization_id => p_organization_id
231 ,p_distribution_percentage => p_distribution_percentage
232 ,p_object_version_number => l_object_version_number
233 );
234 --
235 begin
236 --
237 -- Start of API User Hook for the after hook of update_budget_fund_src
238 --
239 pqh_budget_fund_srcs_bk2.update_budget_fund_src_a
240 (
241 p_budget_fund_src_id => p_budget_fund_src_id
242 ,p_budget_element_id => p_budget_element_id
243 ,p_cost_allocation_keyflex_id => p_cost_allocation_keyflex_id
244 ,p_project_id => p_project_id
245 ,p_award_id => p_award_id
246 ,p_task_id => p_task_id
247 ,p_expenditure_type => p_expenditure_type
248 ,p_organization_id => p_organization_id
249 ,p_distribution_percentage => p_distribution_percentage
250 ,p_object_version_number => l_object_version_number
251 );
252 exception
253 when hr_api.cannot_find_prog_unit then
254 hr_api.cannot_find_prog_unit_error
255 (p_module_name => 'update_budget_fund_src'
256 ,p_hook_type => 'AP'
257 );
258 --
259 -- End of API User Hook for the after hook of update_budget_fund_src
260 --
261 end;
262 --
263 hr_utility.set_location(l_proc, 60);
264 --
265 -- When in validation only mode raise the Validate_Enabled exception
266 --
267 if p_validate then
268 raise hr_api.validate_enabled;
269 end if;
270 --
271 -- Set all output arguments
272 --
273 p_object_version_number := l_object_version_number;
274 --
275 hr_utility.set_location(' Leaving:'||l_proc, 70);
276 --
277 exception
278 --
279 when hr_api.validate_enabled then
280 --
281 -- As the Validate_Enabled exception has been raised
282 -- we must rollback to the savepoint
283 --
284 ROLLBACK TO update_budget_fund_src;
285 --
286 -- Only set output warning arguments
287 -- (Any key or derived arguments must be set to null
288 -- when validation only mode is being used.)
289 --
290 hr_utility.set_location(' Leaving:'||l_proc, 80);
291 --
292 when others then
293 p_object_version_number := l_object_version_number;
294 --
295 -- A validation or unexpected error has occured
296 --
297 ROLLBACK TO update_budget_fund_src;
298 raise;
299 --
300 end update_budget_fund_src;
301 -- ----------------------------------------------------------------------------
302 -- |------------------------< delete_budget_fund_src >----------------------|
303 -- ----------------------------------------------------------------------------
304 --
305 procedure delete_budget_fund_src
306 (p_validate in boolean default false
307 ,p_budget_fund_src_id in number
308 ,p_object_version_number in number
309 ) is
310 --
311 -- Declare cursors and local variables
312 --
313 l_proc varchar2(72) := g_package||'delete_budget_fund_src';
314 l_object_version_number pqh_budget_fund_srcs.object_version_number%TYPE;
315 --
316 begin
317 --
318 hr_utility.set_location('Entering:'|| l_proc, 10);
319 --
320 -- Issue a savepoint if operating in validation only mode
321 --
322 savepoint delete_budget_fund_src;
323 --
324 hr_utility.set_location(l_proc, 20);
325 --
326 -- Process Logic
327 --
328 l_object_version_number := p_object_version_number;
329 --
330 --
331 begin
332 --
333 -- Start of API User Hook for the before hook of delete_budget_fund_src
334 --
335 pqh_budget_fund_srcs_bk3.delete_budget_fund_src_b
336 (
337 p_budget_fund_src_id => p_budget_fund_src_id
338 ,p_object_version_number => p_object_version_number
339 );
340 exception
341 when hr_api.cannot_find_prog_unit then
342 hr_api.cannot_find_prog_unit_error
343 (p_module_name => 'delete_budget_fund_src'
344 ,p_hook_type => 'BP'
345 );
346 --
347 -- End of API User Hook for the before hook of delete_budget_fund_src
348 --
349 end;
350 --
351 pqh_bfs_del.del
352 (
353 p_budget_fund_src_id => p_budget_fund_src_id
354 ,p_object_version_number => l_object_version_number
355 );
356 --
357 begin
358 --
359 -- Start of API User Hook for the after hook of delete_budget_fund_src
360 --
361 pqh_budget_fund_srcs_bk3.delete_budget_fund_src_a
362 (
363 p_budget_fund_src_id => p_budget_fund_src_id
364 ,p_object_version_number => l_object_version_number
365 );
366 exception
367 when hr_api.cannot_find_prog_unit then
368 hr_api.cannot_find_prog_unit_error
369 (p_module_name => 'delete_budget_fund_src'
370 ,p_hook_type => 'AP'
371 );
372 --
373 -- End of API User Hook for the after hook of delete_budget_fund_src
374 --
375 end;
376 --
377 hr_utility.set_location(l_proc, 60);
378 --
379 -- When in validation only mode raise the Validate_Enabled exception
380 --
381 if p_validate then
382 raise hr_api.validate_enabled;
383 end if;
384 --
385 hr_utility.set_location(' Leaving:'||l_proc, 70);
386 --
387 exception
388 --
389 when hr_api.validate_enabled then
390 --
391 -- As the Validate_Enabled exception has been raised
392 -- we must rollback to the savepoint
393 --
394 ROLLBACK TO delete_budget_fund_src;
395 --
396 -- Only set output warning arguments
397 -- (Any key or derived arguments must be set to null
398 -- when validation only mode is being used.)
399 --
400 --
401 when others then
402 --
403 -- A validation or unexpected error has occured
404 --
405 ROLLBACK TO delete_budget_fund_src;
406 raise;
407 --
408 end delete_budget_fund_src;
409 --
410 -- ----------------------------------------------------------------------------
411 -- |-------------------------------< lck >------------------------------------|
412 -- ----------------------------------------------------------------------------
413 --
414 procedure lck
415 (
416 p_budget_fund_src_id in number
417 ,p_object_version_number in number
418 ) is
419 --
420 --
421 -- Declare cursors and local variables
422 --
423 l_proc varchar2(72) := g_package||'lck';
424 --
425 begin
426 --
427 hr_utility.set_location('Entering:'|| l_proc, 10);
428 --
429 pqh_bfs_shd.lck
430 (
431 p_budget_fund_src_id => p_budget_fund_src_id
432 ,p_object_version_number => p_object_version_number
433 );
434 --
435 hr_utility.set_location(' Leaving:'||l_proc, 70);
436 --
437 end lck;
438 --
439 end pqh_budget_fund_srcs_api;