[Home] [Help]
PACKAGE BODY: APPS.IRC_VARIABLE_COMP_ELEMENT_API
Source
1 Package Body IRC_VARIABLE_COMP_ELEMENT_API as
2 /* $Header: irvceapi.pkb 120.0 2005/07/26 15:19:06 mbocutt noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := ' IRC_VARIABLE_COMP_ELEMENT_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------< CREATE_VARIABLE_COMPENSATION >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure CREATE_VARIABLE_COMPENSATION
13 (p_validate in boolean default false
14 ,p_vacancy_id in number
15 ,p_variable_comp_lookup in varchar2
16 ,p_effective_date in date
17 ,p_object_version_number out nocopy number
18 ) is
19 --
20 -- Declare cursors and local variables
21 --
22
23 l_proc varchar2(72) := g_package||'CREATE_VARIABLE_COMPENSATION';
24 l_object_version_number number;
25 l_effective_date date;
26 begin
27 hr_utility.set_location('Entering:'|| l_proc, 10);
28 --
29 -- Issue a savepoint
30 --
31 savepoint CREATE_VARIABLE_COMPENSATION;
32 --
33 -- Truncate the time portion from all IN date parameters
34 --
35 l_effective_date := trunc(p_effective_date);
36 --
37 -- Call Before Process User Hook
38 --
39 begin
40 IRC_VARIABLE_COMP_ELEMENT_BK1.CREATE_VARIABLE_COMPENSATION_B
41 (p_vacancy_id => p_vacancy_id
42 ,p_variable_comp_lookup => p_variable_comp_lookup
43 ,p_effective_date => l_effective_date
44 );
45 exception
46 when hr_api.cannot_find_prog_unit then
47 hr_api.cannot_find_prog_unit_error
48 (p_module_name => 'CREATE_VARIABLE_COMPENSATION'
49 ,p_hook_type => 'BP'
50 );
51 end;
52 --
53 -- Validation in addition to Row Handlers
54 --
55 -- Process Logic
56 --
57 irc_vce_ins.ins(
58 p_effective_date => l_effective_date
59 ,p_vacancy_id => p_vacancy_id
60 ,p_variable_comp_lookup => p_variable_comp_lookup
61 ,p_object_version_number => l_object_version_number
62 );
63 --
64 -- Call After Process User Hook
65 --
66 begin
67 IRC_VARIABLE_COMP_ELEMENT_BK1.CREATE_VARIABLE_COMPENSATION_A
68 (p_vacancy_id => p_vacancy_id
69 ,p_variable_comp_lookup => p_variable_comp_lookup
70 ,p_effective_date => l_effective_date
71 ,p_object_version_number => l_object_version_number
72 );
73 exception
74 when hr_api.cannot_find_prog_unit then
75 hr_api.cannot_find_prog_unit_error
76 (p_module_name => 'CREATE_VARIABLE_COMPENSATION'
77 ,p_hook_type => 'AP'
78 );
79 end;
80 --
81 -- When in validation only mode raise the Validate_Enabled exception
82 --
83 if p_validate then
84 raise hr_api.validate_enabled;
85 end if;
86 --
87 -- Set all output arguments
88 p_object_version_number := l_object_version_number;
89 --
90 hr_utility.set_location(' Leaving:'||l_proc, 70);
91 exception
92 when hr_api.validate_enabled then
93 --
94 -- As the Validate_Enabled exception has been raised
95 -- we must rollback to the savepoint
96 --
97 rollback to CREATE_VARIABLE_COMPENSATION;
98 --
99 -- Only set output warning arguments
100 -- (Any key or derived arguments must be set to null
101 -- when validation only mode is being used.)
102 p_object_version_number := null;
103 --
104 hr_utility.set_location(' Leaving:'||l_proc, 80);
105 when others then
106 --
107 -- A validation or unexpected error has occured
108 --
109 p_object_version_number := null;
110 rollback to CREATE_VARIABLE_COMPENSATION;
111 hr_utility.set_location(' Leaving:'||l_proc, 90);
112 raise;
113 end CREATE_VARIABLE_COMPENSATION;
114 --
115 -- ----------------------------------------------------------------------------
116 -- |--------------------< DELETE_VARIABLE_COMPENSATION >----------------------|
117 -- ----------------------------------------------------------------------------
118 --
119 procedure DELETE_VARIABLE_COMPENSATION
120 (p_validate in boolean default false
121 ,p_vacancy_id in number
122 ,p_variable_comp_lookup in varchar2
123 ,p_object_version_number in number
124 ) is
125 --
126 -- Declare cursors and local variables
127 --
128 l_proc varchar2(72) := g_package||'DELETE_VARIABLE_COMPENSATION';
129 begin
130 hr_utility.set_location('Entering:'|| l_proc, 10);
131 --
132 -- Issue a savepoint
133 --
134 savepoint DELETE_VARIABLE_COMPENSATION;
135 --
136 -- Truncate the time portion from all IN date parameters
137 --
138 -- Call Before Process User Hook
139 --
140 begin
141 IRC_VARIABLE_COMP_ELEMENT_BK2.DELETE_VARIABLE_COMPENSATION_B
142 (p_vacancy_id => p_vacancy_id
143 ,p_variable_comp_lookup => p_variable_comp_lookup
144 ,p_object_version_number => p_object_version_number
145 );
146 exception
147 when hr_api.cannot_find_prog_unit then
148 hr_api.cannot_find_prog_unit_error
149 (p_module_name => 'DELETE_VARIABLE_COMPENSATION'
150 ,p_hook_type => 'BP'
151 );
152 end;
153 --
154 -- Validation in addition to Row Handlers
155 --
156 -- Process Logic
157 --
158 irc_vce_del.del
159 (p_vacancy_id => p_vacancy_id
160 ,p_variable_comp_lookup => p_variable_comp_lookup
161 ,p_object_version_number => p_object_version_number
162 );
163 --
164 -- Call After Process User Hook
165 --
166 begin
167 IRC_VARIABLE_COMP_ELEMENT_BK2.DELETE_VARIABLE_COMPENSATION_A
168 (p_vacancy_id => p_vacancy_id
169 ,p_variable_comp_lookup => p_variable_comp_lookup
170 ,p_object_version_number => p_object_version_number
171 );
172 exception
173 when hr_api.cannot_find_prog_unit then
174 hr_api.cannot_find_prog_unit_error
175 (p_module_name => 'DELETE_VARIABLE_COMPENSATION'
176 ,p_hook_type => 'AP'
177 );
178 end;
179 --
180 -- When in validation only mode raise the Validate_Enabled exception
181 --
182 if p_validate then
183 raise hr_api.validate_enabled;
184 end if;
185 --
186 -- Set all output arguments
187 -- No output Parameters.
188 --
189 hr_utility.set_location(' Leaving:'||l_proc, 70);
190 exception
191 when hr_api.validate_enabled then
192 --
193 -- As the Validate_Enabled exception has been raised
194 -- we must rollback to the savepoint
195 --
196 rollback to DELETE_VARIABLE_COMPENSATION;
197 --
198 -- Only set output warning arguments
199 -- (Any key or derived arguments must be set to null
200 -- when validation only mode is being used.)
201 --
202 hr_utility.set_location(' Leaving:'||l_proc, 80);
203 when others then
204 --
205 -- A validation or unexpected error has occured
206 --
207 rollback to DELETE_VARIABLE_COMPENSATION;
208 hr_utility.set_location(' Leaving:'||l_proc, 90);
209 raise;
210 end DELETE_VARIABLE_COMPENSATION;
211 --
212 end IRC_VARIABLE_COMP_ELEMENT_API;