[Home] [Help]
PACKAGE BODY: APPS.PQH_TRAN_CATEGORY_API
Source
1 Package Body pqh_TRAN_CATEGORY_api as
2 /* $Header: pqtctapi.pkb 115.11 2004/01/22 16:12:06 nsanghal noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' pqh_TRAN_CATEGORY_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_TRAN_CATEGORY >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_TRAN_CATEGORY
13 (p_validate in boolean default false
14 ,p_transaction_category_id out nocopy number
15 ,p_custom_wf_process_name in varchar2 default null
16 ,p_custom_workflow_name in varchar2 default null
17 ,p_form_name in varchar2
18 ,p_freeze_status_cd in varchar2 default null
19 ,p_future_action_cd in varchar2
20 ,p_member_cd in varchar2
21 ,p_name in varchar2
22 ,p_short_name in varchar2
23 ,p_post_style_cd in varchar2
24 ,p_post_txn_function in varchar2
25 ,p_route_validated_txn_flag in varchar2
26 ,p_prevent_approver_skip in varchar2 default null
27 ,p_workflow_enable_flag in varchar2
28 ,p_enable_flag in varchar2
29 ,p_timeout_days in number default null
30 ,p_object_version_number out nocopy number
31 ,p_consolidated_table_route_id in number
32 ,p_business_group_id in number default null
33 ,p_setup_type_cd in varchar2 default null
34 ,p_master_table_route_id in number default null
35 ,p_effective_date in date
36 ,p_language_code in varchar2 default hr_api.userenv_lang
37 ) is
38 --
39 -- Declare cursors and local variables
40 --
41 l_transaction_category_id pqh_transaction_categories.transaction_category_id%TYPE;
42 l_proc varchar2(72) := g_package||'create_TRAN_CATEGORY';
43 l_object_version_number pqh_transaction_categories.object_version_number%TYPE;
44 --
45 begin
46 --
47 hr_utility.set_location('Entering:'|| l_proc, 10);
48 --
49 -- Issue a savepoint if operating in validation only mode
50 --
51 savepoint create_TRAN_CATEGORY;
52 --
53 hr_utility.set_location(l_proc, 20);
54 --
55 -- Process Logic
56 --
57 begin
58 --
59 -- Start of API User Hook for the before hook of create_TRAN_CATEGORY
60 --
61 pqh_TRAN_CATEGORY_bk1.create_TRAN_CATEGORY_b
62 (
63 p_custom_wf_process_name => p_custom_wf_process_name
64 ,p_custom_workflow_name => p_custom_workflow_name
65 ,p_form_name => p_form_name
66 ,p_freeze_status_cd => p_freeze_status_cd
67 ,p_future_action_cd => p_future_action_cd
68 ,p_member_cd => p_member_cd
69 ,p_name => p_name
70 ,p_short_name => p_short_name
71 ,p_post_style_cd => p_post_style_cd
72 ,p_post_txn_function => p_post_txn_function
73 ,p_route_validated_txn_flag => p_route_validated_txn_flag
74 ,p_prevent_approver_skip => p_prevent_approver_skip
75 ,p_workflow_enable_flag => p_workflow_enable_flag
76 ,p_enable_flag => p_enable_flag
77 ,p_timeout_days => p_timeout_days
78 ,p_consolidated_table_route_id => p_consolidated_table_route_id
79 ,p_business_group_id => p_business_group_id
80 ,p_setup_type_cd => p_setup_type_cd
81 ,p_master_table_route_id => p_master_table_route_id
82 ,p_effective_date => trunc(p_effective_date)
83 );
84 exception
85 when hr_api.cannot_find_prog_unit then
86 hr_api.cannot_find_prog_unit_error
87 (
88 p_module_name => 'CREATE_TRAN_CATEGORY'
89 ,p_hook_type => 'BP'
90 );
91 --
92 -- End of API User Hook for the before hook of create_TRAN_CATEGORY
93 --
94 end;
95 --
96 pqh_tct_ins.ins
97 (
98 p_transaction_category_id => l_transaction_category_id
99 ,p_custom_wf_process_name => p_custom_wf_process_name
100 ,p_custom_workflow_name => p_custom_workflow_name
101 ,p_form_name => p_form_name
102 ,p_freeze_status_cd => p_freeze_status_cd
103 ,p_future_action_cd => p_future_action_cd
104 ,p_member_cd => p_member_cd
105 ,p_name => p_name
106 ,p_short_name => p_short_name
107 ,p_post_style_cd => p_post_style_cd
108 ,p_post_txn_function => p_post_txn_function
109 ,p_route_validated_txn_flag => p_route_validated_txn_flag
110 ,p_prevent_approver_skip => p_prevent_approver_skip
111 ,p_workflow_enable_flag => p_workflow_enable_flag
112 ,p_enable_flag => p_enable_flag
113 ,p_timeout_days => p_timeout_days
114 ,p_object_version_number => l_object_version_number
115 ,p_consolidated_table_route_id => p_consolidated_table_route_id
116 ,p_business_group_id => p_business_group_id
117 ,p_setup_type_cd => p_setup_type_cd
118 ,p_master_table_route_id => p_master_table_route_id
119 ,p_effective_date => trunc(p_effective_date)
120 );
121 --
122 p_transaction_category_id := l_transaction_category_id ;
123 --
124 pqh_ctl_ins.ins_tl
125 (
126 p_language_code => p_language_code,
127 p_transaction_category_id => l_transaction_category_id ,
128 p_name => p_name );
129 --
130 begin
131 --
132 -- Start of API User Hook for the after hook of create_TRAN_CATEGORY
133 --
134 pqh_TRAN_CATEGORY_bk1.create_TRAN_CATEGORY_a
135 (
136 p_transaction_category_id => l_transaction_category_id
137 ,p_custom_wf_process_name => p_custom_wf_process_name
138 ,p_custom_workflow_name => p_custom_workflow_name
139 ,p_form_name => p_form_name
140 ,p_freeze_status_cd => p_freeze_status_cd
141 ,p_future_action_cd => p_future_action_cd
142 ,p_member_cd => p_member_cd
143 ,p_name => p_name
144 ,p_short_name => p_short_name
145 ,p_post_style_cd => p_post_style_cd
146 ,p_post_txn_function => p_post_txn_function
147 ,p_route_validated_txn_flag => p_route_validated_txn_flag
148 ,p_prevent_approver_skip => p_prevent_approver_skip
149 ,p_workflow_enable_flag => p_workflow_enable_flag
150 ,p_enable_flag => p_enable_flag
151 ,p_timeout_days => p_timeout_days
152 ,p_object_version_number => l_object_version_number
153 ,p_consolidated_table_route_id => p_consolidated_table_route_id
154 ,p_business_group_id => p_business_group_id
155 ,p_setup_type_cd => p_setup_type_cd
156 ,p_master_table_route_id => p_master_table_route_id
157 ,p_effective_date => trunc(p_effective_date)
158 );
159 exception
160 when hr_api.cannot_find_prog_unit then
161 hr_api.cannot_find_prog_unit_error
162 (p_module_name => 'CREATE_TRAN_CATEGORY'
163 ,p_hook_type => 'AP'
164 );
165 --
166 -- End of API User Hook for the after hook of create_TRAN_CATEGORY
167 --
168 end;
169 --
170 hr_utility.set_location(l_proc, 60);
171 --
172 -- When in validation only mode raise the Validate_Enabled exception
173 --
174 if p_validate then
175 raise hr_api.validate_enabled;
176 end if;
177 --
178 -- Set all output arguments
179 --
180 p_transaction_category_id := l_transaction_category_id;
181 p_object_version_number := l_object_version_number;
182 --
183 hr_utility.set_location(' Leaving:'||l_proc, 70);
184 --
185 exception
186 --
187 when hr_api.validate_enabled then
188 --
189 -- As the Validate_Enabled exception has been raised
190 -- we must rollback to the savepoint
191 --
192 ROLLBACK TO create_TRAN_CATEGORY;
193 --
194 -- Only set output warning arguments
195 -- (Any key or derived arguments must be set to null
196 -- when validation only mode is being used.)
197 --
198 p_transaction_category_id := null;
199 p_object_version_number := null;
200 hr_utility.set_location(' Leaving:'||l_proc, 80);
201 --
202 when others then
203 p_transaction_category_id := null;
204 p_object_version_number := null;
205 --
206 -- A validation or unexpected error has occured
207 --
208 ROLLBACK TO create_TRAN_CATEGORY;
209 raise;
210 --
211 end create_TRAN_CATEGORY;
212 -- ----------------------------------------------------------------------------
213 -- |------------------------< update_TRAN_CATEGORY >--- ------------------|
214 -- ----------------------------------------------------------------------------
215 --
216 procedure update_TRAN_CATEGORY
217 (p_validate in boolean default false
218 ,p_transaction_category_id in number
219 ,p_custom_wf_process_name in varchar2 default hr_api.g_varchar2
220 ,p_custom_workflow_name in varchar2 default hr_api.g_varchar2
221 ,p_form_name in varchar2 default hr_api.g_varchar2
222 ,p_freeze_status_cd in varchar2 default hr_api.g_varchar2
223 ,p_future_action_cd in varchar2 default hr_api.g_varchar2
224 ,p_member_cd in varchar2 default hr_api.g_varchar2
225 ,p_name in varchar2 default hr_api.g_varchar2
226 ,p_short_name in varchar2 default hr_api.g_varchar2
227 ,p_post_style_cd in varchar2 default hr_api.g_varchar2
228 ,p_post_txn_function in varchar2 default hr_api.g_varchar2
229 ,p_route_validated_txn_flag in varchar2 default hr_api.g_varchar2
230 ,p_prevent_approver_skip in varchar2 default hr_api.g_varchar2
231 ,p_workflow_enable_flag in varchar2 default hr_api.g_varchar2
232 ,p_enable_flag in varchar2 default hr_api.g_varchar2
233 ,p_timeout_days in number default hr_api.g_number
234 ,p_object_version_number in out nocopy number
235 ,p_consolidated_table_route_id in number default hr_api.g_number
236 ,p_business_group_id in number default hr_api.g_number
237 ,p_setup_type_cd in varchar2 default hr_api.g_varchar2
238 ,p_master_table_route_id in number default hr_api.g_number
239 ,p_effective_date in date
240 ,p_language_code in varchar2 default hr_api.userenv_lang
241 ) is
242 --
243 -- Declare cursors and local variables
244 --
245 l_proc varchar2(72) := g_package||'update_TRAN_CATEGORY';
246 l_object_version_number pqh_transaction_categories.object_version_number%TYPE;
247 --
248 begin
249 --
250 hr_utility.set_location('Entering:'|| l_proc, 10);
251 --
252 -- Issue a savepoint if operating in validation only mode
253 --
254 savepoint update_TRAN_CATEGORY;
255 --
256 hr_utility.set_location(l_proc, 20);
257 --
258 -- Process Logic
259 --
260 l_object_version_number := p_object_version_number;
261 --
262 begin
263 --
264 -- Start of API User Hook for the before hook of update_TRAN_CATEGORY
265 --
266 pqh_TRAN_CATEGORY_bk2.update_TRAN_CATEGORY_b
267 (
268 p_transaction_category_id => p_transaction_category_id
269 ,p_custom_wf_process_name => p_custom_wf_process_name
270 ,p_custom_workflow_name => p_custom_workflow_name
271 ,p_form_name => p_form_name
272 ,p_freeze_status_cd => p_freeze_status_cd
273 ,p_future_action_cd => p_future_action_cd
274 ,p_member_cd => p_member_cd
275 ,p_name => p_name
276 ,p_short_name => p_short_name
277 ,p_post_style_cd => p_post_style_cd
278 ,p_post_txn_function => p_post_txn_function
279 ,p_route_validated_txn_flag => p_route_validated_txn_flag
280 ,p_prevent_approver_skip => p_prevent_approver_skip
281 ,p_workflow_enable_flag => p_workflow_enable_flag
282 ,p_enable_flag => p_enable_flag
283 ,p_timeout_days => p_timeout_days
284 ,p_object_version_number => p_object_version_number
285 ,p_consolidated_table_route_id => p_consolidated_table_route_id
286 ,p_business_group_id => p_business_group_id
287 ,p_setup_type_cd => p_setup_type_cd
288 ,p_master_table_route_id => p_master_table_route_id
289 ,p_effective_date => trunc(p_effective_date)
290 );
291 exception
292 when hr_api.cannot_find_prog_unit then
293 hr_api.cannot_find_prog_unit_error
294 (p_module_name => 'UPDATE_TRAN_CATEGORY'
295 ,p_hook_type => 'BP'
296 );
297 --
298 -- End of API User Hook for the before hook of update_TRAN_CATEGORY
299 --
300 end;
301 --
302 pqh_tct_upd.upd
303 (
304 p_transaction_category_id => p_transaction_category_id
305 ,p_custom_wf_process_name => p_custom_wf_process_name
306 ,p_custom_workflow_name => p_custom_workflow_name
307 ,p_form_name => p_form_name
308 ,p_freeze_status_cd => p_freeze_status_cd
309 ,p_future_action_cd => p_future_action_cd
310 ,p_member_cd => p_member_cd
311 ,p_name => p_name
312 ,p_short_name => p_short_name
313 ,p_post_style_cd => p_post_style_cd
314 ,p_post_txn_function => p_post_txn_function
315 ,p_route_validated_txn_flag => p_route_validated_txn_flag
316 ,p_prevent_approver_skip => p_prevent_approver_skip
317 ,p_workflow_enable_flag => p_workflow_enable_flag
318 ,p_enable_flag => p_enable_flag
319 ,p_timeout_days => p_timeout_days
320 ,p_object_version_number => l_object_version_number
321 ,p_consolidated_table_route_id => p_consolidated_table_route_id
322 ,p_business_group_id => p_business_group_id
323 ,p_setup_type_cd => p_setup_type_cd
324 ,p_master_table_route_id => p_master_table_route_id
325 ,p_effective_date => trunc(p_effective_date)
326 );
327 --
328 pqh_ctl_upd.upd_tl
329 (
330 p_language_code => p_language_code,
331 p_transaction_category_id => p_transaction_category_id ,
332 p_name => p_name );
333 --
334 begin
335 --
336 -- Start of API User Hook for the after hook of update_TRAN_CATEGORY
337 --
338 pqh_TRAN_CATEGORY_bk2.update_TRAN_CATEGORY_a
339 (
340 p_transaction_category_id => p_transaction_category_id
341 ,p_custom_wf_process_name => p_custom_wf_process_name
342 ,p_custom_workflow_name => p_custom_workflow_name
343 ,p_form_name => p_form_name
344 ,p_freeze_status_cd => p_freeze_status_cd
345 ,p_future_action_cd => p_future_action_cd
346 ,p_member_cd => p_member_cd
347 ,p_name => p_name
348 ,p_short_name => p_short_name
349 ,p_post_style_cd => p_post_style_cd
350 ,p_post_txn_function => p_post_txn_function
351 ,p_route_validated_txn_flag => p_route_validated_txn_flag
352 ,p_prevent_approver_skip => p_prevent_approver_skip
353 ,p_workflow_enable_flag => p_workflow_enable_flag
354 ,p_enable_flag => p_enable_flag
355 ,p_timeout_days => p_timeout_days
356 ,p_object_version_number => l_object_version_number
357 ,p_consolidated_table_route_id => p_consolidated_table_route_id
358 ,p_business_group_id => p_business_group_id
359 ,p_setup_type_cd => p_setup_type_cd
360 ,p_master_table_route_id => p_master_table_route_id
361 ,p_effective_date => trunc(p_effective_date)
362 );
363 exception
364 when hr_api.cannot_find_prog_unit then
365 hr_api.cannot_find_prog_unit_error
366 (p_module_name => 'UPDATE_TRAN_CATEGORY'
367 ,p_hook_type => 'AP'
368 );
369 --
370 -- End of API User Hook for the after hook of update_TRAN_CATEGORY
371 --
372 end;
373 --
374 hr_utility.set_location(l_proc, 60);
375 --
376 -- When in validation only mode raise the Validate_Enabled exception
377 --
378 if p_validate then
379 raise hr_api.validate_enabled;
380 end if;
381 --
382 -- Set all output arguments
383 --
384 p_object_version_number := l_object_version_number;
385 --
386 hr_utility.set_location(' Leaving:'||l_proc, 70);
387 --
388 exception
389 --
390 when hr_api.validate_enabled then
391 --
392 -- As the Validate_Enabled exception has been raised
393 -- we must rollback to the savepoint
394 --
395 ROLLBACK TO update_TRAN_CATEGORY;
396 --
397 -- Only set output warning arguments
398 -- (Any key or derived arguments must be set to null
399 -- when validation only mode is being used.)
400 --
401 hr_utility.set_location(' Leaving:'||l_proc, 80);
402 --
403 when others then
404 p_object_version_number := l_object_version_number;
405 --
406 -- A validation or unexpected error has occured
407 --
408 ROLLBACK TO update_TRAN_CATEGORY;
409 raise;
410 --
411 end update_TRAN_CATEGORY;
412 -- ----------------------------------------------------------------------------
413 -- |------------------------< delete_TRAN_CATEGORY >----------------------|
414 -- ----------------------------------------------------------------------------
415 --
416 procedure delete_TRAN_CATEGORY
417 (p_validate in boolean default false
418 ,p_transaction_category_id in number
419 ,p_object_version_number in number
420 ,p_effective_date in date
421 ) is
422 --
423 -- Declare cursors and local variables
424 --
425 l_proc varchar2(72) := g_package||'delete_TRAN_CATEGORY';
426 l_object_version_number pqh_transaction_categories.object_version_number%TYPE;
427 --
428 begin
429 --
430 hr_utility.set_location('Entering:'|| l_proc, 10);
431 --
432 -- Issue a savepoint if operating in validation only mode
433 --
434 savepoint delete_TRAN_CATEGORY;
435 --
436 hr_utility.set_location(l_proc, 20);
437 --
438 -- Process Logic
439 --
440 l_object_version_number := p_object_version_number;
441 --
442 --
443 begin
444 --
445 -- Start of API User Hook for the before hook of delete_TRAN_CATEGORY
446 --
447 pqh_TRAN_CATEGORY_bk3.delete_TRAN_CATEGORY_b
448 (
449 p_transaction_category_id => p_transaction_category_id
450 ,p_object_version_number => p_object_version_number
451 ,p_effective_date => trunc(p_effective_date)
452 );
453 exception
454 when hr_api.cannot_find_prog_unit then
455 hr_api.cannot_find_prog_unit_error
456 (p_module_name => 'DELETE_TRAN_CATEGORY'
457 ,p_hook_type => 'BP'
458 );
459 --
460 -- End of API User Hook for the before hook of delete_TRAN_CATEGORY
461 --
462 end;
463 --
464 pqh_tct_shd.lck
465 (
466 p_transaction_category_id => p_transaction_category_id
467 ,p_object_version_number => p_object_version_number
468 );
469 --
470 --
471 pqh_ctl_del.del_tl
472 (
473 p_transaction_category_id => p_transaction_category_id);
474
475 --
476 pqh_tct_del.del
477 (
478 p_transaction_category_id => p_transaction_category_id
479 ,p_object_version_number => l_object_version_number
480 ,p_effective_date => p_effective_date
481 );
482 --
483 begin
484 --
485 -- Start of API User Hook for the after hook of delete_TRAN_CATEGORY
486 --
487 pqh_TRAN_CATEGORY_bk3.delete_TRAN_CATEGORY_a
488 (
489 p_transaction_category_id => p_transaction_category_id
490 ,p_object_version_number => l_object_version_number
491 ,p_effective_date => trunc(p_effective_date)
492 );
493 exception
494 when hr_api.cannot_find_prog_unit then
495 hr_api.cannot_find_prog_unit_error
496 (p_module_name => 'DELETE_TRAN_CATEGORY'
497 ,p_hook_type => 'AP'
498 );
499 --
500 -- End of API User Hook for the after hook of delete_TRAN_CATEGORY
501 --
502 end;
503 --
504 hr_utility.set_location(l_proc, 60);
505 --
506 -- When in validation only mode raise the Validate_Enabled exception
507 --
508 if p_validate then
509 raise hr_api.validate_enabled;
510 end if;
511 --
512 hr_utility.set_location(' Leaving:'||l_proc, 70);
513 --
514 exception
515 --
516 when hr_api.validate_enabled then
517 --
518 -- As the Validate_Enabled exception has been raised
519 -- we must rollback to the savepoint
520 --
521 ROLLBACK TO delete_TRAN_CATEGORY;
522 --
523 -- Only set output warning arguments
524 -- (Any key or derived arguments must be set to null
525 -- when validation only mode is being used.)
526 --
527 --
528 when others then
529 --
530 -- A validation or unexpected error has occured
531 --
532 ROLLBACK TO delete_TRAN_CATEGORY;
533 raise;
534 --
535 end delete_TRAN_CATEGORY;
536 --
537 -- ----------------------------------------------------------------------------
538 -- |-------------------------------< lck >------------------------------------|
539 -- ----------------------------------------------------------------------------
540 --
541 procedure lck
542 (
543 p_transaction_category_id in number
544 ,p_object_version_number in number
545 ) is
546 --
547 --
548 -- Declare cursors and local variables
549 --
550 l_proc varchar2(72) := g_package||'lck';
551 --
552 begin
553 --
554 hr_utility.set_location('Entering:'|| l_proc, 10);
555 --
556 pqh_tct_shd.lck
557 (
558 p_transaction_category_id => p_transaction_category_id
559 ,p_object_version_number => p_object_version_number
560 );
561 --
562 hr_utility.set_location(' Leaving:'||l_proc, 70);
563 --
564 end lck;
565 --
566 --
567 end pqh_TRAN_CATEGORY_api;