DBA Data[Home] [Help]

PACKAGE BODY: APPS.BEN_TTL_PRTT_RT_API

Source


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