DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_OPTD_MDCR_RT_API

Source


1 Package Body ben_optd_mdcr_rt_api as
2 /* $Header: beomrapi.pkb 115.1 2002/12/13 08:30:08 bmanyam noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  ben_optd_mdcr_rt_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_OPTD_MDCR_RT >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_optd_mdcr_rt
13   (p_validate                       in  boolean   default false
14   ,p_optd_mdcr_rt_id         out nocopy number
15   ,p_effective_start_date           out nocopy date
16   ,p_effective_end_date             out nocopy date
17   ,p_optd_mdcr_flag                 in  varchar2  default 'N'
18   ,p_exlcd_flag                     in  varchar2  default 'N'
19   ,p_vrbl_rt_prfl_id                  in  number    default null
20   ,p_business_group_id              in  number    default null
21   ,p_omr_attribute_category         in  varchar2  default null
22   ,p_omr_attribute1                 in  varchar2  default null
23   ,p_omr_attribute2                 in  varchar2  default null
24   ,p_omr_attribute3                 in  varchar2  default null
25   ,p_omr_attribute4                 in  varchar2  default null
26   ,p_omr_attribute5                 in  varchar2  default null
27   ,p_omr_attribute6                 in  varchar2  default null
28   ,p_omr_attribute7                 in  varchar2  default null
29   ,p_omr_attribute8                 in  varchar2  default null
30   ,p_omr_attribute9                 in  varchar2  default null
31   ,p_omr_attribute10                in  varchar2  default null
32   ,p_omr_attribute11                in  varchar2  default null
33   ,p_omr_attribute12                in  varchar2  default null
34   ,p_omr_attribute13                in  varchar2  default null
35   ,p_omr_attribute14                in  varchar2  default null
36   ,p_omr_attribute15                in  varchar2  default null
37   ,p_omr_attribute16                in  varchar2  default null
38   ,p_omr_attribute17                in  varchar2  default null
39   ,p_omr_attribute18                in  varchar2  default null
40   ,p_omr_attribute19                in  varchar2  default null
41   ,p_omr_attribute20                in  varchar2  default null
42   ,p_omr_attribute21                in  varchar2  default null
43   ,p_omr_attribute22                in  varchar2  default null
44   ,p_omr_attribute23                in  varchar2  default null
45   ,p_omr_attribute24                in  varchar2  default null
46   ,p_omr_attribute25                in  varchar2  default null
47   ,p_omr_attribute26                in  varchar2  default null
48   ,p_omr_attribute27                in  varchar2  default null
49   ,p_omr_attribute28                in  varchar2  default null
50   ,p_omr_attribute29                in  varchar2  default null
51   ,p_omr_attribute30                in  varchar2  default null
52   ,p_object_version_number          out nocopy number
53   ,p_effective_date                 in  date
54   ) is
55   --
56   -- Declare cursors and local variables
57   --
58   l_optd_mdcr_rt_id ben_optd_mdcr_rt_f.optd_mdcr_rt_id%type;
59   l_effective_start_date ben_optd_mdcr_rt_f.effective_start_date%type;
60   l_effective_end_date ben_optd_mdcr_rt_f.effective_end_date%type;
61   l_proc varchar2(72) := g_package||'create_optd_mdcr_rt';
62   l_object_version_number ben_optd_mdcr_rt_f.object_version_number%type;
63   --
64 begin
65   --
66   hr_utility.set_location('Entering:'|| l_proc, 10);
67   --
68   -- Issue a savepoint if operating in validation only mode
69   --
70   savepoint create_OPTD_MDCR_RT;
71   --
72   hr_utility.set_location(l_proc, 20);
73   --
74   -- Process Logic
75   --
76   begin
77     --
78     -- Start of API User Hook for the before hook of create_OPTD_MDCR_RT
79     --
80     ben_OPTD_MDCR_RT_bk1.create_OPTD_MDCR_RT_b
81       (
82        p_optd_mdcr_flag                 =>  p_optd_mdcr_flag
83       ,p_exlcd_flag                     =>  p_exlcd_flag
84       ,p_vrbl_rt_prfl_id                  =>  p_vrbl_rt_prfl_id
85       ,p_business_group_id              =>  p_business_group_id
86       ,p_omr_attribute_category         =>  p_omr_attribute_category
87       ,p_omr_attribute1                 =>  p_omr_attribute1
88       ,p_omr_attribute2                 =>  p_omr_attribute2
89       ,p_omr_attribute3                 =>  p_omr_attribute3
90       ,p_omr_attribute4                 =>  p_omr_attribute4
91       ,p_omr_attribute5                 =>  p_omr_attribute5
92       ,p_omr_attribute6                 =>  p_omr_attribute6
93       ,p_omr_attribute7                 =>  p_omr_attribute7
94       ,p_omr_attribute8                 =>  p_omr_attribute8
95       ,p_omr_attribute9                 =>  p_omr_attribute9
96       ,p_omr_attribute10                =>  p_omr_attribute10
97       ,p_omr_attribute11                =>  p_omr_attribute11
98       ,p_omr_attribute12                =>  p_omr_attribute12
99       ,p_omr_attribute13                =>  p_omr_attribute13
100       ,p_omr_attribute14                =>  p_omr_attribute14
101       ,p_omr_attribute15                =>  p_omr_attribute15
102       ,p_omr_attribute16                =>  p_omr_attribute16
103       ,p_omr_attribute17                =>  p_omr_attribute17
104       ,p_omr_attribute18                =>  p_omr_attribute18
105       ,p_omr_attribute19                =>  p_omr_attribute19
106       ,p_omr_attribute20                =>  p_omr_attribute20
107       ,p_omr_attribute21                =>  p_omr_attribute21
108       ,p_omr_attribute22                =>  p_omr_attribute22
109       ,p_omr_attribute23                =>  p_omr_attribute23
110       ,p_omr_attribute24                =>  p_omr_attribute24
111       ,p_omr_attribute25                =>  p_omr_attribute25
112       ,p_omr_attribute26                =>  p_omr_attribute26
113       ,p_omr_attribute27                =>  p_omr_attribute27
114       ,p_omr_attribute28                =>  p_omr_attribute28
115       ,p_omr_attribute29                =>  p_omr_attribute29
116       ,p_omr_attribute30                =>  p_omr_attribute30
117       ,p_effective_date                 => trunc(p_effective_date)
118       );
119   exception
120     when hr_api.cannot_find_prog_unit then
121       hr_api.cannot_find_prog_unit_error
122         (
123          p_module_name => 'CREATE_OPTD_MDCR_RT'
124         ,p_hook_type   => 'BP'
125         );
126     --
127     -- End of API User Hook for the before hook of create_OPTD_MDCR_RT
128     --
129   end;
130   --
131   ben_omr_ins.ins
132     (
133      p_OPTD_MDCR_RT_id        => l_OPTD_MDCR_RT_id
134     ,p_effective_start_date          => l_effective_start_date
135     ,p_effective_end_date            => l_effective_end_date
136     ,p_optd_mdcr_flag                => p_optd_mdcr_flag
137     ,p_exlcd_flag                    => p_exlcd_flag
138     ,p_vrbl_rt_prfl_id                 => p_vrbl_rt_prfl_id
139     ,p_business_group_id             => p_business_group_id
140     ,p_omr_attribute_category        => p_omr_attribute_category
141     ,p_omr_attribute1                => p_omr_attribute1
142     ,p_omr_attribute2                => p_omr_attribute2
143     ,p_omr_attribute3                => p_omr_attribute3
144     ,p_omr_attribute4                => p_omr_attribute4
145     ,p_omr_attribute5                => p_omr_attribute5
146     ,p_omr_attribute6                => p_omr_attribute6
147     ,p_omr_attribute7                => p_omr_attribute7
148     ,p_omr_attribute8                => p_omr_attribute8
149     ,p_omr_attribute9                => p_omr_attribute9
150     ,p_omr_attribute10               => p_omr_attribute10
151     ,p_omr_attribute11               => p_omr_attribute11
152     ,p_omr_attribute12               => p_omr_attribute12
153     ,p_omr_attribute13               => p_omr_attribute13
154     ,p_omr_attribute14               => p_omr_attribute14
155     ,p_omr_attribute15               => p_omr_attribute15
156     ,p_omr_attribute16               => p_omr_attribute16
157     ,p_omr_attribute17               => p_omr_attribute17
158     ,p_omr_attribute18               => p_omr_attribute18
159     ,p_omr_attribute19               => p_omr_attribute19
160     ,p_omr_attribute20               => p_omr_attribute20
161     ,p_omr_attribute21               => p_omr_attribute21
162     ,p_omr_attribute22               => p_omr_attribute22
163     ,p_omr_attribute23               => p_omr_attribute23
164     ,p_omr_attribute24               => p_omr_attribute24
165     ,p_omr_attribute25               => p_omr_attribute25
166     ,p_omr_attribute26               => p_omr_attribute26
167     ,p_omr_attribute27               => p_omr_attribute27
168     ,p_omr_attribute28               => p_omr_attribute28
169     ,p_omr_attribute29               => p_omr_attribute29
170     ,p_omr_attribute30               => p_omr_attribute30
171     ,p_object_version_number         => l_object_version_number
172     ,p_effective_date                => trunc(p_effective_date)
173     );
174   --
175   begin
176     --
177     -- Start of API User Hook for the after hook of create_OPTD_MDCR_RT
178     --
179     ben_OPTD_MDCR_RT_bk1.create_OPTD_MDCR_RT_a
180       (
181        p_OPTD_MDCR_RT_id         =>  l_OPTD_MDCR_RT_id
182       ,p_effective_start_date           =>  l_effective_start_date
183       ,p_effective_end_date             =>  l_effective_end_date
184       ,p_optd_mdcr_flag                 =>  p_optd_mdcr_flag
185       ,p_exlcd_flag                     =>  p_exlcd_flag
186       ,p_vrbl_rt_prfl_id                  =>  p_vrbl_rt_prfl_id
187       ,p_business_group_id              =>  p_business_group_id
188       ,p_omr_attribute_category         =>  p_omr_attribute_category
189       ,p_omr_attribute1                 =>  p_omr_attribute1
190       ,p_omr_attribute2                 =>  p_omr_attribute2
191       ,p_omr_attribute3                 =>  p_omr_attribute3
192       ,p_omr_attribute4                 =>  p_omr_attribute4
193       ,p_omr_attribute5                 =>  p_omr_attribute5
194       ,p_omr_attribute6                 =>  p_omr_attribute6
195       ,p_omr_attribute7                 =>  p_omr_attribute7
196       ,p_omr_attribute8                 =>  p_omr_attribute8
197       ,p_omr_attribute9                 =>  p_omr_attribute9
198       ,p_omr_attribute10                =>  p_omr_attribute10
199       ,p_omr_attribute11                =>  p_omr_attribute11
200       ,p_omr_attribute12                =>  p_omr_attribute12
201       ,p_omr_attribute13                =>  p_omr_attribute13
202       ,p_omr_attribute14                =>  p_omr_attribute14
203       ,p_omr_attribute15                =>  p_omr_attribute15
204       ,p_omr_attribute16                =>  p_omr_attribute16
205       ,p_omr_attribute17                =>  p_omr_attribute17
206       ,p_omr_attribute18                =>  p_omr_attribute18
207       ,p_omr_attribute19                =>  p_omr_attribute19
208       ,p_omr_attribute20                =>  p_omr_attribute20
209       ,p_omr_attribute21                =>  p_omr_attribute21
210       ,p_omr_attribute22                =>  p_omr_attribute22
211       ,p_omr_attribute23                =>  p_omr_attribute23
212       ,p_omr_attribute24                =>  p_omr_attribute24
213       ,p_omr_attribute25                =>  p_omr_attribute25
214       ,p_omr_attribute26                =>  p_omr_attribute26
215       ,p_omr_attribute27                =>  p_omr_attribute27
216       ,p_omr_attribute28                =>  p_omr_attribute28
217       ,p_omr_attribute29                =>  p_omr_attribute29
218       ,p_omr_attribute30                =>  p_omr_attribute30
219       ,p_object_version_number          =>  l_object_version_number
220       ,p_effective_date                      => trunc(p_effective_date)
221       );
222   exception
223     when hr_api.cannot_find_prog_unit then
224       hr_api.cannot_find_prog_unit_error
225         (p_module_name => 'CREATE_OPTD_MDCR_RT'
226         ,p_hook_type   => 'AP'
227         );
228     --
229     -- End of API User Hook for the after hook of create_OPTD_MDCR_RT
230     --
231   end;
232   --
233   ben_profile_handler.event_handler
234     (p_event                       => 'CREATE',
235      p_base_table                  => 'BEN_VRBL_RT_PRFL_F',
236      p_base_table_column           => 'vrbl_rt_prfl_id',
237      p_base_table_column_value     =>  p_vrbl_rt_prfl_id,
238      p_base_table_reference_column => 'RT_OPTD_MDCR_FLAG',
239      p_reference_table             => 'BEN_OPTD_MDCR_RT_F',
240      p_reference_table_column      => 'vrbl_rt_prfl_id');
241   --
242   hr_utility.set_location(l_proc, 60);
243   --
244   -- When in validation only mode raise the Validate_Enabled exception
245   --
246   if p_validate then
247     raise hr_api.validate_enabled;
248   end if;
249   --
250   -- Set all output arguments
251   --
252   p_OPTD_MDCR_RT_id := l_OPTD_MDCR_RT_id;
253   p_effective_start_date := l_effective_start_date;
254   p_effective_end_date := l_effective_end_date;
255   p_object_version_number := l_object_version_number;
256   --
257   hr_utility.set_location(' Leaving:'||l_proc, 70);
258   --
259 exception
260   --
261   when hr_api.validate_enabled then
262     --
263     -- As the Validate_Enabled exception has been raised
264     -- we must rollback to the savepoint
265     --
266     ROLLBACK TO create_OPTD_MDCR_RT;
267     --
268     -- Only set output warning arguments
269     -- (Any key or derived arguments must be set to null
270     -- when validation only mode is being used.)
271     --
272     p_OPTD_MDCR_RT_id := null;
273     p_effective_start_date := null;
274     p_effective_end_date := null;
275     p_object_version_number  := null;
276     hr_utility.set_location(' Leaving:'||l_proc, 80);
277     --
278   when others then
279     --
280     -- A validation or unexpected error has occured
281     --
282     ROLLBACK TO create_OPTD_MDCR_RT;
283     -- NOCOPY Changes
284     p_OPTD_MDCR_RT_id := null;
285     p_effective_start_date := null;
286     p_effective_end_date := null;
287     p_object_version_number  := null;
288     -- NOCOPY Changes
289 
290     raise;
291     --
292 end create_OPTD_MDCR_RT;
293 -- ----------------------------------------------------------------------------
294 -- |------------------------< update_OPTD_MDCR_RT >--- ------------------|
295 -- ----------------------------------------------------------------------------
296 --
297 procedure update_OPTD_MDCR_RT
298   (p_validate                       in  boolean   default false
299   ,p_OPTD_MDCR_RT_id         in  number
300   ,p_effective_start_date           out nocopy date
301   ,p_effective_end_date             out nocopy date
302   ,p_optd_mdcr_flag                 in  varchar2  default hr_api.g_varchar2
303   ,p_exlcd_flag                     in  varchar2  default hr_api.g_varchar2
304   ,p_vrbl_rt_prfl_id                  in  number    default hr_api.g_number
305   ,p_business_group_id              in  number    default hr_api.g_number
306   ,p_omr_attribute_category         in  varchar2  default hr_api.g_varchar2
307   ,p_omr_attribute1                 in  varchar2  default hr_api.g_varchar2
308   ,p_omr_attribute2                 in  varchar2  default hr_api.g_varchar2
309   ,p_omr_attribute3                 in  varchar2  default hr_api.g_varchar2
310   ,p_omr_attribute4                 in  varchar2  default hr_api.g_varchar2
311   ,p_omr_attribute5                 in  varchar2  default hr_api.g_varchar2
312   ,p_omr_attribute6                 in  varchar2  default hr_api.g_varchar2
313   ,p_omr_attribute7                 in  varchar2  default hr_api.g_varchar2
314   ,p_omr_attribute8                 in  varchar2  default hr_api.g_varchar2
315   ,p_omr_attribute9                 in  varchar2  default hr_api.g_varchar2
316   ,p_omr_attribute10                in  varchar2  default hr_api.g_varchar2
317   ,p_omr_attribute11                in  varchar2  default hr_api.g_varchar2
318   ,p_omr_attribute12                in  varchar2  default hr_api.g_varchar2
319   ,p_omr_attribute13                in  varchar2  default hr_api.g_varchar2
320   ,p_omr_attribute14                in  varchar2  default hr_api.g_varchar2
321   ,p_omr_attribute15                in  varchar2  default hr_api.g_varchar2
322   ,p_omr_attribute16                in  varchar2  default hr_api.g_varchar2
323   ,p_omr_attribute17                in  varchar2  default hr_api.g_varchar2
324   ,p_omr_attribute18                in  varchar2  default hr_api.g_varchar2
325   ,p_omr_attribute19                in  varchar2  default hr_api.g_varchar2
326   ,p_omr_attribute20                in  varchar2  default hr_api.g_varchar2
327   ,p_omr_attribute21                in  varchar2  default hr_api.g_varchar2
328   ,p_omr_attribute22                in  varchar2  default hr_api.g_varchar2
329   ,p_omr_attribute23                in  varchar2  default hr_api.g_varchar2
330   ,p_omr_attribute24                in  varchar2  default hr_api.g_varchar2
331   ,p_omr_attribute25                in  varchar2  default hr_api.g_varchar2
332   ,p_omr_attribute26                in  varchar2  default hr_api.g_varchar2
333   ,p_omr_attribute27                in  varchar2  default hr_api.g_varchar2
334   ,p_omr_attribute28                in  varchar2  default hr_api.g_varchar2
335   ,p_omr_attribute29                in  varchar2  default hr_api.g_varchar2
336   ,p_omr_attribute30                in  varchar2  default hr_api.g_varchar2
337   ,p_object_version_number          in out nocopy number
338   ,p_effective_date                 in  date
339   ,p_datetrack_mode                 in  varchar2
340   ) is
341   --
342   -- Declare cursors and local variables
343   --
344   l_proc varchar2(72) := g_package||'update_OPTD_MDCR_RT';
345   l_object_version_number ben_OPTD_MDCR_RT_f.object_version_number%TYPE;
346   l_effective_start_date ben_OPTD_MDCR_RT_f.effective_start_date%TYPE;
347   l_effective_end_date ben_OPTD_MDCR_RT_f.effective_end_date%TYPE;
348   --
349 begin
350   --
351   hr_utility.set_location('Entering:'|| l_proc, 10);
352   --
353   -- Issue a savepoint if operating in validation only mode
354   --
355   savepoint update_OPTD_MDCR_RT;
356   --
357   hr_utility.set_location(l_proc, 20);
358   --
359   -- Process Logic
360   --
361   l_object_version_number := p_object_version_number;
362   --
363   begin
364     --
365     -- Start of API User Hook for the before hook of update_OPTD_MDCR_RT
366     --
367     ben_OPTD_MDCR_RT_bk2.update_OPTD_MDCR_RT_b
368       (
369        p_OPTD_MDCR_RT_id         =>  p_OPTD_MDCR_RT_id
370       ,p_optd_mdcr_flag                 =>  p_optd_mdcr_flag
371       ,p_exlcd_flag                     =>  p_exlcd_flag
372       ,p_vrbl_rt_prfl_id                  =>  p_vrbl_rt_prfl_id
373       ,p_business_group_id              =>  p_business_group_id
374       ,p_omr_attribute_category         =>  p_omr_attribute_category
375       ,p_omr_attribute1                 =>  p_omr_attribute1
376       ,p_omr_attribute2                 =>  p_omr_attribute2
377       ,p_omr_attribute3                 =>  p_omr_attribute3
378       ,p_omr_attribute4                 =>  p_omr_attribute4
379       ,p_omr_attribute5                 =>  p_omr_attribute5
380       ,p_omr_attribute6                 =>  p_omr_attribute6
381       ,p_omr_attribute7                 =>  p_omr_attribute7
382       ,p_omr_attribute8                 =>  p_omr_attribute8
383       ,p_omr_attribute9                 =>  p_omr_attribute9
384       ,p_omr_attribute10                =>  p_omr_attribute10
385       ,p_omr_attribute11                =>  p_omr_attribute11
386       ,p_omr_attribute12                =>  p_omr_attribute12
387       ,p_omr_attribute13                =>  p_omr_attribute13
388       ,p_omr_attribute14                =>  p_omr_attribute14
389       ,p_omr_attribute15                =>  p_omr_attribute15
390       ,p_omr_attribute16                =>  p_omr_attribute16
391       ,p_omr_attribute17                =>  p_omr_attribute17
392       ,p_omr_attribute18                =>  p_omr_attribute18
393       ,p_omr_attribute19                =>  p_omr_attribute19
394       ,p_omr_attribute20                =>  p_omr_attribute20
395       ,p_omr_attribute21                =>  p_omr_attribute21
396       ,p_omr_attribute22                =>  p_omr_attribute22
397       ,p_omr_attribute23                =>  p_omr_attribute23
398       ,p_omr_attribute24                =>  p_omr_attribute24
399       ,p_omr_attribute25                =>  p_omr_attribute25
400       ,p_omr_attribute26                =>  p_omr_attribute26
401       ,p_omr_attribute27                =>  p_omr_attribute27
402       ,p_omr_attribute28                =>  p_omr_attribute28
403       ,p_omr_attribute29                =>  p_omr_attribute29
404       ,p_omr_attribute30                =>  p_omr_attribute30
405       ,p_object_version_number          =>  p_object_version_number
406     ,p_effective_date                      => trunc(p_effective_date)
407     ,p_datetrack_mode                      => p_datetrack_mode
408       );
409   exception
410     when hr_api.cannot_find_prog_unit then
411       hr_api.cannot_find_prog_unit_error
412         (p_module_name => 'UPDATE_OPTD_MDCR_RT'
413         ,p_hook_type   => 'BP'
414         );
415     --
416     -- End of API User Hook for the before hook of update_OPTD_MDCR_RT
417     --
418   end;
419   --
420   ben_omr_upd.upd
421     (
422      p_OPTD_MDCR_RT_id        => p_OPTD_MDCR_RT_id
423     ,p_effective_start_date          => l_effective_start_date
424     ,p_effective_end_date            => l_effective_end_date
425     ,p_optd_mdcr_flag                => p_optd_mdcr_flag
426     ,p_exlcd_flag                    => p_exlcd_flag
427     ,p_vrbl_rt_prfl_id                 => p_vrbl_rt_prfl_id
428     ,p_business_group_id             => p_business_group_id
429     ,p_omr_attribute_category        => p_omr_attribute_category
430     ,p_omr_attribute1                => p_omr_attribute1
431     ,p_omr_attribute2                => p_omr_attribute2
432     ,p_omr_attribute3                => p_omr_attribute3
433     ,p_omr_attribute4                => p_omr_attribute4
434     ,p_omr_attribute5                => p_omr_attribute5
435     ,p_omr_attribute6                => p_omr_attribute6
436     ,p_omr_attribute7                => p_omr_attribute7
437     ,p_omr_attribute8                => p_omr_attribute8
438     ,p_omr_attribute9                => p_omr_attribute9
439     ,p_omr_attribute10               => p_omr_attribute10
440     ,p_omr_attribute11               => p_omr_attribute11
441     ,p_omr_attribute12               => p_omr_attribute12
442     ,p_omr_attribute13               => p_omr_attribute13
443     ,p_omr_attribute14               => p_omr_attribute14
444     ,p_omr_attribute15               => p_omr_attribute15
445     ,p_omr_attribute16               => p_omr_attribute16
446     ,p_omr_attribute17               => p_omr_attribute17
447     ,p_omr_attribute18               => p_omr_attribute18
448     ,p_omr_attribute19               => p_omr_attribute19
449     ,p_omr_attribute20               => p_omr_attribute20
450     ,p_omr_attribute21               => p_omr_attribute21
451     ,p_omr_attribute22               => p_omr_attribute22
452     ,p_omr_attribute23               => p_omr_attribute23
453     ,p_omr_attribute24               => p_omr_attribute24
454     ,p_omr_attribute25               => p_omr_attribute25
455     ,p_omr_attribute26               => p_omr_attribute26
456     ,p_omr_attribute27               => p_omr_attribute27
457     ,p_omr_attribute28               => p_omr_attribute28
458     ,p_omr_attribute29               => p_omr_attribute29
459     ,p_omr_attribute30               => p_omr_attribute30
460     ,p_object_version_number         => l_object_version_number
461     ,p_effective_date                => trunc(p_effective_date)
462     ,p_datetrack_mode                => p_datetrack_mode
463     );
464   --
465   begin
466     --
467     -- Start of API User Hook for the after hook of update_OPTD_MDCR_RT
468     --
469     ben_OPTD_MDCR_RT_bk2.update_OPTD_MDCR_RT_a
470       (
471        p_OPTD_MDCR_RT_id         =>  p_OPTD_MDCR_RT_id
472       ,p_effective_start_date           =>  l_effective_start_date
473       ,p_effective_end_date             =>  l_effective_end_date
474       ,p_optd_mdcr_flag                 =>  p_optd_mdcr_flag
475       ,p_exlcd_flag                     =>  p_exlcd_flag
476       ,p_vrbl_rt_prfl_id                  =>  p_vrbl_rt_prfl_id
477       ,p_business_group_id              =>  p_business_group_id
478       ,p_omr_attribute_category         =>  p_omr_attribute_category
479       ,p_omr_attribute1                 =>  p_omr_attribute1
480       ,p_omr_attribute2                 =>  p_omr_attribute2
481       ,p_omr_attribute3                 =>  p_omr_attribute3
482       ,p_omr_attribute4                 =>  p_omr_attribute4
483       ,p_omr_attribute5                 =>  p_omr_attribute5
484       ,p_omr_attribute6                 =>  p_omr_attribute6
485       ,p_omr_attribute7                 =>  p_omr_attribute7
486       ,p_omr_attribute8                 =>  p_omr_attribute8
487       ,p_omr_attribute9                 =>  p_omr_attribute9
488       ,p_omr_attribute10                =>  p_omr_attribute10
489       ,p_omr_attribute11                =>  p_omr_attribute11
490       ,p_omr_attribute12                =>  p_omr_attribute12
491       ,p_omr_attribute13                =>  p_omr_attribute13
492       ,p_omr_attribute14                =>  p_omr_attribute14
493       ,p_omr_attribute15                =>  p_omr_attribute15
494       ,p_omr_attribute16                =>  p_omr_attribute16
495       ,p_omr_attribute17                =>  p_omr_attribute17
496       ,p_omr_attribute18                =>  p_omr_attribute18
497       ,p_omr_attribute19                =>  p_omr_attribute19
498       ,p_omr_attribute20                =>  p_omr_attribute20
499       ,p_omr_attribute21                =>  p_omr_attribute21
500       ,p_omr_attribute22                =>  p_omr_attribute22
501       ,p_omr_attribute23                =>  p_omr_attribute23
502       ,p_omr_attribute24                =>  p_omr_attribute24
503       ,p_omr_attribute25                =>  p_omr_attribute25
504       ,p_omr_attribute26                =>  p_omr_attribute26
505       ,p_omr_attribute27                =>  p_omr_attribute27
506       ,p_omr_attribute28                =>  p_omr_attribute28
507       ,p_omr_attribute29                =>  p_omr_attribute29
508       ,p_omr_attribute30                =>  p_omr_attribute30
509       ,p_object_version_number          =>  l_object_version_number
510       ,p_effective_date                     => trunc(p_effective_date)
511       ,p_datetrack_mode                     => p_datetrack_mode
512       );
513   exception
514     when hr_api.cannot_find_prog_unit then
515       hr_api.cannot_find_prog_unit_error
516         (p_module_name => 'UPDATE_OPTD_MDCR_RT'
517         ,p_hook_type   => 'AP'
518         );
519     --
520     -- End of API User Hook for the after hook of update_OPTD_MDCR_RT
521     --
522   end;
523   --
524   hr_utility.set_location(l_proc, 60);
525   --
526   -- When in validation only mode raise the Validate_Enabled exception
527   --
528   if p_validate then
529     raise hr_api.validate_enabled;
530   end if;
531   --
532   -- Set all output arguments
533   --
534   p_object_version_number := l_object_version_number;
535   p_effective_start_date := l_effective_start_date;
536   p_effective_end_date := l_effective_end_date;
537   --
538   hr_utility.set_location(' Leaving:'||l_proc, 70);
539   --
540 exception
541   --
542   when hr_api.validate_enabled then
543     --
544     -- As the Validate_Enabled exception has been raised
545     -- we must rollback to the savepoint
546     --
547     ROLLBACK TO update_OPTD_MDCR_RT;
548     --
549 	-- NOCOPY Changes
550     p_effective_start_date := null;
551     p_effective_end_date := null;
552     -- NOCOPY Changes
553 
554     -- Only set output warning arguments
555     -- (Any key or derived arguments must be set to null
556     -- when validation only mode is being used.)
557     --
558     hr_utility.set_location(' Leaving:'||l_proc, 80);
559     --
560   when others then
561     --
562     -- A validation or unexpected error has occured
563     --
564     ROLLBACK TO update_OPTD_MDCR_RT;
565     -- NOCOPY Changes
566     p_effective_start_date := null;
567     p_effective_end_date := null;
568     -- NOCOPY Changes
569 
570     raise;
571     --
572 end update_OPTD_MDCR_RT;
573 -- ----------------------------------------------------------------------------
574 -- |------------------------< delete_OPTD_MDCR_RT >----------------------|
575 -- ----------------------------------------------------------------------------
576 --
577 procedure delete_OPTD_MDCR_RT
578   (p_validate                       in  boolean  default false
579   ,p_OPTD_MDCR_RT_id         in  number
580   ,p_effective_start_date           out nocopy date
581   ,p_effective_end_date             out nocopy date
582   ,p_object_version_number          in out nocopy number
583   ,p_effective_date                 in  date
584   ,p_datetrack_mode                 in  varchar2
585   ) is
586   --
587   -- Declare cursors and local variables
588   --
589   l_proc varchar2(72) := g_package||'update_OPTD_MDCR_RT';
590   l_object_version_number ben_OPTD_MDCR_RT_f.object_version_number%TYPE;
591   l_effective_start_date ben_OPTD_MDCR_RT_f.effective_start_date%TYPE;
592   l_effective_end_date ben_OPTD_MDCR_RT_f.effective_end_date%TYPE;
593   --
594 begin
595   --
596   hr_utility.set_location('Entering:'|| l_proc, 10);
597   --
598   -- Issue a savepoint if operating in validation only mode
599   --
600   savepoint delete_OPTD_MDCR_RT;
601   --
602   hr_utility.set_location(l_proc, 20);
603   --
604   -- Process Logic
605   --
606   l_object_version_number := p_object_version_number;
607   --
608   --
609   begin
610     --
611     -- Start of API User Hook for the before hook of delete_OPTD_MDCR_RT
612     --
613     ben_OPTD_MDCR_RT_bk3.delete_OPTD_MDCR_RT_b
614       (
615        p_OPTD_MDCR_RT_id         =>  p_OPTD_MDCR_RT_id
616       ,p_object_version_number          =>  p_object_version_number
617     ,p_effective_date                      => trunc(p_effective_date)
618     ,p_datetrack_mode                      => p_datetrack_mode
619       );
620   exception
621     when hr_api.cannot_find_prog_unit then
622       hr_api.cannot_find_prog_unit_error
623         (p_module_name => 'DELETE_OPTD_MDCR_RT'
624         ,p_hook_type   => 'BP'
625         );
626     --
627     -- End of API User Hook for the before hook of delete_OPTD_MDCR_RT
628     --
629   end;
630   --
631   ben_omr_del.del
632     (
633      p_OPTD_MDCR_RT_id        => p_OPTD_MDCR_RT_id
634     ,p_effective_start_date          => l_effective_start_date
635     ,p_effective_end_date            => l_effective_end_date
636     ,p_object_version_number         => l_object_version_number
637     ,p_effective_date                => p_effective_date
638     ,p_datetrack_mode                => p_datetrack_mode
639     );
640   --
641   begin
642     --
643     -- Start of API User Hook for the after hook of delete_OPTD_MDCR_RT
644     --
645     ben_OPTD_MDCR_RT_bk3.delete_OPTD_MDCR_RT_a
646       (
647        p_OPTD_MDCR_RT_id         =>  p_OPTD_MDCR_RT_id
648       ,p_effective_start_date           =>  l_effective_start_date
649       ,p_effective_end_date             =>  l_effective_end_date
650       ,p_object_version_number          =>  l_object_version_number
651     ,p_effective_date                      => trunc(p_effective_date)
652     ,p_datetrack_mode                      => p_datetrack_mode
653       );
654   exception
655     when hr_api.cannot_find_prog_unit then
656       hr_api.cannot_find_prog_unit_error
657         (p_module_name => 'DELETE_OPTD_MDCR_RT'
658         ,p_hook_type   => 'AP'
659         );
660     --
661     -- End of API User Hook for the after hook of delete_OPTD_MDCR_RT
662     --
663   end;
664   --
665   ben_profile_handler.event_handler
666     (p_event                       => 'DELETE',
667      p_base_table                  => 'BEN_VRBL_RT_PRFL_F',
668      p_base_table_column           => 'vrbl_rt_prfl_id',
669      p_base_table_column_value     => ben_omr_shd.g_old_rec.vrbl_rt_prfl_id,
670      p_base_table_reference_column => 'RT_OPTD_MDCR_FLAG',
671      p_reference_table             => 'BEN_OPTD_MDCR_RT_F',
672      p_reference_table_column      => 'vrbl_rt_prfl_id');
673   --
674   hr_utility.set_location(l_proc, 60);
675   --
676   -- When in validation only mode raise the Validate_Enabled exception
677   --
678   if p_validate then
679     raise hr_api.validate_enabled;
680   end if;
681   --
682   hr_utility.set_location(' Leaving:'||l_proc, 70);
683   --
684 exception
685   --
686   when hr_api.validate_enabled then
687     --
688     -- As the Validate_Enabled exception has been raised
689     -- we must rollback to the savepoint
690     --
691     ROLLBACK TO delete_optd_mdcr_rt;
692     --
693     -- Only set output warning arguments
694     -- (Any key or derived arguments must be set to null
695     -- when validation only mode is being used.)
696     --
697     p_effective_start_date := null;
698     p_effective_end_date := null;
699     --
700   when others then
701     --
702     -- A validation or unexpected error has occured
703     --
704     ROLLBACK TO delete_OPTD_MDCR_RT;
705     -- NOCOPY Changes
706     p_effective_start_date := null;
707     p_effective_end_date := null;
708     -- NOCOPY Changes
709 
710     raise;
711     --
712 end delete_OPTD_MDCR_RT;
713 --
714 -- ----------------------------------------------------------------------------
715 -- |-------------------------------< lck >------------------------------------|
716 -- ----------------------------------------------------------------------------
717 --
718 procedure lck
719   (
720    p_OPTD_MDCR_RT_id                   in     number
721   ,p_object_version_number          in     number
722   ,p_effective_date                 in     date
723   ,p_datetrack_mode                 in     varchar2
724   ,p_validation_start_date          out nocopy    date
725   ,p_validation_end_date            out nocopy    date
726   ) is
727   --
728   --
729   -- Declare cursors and local variables
730   --
731   l_proc varchar2(72) := g_package||'lck';
732   l_validation_start_date date;
733   l_validation_end_date date;
734   --
735 begin
736   --
737   hr_utility.set_location('Entering:'|| l_proc, 10);
738   --
739   ben_omr_shd.lck
740     (
741       p_OPTD_MDCR_RT_id                 => p_OPTD_MDCR_RT_id
742      ,p_validation_start_date      => l_validation_start_date
743      ,p_validation_end_date        => l_validation_end_date
744      ,p_object_version_number      => p_object_version_number
745      ,p_effective_date             => p_effective_date
746      ,p_datetrack_mode             => p_datetrack_mode
747     );
748   --
749   hr_utility.set_location(' Leaving:'||l_proc, 70);
750   --
751 end lck;
752 --
753 end ben_OPTD_MDCR_RT_api;