DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_DE_VLDOPR_API

Source


1 Package Body PQH_DE_VLDOPR_API as
2 /* $Header: pqopsapi.pkb 115.1 2002/12/03 20:41:47 rpasapul noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := 'PQH_DE_VLDOPR_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< Insert_Vldtn_Oprn >--------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure Insert_Vldtn_Oprn
13   (p_validate                      in  boolean  default false
14   ,p_effective_date                in  date
15   ,p_business_group_id             in  number
16   ,P_WRKPLC_VLDTN_VER_ID           In  Number
17   ,P_WRKPLC_OPERATION_ID           In  Number
18   ,P_DESCRIPTION                   In  Varchar2
19   ,P_UNIT_PERCENTAGE               In  Number
20   ,P_WRKPLC_VLDTN_OP_ID            out nocopy Number
21   ,p_object_version_number         out nocopy number) is
22   --
23   -- Declare cursors and local variables
24   --
25 
26   l_proc  varchar2(72)    := g_package||'Insert_Vldtn_Oprn';
27   l_object_Version_Number PQH_DE_WRKPLC_VLDTN_OPS.OBJECT_VERSION_NUMBER%TYPE;
28   L_Effective_Date        Date;
29   l_Wrkplc_vldtn_Op_id   PQH_DE_WRKPLC_VLDTN_OPS.WRKPLC_VLDTN_OP_ID%TYPE;
30 
31 begin
32   hr_utility.set_location('Entering:'|| l_proc, 10);
33   --
34   -- Issue a savepoint
35   --
36   savepoint Insert_Vldtn_Oprn;
37   --
38   -- Truncate the time portion from all IN date parameters
39   --
40      l_effective_date := Trunc(p_effective_Date);
41   --
42   -- Call Before Process User Hook
43   --
44   begin
45    PQH_DE_VLDOPR_BK1.Insert_Vldtn_Oprn_b
46    (p_effective_date             => L_Effective_Date
47    ,p_business_group_id          => p_Business_Group_Id
48    ,P_WRKPLC_VLDTN_VER_ID        => P_Wrkplc_Vldtn_Ver_Id
49    ,P_WRKPLC_OPERATION_ID        => P_Wrkplc_Operation_Id
50    ,P_DESCRIPTION                => P_Description
51    ,P_UNIT_PERCENTAGE            => p_Unit_Percentage);
52 
53 
54   exception
55     when hr_api.cannot_find_prog_unit then
56       hr_api.cannot_find_prog_unit_error
57         (p_module_name => 'Insert_Vldtn_Oprn'
58         ,p_hook_type   => 'BP'
59         );
60   end;
61   --
62   -- Validation in addition to Row Handlers
63   --
64   --
65   -- Process Logic
66      pqh_ops_ins.ins
67      (P_EFFECTIVE_DATE               => l_Effective_date
68      ,P_WRKPLC_VLDTN_VER_ID          => p_Wrkplc_Vldtn_ver_Id
69      ,P_WRKPLC_OPERATION_ID          => P_WRKPLC_OPERATION_ID
70      ,P_BUSINESS_GROUP_ID            => P_BUSINESS_GROUP_ID
71      ,P_DESCRIPTION                  => P_DESCRIPTION
72      ,P_UNIT_PERCENTAGE              => P_UNIT_PERCENTAGE
73      ,P_WRKPLC_VLDTN_OP_ID           => l_WRKPLC_VLDTN_OP_ID
74      ,P_OBJECT_VERSION_NUMBER        => l_OBJECT_VERSION_NUMBER);
75 
76   --
77   -- Call After Process User Hook
78   --
79   begin
80      PQH_DE_VLDOPR_BK1.Insert_Vldtn_Oprn_a
81      (p_effective_date               => l_Effective_Date
82      ,p_business_group_id            => p_Business_group_Id
83      ,p_WRKPLC_VLDTN_VER_ID          => p_WRKPLC_VLDTN_VER_ID
84      ,p_WRKPLC_OPERATION_ID          => p_WRKPLC_OPERATION_ID
85      ,P_DESCRIPTION                  => P_DESCRIPTION
86      ,P_UNIT_PERCENTAGE              => P_UNIT_PERCENTAGE
87      ,P_WRKPLC_VLDTN_OP_ID           => l_WRKPLC_VLDTN_OP_ID
88      ,p_object_version_number        => l_object_version_number);
89 
90   exception
91     when hr_api.cannot_find_prog_unit then
92       hr_api.cannot_find_prog_unit_error
93         (p_module_name => 'Insert_Vldtn_Oprn'
94         ,p_hook_type   => 'AP'
95         );
96   end;
97   --
98   -- When in validation only mode raise the Validate_Enabled exception
99   --
100   if p_validate then
101     raise hr_api.validate_enabled;
102   end if;
103   --
104   -- Set all output arguments
105   --
106   p_wrkplc_vldtn_Op_id     := l_Wrkplc_vldtn_Op_id;
107   p_object_version_number  := l_object_version_number;
108 
109   --
110   hr_utility.set_location(' Leaving:'||l_proc, 70);
111 exception
112   when hr_api.validate_enabled then
113     --
114     -- As the Validate_Enabled exception has been raised
115     -- we must rollback to the savepoint
116     --
117     rollback to Insert_Vldtn_oprn;
118     --
119     -- Only set output warning arguments
120     -- (Any key or derived arguments must be set to null
121     -- when validation only mode is being used.)
122     --
123     p_wrkplc_vldtn_Op_id    := null;
124     p_object_version_number  := null;
125     hr_utility.set_location(' Leaving:'||l_proc, 80);
126 
127   when others then
128     p_wrkplc_vldtn_Op_id    := null;
129     p_object_version_number  := null;
130     --
131     -- A validation or unexpected error has occured
132     --
133     rollback to Insert_Vldtn_oprn;
134     hr_utility.set_location(' Leaving:'||l_proc, 90);
135     raise;
136 end Insert_Vldtn_Oprn;
137 
138 --
139 -- ----------------------------------------------------------------------------
140 -- |--------------------------< Update_Vldtn_Oprn >--------------------------|
141 -- ----------------------------------------------------------------------------
142 
143 procedure Update_Vldtn_Oprn
144   (p_validate                      in  boolean  default false
145   ,p_effective_date                in  date
146   ,p_business_group_id             in  number   Default hr_api.g_Number
147   ,P_WRKPLC_VLDTN_VER_ID           In  Number   Default hr_api.g_Number
148   ,P_WRKPLC_OPERATION_ID           In  Number   Default hr_api.g_Number
149   ,P_DESCRIPTION                   In  Varchar2 Default hr_api.g_Varchar2
150   ,P_UNIT_PERCENTAGE               In  Number   Default hr_api.g_Number
151   ,P_WRKPLC_VLDTN_OP_ID            In  Number
152   ,p_object_version_number         In  out nocopy number) Is
153 
154   l_proc  varchar2(72)    := g_package||'Update_Vldtn_Oprn';
155   l_object_Version_Number PQH_DE_WRKPLC_VLDTN_OPS.OBJECT_VERSION_NUMBER%TYPE := P_Object_version_Number;
156   L_Effective_Date        Date;
157 
158 Begin
159   hr_utility.set_location('Entering:'|| l_proc, 10);
160   --
161   -- Issue a savepoint
162   --
163   savepoint Update_Vldtn_Oprn;
164   --
165   -- Truncate the time portion from all IN date parameters
166   --
167      l_effective_date := Trunc(p_effective_Date);
168   --
169   -- Call Before Process User Hook
170   --
171   begin
172 
173    PQH_DE_VLDOPR_BK2.Update_Vldtn_Oprn_b
174   (p_effective_date                => l_Effective_Date
175   ,p_business_group_id             => p_business_group_id
176   ,p_WRKPLC_VLDTN_VER_ID           => p_Wrkplc_Vldtn_ver_Id
177   ,P_WRKPLC_OPERATION_ID           => P_WRKPLC_OPERATION_ID
178   ,P_DESCRIPTION                   => P_DESCRIPTION
179   ,P_UNIT_PERCENTAGE               => P_UNIT_PERCENTAGE
180   ,P_WRKPLC_VLDTN_OP_ID            => P_WRKPLC_VLDTN_OP_ID
181   ,p_object_version_number         => l_object_version_number);
182 
183  exception
184     when hr_api.cannot_find_prog_unit then
185       hr_api.cannot_find_prog_unit_error
186         (p_module_name => 'Update_Vldtn_Oprn'
187         ,p_hook_type   => 'BP'
188         );
189   end;
190 
191   pqh_Ops_upd.upd
192   (P_EFFECTIVE_DATE       	  => l_Effective_Date
193   ,P_WRKPLC_VLDTN_OP_ID           => P_WRKPLC_VLDTN_OP_ID
194   ,P_OBJECT_VERSION_NUMBER        => l_OBJECT_VERSION_NUMBER
195   ,P_WRKPLC_VLDTN_VER_ID          => P_WRKPLC_VLDTN_VER_ID
196   ,P_WRKPLC_OPERATION_ID          => P_WRKPLC_OPERATION_ID
197   ,P_BUSINESS_GROUP_ID            => P_BUSINESS_GROUP_ID
198   ,P_DESCRIPTION                  => P_DESCRIPTION
199   ,P_UNIT_PERCENTAGE              => P_UNIT_PERCENTAGE);
200 
201 --
202 --
203   -- Call After Process User Hook
204   --
205   begin
206 
207    PQH_DE_VLDOPR_BK2.Update_Vldtn_Oprn_a
208   (p_effective_date                => l_Effective_Date
209   ,p_business_group_id             => p_business_group_id
210   ,p_WRKPLC_VLDTN_VER_ID           => p_Wrkplc_Vldtn_ver_Id
211   ,P_WRKPLC_OPERATION_ID           => P_WRKPLC_OPERATION_ID
212   ,P_DESCRIPTION                   => P_DESCRIPTION
213   ,P_UNIT_PERCENTAGE               => P_UNIT_PERCENTAGE
214   ,P_WRKPLC_VLDTN_OP_ID            => P_WRKPLC_VLDTN_OP_ID
215   ,p_object_version_number         => l_object_version_number);
216 
217   exception
218     when hr_api.cannot_find_prog_unit then
219       hr_api.cannot_find_prog_unit_error
220         (p_module_name => 'Insert_Vldtn_Oprn'
221         ,p_hook_type   => 'AP'
222         );
223   end;
224   --
225   -- When in validation only mode raise the Validate_Enabled exception
226   --
227   if p_validate then
228     raise hr_api.validate_enabled;
229   end if;
230   --
231   -- Set all output arguments
232   --
233 
234   p_object_version_number  := l_object_version_number;
235 
236   --
237   hr_utility.set_location(' Leaving:'||l_proc, 70);
238 exception
239   when hr_api.validate_enabled then
240     --
241     -- As the Validate_Enabled exception has been raised
242     -- we must rollback to the savepoint
243     --
244     rollback to Update_Vldtn_Oprn;
245     --
246     -- Only set output warning arguments
247     -- (Any key or derived arguments must be set to null
248     -- when validation only mode is being used.)
249     --
250     hr_utility.set_location(' Leaving:'||l_proc, 80);
251 
252   when others then
253   p_object_version_number := l_object_version_number;
254     --
255     -- A validation or unexpected error has occured
256     --
257     rollback to Update_Vldtn_oprn;
258     hr_utility.set_location(' Leaving:'||l_proc, 90);
259     raise;
260 end Update_Vldtn_Oprn;
261 
262 --
263 -- ----------------------------------------------------------------------------
264 -- |-------------------< delete_Vldtn_Oprn>------------------------------|
265 -- ----------------------------------------------------------------------------
266 procedure delete_Vldtn_Oprn
267   (p_validate                      in     boolean  default false
268   ,p_WRKPLC_VLDTN_OP_ID            In     Number
269   ,p_object_version_number         In     number) Is   --
270 
271   -- Declare cursors and local variables
272   --
273   l_proc           varchar2(72) := g_package||'delete_Vldtn_Oprn';
274   --
275 begin
276   hr_utility.set_location('Entering:'|| l_proc, 10);
277   --
278   -- Issue a savepoint
279   --
280   savepoint delete_Vldtn_Oprn;
281   --
282   -- Call Before Process User Hook
283   --
284   begin
285   PQH_DE_VLDOPR_BK3.Delete_Vldtn_Oprn_b
286   (p_WRKPLC_VLDTN_OP_ID            =>   p_WRKPLC_VLDTN_OP_ID
287   ,p_object_version_number         =>   p_object_version_number);
288   exception
289     when hr_api.cannot_find_prog_unit then
290       hr_api.cannot_find_prog_unit_error
291         (p_module_name => 'delete_Vldtn_Vern'
292         ,p_hook_type   => 'BP');
293   end;
294   --
295   -- Process Logic
296   --
297   pqh_ops_del.del
298     (p_WRKPLC_VLDTN_OP_ID          =>  p_WRKPLC_VLDTN_Op_ID
299     ,p_object_version_number       =>  p_object_version_number);
300   --
301   -- Call After Process User Hook
302   --
303   begin
304 
305    PQH_DE_VLDOPR_BK3.Delete_Vldtn_Oprn_a
306   (p_WRKPLC_VLDTN_OP_ID            => p_WRKPLC_VLDTN_OP_ID
307   ,p_object_version_number         => p_object_version_number);
308 
309   exception
310     when hr_api.cannot_find_prog_unit then
311       hr_api.cannot_find_prog_unit_error
312         (p_module_name => 'delete_Vldtn_Oprn'
313         ,p_hook_type   => 'AP');
314   end;
315   --
316   -- When in validation only mode raise the Validate_Enabled exception
317   --
318   if p_validate then
319     raise hr_api.validate_enabled;
320   end if;
321   --
325 exception
322   -- Set all output arguments
323   --
324   hr_utility.set_location(' Leaving:'||l_proc, 70);
326   when hr_api.validate_enabled then
327     --
328     -- As the Validate_Enabled exception has been raised
329     -- we must rollback to the savepoint
330     --
331     rollback to delete_Vldtn_Oprn;
332     --
333     -- Only set output warning arguments
334     -- (Any key or derived arguments must be set to null
335     -- when validation only mode is being used.)
336     --
337     hr_utility.set_location(' Leaving:'||l_proc, 80);
338   when others then
339     --
340     -- A validation or unexpected error has occured
341     --
342     rollback to delete_Vldtn_Oprn;
343     hr_utility.set_location(' Leaving:'||l_proc, 90);
344     raise;
345 end delete_Vldtn_Oprn;
346 
347 end PQH_DE_VLDOPR_API;