DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_WORKSHEETS_API

Source


1 Package Body pqh_WORKSHEETS_api as
2 /* $Header: pqwksapi.pkb 115.5 2002/12/06 23:49:58 rpasapul noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  pqh_WORKSHEETS_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_WORKSHEET >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_WORKSHEET
13   (p_validate                       in  boolean   default false
14   ,p_worksheet_id                   out nocopy number
15   ,p_budget_id                      in  number
16   ,p_worksheet_name                 in  varchar2
17   ,p_version_number                 in  number
18   ,p_action_date                    in  date
19   ,p_date_from                      in  date      default null
20   ,p_date_to                        in  date      default null
21   ,p_worksheet_mode_cd              in  varchar2  default null
22   ,p_transaction_status             in  varchar2  default null
23   ,p_object_version_number          out nocopy number
24   ,p_budget_version_id              in  number
25   ,p_propagation_method             in  varchar2  default null
26   ,p_effective_date                 in  date
27   ,p_wf_transaction_category_id     in number
28   ) is
29   --
30   -- Declare cursors and local variables
31   --
32   l_worksheet_id pqh_worksheets.worksheet_id%TYPE;
33   l_proc varchar2(72) := g_package||'create_WORKSHEET';
34   l_object_version_number pqh_worksheets.object_version_number%TYPE;
35   --
36 begin
37   --
38   hr_utility.set_location('Entering:'|| l_proc, 10);
39   --
40   -- Issue a savepoint if operating in validation only mode
41   --
42   savepoint create_WORKSHEET;
43   --
44   hr_utility.set_location(l_proc, 20);
45   --
46   -- Process Logic
47   --
48   begin
49     --
50     -- Start of API User Hook for the before hook of create_WORKSHEET
51     --
52     pqh_WORKSHEETS_bk1.create_WORKSHEET_b
53       (
54        p_budget_id                      =>  p_budget_id
55       ,p_worksheet_name                 =>  p_worksheet_name
56       ,p_version_number                 =>  p_version_number
57       ,p_action_date                    =>  p_action_date
58       ,p_date_from                      =>  p_date_from
59       ,p_date_to                        =>  p_date_to
60       ,p_worksheet_mode_cd              =>  p_worksheet_mode_cd
61       ,p_transaction_status             =>  p_transaction_status
62       ,p_budget_version_id              =>  p_budget_version_id
63       ,p_propagation_method             =>  p_propagation_method
64       ,p_effective_date                 => trunc(p_effective_date)
65       ,p_wf_transaction_category_id     => p_wf_transaction_category_id
66       );
67   exception
68     when hr_api.cannot_find_prog_unit then
69       hr_api.cannot_find_prog_unit_error
70         (
71          p_module_name => 'CREATE_WORKSHEET'
72         ,p_hook_type   => 'BP'
73         );
74     --
75     -- End of API User Hook for the before hook of create_WORKSHEET
76     --
77   end;
78   --
79   pqh_wks_ins.ins
80     (
81      p_worksheet_id                  => l_worksheet_id
82     ,p_budget_id                     => p_budget_id
83     ,p_worksheet_name                => p_worksheet_name
84     ,p_version_number                => p_version_number
85     ,p_action_date                   => p_action_date
86     ,p_date_from                     => p_date_from
87     ,p_date_to                       => p_date_to
88     ,p_worksheet_mode_cd             => p_worksheet_mode_cd
89     ,p_transaction_status            => p_transaction_status
90     ,p_object_version_number         => l_object_version_number
91     ,p_budget_version_id             => p_budget_version_id
92     ,p_propagation_method            => p_propagation_method
93     ,p_effective_date                => trunc(p_effective_date)
94     ,p_wf_transaction_category_id    => p_wf_transaction_category_id
95     );
96   --
97   begin
98     --
99     -- Start of API User Hook for the after hook of create_WORKSHEET
100     --
101     pqh_WORKSHEETS_bk1.create_WORKSHEET_a
102       (
103        p_worksheet_id                   =>  l_worksheet_id
104       ,p_budget_id                      =>  p_budget_id
105       ,p_worksheet_name                 =>  p_worksheet_name
106       ,p_version_number                 =>  p_version_number
107       ,p_action_date                    =>  p_action_date
108       ,p_date_from                      =>  p_date_from
109       ,p_date_to                        =>  p_date_to
110       ,p_worksheet_mode_cd              =>  p_worksheet_mode_cd
111       ,p_transaction_status             =>  p_transaction_status
112       ,p_object_version_number          =>  l_object_version_number
113       ,p_budget_version_id              =>  p_budget_version_id
114       ,p_propagation_method             =>  p_propagation_method
115       ,p_effective_date                 =>  trunc(p_effective_date)
116       ,p_wf_transaction_category_id     =>  p_wf_transaction_category_id
117       );
118   exception
119     when hr_api.cannot_find_prog_unit then
120       hr_api.cannot_find_prog_unit_error
121         (p_module_name => 'CREATE_WORKSHEET'
122         ,p_hook_type   => 'AP'
123         );
124     --
125     -- End of API User Hook for the after hook of create_WORKSHEET
126     --
127   end;
128   --
129   hr_utility.set_location(l_proc, 60);
130   --
131   -- When in validation only mode raise the Validate_Enabled exception
132   --
133   if p_validate then
134     raise hr_api.validate_enabled;
135   end if;
136   --
137   -- Set all output arguments
138   --
139   p_worksheet_id := l_worksheet_id;
140   p_object_version_number := l_object_version_number;
141   --
142   hr_utility.set_location(' Leaving:'||l_proc, 70);
143   --
144 exception
145   --
146   when hr_api.validate_enabled then
147     --
148     -- As the Validate_Enabled exception has been raised
149     -- we must rollback to the savepoint
150     --
151     ROLLBACK TO create_WORKSHEET;
152     --
153     -- Only set output warning arguments
154     -- (Any key or derived arguments must be set to null
155     -- when validation only mode is being used.)
156     --
157     p_worksheet_id := null;
158     p_object_version_number  := null;
159     hr_utility.set_location(' Leaving:'||l_proc, 80);
160     --
161   when others then
162        p_worksheet_id := null;
163     p_object_version_number  := null;
164     --
165     -- A validation or unexpected error has occured
166     --
167     ROLLBACK TO create_WORKSHEET;
168     raise;
169     --
170 end create_WORKSHEET;
171 -- ----------------------------------------------------------------------------
172 -- |------------------------< update_WORKSHEET >--- ------------------|
173 -- ----------------------------------------------------------------------------
174 --
175 procedure update_WORKSHEET
176   (p_validate                       in  boolean   default false
177   ,p_worksheet_id                   in  number
178   ,p_budget_id                      in  number    default hr_api.g_number
179   ,p_worksheet_name                 in  varchar2  default hr_api.g_varchar2
180   ,p_version_number                 in  number    default hr_api.g_number
181   ,p_action_date                    in  date      default hr_api.g_date
182   ,p_date_from                      in  date      default hr_api.g_date
183   ,p_date_to                        in  date      default hr_api.g_date
184   ,p_worksheet_mode_cd              in  varchar2  default hr_api.g_varchar2
185   ,p_transaction_status             in  varchar2  default hr_api.g_varchar2
186   ,p_object_version_number          in out nocopy number
187   ,p_budget_version_id              in  number    default hr_api.g_number
188   ,p_propagation_method             in  varchar2  default hr_api.g_varchar2
189   ,p_effective_date                 in  date
190   ,p_wf_transaction_category_id     in  number    default hr_api.g_number
191   ) is
192   --
193   -- Declare cursors and local variables
194   --
195   l_proc varchar2(72) := g_package||'update_WORKSHEET';
196   l_object_version_number pqh_worksheets.object_version_number%TYPE;
197   --
198 begin
199   --
200   hr_utility.set_location('Entering:'|| l_proc, 10);
201   --
202   -- Issue a savepoint if operating in validation only mode
203   --
204   savepoint update_WORKSHEET;
205   --
206   hr_utility.set_location(l_proc, 20);
207   --
208   -- Process Logic
209   --
210   l_object_version_number := p_object_version_number;
211   --
212   begin
213     --
214     -- Start of API User Hook for the before hook of update_WORKSHEET
215     --
216     pqh_WORKSHEETS_bk2.update_WORKSHEET_b
217       (
218        p_worksheet_id                   =>  p_worksheet_id
219       ,p_budget_id                      =>  p_budget_id
220       ,p_worksheet_name                 =>  p_worksheet_name
221       ,p_version_number                 =>  p_version_number
222       ,p_action_date                    =>  p_action_date
223       ,p_date_from                      =>  p_date_from
224       ,p_date_to                        =>  p_date_to
225       ,p_worksheet_mode_cd              =>  p_worksheet_mode_cd
226       ,p_transaction_status             =>  p_transaction_status
227       ,p_object_version_number          =>  p_object_version_number
228       ,p_budget_version_id              =>  p_budget_version_id
229       ,p_propagation_method             =>  p_propagation_method
230       ,p_effective_date                 =>  trunc(p_effective_date)
231       ,p_wf_transaction_category_id     =>  p_wf_transaction_category_id
232       );
233   exception
234     when hr_api.cannot_find_prog_unit then
235       hr_api.cannot_find_prog_unit_error
236         (p_module_name => 'UPDATE_WORKSHEET'
237         ,p_hook_type   => 'BP'
238         );
239     --
240     -- End of API User Hook for the before hook of update_WORKSHEET
241     --
242   end;
243   --
244   pqh_wks_upd.upd
245     (
246      p_worksheet_id                  => p_worksheet_id
247     ,p_budget_id                     => p_budget_id
248     ,p_worksheet_name                => p_worksheet_name
249     ,p_version_number                => p_version_number
250     ,p_action_date                   => p_action_date
251     ,p_date_from                     => p_date_from
252     ,p_date_to                       => p_date_to
253     ,p_worksheet_mode_cd             => p_worksheet_mode_cd
254     ,p_transaction_status            => p_transaction_status
255     ,p_object_version_number         => l_object_version_number
256     ,p_budget_version_id             => p_budget_version_id
257     ,p_propagation_method            => p_propagation_method
258     ,p_effective_date                => trunc(p_effective_date)
259     ,p_wf_transaction_category_id    => p_wf_transaction_category_id
260     );
261   --
262   begin
263     --
264     -- Start of API User Hook for the after hook of update_WORKSHEET
265     --
266     pqh_WORKSHEETS_bk2.update_WORKSHEET_a
267       (
268        p_worksheet_id                   =>  p_worksheet_id
269       ,p_budget_id                      =>  p_budget_id
270       ,p_worksheet_name                 =>  p_worksheet_name
271       ,p_version_number                 =>  p_version_number
272       ,p_action_date                    =>  p_action_date
273       ,p_date_from                      =>  p_date_from
274       ,p_date_to                        =>  p_date_to
275       ,p_worksheet_mode_cd              =>  p_worksheet_mode_cd
276       ,p_transaction_status             =>  p_transaction_status
277       ,p_object_version_number          =>  l_object_version_number
278       ,p_budget_version_id              =>  p_budget_version_id
279       ,p_propagation_method             =>  p_propagation_method
280       ,p_effective_date                 =>  trunc(p_effective_date)
281       ,p_wf_transaction_category_id     =>  p_wf_transaction_category_id
282       );
283   exception
284     when hr_api.cannot_find_prog_unit then
285       hr_api.cannot_find_prog_unit_error
286         (p_module_name => 'UPDATE_WORKSHEET'
287         ,p_hook_type   => 'AP'
288         );
289     --
290     -- End of API User Hook for the after hook of update_WORKSHEET
291     --
292   end;
293   --
294   hr_utility.set_location(l_proc, 60);
295   --
296   -- When in validation only mode raise the Validate_Enabled exception
297   --
298   if p_validate then
299     raise hr_api.validate_enabled;
300   end if;
301   --
302   -- Set all output arguments
303   --
304   p_object_version_number := l_object_version_number;
305   --
306   hr_utility.set_location(' Leaving:'||l_proc, 70);
307   --
308 exception
309   --
310   when hr_api.validate_enabled then
311     --
312     -- As the Validate_Enabled exception has been raised
313     -- we must rollback to the savepoint
314     --
315     ROLLBACK TO update_WORKSHEET;
316     --
317     -- Only set output warning arguments
318     -- (Any key or derived arguments must be set to null
319     -- when validation only mode is being used.)
320     --
321     hr_utility.set_location(' Leaving:'||l_proc, 80);
322     --
323   when others then
324     p_object_version_number := l_object_version_number;
325     --
326     -- A validation or unexpected error has occured
327     --
328     ROLLBACK TO update_WORKSHEET;
329     raise;
330     --
331 end update_WORKSHEET;
332 -- ----------------------------------------------------------------------------
333 -- |------------------------< delete_WORKSHEET >----------------------|
334 -- ----------------------------------------------------------------------------
335 --
336 procedure delete_WORKSHEET
337   (p_validate                       in  boolean  default false
338   ,p_worksheet_id                   in  number
339   ,p_object_version_number          in  number
340   ,p_effective_date                 in  date
341   ) is
342   --
343   -- Declare cursors and local variables
344   --
345   l_proc varchar2(72) := g_package||'delete_WORKSHEET';
346   l_object_version_number pqh_worksheets.object_version_number%TYPE;
347   --
348 begin
349   --
350   hr_utility.set_location('Entering:'|| l_proc, 10);
351   --
352   -- Issue a savepoint if operating in validation only mode
353   --
354   savepoint delete_WORKSHEET;
355   --
356   hr_utility.set_location(l_proc, 20);
357   --
358   -- Process Logic
359   --
360   l_object_version_number := p_object_version_number;
361   --
362   --
363   begin
364     --
365     -- Start of API User Hook for the before hook of delete_WORKSHEET
366     --
367     pqh_WORKSHEETS_bk3.delete_WORKSHEET_b
368       (
369        p_worksheet_id                   =>  p_worksheet_id
370       ,p_object_version_number          =>  p_object_version_number
371     ,p_effective_date                      => trunc(p_effective_date)
372       );
373   exception
374     when hr_api.cannot_find_prog_unit then
375       hr_api.cannot_find_prog_unit_error
376         (p_module_name => 'DELETE_WORKSHEET'
377         ,p_hook_type   => 'BP'
378         );
379     --
380     -- End of API User Hook for the before hook of delete_WORKSHEET
381     --
382   end;
383   --
384   pqh_wks_del.del
385     (
386      p_worksheet_id                  => p_worksheet_id
387     ,p_object_version_number         => l_object_version_number
388     ,p_effective_date                => p_effective_date
389     );
390   --
391   begin
392     --
393     -- Start of API User Hook for the after hook of delete_WORKSHEET
394     --
395     pqh_WORKSHEETS_bk3.delete_WORKSHEET_a
396       (
397        p_worksheet_id                   =>  p_worksheet_id
398       ,p_object_version_number          =>  l_object_version_number
399     ,p_effective_date                      => trunc(p_effective_date)
400       );
401   exception
402     when hr_api.cannot_find_prog_unit then
403       hr_api.cannot_find_prog_unit_error
404         (p_module_name => 'DELETE_WORKSHEET'
405         ,p_hook_type   => 'AP'
406         );
407     --
408     -- End of API User Hook for the after hook of delete_WORKSHEET
409     --
410   end;
411   --
412   hr_utility.set_location(l_proc, 60);
413   --
414   -- When in validation only mode raise the Validate_Enabled exception
415   --
416   if p_validate then
417     raise hr_api.validate_enabled;
418   end if;
419   --
420   hr_utility.set_location(' Leaving:'||l_proc, 70);
421   --
422 exception
423   --
424   when hr_api.validate_enabled then
425     --
426     -- As the Validate_Enabled exception has been raised
427     -- we must rollback to the savepoint
428     --
429     ROLLBACK TO delete_WORKSHEET;
430     --
431     -- Only set output warning arguments
432     -- (Any key or derived arguments must be set to null
433     -- when validation only mode is being used.)
434     --
435     --
436   when others then
437     --
438     -- A validation or unexpected error has occured
439     --
440     ROLLBACK TO delete_WORKSHEET;
441     raise;
442     --
443 end delete_WORKSHEET;
444 --
445 -- ----------------------------------------------------------------------------
446 -- |-------------------------------< lck >------------------------------------|
447 -- ----------------------------------------------------------------------------
448 --
449 procedure lck
450   (
451    p_worksheet_id                   in     number
452   ,p_object_version_number          in     number
453   ) is
454   --
455   --
456   -- Declare cursors and local variables
457   --
458   l_proc varchar2(72) := g_package||'lck';
459   --
460 begin
461   --
462   hr_utility.set_location('Entering:'|| l_proc, 10);
463   --
464   pqh_wks_shd.lck
465     (
466       p_worksheet_id                 => p_worksheet_id
467      ,p_object_version_number      => p_object_version_number
468     );
469   --
470   hr_utility.set_location(' Leaving:'||l_proc, 70);
471   --
472 end lck;
473 --
474 end pqh_WORKSHEETS_api;