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