DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_ECU_API

Source


1 package body pay_ecu_api as
2 /* $Header: pyecuapi.pkb 120.1 2005/10/20 02:50:13 pgongada noship $ */
3 --
4 procedure CREATE_ELE_CLASS_USAGES
5   (p_validate                      in     boolean  default false
6   ,p_effective_date                in     date
7   ,p_run_type_id                   in	  number
8   ,p_classification_id             in     number
9   ,p_business_group_id             in     number   default null
10   ,p_legislation_code              in     varchar2 default null
11   ,p_element_class_usage_id        out nocopy   number
12   ,p_object_version_number         out nocopy   number
13   ,p_effective_start_date          out nocopy   date
14   ,p_effective_end_date            out nocopy   date
15   ) is
16 --
17   l_element_class_usage_id         PAY_ELEMENT_CLASS_USAGES_F.ELEMENT_CLASS_USAGE_ID%TYPE;
18   l_object_version_number          PAY_ELEMENT_CLASS_USAGES_F.OBJECT_VERSION_NUMBER%TYPE;
19   l_effective_start_date           PAY_ELEMENT_CLASS_USAGES_F.EFFECTIVE_START_DATE%TYPE;
20   l_effective_end_date             PAY_ELEMENT_CLASS_USAGES_F.EFFECTIVE_END_DATE%TYPE;
21   l_proc		           varchar2(72) :=  g_package||'.create_ele_class_usages';
22 --
23 begin
24 --
25 	hr_utility.set_location(' Entering : '||l_proc,10);
26 	--
27 	-- Standard savepoint.
28 	--
29 	savepoint create_ele_class_usages;
30 	--
31 	begin
32 	--
33 		hr_utility.set_location('Calling create_ele_class_b'||l_proc,15);
34 		pay_ecu_bk1.create_ele_class_usages_b(
35 		 p_effective_date	=> p_effective_date
36 		,p_run_type_id          => p_run_type_id
37 	        ,p_classification_id    => p_classification_id
38 		,p_business_group_id    => p_business_group_id
39 		,p_legislation_code     => p_legislation_code
40 		);
41 		exception
42 			when hr_api.cannot_find_prog_unit then
43 			hr_api.cannot_find_prog_unit_error
44 			(p_module_name => 'create_ele_class_usages'
45 			,p_hook_type   => 'BP');
46 	--
47 	end;
48 	hr_utility.set_location('Calling pay_ecu_ins.ins :'||l_proc,20);
49 	pay_ecu_ins.ins(
50 	 p_effective_date                 => p_effective_date
51 	,p_run_type_id                    => p_run_type_id
52 	,p_classification_id              => p_classification_id
53 	,p_business_group_id              => p_business_group_id
54 	,p_legislation_code               => p_legislation_code
55 	,p_element_class_usage_id         => l_element_class_usage_id
56 	,p_object_version_number          => l_object_version_number
57 	,p_effective_start_date           => l_effective_start_date
58 	,p_effective_end_date             => l_effective_end_date
59 	);
60 	begin
61 		hr_utility.set_location('Calling create_ele_class_a'||l_proc,25);
62 		pay_ecu_bk1.create_ele_class_usages_a(
63 		p_effective_date                => p_effective_date
64 		,p_element_class_usage_id       => l_element_class_usage_id
65 		,p_run_type_id                  => p_run_type_id
66 		,p_classification_id		=> p_classification_id
67 		,p_business_group_id            => p_business_group_id
68 		,p_legislation_code             => p_legislation_code
69 		,p_object_version_number	=> l_object_version_number
70 		,p_effective_start_date		=> l_effective_start_date
71 		,p_effective_end_date		=> l_effective_end_date);
72 		exception
73 			when hr_api.cannot_find_prog_unit then
74 			hr_api.cannot_find_prog_unit_error
75 			(p_module_name => 'create_ele_class_usages'
76 			,p_hook_type   => 'AP');
77 	end;
78 	if(p_validate) then
79 	--
80 		raise hr_api.validate_enabled;
81 	--
82 	end if;
83 
84 	hr_utility.set_location(l_proc,30);
85 	--
86 	p_element_class_usage_id       := l_element_class_usage_id;
87 	p_object_version_number	       := l_object_version_number;
88 	p_effective_start_date	       := l_effective_start_date;
89 	p_effective_end_date	       := l_effective_end_date;
90 	--
91 	hr_utility.set_location(' Leaving:'||l_proc, 70);
92 	EXCEPTION
93 		WHEN hr_api.validate_enabled then
94 		--
95 			ROLLBACK TO create_ele_class_usages;
96 			p_element_class_usage_id       := null;
97 			p_object_version_number	       := null;
98 			p_effective_start_date	       := null;
99 			p_effective_end_date	       := null;
100 		--
101 		WHEN OTHERS then
102 		--
103 			ROLLBACK TO create_ele_class_usages;
104 			--
105 			p_element_class_usage_id       := null;
106 			p_object_version_number	       := null;
107 			p_effective_start_date	       := null;
108 			p_effective_end_date	       := null;
109 			--
110 			RAISE;
111 		--
112 end CREATE_ELE_CLASS_USAGES;
113 --
114 -- ----------------------------------------------------------------------------
115 -- |-----------------------< UPDATE_ELE_CLASS_USAGES >------------------------|
116 -- ----------------------------------------------------------------------------
117 --
118 procedure UPDATE_ELE_CLASS_USAGES
119   (p_validate                      in     boolean  default false
120   ,p_effective_date                in     date
121   ,p_datetrack_mode                in     varchar2
122   ,p_run_type_id                   in	  number   default hr_api.g_number
123   ,p_classification_id             in     number   default hr_api.g_number
124   ,p_business_group_id             in     number   default hr_api.g_number
125   ,p_legislation_code              in     varchar2 default hr_api.g_varchar2
126   ,p_element_class_usage_id        in out nocopy   number
127   ,p_object_version_number         in out nocopy   number
128   ,p_effective_start_date          out    nocopy   date
129   ,p_effective_end_date            out    nocopy   date
130   ) is
131 --
132   l_proc		varchar2(72) :=g_package || '.update_ele_class_usages';
133 --
134   l_element_class_usage_id         PAY_ELEMENT_CLASS_USAGES_F.ELEMENT_CLASS_USAGE_ID%TYPE;
135   l_in_out_ele_class_usage_id      PAY_ELEMENT_CLASS_USAGES_F.ELEMENT_CLASS_USAGE_ID%TYPE;
136   l_object_version_number          PAY_ELEMENT_CLASS_USAGES_F.OBJECT_VERSION_NUMBER%TYPE;
137   l_in_out_object_version_number   PAY_ELEMENT_CLASS_USAGES_F.OBJECT_VERSION_NUMBER%TYPE;
138   l_effective_start_date           PAY_ELEMENT_CLASS_USAGES_F.EFFECTIVE_START_DATE%TYPE;
139   l_effective_end_date             PAY_ELEMENT_CLASS_USAGES_F.EFFECTIVE_END_DATE%TYPE;
140 --
141 begin
142 	hr_utility.set_location(' Entering : '||l_proc,10);
143 	l_element_class_usage_id	:= p_element_class_usage_id;
144 	l_in_out_ele_class_usage_id     := p_element_class_usage_id;
145 	l_object_version_number		:= p_object_version_number;
146 	l_in_out_object_version_number	:= p_object_version_number;
147 	--
148 	-- Standard savepoint.
149 	--
150 	savepoint update_ele_class_usages;
151 	--
152 	begin
153 	--
154 		hr_utility.set_location('Calling update_ele_class_b'||l_proc,15);
155 		pay_ecu_bk2.update_ele_class_usages_b(
156 		 p_effective_date		=> p_effective_date
157 		,p_datetrack_mode		=> p_datetrack_mode
158 		,p_element_class_usage_id       => p_element_class_usage_id
159 		,p_run_type_id			=> p_run_type_id
160 	        ,p_classification_id		=> p_classification_id
161 		,p_business_group_id		=> p_business_group_id
162 		,p_legislation_code		=> p_legislation_code
163 		,p_object_version_number        => p_object_version_number
164 		);
165 		exception
166 			when hr_api.cannot_find_prog_unit then
167 			hr_api.cannot_find_prog_unit_error
168 			(p_module_name => 'update_ele_class_usages'
169 			,p_hook_type   => 'BP');
170 	--
171 	end;
172 		hr_utility.set_location('Calling pay_ecu_upd.upd'||l_proc,25);
173 		--
174 		pay_ecu_upd.upd(
175 	        p_effective_date                => p_effective_date
176 	       ,p_datetrack_mode                => p_datetrack_mode
177 	       ,p_run_type_id                   => p_run_type_id
178 	       ,p_classification_id             => p_classification_id
179 	       ,p_business_group_id             => p_business_group_id
180                ,p_legislation_code              => p_legislation_code
181                ,p_element_class_usage_id        => l_element_class_usage_id
182 	       ,p_object_version_number         => l_object_version_number
183                ,p_effective_start_date          => l_effective_start_date
184                ,p_effective_end_date            => l_effective_end_date);
185 
186 	begin
187 	--
188 		hr_utility.set_location('update_ele_class_a'||l_proc,25);
189 		pay_ecu_bk2.update_ele_class_usages_a(
190 		 p_effective_date                => p_effective_date
191                 ,p_datetrack_mode                => p_datetrack_mode
192 		,p_element_class_usage_id        => l_element_class_usage_id
193 		,p_run_type_id                   => p_run_type_id
194 		,p_classification_id		 => p_classification_id
195 		,p_business_group_id             => p_business_group_id
196 		,p_legislation_code              => p_legislation_code
197 		,p_object_version_number	 => l_object_version_number
198 		,p_effective_start_date		 => l_effective_start_date
199 		,p_effective_end_date		 => l_effective_end_date);
200 
201 		exception
202 			when hr_api.cannot_find_prog_unit then
203 			hr_api.cannot_find_prog_unit_error
204 			(p_module_name => 'update_ele_class_usages'
205 			,p_hook_type   => 'AP');
206 	--
207 	end;
208 	--
209 	if(p_validate) then
210 	--
211 		raise hr_api.validate_enabled;
212 	--
213 	end if;
214 
215 	hr_utility.set_location(l_proc,30);
216 	--
217 	p_element_class_usage_id       := l_element_class_usage_id;
218 	p_object_version_number	       := l_object_version_number;
219 	p_effective_start_date	       := l_effective_start_date;
220 	p_effective_end_date	       := l_effective_end_date;
221 	--
222         hr_utility.set_location(' Leaving:'||l_proc, 70);
223 	EXCEPTION
224 		WHEN hr_api.validate_enabled then
225 		--
226 			ROLLBACK TO update_ele_class_usages;
227 			p_element_class_usage_id       := l_in_out_ele_class_usage_id;
228 			p_object_version_number	       := l_in_out_object_version_number;
229 			p_effective_start_date	       := null;
230 			p_effective_end_date	       := null;
231 		--
232 		WHEN OTHERS then
233 		--
234 			ROLLBACK TO update_ele_class_usages;
235 			--
236 			p_element_class_usage_id       := l_in_out_ele_class_usage_id;
237 			p_object_version_number	       := l_in_out_object_version_number;
238 			p_effective_start_date	       := null;
239 			p_effective_end_date	       := null;
240 			--
241 			RAISE;
242 		--
243 end UPDATE_ELE_CLASS_USAGES;
244 --
245 -- ----------------------------------------------------------------------------
246 -- |-----------------------< DELETE_ELE_CLASS_USAGES >------------------------|
247 -- ----------------------------------------------------------------------------
248 --
249 procedure DELETE_ELE_CLASS_USAGES
250   (p_validate                      in     boolean  default false
251   ,p_effective_date                in     date
252   ,p_datetrack_mode                in     varchar2
253   ,p_element_class_usage_id        in     number
254   ,p_object_version_number         in out nocopy   number
255   ,p_effective_start_date          out    nocopy   date
256   ,p_effective_end_date            out    nocopy   date
257   ) is
258 --
259   l_proc		varchar2(72) :=g_package || '.delete_ele_class_usages';
260 --
261   l_object_version_number          PAY_ELEMENT_CLASS_USAGES_F.OBJECT_VERSION_NUMBER%TYPE;
262   l_in_out_object_version_number   PAY_ELEMENT_CLASS_USAGES_F.OBJECT_VERSION_NUMBER%TYPE;
263   l_effective_start_date           PAY_ELEMENT_CLASS_USAGES_F.EFFECTIVE_START_DATE%TYPE;
264   l_effective_end_date             PAY_ELEMENT_CLASS_USAGES_F.EFFECTIVE_END_DATE%TYPE;
265 --
266 begin
267 --
268 	hr_utility.set_location(' Entering : '||l_proc,10);
269 	l_object_version_number		:= p_object_version_number;
270 	l_in_out_object_version_number  := p_object_version_number;
271 	--
272 	-- Standard savepoint.
273 	--
274 	savepoint delete_ele_class_usages;
275 	--
276 	begin
277 	--
278 		hr_utility.set_location('Calling delete_ele_class_b'||l_proc,15);
279 		pay_ecu_bk3.delete_ele_class_usages_b(
280 		 p_effective_date		=> p_effective_date
281 		,p_datetrack_mode		=> p_datetrack_mode
282 		,p_element_class_usage_id       => p_element_class_usage_id
283 		,p_object_version_number        => p_object_version_number
284 		);
285 		exception
286 			when hr_api.cannot_find_prog_unit then
287 			hr_api.cannot_find_prog_unit_error
288 			(p_module_name => 'delete_ele_class_usages'
289 			,p_hook_type   => 'BP');
290 	--
291 	end;
292 		hr_utility.set_location('Calling pay_ecu_del'||l_proc,10);
293 		--
294 		pay_ecu_del.del(
295 		p_effective_date                => p_effective_date
296 	       ,p_datetrack_mode                => p_datetrack_mode
297 	       ,p_element_class_usage_id        => p_element_class_usage_id
298 	       ,p_object_version_number         => l_object_version_number
299                ,p_effective_start_date          => l_effective_start_date
300                ,p_effective_end_date            => l_effective_end_date);
301 	begin
302 	--
303 		hr_utility.set_location('Calling delete_ele_class_a'||l_proc,25);
304 		pay_ecu_bk3.delete_ele_class_usages_a(
305 		 p_effective_date                => p_effective_date
306                 ,p_datetrack_mode                => p_datetrack_mode
307 		,p_element_class_usage_id        => p_element_class_usage_id
308 		,p_object_version_number	 => l_object_version_number
309 		,p_effective_start_date		 => l_effective_start_date
310 		,p_effective_end_date		 => l_effective_end_date);
311 
312 		exception
313 			when hr_api.cannot_find_prog_unit then
314 			hr_api.cannot_find_prog_unit_error
318 	end;
315 			(p_module_name => 'delete_ele_class_usages'
316 			,p_hook_type   => 'AP');
317 	--
319 	--
320 	if(p_validate) then
321 	--
322 		raise hr_api.validate_enabled;
323 	--
324 	end if;
325 
326 	hr_utility.set_location(l_proc,30);
327 	p_object_version_number	       := l_object_version_number;
328 	p_effective_start_date	       := l_effective_start_date;
329 	p_effective_end_date	       := l_effective_end_date;
330 
331 	hr_utility.set_location(' Leaving:'||l_proc, 70);
332 	EXCEPTION
333 		WHEN hr_api.validate_enabled then
334 		--
335 			ROLLBACK TO delete_ele_class_usages;
336 			p_object_version_number	       := l_in_out_object_version_number;
337 			p_effective_start_date	       := null;
338 			p_effective_end_date	       := null;
339 		--
340 		WHEN OTHERS then
341 		--
342 			ROLLBACK TO delete_ele_class_usages;
343 			--
344 			p_object_version_number	       := l_in_out_object_version_number;
345 			p_effective_start_date	       := null;
346 			p_effective_end_date	       := null;
347 			--
348 			RAISE;
349 		--
350 end delete_ele_class_usages;
351 --
352 end PAY_ECU_API;
353