[Home] [Help]
PACKAGE BODY: APPS.OTA_TCC_API
Source
1 Package Body OTA_TCC_API as
2 /* $Header: ottccapi.pkb 115.2 2002/11/29 13:15:39 jbharath noship $ */
3 --
4 -- Package Variables
5 --
6 g_package varchar2(33) := 'OTA_TCC_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< <create_cross_charge> >------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_cross_charge
13 (p_effective_date in date
14 ,p_business_group_id in number
15 ,p_gl_set_of_books_id in number
16 ,p_type in varchar2
17 ,p_from_to in varchar2
18 ,p_start_date_active in date
19 ,p_end_date_active in date default null
20 ,p_cross_charge_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_Cross_charge';
29 begin
30 hr_utility.set_location('Entering:'|| l_proc, 10);
31 --
32 -- Issue a savepoint
33 --
34 savepoint create_cross_charges;
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_TCC_BK1.create_cross_charge_b
45 (p_effective_date => l_effective_date
46 ,p_business_group_id => p_business_group_id
47 ,p_gl_set_of_books_id => p_gl_set_of_books_id
48 ,p_type => p_type
49 ,p_from_to => p_from_to
50 ,p_start_date_active => p_start_date_active
51 ,p_end_date_active => p_end_date_active
52 ,p_cross_charge_id => p_cross_charge_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_cross_charge_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_tcc_ins.ins
74 (p_effective_date => l_effective_date
75 ,p_business_group_id => p_business_group_id
76 ,p_gl_set_of_books_id => p_gl_set_of_books_id
77 ,p_type => p_type
78 ,p_from_to => p_from_to
79 ,p_start_date_active => p_start_date_active
80 ,p_end_date_active => p_end_date_active
81 ,p_cross_charge_id => p_cross_charge_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_TCC_BK1.create_cross_charge_a
91 (p_effective_date => l_effective_date
92 ,p_business_group_id => p_business_group_id
93 ,p_gl_set_of_books_id => p_gl_set_of_books_id
94 ,p_type => p_type
95 ,p_from_to => p_from_to
96 ,p_start_date_active => p_start_date_active
97 ,p_end_date_active => p_end_date_active
98 ,p_cross_charge_id => p_cross_charge_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_cross_charge_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_cross_charges;
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_cross_charges;
143 hr_utility.set_location(' Leaving:'||l_proc, 90);
144 raise;
145 end create_cross_charge;
146 --
147
148
149
150 -- ----------------------------------------------------------------------------
151 -- |--------------------------< <update_cross_charge> >-------------------|
152 -- ----------------------------------------------------------------------------
153 --
154 procedure update_cross_charge
155 (p_effective_date in date
156 ,p_cross_charge_id in number
157 ,p_object_version_number in out nocopy number
158 ,p_business_group_id in number default hr_api.g_number
159 ,p_gl_set_of_books_id in number default hr_api.g_number
160 ,p_type in varchar2 default hr_api.g_varchar2
161 ,p_from_to in varchar2 default hr_api.g_varchar2
162 ,p_start_date_active in date default hr_api.g_date
163 ,p_end_date_active in date default hr_api.g_date
164 ,p_validate in boolean default false
165 ) is
166
167
168 l_effective_date date;
169 l_proc varchar2(72) := g_package||'update_cross_charge';
170 begin
171 hr_utility.set_location('Entering:'|| l_proc, 10);
172 --
173 -- Issue a savepoint
174 --
175 savepoint update_cross_charges;
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_TCC_BK2.update_cross_charge_b
186 (p_effective_date => l_effective_date
187 ,p_business_group_id => p_business_group_id
188 ,p_gl_set_of_books_id => p_gl_set_of_books_id
189 ,p_type => p_type
190 ,p_from_to => p_from_to
191 ,p_start_date_active => p_start_date_active
192 ,p_end_date_active => p_end_date_active
193 ,p_cross_charge_id => p_cross_charge_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_cross_charge_b'
200 ,p_hook_type => 'BP'
201 );
202 end;
203 --
204 -- Validation in addition to Row Handlers
205 --
206
207 ota_tcc_upd.upd
208 (p_effective_date => l_effective_date
209 ,p_business_group_id => p_business_group_id
210 ,p_gl_set_of_books_id => p_gl_set_of_books_id
211 ,p_type => p_type
212 ,p_from_to => p_from_to
213 ,p_start_date_active => p_start_date_active
214 ,p_end_date_active => p_end_date_active
215 ,p_cross_charge_id => p_cross_charge_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_TCC_BK2.update_cross_charge_a
232 (p_effective_date => l_effective_date
233 ,p_business_group_id => p_business_group_id
234 ,p_gl_set_of_books_id => p_gl_set_of_books_id
235 ,p_type => p_type
236 ,p_from_to => p_from_to
237 ,p_start_date_active => p_start_date_active
238 ,p_end_date_active => p_end_date_active
239 ,p_cross_charge_id => p_cross_charge_id
240 ,p_object_version_number => p_object_version_number
241 );
242 exception
243 when hr_api.cannot_find_prog_unit then
244 hr_api.cannot_find_prog_unit_error
245 (p_module_name => 'update_cross_charge_a'
246 ,p_hook_type => 'AP'
247 );
248 end;
249 --
250 -- When in validation only mode raise the Validate_Enabled exception
251 --
252 if p_validate then
253 raise hr_api.validate_enabled;
254 end if;
255 --
256 -- Set all output arguments
257 --
258 /* p_id := <local_var_set_in_process_logic>
259 p_object_version_number := <local_var_set_in_process_logic>
260 p_some_warning := <local_var_set_in_process_logic>*/
261 --
262 hr_utility.set_location(' Leaving:'||l_proc, 70);
263 exception
264 when hr_api.validate_enabled then
265 --
266 -- As the Validate_Enabled exception has been raised
267 -- we must rollback to the savepoint
268 --
269 rollback to update_cross_charges;
270 --
271 -- Only set output warning arguments
272 -- (Any key or derived arguments must be set to null
273 -- when validation only mode is being used.)
274 --
275 /* p_id := null;
276 p_object_version_number := null;
277 p_some_warning := <local_var_set_in_process_logic> */
278 hr_utility.set_location(' Leaving:'||l_proc, 80);
279 when others then
280 --
281 -- A validation or unexpected error has occured
282 --
283 rollback to update_cross_charges;
284 hr_utility.set_location(' Leaving:'||l_proc, 90);
285 raise;
286 end update_cross_charge;
287 --
288
289 end OTA_TCC_API;