1 package body ams_manual_list_gen_w as
2 /* $Header: amswlmlb.pls 120.0 2005/05/31 21:54:19 appldev noship $ */
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 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
7 function rosetta_g_miss_date_in_map(d date) return date as
8 begin
9 if d = rosetta_g_mistake_date then return fnd_api.g_miss_date; end if;
10 return d;
11 end;
12
13 function rosetta_g_miss_num_map(n number) return number as
14 a number := fnd_api.g_miss_num;
15 b number := 0-1962.0724;
16 begin
17 if n=a then return b; end if;
18 if n=b then return a; end if;
19 return n;
20 end;
21
22 procedure rosetta_table_copy_in_p1(t out nocopy ams_manual_list_gen.primary_key_tbl_type, a0 JTF_NUMBER_TABLE) as
23 ddindx binary_integer; indx binary_integer;
24 begin
25 if a0 is not null and a0.count > 0 then
26 if a0.count > 0 then
27 indx := a0.first;
28 ddindx := 1;
29 while true loop
30 t(ddindx) := rosetta_g_miss_num_map(a0(indx));
31 ddindx := ddindx+1;
32 if a0.last =indx
33 then exit;
34 end if;
35 indx := a0.next(indx);
36 end loop;
37 end if;
38 end if;
39 end rosetta_table_copy_in_p1;
40 procedure rosetta_table_copy_out_p1(t ams_manual_list_gen.primary_key_tbl_type, a0 out nocopy JTF_NUMBER_TABLE) as
41 ddindx binary_integer; indx binary_integer;
42 begin
43 if t is null or t.count = 0 then
44 a0 := JTF_NUMBER_TABLE();
45 else
46 a0 := JTF_NUMBER_TABLE();
47 if t.count > 0 then
48 a0.extend(t.count);
49 ddindx := t.first;
50 indx := 1;
51 while true loop
52 a0(indx) := rosetta_g_miss_num_map(t(ddindx));
53 indx := indx+1;
54 if t.last =ddindx
55 then exit;
56 end if;
57 ddindx := t.next(ddindx);
58 end loop;
59 end if;
60 end if;
61 end rosetta_table_copy_out_p1;
62
63 procedure rosetta_table_copy_in_p2(t out nocopy ams_manual_list_gen.varchar2_tbl_type, a0 JTF_VARCHAR2_TABLE_400) as
64 ddindx binary_integer; indx binary_integer;
65 begin
66 if a0 is not null and a0.count > 0 then
67 if a0.count > 0 then
68 indx := a0.first;
69 ddindx := 1;
70 while true loop
71 t(ddindx) := a0(indx);
72 ddindx := ddindx+1;
73 if a0.last =indx
74 then exit;
75 end if;
76 indx := a0.next(indx);
77 end loop;
78 end if;
79 end if;
80 end rosetta_table_copy_in_p2;
81 procedure rosetta_table_copy_out_p2(t ams_manual_list_gen.varchar2_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_400) as
82 ddindx binary_integer; indx binary_integer;
83 begin
84 if t is null or t.count = 0 then
85 a0 := JTF_VARCHAR2_TABLE_400();
86 else
87 a0 := JTF_VARCHAR2_TABLE_400();
88 if t.count > 0 then
89 a0.extend(t.count);
90 ddindx := t.first;
91 indx := 1;
92 while true loop
93 a0(indx) := t(ddindx);
94 indx := indx+1;
95 if t.last =ddindx
96 then exit;
97 end if;
98 ddindx := t.next(ddindx);
99 end loop;
100 end if;
101 end if;
102 end rosetta_table_copy_out_p2;
103
104 procedure rosetta_table_copy_in_p3(t out nocopy ams_manual_list_gen.child_type, a0 JTF_VARCHAR2_TABLE_100) as
105 ddindx binary_integer; indx binary_integer;
106 begin
107 if a0 is not null and a0.count > 0 then
108 if a0.count > 0 then
109 indx := a0.first;
110 ddindx := 1;
111 while true loop
112 t(ddindx) := a0(indx);
113 ddindx := ddindx+1;
114 if a0.last =indx
115 then exit;
116 end if;
117 indx := a0.next(indx);
118 end loop;
119 end if;
120 end if;
121 end rosetta_table_copy_in_p3;
122 procedure rosetta_table_copy_out_p3(t ams_manual_list_gen.child_type, a0 out nocopy JTF_VARCHAR2_TABLE_100) as
123 ddindx binary_integer; indx binary_integer;
124 begin
125 if t is null or t.count = 0 then
126 a0 := JTF_VARCHAR2_TABLE_100();
127 else
128 a0 := JTF_VARCHAR2_TABLE_100();
129 if t.count > 0 then
130 a0.extend(t.count);
131 ddindx := t.first;
132 indx := 1;
133 while true loop
134 a0(indx) := t(ddindx);
135 indx := indx+1;
136 if t.last =ddindx
137 then exit;
138 end if;
139 ddindx := t.next(ddindx);
140 end loop;
141 end if;
142 end if;
143 end rosetta_table_copy_out_p3;
144
145 procedure process_manual_list(p_api_version NUMBER
146 , p_init_msg_list VARCHAR2
147 , p_commit VARCHAR2
148 , p_validation_level NUMBER
149 , x_return_status out nocopy VARCHAR2
150 , x_msg_count out nocopy NUMBER
151 , x_msg_data out nocopy VARCHAR2
152 , p_list_header_id NUMBER
153 , p_primary_key_tbl JTF_NUMBER_TABLE
154 , p_master_type VARCHAR2
155 , x_added_entry_count out nocopy NUMBER
156 )
157
158 as
159 ddp_primary_key_tbl ams_manual_list_gen.primary_key_tbl_type;
160 ddindx binary_integer; indx binary_integer;
161 begin
162
163 -- copy data to the local IN or IN-OUT args, if any
164
165
166
167
168
169
170
171
172 ams_manual_list_gen_w.rosetta_table_copy_in_p1(ddp_primary_key_tbl, p_primary_key_tbl);
173
174
175
176 -- here's the delegated call to the old PL/SQL routine
177 ams_manual_list_gen.process_manual_list(p_api_version,
178 p_init_msg_list,
179 p_commit,
180 p_validation_level,
181 x_return_status,
182 x_msg_count,
183 x_msg_data,
184 p_list_header_id,
185 -- ddp_primary_key_tbl,
186 p_primary_key_tbl,
187 p_master_type,
188 x_added_entry_count);
189
190 -- copy data back from the local variables to OUT or IN-OUT args, if any
191
192
193
194
195
196
197
198
199
200
201 end;
202
203 procedure process_manual_list(p_api_version NUMBER
204 , p_init_msg_list VARCHAR2
205 , p_commit VARCHAR2
206 , p_validation_level NUMBER
207 , x_return_status out nocopy VARCHAR2
208 , x_msg_count out nocopy NUMBER
209 , x_msg_data out nocopy VARCHAR2
210 , p_list_header_id NUMBER
211 , p_primary_key_tbl JTF_NUMBER_TABLE
212 , p_master_type VARCHAR2
213 )
214
215 as
216 ddp_primary_key_tbl ams_manual_list_gen.primary_key_tbl_type;
217 ddindx binary_integer; indx binary_integer;
218 begin
219
220 -- copy data to the local IN or IN-OUT args, if any
221
222
223
224
225
226
227
228
229 ams_manual_list_gen_w.rosetta_table_copy_in_p1(ddp_primary_key_tbl, p_primary_key_tbl);
230
231
232 -- here's the delegated call to the old PL/SQL routine
233 ams_manual_list_gen.process_manual_list(p_api_version,
234 p_init_msg_list,
235 p_commit,
236 p_validation_level,
237 x_return_status,
238 x_msg_count,
239 x_msg_data,
240 p_list_header_id,
241 -- ddp_primary_key_tbl,
242 p_primary_key_tbl,
243 p_master_type);
244
245 -- copy data back from the local variables to OUT or IN-OUT args, if any
246
247
248
249
250
251
252
253
254
255 end;
256
257 procedure process_employee_list(p_api_version NUMBER
258 , p_init_msg_list VARCHAR2
259 , p_commit VARCHAR2
260 , p_validation_level NUMBER
261 , x_return_status out nocopy VARCHAR2
262 , x_msg_count out nocopy NUMBER
263 , x_msg_data out nocopy VARCHAR2
264 , p_list_header_id NUMBER
265 , p_primary_key_tbl JTF_NUMBER_TABLE
266 , p_last_name_tbl JTF_VARCHAR2_TABLE_400
267 , p_first_name_tbl JTF_VARCHAR2_TABLE_400
268 , p_email_tbl JTF_VARCHAR2_TABLE_400
269 , p_master_type VARCHAR2
270 )
271
272 as
273 ddp_primary_key_tbl ams_manual_list_gen.primary_key_tbl_type;
274 ddp_last_name_tbl ams_manual_list_gen.varchar2_tbl_type;
275 ddp_first_name_tbl ams_manual_list_gen.varchar2_tbl_type;
276 ddp_email_tbl ams_manual_list_gen.varchar2_tbl_type;
277 ddindx binary_integer; indx binary_integer;
278 begin
279
280 -- copy data to the local IN or IN-OUT args, if any
281
282
283
284
285
286
287
288
289 ams_manual_list_gen_w.rosetta_table_copy_in_p1(ddp_primary_key_tbl, p_primary_key_tbl);
290
291 ams_manual_list_gen_w.rosetta_table_copy_in_p2(ddp_last_name_tbl, p_last_name_tbl);
292
293 ams_manual_list_gen_w.rosetta_table_copy_in_p2(ddp_first_name_tbl, p_first_name_tbl);
294
295 ams_manual_list_gen_w.rosetta_table_copy_in_p2(ddp_email_tbl, p_email_tbl);
296
297
298 -- here's the delegated call to the old PL/SQL routine
299 ams_manual_list_gen.process_employee_list(p_api_version,
300 p_init_msg_list,
301 p_commit,
302 p_validation_level,
303 x_return_status,
304 x_msg_count,
305 x_msg_data,
306 p_list_header_id,
307 ddp_primary_key_tbl,
308 ddp_last_name_tbl,
309 ddp_first_name_tbl,
310 ddp_email_tbl,
311 p_master_type);
312
313 -- copy data back from the local variables to OUT or IN-OUT args, if any
314
315
316
317
318
319
320
321
322
323
324
325
326 end;
327
328 end ams_manual_list_gen_w;