[Home] [Help]
PACKAGE BODY: APPS.AMS_TEMPLATE_RES_PVT_W
Source
1 package body ams_template_res_pvt_w as
2 /* $Header: amswptrb.pls 115.2 2002/11/15 21:04:39 abhola 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
6 function rosetta_g_miss_num_map(n number) return number as
7 a number := fnd_api.g_miss_num;
8 b number := 0-1962.0724;
9 begin
10 if n=a then return b; end if;
11 if n=b then return a; end if;
12 return n;
13 end;
14
15 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
16 function rosetta_g_miss_date_in_map(d date) return date as
17 begin
18 if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
19 return d;
20 end;
21
22 procedure rosetta_table_copy_in_p3(t OUT NOCOPY ams_template_res_pvt.template_res_tbl_type, a0 JTF_NUMBER_TABLE
23 , a1 JTF_NUMBER_TABLE
24 , a2 JTF_NUMBER_TABLE
25 , a3 JTF_DATE_TABLE
26 , a4 JTF_NUMBER_TABLE
27 , a5 JTF_DATE_TABLE
28 , a6 JTF_NUMBER_TABLE
29 , a7 JTF_NUMBER_TABLE
30 , a8 JTF_NUMBER_TABLE
31 , a9 JTF_NUMBER_TABLE
32 ) as
33 ddindx binary_integer; indx binary_integer;
34 begin
35 if a0 is not null and a0.count > 0 then
36 if a0.count > 0 then
37 indx := a0.first;
38 ddindx := 1;
39 while true loop
40 t(ddindx).templ_responsibility_id := rosetta_g_miss_num_map(a0(indx));
41 t(ddindx).template_id := rosetta_g_miss_num_map(a1(indx));
42 t(ddindx).responsibility_id := rosetta_g_miss_num_map(a2(indx));
43 t(ddindx).last_update_date := rosetta_g_miss_date_in_map(a3(indx));
44 t(ddindx).last_updated_by := rosetta_g_miss_num_map(a4(indx));
45 t(ddindx).creation_date := rosetta_g_miss_date_in_map(a5(indx));
46 t(ddindx).created_by := rosetta_g_miss_num_map(a6(indx));
47 t(ddindx).object_version_number := rosetta_g_miss_num_map(a7(indx));
48 t(ddindx).last_update_login := rosetta_g_miss_num_map(a8(indx));
49 t(ddindx).security_group_id := rosetta_g_miss_num_map(a9(indx));
50 ddindx := ddindx+1;
51 if a0.last =indx
52 then exit;
53 end if;
54 indx := a0.next(indx);
55 end loop;
56 end if;
57 end if;
58 end rosetta_table_copy_in_p3;
59 procedure rosetta_table_copy_out_p3(t ams_template_res_pvt.template_res_tbl_type, a0 OUT NOCOPY JTF_NUMBER_TABLE
60 , a1 OUT NOCOPY JTF_NUMBER_TABLE
61 , a2 OUT NOCOPY JTF_NUMBER_TABLE
62 , a3 OUT NOCOPY JTF_DATE_TABLE
63 , a4 OUT NOCOPY JTF_NUMBER_TABLE
64 , a5 OUT NOCOPY JTF_DATE_TABLE
65 , a6 OUT NOCOPY JTF_NUMBER_TABLE
66 , a7 OUT NOCOPY JTF_NUMBER_TABLE
67 , a8 OUT NOCOPY JTF_NUMBER_TABLE
68 , a9 OUT NOCOPY JTF_NUMBER_TABLE
69 ) as
70 ddindx binary_integer; indx binary_integer;
71 begin
72 if t is null or t.count = 0 then
73 a0 := JTF_NUMBER_TABLE();
74 a1 := JTF_NUMBER_TABLE();
75 a2 := JTF_NUMBER_TABLE();
76 a3 := JTF_DATE_TABLE();
77 a4 := JTF_NUMBER_TABLE();
78 a5 := JTF_DATE_TABLE();
79 a6 := JTF_NUMBER_TABLE();
80 a7 := JTF_NUMBER_TABLE();
81 a8 := JTF_NUMBER_TABLE();
82 a9 := JTF_NUMBER_TABLE();
83 else
84 a0 := JTF_NUMBER_TABLE();
85 a1 := JTF_NUMBER_TABLE();
86 a2 := JTF_NUMBER_TABLE();
87 a3 := JTF_DATE_TABLE();
88 a4 := JTF_NUMBER_TABLE();
89 a5 := JTF_DATE_TABLE();
90 a6 := JTF_NUMBER_TABLE();
91 a7 := JTF_NUMBER_TABLE();
92 a8 := JTF_NUMBER_TABLE();
93 a9 := JTF_NUMBER_TABLE();
94 if t.count > 0 then
95 a0.extend(t.count);
96 a1.extend(t.count);
97 a2.extend(t.count);
98 a3.extend(t.count);
99 a4.extend(t.count);
100 a5.extend(t.count);
101 a6.extend(t.count);
102 a7.extend(t.count);
103 a8.extend(t.count);
104 a9.extend(t.count);
105 ddindx := t.first;
106 indx := 1;
107 while true loop
108 a0(indx) := rosetta_g_miss_num_map(t(ddindx).templ_responsibility_id);
109 a1(indx) := rosetta_g_miss_num_map(t(ddindx).template_id);
110 a2(indx) := rosetta_g_miss_num_map(t(ddindx).responsibility_id);
111 a3(indx) := t(ddindx).last_update_date;
112 a4(indx) := rosetta_g_miss_num_map(t(ddindx).last_updated_by);
113 a5(indx) := t(ddindx).creation_date;
114 a6(indx) := rosetta_g_miss_num_map(t(ddindx).created_by);
115 a7(indx) := rosetta_g_miss_num_map(t(ddindx).object_version_number);
116 a8(indx) := rosetta_g_miss_num_map(t(ddindx).last_update_login);
117 a9(indx) := rosetta_g_miss_num_map(t(ddindx).security_group_id);
118 indx := indx+1;
119 if t.last =ddindx
120 then exit;
121 end if;
122 ddindx := t.next(ddindx);
123 end loop;
124 end if;
125 end if;
126 end rosetta_table_copy_out_p3;
127
128 procedure create_template_res(p_api_version_number NUMBER
129 , p_init_msg_list VARCHAR2
130 , p_commit VARCHAR2
131 , p_validation_level NUMBER
132 , x_return_status OUT NOCOPY VARCHAR2
133 , x_msg_count OUT NOCOPY NUMBER
134 , x_msg_data OUT NOCOPY VARCHAR2
135 , x_templ_responsibility_id OUT NOCOPY NUMBER
136 , p7_a0 NUMBER := 0-1962.0724
137 , p7_a1 NUMBER := 0-1962.0724
138 , p7_a2 NUMBER := 0-1962.0724
139 , p7_a3 DATE := fnd_api.g_miss_date
140 , p7_a4 NUMBER := 0-1962.0724
141 , p7_a5 DATE := fnd_api.g_miss_date
142 , p7_a6 NUMBER := 0-1962.0724
143 , p7_a7 NUMBER := 0-1962.0724
144 , p7_a8 NUMBER := 0-1962.0724
145 , p7_a9 NUMBER := 0-1962.0724
146 )
147 as
148 ddp_template_res_rec ams_template_res_pvt.template_res_rec_type;
149 ddindx binary_integer; indx binary_integer;
150 begin
151
152 -- copy data to the local IN or IN-OUT args, if any
153
154
155
156
157
158
159
160 ddp_template_res_rec.templ_responsibility_id := rosetta_g_miss_num_map(p7_a0);
161 ddp_template_res_rec.template_id := rosetta_g_miss_num_map(p7_a1);
162 ddp_template_res_rec.responsibility_id := rosetta_g_miss_num_map(p7_a2);
163 ddp_template_res_rec.last_update_date := rosetta_g_miss_date_in_map(p7_a3);
164 ddp_template_res_rec.last_updated_by := rosetta_g_miss_num_map(p7_a4);
165 ddp_template_res_rec.creation_date := rosetta_g_miss_date_in_map(p7_a5);
166 ddp_template_res_rec.created_by := rosetta_g_miss_num_map(p7_a6);
167 ddp_template_res_rec.object_version_number := rosetta_g_miss_num_map(p7_a7);
168 ddp_template_res_rec.last_update_login := rosetta_g_miss_num_map(p7_a8);
169 ddp_template_res_rec.security_group_id := rosetta_g_miss_num_map(p7_a9);
170
171
172 -- here's the delegated call to the old PL/SQL routine
173 ams_template_res_pvt.create_template_res(p_api_version_number,
174 p_init_msg_list,
175 p_commit,
176 p_validation_level,
177 x_return_status,
178 x_msg_count,
179 x_msg_data,
180 ddp_template_res_rec,
181 x_templ_responsibility_id);
182
183 -- copy data back from the local OUT or IN-OUT args, if any
184
185
186
187
188
189
190
191
192 end;
193
194 procedure update_template_res(p_api_version_number NUMBER
195 , p_init_msg_list VARCHAR2
196 , p_commit VARCHAR2
197 , p_validation_level NUMBER
198 , x_return_status OUT NOCOPY VARCHAR2
199 , x_msg_count OUT NOCOPY NUMBER
200 , x_msg_data OUT NOCOPY VARCHAR2
201 , p7_a0 NUMBER := 0-1962.0724
202 , p7_a1 NUMBER := 0-1962.0724
203 , p7_a2 NUMBER := 0-1962.0724
204 , p7_a3 DATE := fnd_api.g_miss_date
205 , p7_a4 NUMBER := 0-1962.0724
206 , p7_a5 DATE := fnd_api.g_miss_date
207 , p7_a6 NUMBER := 0-1962.0724
208 , p7_a7 NUMBER := 0-1962.0724
209 , p7_a8 NUMBER := 0-1962.0724
210 , p7_a9 NUMBER := 0-1962.0724
211 )
212 as
213 ddp_template_res_rec ams_template_res_pvt.template_res_rec_type;
214 ddindx binary_integer; indx binary_integer;
215 begin
216
217 -- copy data to the local IN or IN-OUT args, if any
218
219
220
221
222
223
224
225 ddp_template_res_rec.templ_responsibility_id := rosetta_g_miss_num_map(p7_a0);
226 ddp_template_res_rec.template_id := rosetta_g_miss_num_map(p7_a1);
227 ddp_template_res_rec.responsibility_id := rosetta_g_miss_num_map(p7_a2);
228 ddp_template_res_rec.last_update_date := rosetta_g_miss_date_in_map(p7_a3);
229 ddp_template_res_rec.last_updated_by := rosetta_g_miss_num_map(p7_a4);
230 ddp_template_res_rec.creation_date := rosetta_g_miss_date_in_map(p7_a5);
231 ddp_template_res_rec.created_by := rosetta_g_miss_num_map(p7_a6);
232 ddp_template_res_rec.object_version_number := rosetta_g_miss_num_map(p7_a7);
233 ddp_template_res_rec.last_update_login := rosetta_g_miss_num_map(p7_a8);
234 ddp_template_res_rec.security_group_id := rosetta_g_miss_num_map(p7_a9);
235
236 -- here's the delegated call to the old PL/SQL routine
237 ams_template_res_pvt.update_template_res(p_api_version_number,
238 p_init_msg_list,
239 p_commit,
240 p_validation_level,
241 x_return_status,
242 x_msg_count,
243 x_msg_data,
244 ddp_template_res_rec);
245
246 -- copy data back from the local OUT or IN-OUT args, if any
247
248
249
250
251
252
253
254 end;
255
256 procedure validate_template_res(p_api_version_number NUMBER
257 , p_init_msg_list VARCHAR2
258 , p_validation_level NUMBER
259 , p_validation_mode VARCHAR2
260 , x_return_status OUT NOCOPY VARCHAR2
261 , x_msg_count OUT NOCOPY NUMBER
262 , x_msg_data OUT NOCOPY VARCHAR2
263 , p3_a0 NUMBER := 0-1962.0724
264 , p3_a1 NUMBER := 0-1962.0724
265 , p3_a2 NUMBER := 0-1962.0724
266 , p3_a3 DATE := fnd_api.g_miss_date
267 , p3_a4 NUMBER := 0-1962.0724
268 , p3_a5 DATE := fnd_api.g_miss_date
269 , p3_a6 NUMBER := 0-1962.0724
270 , p3_a7 NUMBER := 0-1962.0724
271 , p3_a8 NUMBER := 0-1962.0724
272 , p3_a9 NUMBER := 0-1962.0724
273 )
274 as
275 ddp_template_res_rec ams_template_res_pvt.template_res_rec_type;
276 ddindx binary_integer; indx binary_integer;
277 begin
278
279 -- copy data to the local IN or IN-OUT args, if any
280
281
282
283 ddp_template_res_rec.templ_responsibility_id := rosetta_g_miss_num_map(p3_a0);
284 ddp_template_res_rec.template_id := rosetta_g_miss_num_map(p3_a1);
285 ddp_template_res_rec.responsibility_id := rosetta_g_miss_num_map(p3_a2);
286 ddp_template_res_rec.last_update_date := rosetta_g_miss_date_in_map(p3_a3);
287 ddp_template_res_rec.last_updated_by := rosetta_g_miss_num_map(p3_a4);
288 ddp_template_res_rec.creation_date := rosetta_g_miss_date_in_map(p3_a5);
289 ddp_template_res_rec.created_by := rosetta_g_miss_num_map(p3_a6);
290 ddp_template_res_rec.object_version_number := rosetta_g_miss_num_map(p3_a7);
291 ddp_template_res_rec.last_update_login := rosetta_g_miss_num_map(p3_a8);
292 ddp_template_res_rec.security_group_id := rosetta_g_miss_num_map(p3_a9);
293
294
295
296
297
298 -- here's the delegated call to the old PL/SQL routine
299 ams_template_res_pvt.validate_template_res(p_api_version_number,
300 p_init_msg_list,
301 p_validation_level,
302 ddp_template_res_rec,
303 p_validation_mode,
304 x_return_status,
305 x_msg_count,
306 x_msg_data);
307
308 -- copy data back from the local OUT or IN-OUT args, if any
309
310
311
312
313
314
315
316 end;
317
318 procedure check_template_res_items(p_validation_mode VARCHAR2
319 , x_return_status OUT NOCOPY VARCHAR2
320 , p0_a0 NUMBER := 0-1962.0724
321 , p0_a1 NUMBER := 0-1962.0724
322 , p0_a2 NUMBER := 0-1962.0724
323 , p0_a3 DATE := fnd_api.g_miss_date
324 , p0_a4 NUMBER := 0-1962.0724
325 , p0_a5 DATE := fnd_api.g_miss_date
326 , p0_a6 NUMBER := 0-1962.0724
327 , p0_a7 NUMBER := 0-1962.0724
328 , p0_a8 NUMBER := 0-1962.0724
329 , p0_a9 NUMBER := 0-1962.0724
330 )
331 as
332 ddp_template_res_rec ams_template_res_pvt.template_res_rec_type;
333 ddindx binary_integer; indx binary_integer;
334 begin
335
336 -- copy data to the local IN or IN-OUT args, if any
337 ddp_template_res_rec.templ_responsibility_id := rosetta_g_miss_num_map(p0_a0);
338 ddp_template_res_rec.template_id := rosetta_g_miss_num_map(p0_a1);
339 ddp_template_res_rec.responsibility_id := rosetta_g_miss_num_map(p0_a2);
340 ddp_template_res_rec.last_update_date := rosetta_g_miss_date_in_map(p0_a3);
341 ddp_template_res_rec.last_updated_by := rosetta_g_miss_num_map(p0_a4);
342 ddp_template_res_rec.creation_date := rosetta_g_miss_date_in_map(p0_a5);
343 ddp_template_res_rec.created_by := rosetta_g_miss_num_map(p0_a6);
344 ddp_template_res_rec.object_version_number := rosetta_g_miss_num_map(p0_a7);
345 ddp_template_res_rec.last_update_login := rosetta_g_miss_num_map(p0_a8);
346 ddp_template_res_rec.security_group_id := rosetta_g_miss_num_map(p0_a9);
347
348
349
350 -- here's the delegated call to the old PL/SQL routine
351 ams_template_res_pvt.check_template_res_items(ddp_template_res_rec,
352 p_validation_mode,
353 x_return_status);
354
355 -- copy data back from the local OUT or IN-OUT args, if any
356
357
358 end;
359
360 procedure validate_template_res_rec(p_api_version_number NUMBER
361 , p_init_msg_list VARCHAR2
362 , x_return_status OUT NOCOPY VARCHAR2
363 , x_msg_count OUT NOCOPY NUMBER
364 , x_msg_data OUT NOCOPY VARCHAR2
365 , p5_a0 NUMBER := 0-1962.0724
366 , p5_a1 NUMBER := 0-1962.0724
367 , p5_a2 NUMBER := 0-1962.0724
368 , p5_a3 DATE := fnd_api.g_miss_date
369 , p5_a4 NUMBER := 0-1962.0724
370 , p5_a5 DATE := fnd_api.g_miss_date
371 , p5_a6 NUMBER := 0-1962.0724
372 , p5_a7 NUMBER := 0-1962.0724
373 , p5_a8 NUMBER := 0-1962.0724
374 , p5_a9 NUMBER := 0-1962.0724
375 )
376 as
377 ddp_template_res_rec ams_template_res_pvt.template_res_rec_type;
378 ddindx binary_integer; indx binary_integer;
379 begin
380
381 -- copy data to the local IN or IN-OUT args, if any
382
383
384
385
386
387 ddp_template_res_rec.templ_responsibility_id := rosetta_g_miss_num_map(p5_a0);
388 ddp_template_res_rec.template_id := rosetta_g_miss_num_map(p5_a1);
389 ddp_template_res_rec.responsibility_id := rosetta_g_miss_num_map(p5_a2);
390 ddp_template_res_rec.last_update_date := rosetta_g_miss_date_in_map(p5_a3);
391 ddp_template_res_rec.last_updated_by := rosetta_g_miss_num_map(p5_a4);
392 ddp_template_res_rec.creation_date := rosetta_g_miss_date_in_map(p5_a5);
393 ddp_template_res_rec.created_by := rosetta_g_miss_num_map(p5_a6);
394 ddp_template_res_rec.object_version_number := rosetta_g_miss_num_map(p5_a7);
395 ddp_template_res_rec.last_update_login := rosetta_g_miss_num_map(p5_a8);
396 ddp_template_res_rec.security_group_id := rosetta_g_miss_num_map(p5_a9);
397
398 -- here's the delegated call to the old PL/SQL routine
399 ams_template_res_pvt.validate_template_res_rec(p_api_version_number,
400 p_init_msg_list,
401 x_return_status,
402 x_msg_count,
403 x_msg_data,
404 ddp_template_res_rec);
405
406 -- copy data back from the local OUT or IN-OUT args, if any
407
408
409
410
411
412 end;
413
414 end ams_template_res_pvt_w;