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