DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_BATCH_RANGES_API

Source


1 Package Body ben_batch_ranges_api as
2 /* $Header: beranapi.pkb 115.4 2002/12/11 11:34:54 lakrish ship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  ben_batch_ranges_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_batch_ranges >---------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_batch_ranges
13   (p_validate                       in  boolean   default false
14   ,p_range_id                       out nocopy number
15   ,p_benefit_action_id              in  number    default null
16   ,p_range_status_cd                in  varchar2  default null
17   ,p_starting_person_action_id      in  number    default null
18   ,p_ending_person_action_id        in  number    default null
19   ,p_object_version_number          out nocopy number
20   ,p_effective_date                 in  date) is
21   --
22   -- Declare cursors and local variables
23   --
24   l_range_id              ben_batch_ranges.range_id%TYPE;
25   l_proc                  varchar2(72) := g_package||'create_batch_ranges';
26   l_object_version_number ben_batch_ranges.object_version_number%TYPE;
27   --
28 begin
29   --
30   hr_utility.set_location('Entering:'|| l_proc, 10);
31   --
32   -- Issue a savepoint if operating in validation only mode
33   --
34   savepoint create_batch_ranges;
35   --
36   hr_utility.set_location(l_proc, 20);
37   --
38   -- Process Logic
39   --
40   ben_ran_ins.ins
41     (p_range_id                      => l_range_id
42     ,p_benefit_action_id             => p_benefit_action_id
43     ,p_range_status_cd               => p_range_status_cd
44     ,p_starting_person_action_id     => p_starting_person_action_id
45     ,p_ending_person_action_id       => p_ending_person_action_id
46     ,p_object_version_number         => l_object_version_number
47     ,p_effective_date                => trunc(p_effective_date));
48   --
49   hr_utility.set_location(l_proc, 60);
50   --
51   -- When in validation only mode raise the Validate_Enabled exception
52   --
53   if p_validate then
54     raise hr_api.validate_enabled;
55   end if;
56   --
57   -- Set all output arguments
58   --
59   p_range_id := l_range_id;
60   p_object_version_number := l_object_version_number;
61   --
62   hr_utility.set_location(' Leaving:'||l_proc, 70);
63   --
64 exception
65   --
66   when hr_api.validate_enabled then
67     --
68     -- As the Validate_Enabled exception has been raised
69     -- we must rollback to the savepoint
70     --
71     ROLLBACK TO create_batch_ranges;
72     --
73     -- Only set output warning arguments
77     p_range_id := null;
74     -- (Any key or derived arguments must be set to null
75     -- when validation only mode is being used.)
76     --
78     p_object_version_number  := null;
79     hr_utility.set_location(' Leaving:'||l_proc, 80);
80     --
81   when others then
82     --
83     -- A validation or unexpected error has occured
84     --
85     ROLLBACK TO create_batch_ranges;
86 
87     -- NOCOPY, Reset out parameters
88     p_range_id := null;
89     p_object_version_number  := null;
90 
91     raise;
92     --
93 end create_batch_ranges;
94 -- ----------------------------------------------------------------------------
95 -- |------------------------< update_batch_ranges >---------------------------|
96 -- ----------------------------------------------------------------------------
97 --
98 procedure update_batch_ranges
99   (p_validate                       in boolean   default false
100   ,p_range_id                       in number
101   ,p_benefit_action_id              in number    default hr_api.g_number
102   ,p_range_status_cd                in varchar2  default hr_api.g_varchar2
103   ,p_starting_person_action_id      in number    default hr_api.g_number
104   ,p_ending_person_action_id        in number    default hr_api.g_number
105   ,p_object_version_number          in out nocopy number
106   ,p_effective_date                 in date) is
107   --
108   -- Declare cursors and local variables
109   --
110   l_proc                  varchar2(72) := g_package||'update_batch_ranges';
111   l_object_version_number ben_batch_ranges.object_version_number%TYPE;
112   --
113 begin
114   --
115   hr_utility.set_location('Entering:'|| l_proc, 10);
116   --
117   -- Issue a savepoint if operating in validation only mode
118   --
119   savepoint update_batch_ranges;
120   --
121   hr_utility.set_location(l_proc, 20);
122   --
123   -- Process Logic
124   --
125   l_object_version_number := p_object_version_number;
126   --
127   ben_ran_upd.upd
128     (p_range_id                      => p_range_id
129     ,p_benefit_action_id             => p_benefit_action_id
130     ,p_range_status_cd               => p_range_status_cd
131     ,p_starting_person_action_id     => p_starting_person_action_id
132     ,p_ending_person_action_id       => p_ending_person_action_id
133     ,p_object_version_number         => l_object_version_number
134     ,p_effective_date                => trunc(p_effective_date));
135   --
136   hr_utility.set_location(l_proc, 60);
137   --
138   -- When in validation only mode raise the Validate_Enabled exception
139   --
140   if p_validate then
141     raise hr_api.validate_enabled;
142   end if;
143   --
144   -- Set all output arguments
145   --
146   p_object_version_number := l_object_version_number;
147   --
148   hr_utility.set_location(' Leaving:'||l_proc, 70);
149   --
150 exception
151   --
152   when hr_api.validate_enabled then
153     --
154     -- As the Validate_Enabled exception has been raised
155     -- we must rollback to the savepoint
156     --
157     ROLLBACK TO update_batch_ranges;
158     --
159     -- Only set output warning arguments
160     -- (Any key or derived arguments must be set to null
161     -- when validation only mode is being used.)
162     --
163     hr_utility.set_location(' Leaving:'||l_proc, 80);
164     --
165   when others then
166     --
167     -- A validation or unexpected error has occured
168     --
169     ROLLBACK TO update_batch_ranges;
170     raise;
171     --
172 end update_batch_ranges;
173 -- ----------------------------------------------------------------------------
174 -- |------------------------< delete_batch_ranges >---------------------------|
175 -- ----------------------------------------------------------------------------
176 --
177 procedure delete_batch_ranges
178   (p_validate                       in boolean  default false
179   ,p_range_id                       in number
180   ,p_object_version_number          in out nocopy number
181   ,p_effective_date                 in date) is
182   --
183   -- Declare cursors and local variables
184   --
185   l_proc varchar2(72) := g_package||'update_batch_ranges';
186   l_object_version_number ben_batch_ranges.object_version_number%TYPE;
187   --
188 begin
189   --
190   hr_utility.set_location('Entering:'|| l_proc, 10);
191   --
192   -- Issue a savepoint if operating in validation only mode
193   --
194   savepoint delete_batch_ranges;
195   --
196   hr_utility.set_location(l_proc, 20);
197   --
198   -- Process Logic
199   --
200   l_object_version_number := p_object_version_number;
201   --
202   ben_ran_del.del
203     (p_range_id                      => p_range_id
204     ,p_object_version_number         => l_object_version_number
205     ,p_effective_date                => p_effective_date);
206   --
207   hr_utility.set_location(l_proc, 60);
208   --
209   -- When in validation only mode raise the Validate_Enabled exception
210   --
211   if p_validate then
212     raise hr_api.validate_enabled;
213   end if;
214   --
215   hr_utility.set_location(' Leaving:'||l_proc, 70);
216   --
217 exception
218   --
219   when hr_api.validate_enabled then
220     --
221     -- As the Validate_Enabled exception has been raised
222     -- we must rollback to the savepoint
223     --
224     ROLLBACK TO delete_batch_ranges;
225     --
226     -- Only set output warning arguments
227     -- (Any key or derived arguments must be set to null
231   when others then
228     -- when validation only mode is being used.)
229     --
230     --
232     --
233     -- A validation or unexpected error has occured
234     --
235     ROLLBACK TO delete_batch_ranges;
236     raise;
237     --
238 end delete_batch_ranges;
239 --
240 -- ----------------------------------------------------------------------------
241 -- |-------------------------------< lck >------------------------------------|
242 -- ----------------------------------------------------------------------------
243 --
244 procedure lck
245   (p_range_id              in number
246   ,p_object_version_number in number) is
247   --
248   --
249   -- Declare cursors and local variables
250   --
251   l_proc varchar2(72) := g_package||'lck';
252   --
253 begin
254   --
255   hr_utility.set_location('Entering:'|| l_proc, 10);
256   --
257   ben_ran_shd.lck
258     (p_range_id                 => p_range_id
259     ,p_object_version_number    => p_object_version_number);
260   --
261   hr_utility.set_location(' Leaving:'||l_proc, 70);
262   --
263 end lck;
264 --
265 end ben_batch_ranges_api;