[Home] [Help]
PACKAGE BODY: APPS.PQH_COPY_ENTITY_TXNS_API
Source
1 Package Body PQH_COPY_ENTITY_TXNS_API as
2 /* $Header: pqcetapi.pkb 115.5 2002/12/05 19:31:27 rpasapul ship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' PQH_COPY_ENTITY_TXN_APIS.';
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 nocopy 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 nocopy 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_TXNS_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_TXNS_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 p_copy_entity_txn_id := null;
171 p_object_version_number := null;
172 --
173 -- A validation or unexpected error has occured
174 --
175 ROLLBACK TO create_COPY_ENTITY_TXN;
176 raise;
177 --
178 end create_COPY_ENTITY_TXN;
179 -- ----------------------------------------------------------------------------
180 -- |------------------------< update_COPY_ENTITY_TXN >--- ------------------|
181 -- ----------------------------------------------------------------------------
182 --
183 procedure update_COPY_ENTITY_TXN
184 (p_validate in boolean default false
185 ,p_copy_entity_txn_id in number
186 ,p_transaction_category_id in number default hr_API.g_number
187 ,p_txn_category_attribute_id in number default hr_API.g_number
188 ,p_context_business_group_id in number default hr_api.g_number
189 ,p_datetrack_mode in varchar2 default hr_api.g_varchar2
190 ,p_context in varchar2 default hr_API.g_varchar2
191 ,p_action_date in date default hr_API.g_date
192 ,p_src_effective_date in date default hr_API.g_date
193 ,p_number_of_copies in number default hr_API.g_number
194 ,p_display_name in varchar2 default hr_API.g_varchar2
195 ,p_replacement_type_cd in varchar2 default hr_API.g_varchar2
196 ,p_start_with in varchar2 default hr_API.g_varchar2
197 ,p_increment_by in number default hr_API.g_number
198 ,p_status in varchar2 default hr_API.g_varchar2
199 ,p_object_version_number in out nocopy number
200 ,p_effective_date in date
201 ) is
202 --
203 -- Declare cursors and local variables
204 --
205 l_proc varchar2(72) := g_package||'update_COPY_ENTITY_TXN';
206 l_object_version_number pqh_copy_entity_txns.object_version_number%TYPE;
207 --
208 begin
209 --
210 hr_utility.set_location('Entering:'|| l_proc, 10);
211 --
212 -- Issue a savepoint if operating in validation only mode
213 --
214 savepoint update_COPY_ENTITY_TXN;
215 --
216 hr_utility.set_location(l_proc, 20);
217 --
218 -- Process Logic
219 --
220 l_object_version_number := p_object_version_number;
221 --
222 begin
223 --
224 -- Start of API User Hook for the before hook of update_COPY_ENTITY_TXN
225 --
226 PQH_COPY_ENTITY_TXNS_bk2.update_COPY_ENTITY_TXN_b
227 (
228 p_copy_entity_txn_id => p_copy_entity_txn_id
229 ,p_transaction_category_id => p_transaction_category_id
230 ,p_txn_category_attribute_id => p_txn_category_attribute_id
231 ,p_context_business_group_id => p_context_business_group_id
232 ,p_datetrack_mode => p_datetrack_mode
233 ,p_context => p_context
234 ,p_action_date => p_action_date
235 ,p_src_effective_date => p_src_effective_date
236 ,p_number_of_copies => p_number_of_copies
237 ,p_display_name => p_display_name
238 ,p_replacement_type_cd => p_replacement_type_cd
239 ,p_start_with => p_start_with
240 ,p_increment_by => p_increment_by
241 ,p_status => p_status
242 ,p_object_version_number => p_object_version_number
243 ,p_effective_date => trunc(p_effective_date)
244 );
245 exception
246 when hr_API.cannot_find_prog_unit then
247 hr_API.cannot_find_prog_unit_error
248 (p_module_name => 'UPDATE_COPY_ENTITY_TXN'
249 ,p_hook_type => 'BP'
250 );
251 --
252 -- End of API User Hook for the before hook of update_COPY_ENTITY_TXN
253 --
254 end;
255 --
256 pqh_cet_upd.upd
257 (
258 p_copy_entity_txn_id => p_copy_entity_txn_id
259 ,p_transaction_category_id => p_transaction_category_id
260 ,p_txn_category_attribute_id => p_txn_category_attribute_id
261 ,p_context_business_group_id => p_context_business_group_id
262 ,p_datetrack_mode => p_datetrack_mode
263 ,p_context => p_context
264 ,p_action_date => p_action_date
265 ,p_src_effective_date => p_src_effective_date
266 ,p_number_of_copies => p_number_of_copies
267 ,p_display_name => p_display_name
268 ,p_replacement_type_cd => p_replacement_type_cd
269 ,p_start_with => p_start_with
270 ,p_increment_by => p_increment_by
271 ,p_status => p_status
272 ,p_object_version_number => l_object_version_number
273 ,p_effective_date => trunc(p_effective_date)
274 );
275 --
276 begin
277 --
278 -- Start of API User Hook for the after hook of update_COPY_ENTITY_TXN
279 --
280 PQH_COPY_ENTITY_TXNS_bk2.update_COPY_ENTITY_TXN_a
281 (
282 p_copy_entity_txn_id => p_copy_entity_txn_id
283 ,p_transaction_category_id => p_transaction_category_id
284 ,p_txn_category_attribute_id => p_txn_category_attribute_id
285 ,p_context_business_group_id => p_context_business_group_id
286 ,p_datetrack_mode => p_datetrack_mode
287 ,p_context => p_context
288 ,p_action_date => p_action_date
289 ,p_src_effective_date => p_src_effective_date
290 ,p_number_of_copies => p_number_of_copies
291 ,p_display_name => p_display_name
292 ,p_replacement_type_cd => p_replacement_type_cd
293 ,p_start_with => p_start_with
294 ,p_increment_by => p_increment_by
295 ,p_status => p_status
296 ,p_object_version_number => l_object_version_number
297 ,p_effective_date => trunc(p_effective_date)
298 );
299 exception
300 when hr_API.cannot_find_prog_unit then
301 hr_API.cannot_find_prog_unit_error
302 (p_module_name => 'UPDATE_COPY_ENTITY_TXN'
303 ,p_hook_type => 'AP'
304 );
305 --
306 -- End of API User Hook for the after hook of update_COPY_ENTITY_TXN
307 --
308 end;
309 --
310 hr_utility.set_location(l_proc, 60);
311 --
312 -- When in validation only mode raise the Validate_Enabled exception
313 --
314 if p_validate then
315 raise hr_API.validate_enabled;
316 end if;
317 --
318 -- Set all output arguments
319 --
320 p_object_version_number := l_object_version_number;
321 --
322 hr_utility.set_location(' Leaving:'||l_proc, 70);
323 --
324 exception
325 --
326 when hr_API.validate_enabled then
327 --
328 -- As the Validate_Enabled exception has been raised
329 -- we must rollback to the savepoint
330 --
331 ROLLBACK TO update_COPY_ENTITY_TXN;
332 --
333 -- Only set output warning arguments
334 -- (Any key or derived arguments must be set to null
335 -- when validation only mode is being used.)
336 --
337 hr_utility.set_location(' Leaving:'||l_proc, 80);
338 --
339 when others then
340 p_object_version_number := l_object_version_number;
341 --
342 -- A validation or unexpected error has occured
343 --
344 ROLLBACK TO update_COPY_ENTITY_TXN;
345 raise;
346 --
347 end update_COPY_ENTITY_TXN;
348 -- ----------------------------------------------------------------------------
349 -- |------------------------< delete_COPY_ENTITY_TXN >----------------------|
350 -- ----------------------------------------------------------------------------
351 --
352 procedure delete_COPY_ENTITY_TXN
353 (p_validate in boolean default false
354 ,p_copy_entity_txn_id in number
355 ,p_object_version_number in number
356 ,p_effective_date in date
357 ) is
358 --
359 -- Declare cursors and local variables
360 --
361 l_proc varchar2(72) := g_package||'delete_COPY_ENTITY_TXN';
362 l_object_version_number pqh_copy_entity_txns.object_version_number%TYPE;
363 --
364 begin
365 --
366 hr_utility.set_location('Entering:'|| l_proc, 10);
367 --
368 -- Issue a savepoint if operating in validation only mode
369 --
370 pqh_cet_bus.chk_completed_target_err ( p_copy_entity_txn_id );
371 --
372 savepoint delete_COPY_ENTITY_TXN;
373 --
374 hr_utility.set_location(l_proc, 20);
375 --
376 -- Process Logic
377 --
378 l_object_version_number := p_object_version_number;
379 --
380 --
381 begin
382 --
383 -- Start of API User Hook for the before hook of delete_COPY_ENTITY_TXN
384 --
385 PQH_COPY_ENTITY_TXNS_bk3.delete_COPY_ENTITY_TXN_b
386 (
387 p_copy_entity_txn_id => p_copy_entity_txn_id
388 ,p_object_version_number => p_object_version_number
389 ,p_effective_date => trunc(p_effective_date)
390 );
391 exception
392 when hr_API.cannot_find_prog_unit then
393 hr_API.cannot_find_prog_unit_error
394 (p_module_name => 'DELETE_COPY_ENTITY_TXN'
395 ,p_hook_type => 'BP'
396 );
397 --
398 -- End of API User Hook for the before hook of delete_COPY_ENTITY_TXN
399 --
400 end;
401 --
402 pqh_cet_del.del
403 (
404 p_copy_entity_txn_id => p_copy_entity_txn_id
405 ,p_object_version_number => l_object_version_number
406 ,p_effective_date => p_effective_date
407 );
408 --
409 begin
410 --
411 -- Start of API User Hook for the after hook of delete_COPY_ENTITY_TXN
412 --
413 PQH_COPY_ENTITY_TXNS_bk3.delete_COPY_ENTITY_TXN_a
414 (
415 p_copy_entity_txn_id => p_copy_entity_txn_id
416 ,p_object_version_number => l_object_version_number
417 ,p_effective_date => trunc(p_effective_date)
418 );
419 exception
420 when hr_API.cannot_find_prog_unit then
421 hr_API.cannot_find_prog_unit_error
422 (p_module_name => 'DELETE_COPY_ENTITY_TXN'
423 ,p_hook_type => 'AP'
424 );
425 --
426 -- End of API User Hook for the after hook of delete_COPY_ENTITY_TXN
427 --
428 end;
429 --
430 hr_utility.set_location(l_proc, 60);
431 --
432 -- When in validation only mode raise the Validate_Enabled exception
433 --
434 if p_validate then
435 raise hr_API.validate_enabled;
436 end if;
437 --
438 hr_utility.set_location(' Leaving:'||l_proc, 70);
439 --
440 exception
441 --
442 when hr_API.validate_enabled then
443 --
444 -- As the Validate_Enabled exception has been raised
445 -- we must rollback to the savepoint
446 --
447 ROLLBACK TO delete_COPY_ENTITY_TXN;
448 --
449 -- Only set output warning arguments
450 -- (Any key or derived arguments must be set to null
451 -- when validation only mode is being used.)
452 --
453 --
454 when others then
455 --
456 -- A validation or unexpected error has occured
457 --
458 ROLLBACK TO delete_COPY_ENTITY_TXN;
459 raise;
460 --
461 end delete_COPY_ENTITY_TXN;
462 --
463 end PQH_COPY_ENTITY_TXNS_API;