DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_ORG_STRUCTURE_VERSION_SWI

Source


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