[Home] [Help]
PACKAGE BODY: APPS.OTA_THG_API
Source
1 Package Body OTA_THG_API as
2 /* $Header: otthgapi.pkb 115.2 2002/11/29 13:17:28 jbharath noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := 'OTA_THG_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< <create_non_ota_histories> >------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_hr_gl_flex
13 (p_effective_date in date
14 ,p_cross_charge_id in number
15 ,p_segment in varchar2
16 ,p_segment_num in number
17 ,p_hr_data_source in varchar2 default null
18 ,p_constant in varchar2 default null
19 ,p_hr_cost_segment in varchar2 default null
20 ,p_gl_default_segment_id out nocopy number
21 ,p_object_version_number out nocopy number
22 ,p_validate in boolean default false
23 ) is
24 --
25 -- Declare cursors and local variables
26 --
27 l_effective_date date;
28 l_proc varchar2(72) := g_package||'create_hr_gl_flex';
29 begin
30 hr_utility.set_location('Entering:'|| l_proc, 10);
31 --
32 -- Issue a savepoint
33 --
34 savepoint create_hr_gl_flex;
35 --
36 -- Truncate the time portion from all IN date parameters
37 --
38 l_effective_date := trunc(p_effective_date);
39
40 --
41 -- Call Before Process User Hook
42 --
43 begin
44 OTA_THG_BK1.create_hr_gl_flex_b
45 (p_effective_date => l_effective_date
46 ,p_cross_charge_id => p_cross_charge_id
47 ,p_segment => p_segment
48 ,p_segment_num => p_segment_num
49 ,p_hr_data_source => p_hr_data_source
50 ,p_constant => p_constant
51 ,p_hr_cost_segment => p_hr_cost_segment
52 ,p_gl_default_segment_id => p_gl_default_segment_id
53 ,p_object_version_number => p_object_version_number
54 );
55
56 exception
57 when hr_api.cannot_find_prog_unit then
58 hr_api.cannot_find_prog_unit_error
59 (p_module_name => 'create_hr_gl_flex_b'
60 ,p_hook_type => 'BP'
61 );
62 end;
63 --
64 -- Validation in addition to Row Handlers
65 --
66
67
68
69 --
70 -- Process Logic
71 --
72
73 ota_thg_ins.ins
74 (p_effective_date => l_effective_date
75 ,p_cross_charge_id => p_cross_charge_id
76 ,p_segment => p_segment
77 ,p_segment_num => p_segment_num
78 ,p_hr_data_source => p_hr_data_source
79 ,p_constant => p_constant
80 ,p_hr_cost_segment => p_hr_cost_segment
81 ,p_gl_default_segment_id => p_gl_default_segment_id
82 ,p_object_version_number => p_object_version_number
83 ,p_validate => p_validate
84 );
85
86 --
87 -- Call After Process User Hook
88 --
89 begin
90 OTA_THG_BK1.create_hr_gl_flex_a
91 (p_effective_date => l_effective_date
92 ,p_cross_charge_id => p_cross_charge_id
93 ,p_segment => p_segment
94 ,p_segment_num => p_segment_num
95 ,p_hr_data_source => p_hr_data_source
96 ,p_constant => p_constant
97 ,p_hr_cost_segment => p_hr_cost_segment
98 ,p_gl_default_segment_id => p_gl_default_segment_id
99 ,p_object_version_number => p_object_version_number
100 );
101 exception
102 when hr_api.cannot_find_prog_unit then
103 hr_api.cannot_find_prog_unit_error
104 (p_module_name => 'create_hr_gl_flex_a'
105 ,p_hook_type => 'AP'
106 );
107 end;
108 --
109 -- When in validation only mode raise the Validate_Enabled exception
110 --
111 if p_validate then
112 raise hr_api.validate_enabled;
113 end if;
114 --
115 -- Set all output arguments
116 --
117 /*p_id := <local_var_set_in_process_logic>
118 p_object_version_number := <local_var_set_in_process_logic>
119 p_some_warning := <local_var_set_in_process_logic> */
120 --
121 hr_utility.set_location(' Leaving:'||l_proc, 70);
122 exception
123 when hr_api.validate_enabled then
124 --
125 -- As the Validate_Enabled exception has been raised
126 -- we must rollback to the savepoint
127 --
128 rollback to create_hr_gl_flex;
129 --
130 -- Only set output warning arguments
131 -- (Any key or derived arguments must be set to null
132 -- when validation only mode is being used.)
133 --
134 /* p_id := null;
135 p_object_version_number := null;
136 p_some_warning := <local_var_set_in_process_logic>*/
137 hr_utility.set_location(' Leaving:'||l_proc, 80);
138 when others then
139 --
140 -- A validation or unexpected error has occured
141 --
142 rollback to create_hr_gl_flex;
143 hr_utility.set_location(' Leaving:'||l_proc, 90);
144 raise;
145 end create_hr_gl_flex;
146 --
147
148
149
150 -- ----------------------------------------------------------------------------
151 -- |--------------------------< <update_hr_gl_flex> >-------------------------|
152 -- ----------------------------------------------------------------------------
153 --
154 procedure update_hr_gl_flex
155 (p_effective_date in date
156 ,p_gl_default_segment_id in number
157 ,p_object_version_number in out nocopy number
158 ,p_cross_charge_id in number default hr_api.g_number
159 ,p_segment in varchar2 default hr_api.g_varchar2
160 ,p_segment_num in number default hr_api.g_number
161 ,p_hr_data_source in varchar2 default hr_api.g_varchar2
162 ,p_constant in varchar2 default hr_api.g_varchar2
163 ,p_hr_cost_segment in varchar2 default hr_api.g_varchar2
164 ,p_validate in boolean default false
165 ) is
166
167
168 l_effective_date date;
169 l_proc varchar2(72) := g_package||'update_hr_gl_flex';
170 begin
171 hr_utility.set_location('Entering:'|| l_proc, 10);
172 --
173 -- Issue a savepoint
174 --
175 savepoint update_hr_gl_flex;
176 --
177 -- Truncate the time portion from all IN date parameters
178 --
179 l_effective_date := trunc(p_effective_date);
180
181 --
182 -- Call Before Process User Hook
183 --
184 begin
185 OTA_THG_BK2.update_hr_gl_flex_b
186 (p_effective_date => l_effective_date
187 ,p_cross_charge_id => p_cross_charge_id
188 ,p_segment => p_segment
189 ,p_segment_num => p_segment_num
190 ,p_hr_data_source => p_hr_data_source
191 ,p_constant => p_constant
192 ,p_hr_cost_segment => p_hr_cost_segment
193 ,p_gl_default_segment_id => p_gl_default_segment_id
194 ,p_object_version_number => p_object_version_number
195 );
196 exception
197 when hr_api.cannot_find_prog_unit then
198 hr_api.cannot_find_prog_unit_error
199 (p_module_name => 'update_hr_gl_flex_b'
200 ,p_hook_type => 'BP'
201 );
202 end;
203 --
204 -- Validation in addition to Row Handlers
205 --
206
207 ota_thg_upd.upd
208 (p_effective_date => l_effective_date
209 ,p_cross_charge_id => p_cross_charge_id
210 ,p_segment => p_segment
211 ,p_segment_num => p_segment_num
212 ,p_hr_data_source => p_hr_data_source
213 ,p_constant => p_constant
214 ,p_hr_cost_segment => p_hr_cost_segment
215 ,p_gl_default_segment_id => p_gl_default_segment_id
216 ,p_object_version_number => p_object_version_number
217 ,p_validate => p_validate
218 );
219
220
221 --
222 -- Process Logic
223 --
224
225
226
227 --
228 -- Call After Process User Hook
229 --
230 begin
231 OTA_THG_BK2.update_hr_gl_flex_a
232 (p_effective_date => l_effective_date
233 ,p_cross_charge_id => p_cross_charge_id
234 ,p_segment => p_segment
235 ,p_segment_num => p_segment_num
236 ,p_hr_data_source => p_hr_data_source
237 ,p_constant => p_constant
238 ,p_hr_cost_segment => p_hr_cost_segment
239 ,p_gl_default_segment_id => p_gl_default_segment_id
240 ,p_object_version_number => p_object_version_number
241 );
242
243 exception
244 when hr_api.cannot_find_prog_unit then
245 hr_api.cannot_find_prog_unit_error
246 (p_module_name => 'update_hr_gl_flex_a'
247 ,p_hook_type => 'AP'
248 );
249 end;
250 --
251 -- When in validation only mode raise the Validate_Enabled exception
252 --
253 if p_validate then
254 raise hr_api.validate_enabled;
255 end if;
256 --
257 -- Set all output arguments
258 --
259 /* p_id := <local_var_set_in_process_logic>
260 p_object_version_number := <local_var_set_in_process_logic>
261 p_some_warning := <local_var_set_in_process_logic>*/
262 --
263 hr_utility.set_location(' Leaving:'||l_proc, 70);
264 exception
265 when hr_api.validate_enabled then
266 --
267 -- As the Validate_Enabled exception has been raised
268 -- we must rollback to the savepoint
269 --
270 rollback to update_hr_gl_flex;
271 --
272 -- Only set output warning arguments
273 -- (Any key or derived arguments must be set to null
274 -- when validation only mode is being used.)
275 --
276 /* p_id := null;
277 p_object_version_number := null;
278 p_some_warning := <local_var_set_in_process_logic> */
279 hr_utility.set_location(' Leaving:'||l_proc, 80);
280 when others then
281 --
282 -- A validation or unexpected error has occured
283 --
284 rollback to update_hr_gl_flex;
285 hr_utility.set_location(' Leaving:'||l_proc, 90);
286 raise;
287 end update_hr_gl_flex;
288 --
289
290 end OTA_THG_API;