DBA Data[Home] [Help]

PACKAGE BODY: APPS.AME_TRANS_TYPE_SWI

Source


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