DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_USER_COLUMN_INSTANCE_API

Source


1 Package Body pay_user_column_instance_api as
2 /* $Header: pyuciapi.pkb 115.0 2003/09/23 07:27 tvankayl noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  pay_user_column_instance_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-----------------------< create_user_column_instance >--------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_user_column_instance
13   (p_validate                      in     boolean  default false
14   ,p_effective_date                in     date
15   ,p_user_row_id                   in     number
16   ,p_user_column_id                in     number
17   ,p_value                         in     varchar2 default null
18   ,p_business_group_id             in     number   default null
19   ,p_legislation_code              in     varchar2 default null
20   ,p_user_column_instance_id          out nocopy number
21   ,p_object_version_number            out nocopy number
22   ,p_effective_start_date             out nocopy date
23   ,p_effective_end_date               out nocopy date
24   ) is
25   --
26   -- Declare cursors and local variables
27   --
28 
29   l_effective_date      date;
30   l_proc                varchar2(72) := g_package||'create_user_column_instance';
31   l_user_column_instance_id number;
32   l_object_version_number number;
33   l_effective_start_date  date;
34   l_effective_end_date    date;
35   --
36 begin
37   hr_utility.set_location('Entering:'|| l_proc, 10);
38   --
39   -- Issue a savepoint
40   --
41   savepoint create_user_column_instance;
42   --
43   -- Truncate the time portion from all IN date parameters
44   --
45   l_effective_date := trunc(p_effective_date);
46 
47   --
48   -- Call Before Process User Hook
49   --
50   begin
51 	pay_user_column_instance_bk1.create_user_column_instance_b
52 	(p_effective_date    =>  l_effective_date
53 	,p_user_row_id       =>  p_user_row_id
54 	,p_user_column_id    =>  p_user_column_id
55 	,p_value             =>  p_value
56 	,p_business_group_id =>  p_business_group_id
57 	,p_legislation_code  =>  p_legislation_code
58 	);
59   exception
60     when hr_api.cannot_find_prog_unit then
61       hr_api.cannot_find_prog_unit_error
62         (p_module_name => 'create_user_column_instance'
63         ,p_hook_type   => 'BP'
64         );
65   end;
66   --
67   -- Process Logic
68   --
69   pay_uci_ins.ins
70   (p_effective_date                 => l_effective_date
71   ,p_user_row_id                    => p_user_row_id
72   ,p_user_column_id                 => p_user_column_id
73   ,p_business_group_id              => p_business_group_id
74   ,p_legislation_code               => p_legislation_code
75   ,p_value                          => p_value
76   ,p_user_column_instance_id        => l_user_column_instance_id
77   ,p_object_version_number          => l_object_version_number
78   ,p_effective_start_date           => l_effective_start_date
79   ,p_effective_end_date             => l_effective_end_date
80   ) ;
81 
82   --
83   -- Call After Process User Hook
84   --
85   begin
86       pay_user_column_instance_bk1.create_user_column_instance_a
87         (p_effective_date             =>  l_effective_date
88         ,p_user_row_id                =>  p_user_row_id
89 	,p_user_column_id             =>  p_user_column_id
90 	,p_value                      =>  p_value
91 	,p_business_group_id          =>  p_business_group_id
92 	,p_legislation_code           =>  p_legislation_code
93 	,p_user_column_instance_id    => l_user_column_instance_id
94         ,p_object_version_number      => l_object_version_number
95         ,p_effective_start_date       => l_effective_start_date
96         ,p_effective_end_date         => l_effective_end_date
97 	);
98 
99   exception
100     when hr_api.cannot_find_prog_unit then
101       hr_api.cannot_find_prog_unit_error
102         (p_module_name => 'create_user_column_instance'
103         ,p_hook_type   => 'AP'
104         );
105   end;
106   --
107   -- When in validation only mode raise the Validate_Enabled exception
108   --
109   if p_validate then
110     raise hr_api.validate_enabled;
111   end if;
112   --
113   -- Set all IN OUT and OUT parameters with out values
114   --
115    p_user_column_instance_id := l_user_column_instance_id ;
116    p_object_version_number   := l_object_version_number ;
117    p_effective_start_date    := l_effective_start_date ;
118    p_effective_end_date      := l_effective_end_date ;
119 
120   --
121   hr_utility.set_location(' Leaving:'||l_proc, 70);
122 exception
123   when hr_api.validate_enabled then
124     --
125     -- As the Validate_Enabled exception has been raised
126     -- we must rollback to the savepoint
127     --
128     rollback to create_user_column_instance;
129     --
130     -- Reset IN OUT parameters and set OUT parameters
131     -- (Any key or derived arguments must be set to null
132     -- when validation only mode is being used.)
133     --
134     p_user_column_instance_id := null ;
135     p_object_version_number   := null ;
136     p_effective_start_date    := null ;
137     p_effective_end_date      := null ;
138 
139     hr_utility.set_location(' Leaving:'||l_proc, 80);
140   when others then
141     --
142     -- A validation or unexpected error has occured
143     --
144     rollback to create_user_column_instance;
145     --
146     -- Reset IN OUT parameters and set all
147     -- OUT parameters, including warnings, to null
148     --
149     p_user_column_instance_id := null ;
150     p_object_version_number   := null ;
151     p_effective_start_date    := null ;
152     p_effective_end_date      := null ;
153 
154     hr_utility.set_location(' Leaving:'||l_proc, 90);
155     raise;
156 end create_user_column_instance;
157 --
158 -- ----------------------------------------------------------------------------
159 -- |----------------------< update_user_column_instance >---------------------|
160 -- ----------------------------------------------------------------------------
161 --
162 procedure update_user_column_instance
163   (p_validate                      in     boolean  default false
164   ,p_effective_date                in     date
165   ,p_user_column_instance_id       in     number
166   ,p_datetrack_update_mode         in     varchar2
167   ,p_value                         in     varchar2 default HR_API.G_VARCHAR2
168   ,p_object_version_number         in out nocopy number
169   ,p_effective_start_date             out nocopy date
170   ,p_effective_end_date               out nocopy date
171   ) is
172   --
173   -- Declare cursors and local variables
174   --
175   l_in_out_parameter    number;
176   l_effective_date       date;
177   l_proc                 varchar2(72) := g_package||'update_user_column_instance';
178   l_object_version_number number;
179   l_effective_start_date  date;
180   l_effective_end_date    date;
181   --
182 begin
183   hr_utility.set_location('Entering:'|| l_proc, 10);
184   --
185   -- Issue a savepoint
186   --
187   savepoint update_user_column_instance;
188   --
189   -- Remember IN OUT parameter IN values
190   --
191   l_in_out_parameter := p_object_version_number;
192   --
193   l_object_version_number := p_object_version_number;
194   --
195   -- Truncate the time portion from all IN date parameters
196   --
197   l_effective_date := trunc(p_effective_date);
198 
199   --
200   -- Call Before Process User Hook
201   --
202   begin
203 	pay_user_column_instance_bk2.update_user_column_instance_b
204 	(p_effective_date             => l_effective_date
205 	,p_user_column_instance_id    => p_user_column_instance_id
206 	,p_datetrack_update_mode      => p_datetrack_update_mode
207 	,p_value                      => p_value
208 	,p_object_version_number      => l_object_version_number
209 	);
210   exception
211     when hr_api.cannot_find_prog_unit then
212       hr_api.cannot_find_prog_unit_error
213         (p_module_name => 'update_user_column_instance'
214         ,p_hook_type   => 'BP'
215         );
216   end;
217   --
218   -- Process Logic
219   --
220   pay_uci_upd.upd
221   (p_effective_date               => l_effective_date
222   ,p_datetrack_mode               => p_datetrack_update_mode
223   ,p_user_column_instance_id      => p_user_column_instance_id
224   ,p_object_version_number        => l_object_version_number
225   ,p_value                        => p_value
226   ,p_effective_start_date         => l_effective_start_date
227   ,p_effective_end_date           => l_effective_end_date
228   ) ;
229   --
230   -- Call After Process User Hook
231   --
232   begin
233       pay_user_column_instance_bk2.update_user_column_instance_a
234         (p_effective_date             => l_effective_date
235 	,p_user_column_instance_id    => p_user_column_instance_id
236 	,p_datetrack_update_mode      => p_datetrack_update_mode
237 	,p_value                      => p_value
238 	,p_object_version_number      => l_object_version_number
239         ,p_effective_start_date       => l_effective_start_date
240         ,p_effective_end_date         => l_effective_end_date
241 	);
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_user_column_instance'
247         ,p_hook_type   => 'AP'
248         );
249   end;
250   --
251   -- When in validation only mode raise the Validate_Enabled exception
252   --
253   if p_validate then
254     raise hr_api.validate_enabled;
255   end if;
256   --
257   -- Set all IN OUT and OUT parameters with out values
258   --
259    p_object_version_number   := l_object_version_number ;
260    p_effective_start_date    := l_effective_start_date ;
261    p_effective_end_date      := l_effective_end_date ;
262 
263   --
264   hr_utility.set_location(' Leaving:'||l_proc, 70);
265 exception
266   when hr_api.validate_enabled then
267     --
268     -- As the Validate_Enabled exception has been raised
269     -- we must rollback to the savepoint
270     --
271     rollback to update_user_column_instance;
272     --
273     -- Reset IN OUT parameters and set OUT parameters
274     -- (Any key or derived arguments must be set to null
275     -- when validation only mode is being used.)
276     --
277     p_object_version_number   := l_in_out_parameter;
278     p_effective_start_date    := null ;
279     p_effective_end_date      := null ;
280 
281     hr_utility.set_location(' Leaving:'||l_proc, 80);
282   when others then
283     --
284     -- A validation or unexpected error has occured
285     --
286     rollback to update_user_column_instance;
287     --
288     -- Reset IN OUT parameters and set all
289     -- OUT parameters, including warnings, to null
290     --
291     p_object_version_number   := l_in_out_parameter;
292     p_effective_start_date    := null ;
293     p_effective_end_date      := null ;
294 
295     hr_utility.set_location(' Leaving:'||l_proc, 90);
296     raise;
297 end update_user_column_instance;
298 --
299 -- ----------------------------------------------------------------------------
300 -- |--------------------------< delete_user_column_instance >-----------------|
301 -- ----------------------------------------------------------------------------
302 --
303 procedure delete_user_column_instance
304   (p_validate                      in     boolean  default false
305   ,p_effective_date                in     date
306   ,p_user_column_instance_id       in     number
307   ,p_datetrack_update_mode         in     varchar2
308   ,p_object_version_number         in out nocopy number
309   ,p_effective_start_date             out nocopy date
310   ,p_effective_end_date               out nocopy date
311   ) is
312   --
313   -- Declare cursors and local variables
314   --
315   l_in_out_parameter    number;
316   l_effective_date       date;
317   l_proc                 varchar2(72) := g_package||'delete_user_column_instance';
318   l_object_version_number number;
319   l_effective_start_date  date;
320   l_effective_end_date    date;
321   --
322 begin
323   hr_utility.set_location('Entering:'|| l_proc, 10);
324   --
325   -- Issue a savepoint
326   --
327   savepoint delete_user_column_instance;
328   --
329   -- Remember IN OUT parameter IN values
330   --
331   l_in_out_parameter := p_object_version_number;
332   --
333   l_object_version_number := p_object_version_number;
334   --
335   -- Truncate the time portion from all IN date parameters
336   --
337   l_effective_date := trunc(p_effective_date);
338   --
339   -- Call Before Process User Hook
340   --
341   begin
342 	pay_user_column_instance_bk3.delete_user_column_instance_b
343 	(p_effective_date           =>  l_effective_date
344 	,p_user_column_instance_id  =>  p_user_column_instance_id
345 	,p_datetrack_update_mode    =>  p_datetrack_update_mode
346 	,p_object_version_number    =>  l_object_version_number
347 	);
348   exception
349     when hr_api.cannot_find_prog_unit then
350       hr_api.cannot_find_prog_unit_error
351         (p_module_name => 'delete_user_column_instance'
352         ,p_hook_type   => 'BP'
353         );
354   end;
355   --
356   -- Process Logic
357   --
358   pay_uci_del.del
359     (p_effective_date             => l_effective_date
360     ,p_datetrack_mode             => p_datetrack_update_mode
361     ,p_user_column_instance_id    => p_user_column_instance_id
362     ,p_object_version_number      => l_object_version_number
363     ,p_effective_start_date       => l_effective_start_date
364     ,p_effective_end_date         => l_effective_end_date
365     );
366   --
367   -- Call After Process User Hook
368   --
369   begin
370       pay_user_column_instance_bk3.delete_user_column_instance_a
371       	(p_effective_date           =>  l_effective_date
372 	,p_user_column_instance_id  =>  p_user_column_instance_id
373 	,p_datetrack_update_mode    =>  p_datetrack_update_mode
374 	,p_object_version_number    =>  l_object_version_number
375 	,p_effective_start_date     =>  l_effective_start_date
376         ,p_effective_end_date       =>  l_effective_end_date
377 	);
378 
379   exception
380     when hr_api.cannot_find_prog_unit then
381       hr_api.cannot_find_prog_unit_error
382         (p_module_name => 'delete_user_column_instance'
383         ,p_hook_type   => 'AP'
384         );
385   end;
386   --
387   -- When in validation only mode raise the Validate_Enabled exception
388   --
389   if p_validate then
390     raise hr_api.validate_enabled;
391   end if;
392   --
393   -- Set all IN OUT and OUT parameters with out values
394   --
395    p_object_version_number   := l_object_version_number ;
396    p_effective_start_date    := l_effective_start_date ;
397    p_effective_end_date      := l_effective_end_date ;
398 
399   --
400   hr_utility.set_location(' Leaving:'||l_proc, 70);
401 exception
402   when hr_api.validate_enabled then
403     --
404     -- As the Validate_Enabled exception has been raised
405     -- we must rollback to the savepoint
406     --
407     rollback to delete_user_column_instance;
408     --
409     -- Reset IN OUT parameters and set OUT parameters
410     -- (Any key or derived arguments must be set to null
411     -- when validation only mode is being used.)
412     --
413     p_object_version_number   := l_in_out_parameter;
414     p_effective_start_date    := null ;
415     p_effective_end_date      := null ;
416 
417     hr_utility.set_location(' Leaving:'||l_proc, 80);
418   when others then
419     --
420     -- A validation or unexpected error has occured
421     --
422     rollback to delete_user_column_instance;
423     --
424     -- Reset IN OUT parameters and set all
425     -- OUT parameters, including warnings, to null
426     --
427     p_object_version_number   := l_in_out_parameter;
428     p_effective_start_date    := null ;
429     p_effective_end_date      := null ;
430 
431     hr_utility.set_location(' Leaving:'||l_proc, 90);
432     raise;
433 end delete_user_column_instance;
434 --
435 
436 end pay_user_column_instance_api;