[Home] [Help]
PACKAGE BODY: APPS.AHL_UC_UNITCONFIG_PVT_W
Source
1 package body ahl_uc_unitconfig_pvt_w as
2 /* $Header: AHLVUCWB.pls 120.1.12010000.2 2008/11/14 13:03:16 sathapli ship $ */
3 rosetta_g_mistake_date date := to_date('01/01/+4713', 'MM/DD/SYYYY');
4 rosetta_g_miss_date date := to_date('01/01/-4712', 'MM/DD/SYYYY');
5 rosetta_g_mistake_date_high date := to_date('01/01/+4710', 'MM/DD/SYYYY');
6 rosetta_g_mistake_date_low date := to_date('01/01/-4710', 'MM/DD/SYYYY');
7
8 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
9 function rosetta_g_miss_date_in_map(d date) return date as
10 begin
11 if d > rosetta_g_mistake_date_high then return fnd_api.g_miss_date; end if;
12 if d < rosetta_g_mistake_date_low then return fnd_api.g_miss_date; end if;
13 return d;
14 end;
15
16 procedure create_uc_header(p_api_version NUMBER
17 , p_init_msg_list VARCHAR2
18 , p_commit VARCHAR2
19 , p_validation_level NUMBER
20 , p_module_type VARCHAR2
21 , x_return_status out nocopy VARCHAR2
22 , x_msg_count out nocopy NUMBER
23 , x_msg_data out nocopy VARCHAR2
24 , p8_a0 in out nocopy NUMBER
25 , p8_a1 in out nocopy VARCHAR2
26 , p8_a2 in out nocopy NUMBER
27 , p8_a3 in out nocopy VARCHAR2
28 , p8_a4 in out nocopy VARCHAR2
29 , p8_a5 in out nocopy NUMBER
30 , p8_a6 in out nocopy VARCHAR2
31 , p8_a7 in out nocopy VARCHAR2
32 , p8_a8 in out nocopy NUMBER
33 , p8_a9 in out nocopy VARCHAR2
34 , p8_a10 in out nocopy DATE
35 , p8_a11 in out nocopy DATE
36 , p8_a12 in out nocopy NUMBER
37 , p8_a13 in out nocopy VARCHAR2
38 , p8_a14 in out nocopy VARCHAR2
39 , p8_a15 in out nocopy VARCHAR2
40 , p8_a16 in out nocopy VARCHAR2
41 , p8_a17 in out nocopy VARCHAR2
42 , p8_a18 in out nocopy VARCHAR2
43 , p8_a19 in out nocopy VARCHAR2
44 , p8_a20 in out nocopy VARCHAR2
45 , p8_a21 in out nocopy VARCHAR2
46 , p8_a22 in out nocopy VARCHAR2
47 , p8_a23 in out nocopy VARCHAR2
48 , p8_a24 in out nocopy VARCHAR2
49 , p8_a25 in out nocopy VARCHAR2
50 , p8_a26 in out nocopy VARCHAR2
51 , p8_a27 in out nocopy VARCHAR2
52 , p8_a28 in out nocopy VARCHAR2
53 )
54
55 as
56 ddp_x_uc_header_rec ahl_uc_instance_pvt.uc_header_rec_type;
57 ddindx binary_integer; indx binary_integer;
58 begin
59
60 -- copy data to the local IN or IN-OUT args, if any
61
62
63
64
65
66
67
68
69 ddp_x_uc_header_rec.uc_header_id := p8_a0;
70 ddp_x_uc_header_rec.uc_name := p8_a1;
71 ddp_x_uc_header_rec.mc_header_id := p8_a2;
72 ddp_x_uc_header_rec.mc_name := p8_a3;
73 ddp_x_uc_header_rec.mc_revision := p8_a4;
74 ddp_x_uc_header_rec.parent_uc_header_id := p8_a5;
75 ddp_x_uc_header_rec.unit_config_status_code := p8_a6;
76 ddp_x_uc_header_rec.active_uc_status_code := p8_a7;
77 ddp_x_uc_header_rec.instance_id := p8_a8;
78 ddp_x_uc_header_rec.instance_number := p8_a9;
79 ddp_x_uc_header_rec.active_start_date := rosetta_g_miss_date_in_map(p8_a10);
80 ddp_x_uc_header_rec.active_end_date := rosetta_g_miss_date_in_map(p8_a11);
81 ddp_x_uc_header_rec.object_version_number := p8_a12;
82 ddp_x_uc_header_rec.attribute_category := p8_a13;
83 ddp_x_uc_header_rec.attribute1 := p8_a14;
84 ddp_x_uc_header_rec.attribute2 := p8_a15;
85 ddp_x_uc_header_rec.attribute3 := p8_a16;
86 ddp_x_uc_header_rec.attribute4 := p8_a17;
87 ddp_x_uc_header_rec.attribute5 := p8_a18;
88 ddp_x_uc_header_rec.attribute6 := p8_a19;
89 ddp_x_uc_header_rec.attribute7 := p8_a20;
90 ddp_x_uc_header_rec.attribute8 := p8_a21;
91 ddp_x_uc_header_rec.attribute9 := p8_a22;
92 ddp_x_uc_header_rec.attribute10 := p8_a23;
93 ddp_x_uc_header_rec.attribute11 := p8_a24;
94 ddp_x_uc_header_rec.attribute12 := p8_a25;
95 ddp_x_uc_header_rec.attribute13 := p8_a26;
96 ddp_x_uc_header_rec.attribute14 := p8_a27;
97 ddp_x_uc_header_rec.attribute15 := p8_a28;
98
99 -- here's the delegated call to the old PL/SQL routine
100 ahl_uc_unitconfig_pvt.create_uc_header(p_api_version,
101 p_init_msg_list,
102 p_commit,
103 p_validation_level,
104 p_module_type,
105 x_return_status,
106 x_msg_count,
107 x_msg_data,
108 ddp_x_uc_header_rec);
109
110 -- copy data back from the local variables to OUT or IN-OUT args, if any
111
112
113
114
115
116
117
118
119 p8_a0 := ddp_x_uc_header_rec.uc_header_id;
120 p8_a1 := ddp_x_uc_header_rec.uc_name;
121 p8_a2 := ddp_x_uc_header_rec.mc_header_id;
122 p8_a3 := ddp_x_uc_header_rec.mc_name;
123 p8_a4 := ddp_x_uc_header_rec.mc_revision;
124 p8_a5 := ddp_x_uc_header_rec.parent_uc_header_id;
125 p8_a6 := ddp_x_uc_header_rec.unit_config_status_code;
126 p8_a7 := ddp_x_uc_header_rec.active_uc_status_code;
127 p8_a8 := ddp_x_uc_header_rec.instance_id;
128 p8_a9 := ddp_x_uc_header_rec.instance_number;
129 p8_a10 := ddp_x_uc_header_rec.active_start_date;
130 p8_a11 := ddp_x_uc_header_rec.active_end_date;
131 p8_a12 := ddp_x_uc_header_rec.object_version_number;
132 p8_a13 := ddp_x_uc_header_rec.attribute_category;
133 p8_a14 := ddp_x_uc_header_rec.attribute1;
134 p8_a15 := ddp_x_uc_header_rec.attribute2;
135 p8_a16 := ddp_x_uc_header_rec.attribute3;
136 p8_a17 := ddp_x_uc_header_rec.attribute4;
137 p8_a18 := ddp_x_uc_header_rec.attribute5;
138 p8_a19 := ddp_x_uc_header_rec.attribute6;
139 p8_a20 := ddp_x_uc_header_rec.attribute7;
140 p8_a21 := ddp_x_uc_header_rec.attribute8;
141 p8_a22 := ddp_x_uc_header_rec.attribute9;
142 p8_a23 := ddp_x_uc_header_rec.attribute10;
143 p8_a24 := ddp_x_uc_header_rec.attribute11;
144 p8_a25 := ddp_x_uc_header_rec.attribute12;
145 p8_a26 := ddp_x_uc_header_rec.attribute13;
146 p8_a27 := ddp_x_uc_header_rec.attribute14;
147 p8_a28 := ddp_x_uc_header_rec.attribute15;
148 end;
149
150 procedure update_uc_header(p_api_version NUMBER
151 , p_init_msg_list VARCHAR2
152 , p_commit VARCHAR2
153 , p_validation_level NUMBER
154 , p_module_type VARCHAR2
155 , x_return_status out nocopy VARCHAR2
156 , x_msg_count out nocopy NUMBER
157 , x_msg_data out nocopy VARCHAR2
158 , p8_a0 in out nocopy NUMBER
159 , p8_a1 in out nocopy VARCHAR2
160 , p8_a2 in out nocopy NUMBER
161 , p8_a3 in out nocopy VARCHAR2
162 , p8_a4 in out nocopy VARCHAR2
163 , p8_a5 in out nocopy NUMBER
164 , p8_a6 in out nocopy VARCHAR2
165 , p8_a7 in out nocopy VARCHAR2
166 , p8_a8 in out nocopy NUMBER
167 , p8_a9 in out nocopy VARCHAR2
168 , p8_a10 in out nocopy DATE
169 , p8_a11 in out nocopy DATE
170 , p8_a12 in out nocopy NUMBER
171 , p8_a13 in out nocopy VARCHAR2
172 , p8_a14 in out nocopy VARCHAR2
173 , p8_a15 in out nocopy VARCHAR2
174 , p8_a16 in out nocopy VARCHAR2
175 , p8_a17 in out nocopy VARCHAR2
176 , p8_a18 in out nocopy VARCHAR2
177 , p8_a19 in out nocopy VARCHAR2
178 , p8_a20 in out nocopy VARCHAR2
179 , p8_a21 in out nocopy VARCHAR2
180 , p8_a22 in out nocopy VARCHAR2
181 , p8_a23 in out nocopy VARCHAR2
182 , p8_a24 in out nocopy VARCHAR2
183 , p8_a25 in out nocopy VARCHAR2
184 , p8_a26 in out nocopy VARCHAR2
185 , p8_a27 in out nocopy VARCHAR2
186 , p8_a28 in out nocopy VARCHAR2
187 , p9_a0 NUMBER
188 , p9_a1 NUMBER
189 , p9_a2 VARCHAR2
190 , p9_a3 VARCHAR2
191 , p9_a4 NUMBER
192 , p9_a5 VARCHAR2
193 , p9_a6 VARCHAR2
194 , p9_a7 VARCHAR2
195 , p9_a8 VARCHAR2
196 , p9_a9 VARCHAR2
197 , p9_a10 NUMBER
198 , p9_a11 VARCHAR2
199 , p9_a12 VARCHAR2
200 , p9_a13 DATE
201 , p9_a14 DATE
202 , p9_a15 NUMBER
203 , p9_a16 NUMBER
204 , p9_a17 VARCHAR2
205 , p9_a18 VARCHAR2
206 , p9_a19 VARCHAR2
207 , p9_a20 VARCHAR2
208 , p9_a21 VARCHAR2
209 , p9_a22 VARCHAR2
210 , p9_a23 VARCHAR2
211 , p9_a24 VARCHAR2
212 , p9_a25 VARCHAR2
213 , p9_a26 VARCHAR2
214 , p9_a27 VARCHAR2
215 , p9_a28 VARCHAR2
216 , p9_a29 VARCHAR2
217 , p9_a30 VARCHAR2
218 , p9_a31 VARCHAR2
219 , p9_a32 VARCHAR2
220 , p9_a33 VARCHAR2
221 , p9_a34 VARCHAR2
222 , p9_a35 VARCHAR2
223 , p9_a36 VARCHAR2
224 , p9_a37 VARCHAR2
225 , p9_a38 VARCHAR2
226 , p9_a39 VARCHAR2
227 , p9_a40 VARCHAR2
228 , p9_a41 VARCHAR2
229 , p9_a42 VARCHAR2
230 , p9_a43 VARCHAR2
231 , p9_a44 VARCHAR2
232 , p9_a45 VARCHAR2
233 , p9_a46 VARCHAR2
234 , p9_a47 VARCHAR2
235 )
236
237 as
238 ddp_x_uc_header_rec ahl_uc_instance_pvt.uc_header_rec_type;
239 ddp_uc_instance_rec ahl_uc_instance_pvt.uc_instance_rec_type;
240 ddindx binary_integer; indx binary_integer;
241 begin
242
243 -- copy data to the local IN or IN-OUT args, if any
244
245
246
247
248
249
250
251
252 ddp_x_uc_header_rec.uc_header_id := p8_a0;
253 ddp_x_uc_header_rec.uc_name := p8_a1;
254 ddp_x_uc_header_rec.mc_header_id := p8_a2;
255 ddp_x_uc_header_rec.mc_name := p8_a3;
256 ddp_x_uc_header_rec.mc_revision := p8_a4;
257 ddp_x_uc_header_rec.parent_uc_header_id := p8_a5;
258 ddp_x_uc_header_rec.unit_config_status_code := p8_a6;
259 ddp_x_uc_header_rec.active_uc_status_code := p8_a7;
260 ddp_x_uc_header_rec.instance_id := p8_a8;
261 ddp_x_uc_header_rec.instance_number := p8_a9;
262 ddp_x_uc_header_rec.active_start_date := rosetta_g_miss_date_in_map(p8_a10);
263 ddp_x_uc_header_rec.active_end_date := rosetta_g_miss_date_in_map(p8_a11);
264 ddp_x_uc_header_rec.object_version_number := p8_a12;
265 ddp_x_uc_header_rec.attribute_category := p8_a13;
266 ddp_x_uc_header_rec.attribute1 := p8_a14;
267 ddp_x_uc_header_rec.attribute2 := p8_a15;
268 ddp_x_uc_header_rec.attribute3 := p8_a16;
269 ddp_x_uc_header_rec.attribute4 := p8_a17;
270 ddp_x_uc_header_rec.attribute5 := p8_a18;
271 ddp_x_uc_header_rec.attribute6 := p8_a19;
272 ddp_x_uc_header_rec.attribute7 := p8_a20;
273 ddp_x_uc_header_rec.attribute8 := p8_a21;
274 ddp_x_uc_header_rec.attribute9 := p8_a22;
275 ddp_x_uc_header_rec.attribute10 := p8_a23;
276 ddp_x_uc_header_rec.attribute11 := p8_a24;
277 ddp_x_uc_header_rec.attribute12 := p8_a25;
278 ddp_x_uc_header_rec.attribute13 := p8_a26;
279 ddp_x_uc_header_rec.attribute14 := p8_a27;
280 ddp_x_uc_header_rec.attribute15 := p8_a28;
281
282 ddp_uc_instance_rec.inventory_item_id := p9_a0;
283 ddp_uc_instance_rec.inventory_org_id := p9_a1;
284 ddp_uc_instance_rec.inventory_org_code := p9_a2;
285 ddp_uc_instance_rec.item_number := p9_a3;
286 ddp_uc_instance_rec.instance_id := p9_a4;
287 ddp_uc_instance_rec.instance_number := p9_a5;
288 ddp_uc_instance_rec.serial_number := p9_a6;
289 ddp_uc_instance_rec.sn_tag_code := p9_a7;
290 ddp_uc_instance_rec.sn_tag_meaning := p9_a8;
291 ddp_uc_instance_rec.lot_number := p9_a9;
292 ddp_uc_instance_rec.quantity := p9_a10;
293 ddp_uc_instance_rec.uom_code := p9_a11;
294 ddp_uc_instance_rec.revision := p9_a12;
295 ddp_uc_instance_rec.mfg_date := rosetta_g_miss_date_in_map(p9_a13);
296 ddp_uc_instance_rec.install_date := rosetta_g_miss_date_in_map(p9_a14);
297 ddp_uc_instance_rec.relationship_id := p9_a15;
298 ddp_uc_instance_rec.object_version_number := p9_a16;
299 ddp_uc_instance_rec.context := p9_a17;
300 ddp_uc_instance_rec.attribute1 := p9_a18;
301 ddp_uc_instance_rec.attribute2 := p9_a19;
302 ddp_uc_instance_rec.attribute3 := p9_a20;
303 ddp_uc_instance_rec.attribute4 := p9_a21;
304 ddp_uc_instance_rec.attribute5 := p9_a22;
305 ddp_uc_instance_rec.attribute6 := p9_a23;
306 ddp_uc_instance_rec.attribute7 := p9_a24;
307 ddp_uc_instance_rec.attribute8 := p9_a25;
308 ddp_uc_instance_rec.attribute9 := p9_a26;
309 ddp_uc_instance_rec.attribute10 := p9_a27;
310 ddp_uc_instance_rec.attribute11 := p9_a28;
311 ddp_uc_instance_rec.attribute12 := p9_a29;
312 ddp_uc_instance_rec.attribute13 := p9_a30;
313 ddp_uc_instance_rec.attribute14 := p9_a31;
314 ddp_uc_instance_rec.attribute15 := p9_a32;
315 ddp_uc_instance_rec.attribute16 := p9_a33;
316 ddp_uc_instance_rec.attribute17 := p9_a34;
317 ddp_uc_instance_rec.attribute18 := p9_a35;
318 ddp_uc_instance_rec.attribute19 := p9_a36;
319 ddp_uc_instance_rec.attribute20 := p9_a37;
320 ddp_uc_instance_rec.attribute21 := p9_a38;
321 ddp_uc_instance_rec.attribute22 := p9_a39;
322 ddp_uc_instance_rec.attribute23 := p9_a40;
323 ddp_uc_instance_rec.attribute24 := p9_a41;
324 ddp_uc_instance_rec.attribute25 := p9_a42;
325 ddp_uc_instance_rec.attribute26 := p9_a43;
326 ddp_uc_instance_rec.attribute27 := p9_a44;
327 ddp_uc_instance_rec.attribute28 := p9_a45;
328 ddp_uc_instance_rec.attribute29 := p9_a46;
329 ddp_uc_instance_rec.attribute30 := p9_a47;
330
331 -- here's the delegated call to the old PL/SQL routine
332 ahl_uc_unitconfig_pvt.update_uc_header(p_api_version,
333 p_init_msg_list,
334 p_commit,
335 p_validation_level,
336 p_module_type,
337 x_return_status,
338 x_msg_count,
339 x_msg_data,
340 ddp_x_uc_header_rec,
341 ddp_uc_instance_rec);
342
343 -- copy data back from the local variables to OUT or IN-OUT args, if any
344
345
346
347
348
349
350
351
352 p8_a0 := ddp_x_uc_header_rec.uc_header_id;
353 p8_a1 := ddp_x_uc_header_rec.uc_name;
354 p8_a2 := ddp_x_uc_header_rec.mc_header_id;
355 p8_a3 := ddp_x_uc_header_rec.mc_name;
356 p8_a4 := ddp_x_uc_header_rec.mc_revision;
357 p8_a5 := ddp_x_uc_header_rec.parent_uc_header_id;
358 p8_a6 := ddp_x_uc_header_rec.unit_config_status_code;
359 p8_a7 := ddp_x_uc_header_rec.active_uc_status_code;
360 p8_a8 := ddp_x_uc_header_rec.instance_id;
361 p8_a9 := ddp_x_uc_header_rec.instance_number;
362 p8_a10 := ddp_x_uc_header_rec.active_start_date;
363 p8_a11 := ddp_x_uc_header_rec.active_end_date;
364 p8_a12 := ddp_x_uc_header_rec.object_version_number;
365 p8_a13 := ddp_x_uc_header_rec.attribute_category;
366 p8_a14 := ddp_x_uc_header_rec.attribute1;
367 p8_a15 := ddp_x_uc_header_rec.attribute2;
368 p8_a16 := ddp_x_uc_header_rec.attribute3;
369 p8_a17 := ddp_x_uc_header_rec.attribute4;
370 p8_a18 := ddp_x_uc_header_rec.attribute5;
371 p8_a19 := ddp_x_uc_header_rec.attribute6;
372 p8_a20 := ddp_x_uc_header_rec.attribute7;
373 p8_a21 := ddp_x_uc_header_rec.attribute8;
374 p8_a22 := ddp_x_uc_header_rec.attribute9;
375 p8_a23 := ddp_x_uc_header_rec.attribute10;
376 p8_a24 := ddp_x_uc_header_rec.attribute11;
377 p8_a25 := ddp_x_uc_header_rec.attribute12;
378 p8_a26 := ddp_x_uc_header_rec.attribute13;
379 p8_a27 := ddp_x_uc_header_rec.attribute14;
380 p8_a28 := ddp_x_uc_header_rec.attribute15;
381
382 end;
383
384 end ahl_uc_unitconfig_pvt_w;