[Home] [Help]
PACKAGE BODY: APPS.OKL_FORMULAEVALUATE_PVT_W
Source
1 package body okl_formulaevaluate_pvt_w as
2 /* $Header: OKLEEVAB.pls 120.1 2005/07/11 12:49:12 dkagrawa 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_p24(t out nocopy okl_formulaevaluate_pvt.ctxparameter_tbl, a0 JTF_NUMBER_TABLE
23 , a1 JTF_VARCHAR2_TABLE_200
24 , a2 JTF_NUMBER_TABLE
25 ) as
26 ddindx binary_integer; indx binary_integer;
27 begin
28 if a0 is not null and a0.count > 0 then
29 if a0.count > 0 then
30 indx := a0.first;
31 ddindx := 1;
32 while true loop
33 t(ddindx).parameter_id := rosetta_g_miss_num_map(a0(indx));
34 t(ddindx).parameter_name := a1(indx);
35 t(ddindx).parameter_value := rosetta_g_miss_num_map(a2(indx));
36 ddindx := ddindx+1;
37 if a0.last =indx
38 then exit;
39 end if;
40 indx := a0.next(indx);
41 end loop;
42 end if;
43 end if;
44 end rosetta_table_copy_in_p24;
45 procedure rosetta_table_copy_out_p24(t okl_formulaevaluate_pvt.ctxparameter_tbl, a0 out nocopy JTF_NUMBER_TABLE
46 , a1 out nocopy JTF_VARCHAR2_TABLE_200
47 , a2 out nocopy JTF_NUMBER_TABLE
48 ) as
49 ddindx binary_integer; indx binary_integer;
50 begin
51 if t is null or t.count = 0 then
52 a0 := JTF_NUMBER_TABLE();
53 a1 := JTF_VARCHAR2_TABLE_200();
54 a2 := JTF_NUMBER_TABLE();
55 else
56 a0 := JTF_NUMBER_TABLE();
57 a1 := JTF_VARCHAR2_TABLE_200();
58 a2 := JTF_NUMBER_TABLE();
59 if t.count > 0 then
60 a0.extend(t.count);
61 a1.extend(t.count);
62 a2.extend(t.count);
63 ddindx := t.first;
64 indx := 1;
65 while true loop
66 a0(indx) := rosetta_g_miss_num_map(t(ddindx).parameter_id);
67 a1(indx) := t(ddindx).parameter_name;
68 a2(indx) := rosetta_g_miss_num_map(t(ddindx).parameter_value);
69 indx := indx+1;
70 if t.last =ddindx
71 then exit;
72 end if;
73 ddindx := t.next(ddindx);
74 end loop;
75 end if;
76 end if;
77 end rosetta_table_copy_out_p24;
78
79 procedure rosetta_table_copy_in_p26(t out nocopy okl_formulaevaluate_pvt.function_tbl, a0 JTF_NUMBER_TABLE
80 , a1 JTF_VARCHAR2_TABLE_200
81 , a2 JTF_VARCHAR2_TABLE_800
82 , a3 JTF_VARCHAR2_TABLE_100
83 , a4 JTF_NUMBER_TABLE
84 ) as
85 ddindx binary_integer; indx binary_integer;
86 begin
87 if a0 is not null and a0.count > 0 then
88 if a0.count > 0 then
89 indx := a0.first;
90 ddindx := 1;
91 while true loop
92 t(ddindx).function_id := rosetta_g_miss_num_map(a0(indx));
93 t(ddindx).function_name := a1(indx);
94 t(ddindx).function_source := a2(indx);
95 t(ddindx).function_code := a3(indx);
96 t(ddindx).function_value := rosetta_g_miss_num_map(a4(indx));
97 ddindx := ddindx+1;
98 if a0.last =indx
99 then exit;
100 end if;
101 indx := a0.next(indx);
102 end loop;
103 end if;
104 end if;
105 end rosetta_table_copy_in_p26;
106 procedure rosetta_table_copy_out_p26(t okl_formulaevaluate_pvt.function_tbl, a0 out nocopy JTF_NUMBER_TABLE
107 , a1 out nocopy JTF_VARCHAR2_TABLE_200
108 , a2 out nocopy JTF_VARCHAR2_TABLE_800
109 , a3 out nocopy JTF_VARCHAR2_TABLE_100
110 , a4 out nocopy JTF_NUMBER_TABLE
111 ) as
112 ddindx binary_integer; indx binary_integer;
113 begin
114 if t is null or t.count = 0 then
115 a0 := JTF_NUMBER_TABLE();
116 a1 := JTF_VARCHAR2_TABLE_200();
117 a2 := JTF_VARCHAR2_TABLE_800();
118 a3 := JTF_VARCHAR2_TABLE_100();
119 a4 := JTF_NUMBER_TABLE();
120 else
121 a0 := JTF_NUMBER_TABLE();
122 a1 := JTF_VARCHAR2_TABLE_200();
123 a2 := JTF_VARCHAR2_TABLE_800();
124 a3 := JTF_VARCHAR2_TABLE_100();
125 a4 := JTF_NUMBER_TABLE();
126 if t.count > 0 then
127 a0.extend(t.count);
128 a1.extend(t.count);
129 a2.extend(t.count);
130 a3.extend(t.count);
131 a4.extend(t.count);
132 ddindx := t.first;
133 indx := 1;
134 while true loop
135 a0(indx) := rosetta_g_miss_num_map(t(ddindx).function_id);
136 a1(indx) := t(ddindx).function_name;
137 a2(indx) := t(ddindx).function_source;
138 a3(indx) := t(ddindx).function_code;
139 a4(indx) := rosetta_g_miss_num_map(t(ddindx).function_value);
140 indx := indx+1;
141 if t.last =ddindx
142 then exit;
143 end if;
144 ddindx := t.next(ddindx);
145 end loop;
146 end if;
147 end if;
148 end rosetta_table_copy_out_p26;
149
150 function eva_getparameterids(p_fma_id NUMBER
151 , p1_a0 out nocopy JTF_NUMBER_TABLE
152 , p1_a1 out nocopy JTF_VARCHAR2_TABLE_200
153 , p1_a2 out nocopy JTF_NUMBER_TABLE
154 ) return number
155
156 as
157 ddp_ctx_parameter_tbl okl_formulaevaluate_pvt.ctxparameter_tbl;
158 ddindx binary_integer; indx binary_integer;
159 ddrosetta_retval number;
160 begin
161
162 -- copy data to the local IN or IN-OUT args, if any
163
164
165 -- here's the delegated call to the old PL/SQL routine
166 ddrosetta_retval := okl_formulaevaluate_pvt.eva_getparameterids(p_fma_id,
167 ddp_ctx_parameter_tbl);
168
169 -- copy data back from the local variables to OUT or IN-OUT args, if any
170
171 okl_formulaevaluate_pvt_w.rosetta_table_copy_out_p24(ddp_ctx_parameter_tbl, p1_a0
172 , p1_a1
173 , p1_a2
174 );
175
176 return ddrosetta_retval;
177 end;
178
179 procedure eva_getparametervalues(p_api_version NUMBER
180 , p_init_msg_list VARCHAR2
181 , x_return_status out nocopy VARCHAR2
182 , x_msg_count out nocopy NUMBER
183 , x_msg_data out nocopy VARCHAR2
184 , p_fma_id NUMBER
185 , p_contract_id NUMBER
186 , p7_a0 out nocopy JTF_NUMBER_TABLE
187 , p7_a1 out nocopy JTF_VARCHAR2_TABLE_200
188 , p7_a2 out nocopy JTF_NUMBER_TABLE
189 , p_line_id NUMBER
190 )
191
192 as
193 ddx_ctx_parameter_tbl okl_formulaevaluate_pvt.ctxparameter_tbl;
194 ddindx binary_integer; indx binary_integer;
195 begin
196
197 -- copy data to the local IN or IN-OUT args, if any
198
199
200
201
202
203
204
205
206
207 -- here's the delegated call to the old PL/SQL routine
208 okl_formulaevaluate_pvt.eva_getparametervalues(p_api_version,
209 p_init_msg_list,
210 x_return_status,
211 x_msg_count,
212 x_msg_data,
213 p_fma_id,
214 p_contract_id,
215 ddx_ctx_parameter_tbl,
216 p_line_id);
217
218 -- copy data back from the local variables to OUT or IN-OUT args, if any
219
220
221
222
223
224
225
226 okl_formulaevaluate_pvt_w.rosetta_table_copy_out_p24(ddx_ctx_parameter_tbl, p7_a0
227 , p7_a1
228 , p7_a2
229 );
230
231 end;
232
233 procedure eva_getfunctionvalue(p_api_version NUMBER
234 , p_init_msg_list VARCHAR2
235 , x_return_status out nocopy VARCHAR2
236 , x_msg_count out nocopy NUMBER
237 , x_msg_data out nocopy VARCHAR2
238 , p_fma_id NUMBER
239 , p_contract_id NUMBER
240 , p_line_id NUMBER
241 , p8_a0 JTF_NUMBER_TABLE
242 , p8_a1 JTF_VARCHAR2_TABLE_200
243 , p8_a2 JTF_NUMBER_TABLE
244 , p9_a0 out nocopy JTF_NUMBER_TABLE
245 , p9_a1 out nocopy JTF_VARCHAR2_TABLE_200
246 , p9_a2 out nocopy JTF_VARCHAR2_TABLE_800
247 , p9_a3 out nocopy JTF_VARCHAR2_TABLE_100
248 , p9_a4 out nocopy JTF_NUMBER_TABLE
249 )
250
251 as
252 ddp_ctx_parameter_tbl okl_formulaevaluate_pvt.ctxparameter_tbl;
253 ddx_function_tbl okl_formulaevaluate_pvt.function_tbl;
254 ddindx binary_integer; indx binary_integer;
255 begin
256
257 -- copy data to the local IN or IN-OUT args, if any
258
259
260
261
262
263
264
265
266 okl_formulaevaluate_pvt_w.rosetta_table_copy_in_p24(ddp_ctx_parameter_tbl, p8_a0
267 , p8_a1
268 , p8_a2
269 );
270
271
272 -- here's the delegated call to the old PL/SQL routine
273 okl_formulaevaluate_pvt.eva_getfunctionvalue(p_api_version,
274 p_init_msg_list,
275 x_return_status,
276 x_msg_count,
277 x_msg_data,
278 p_fma_id,
279 p_contract_id,
280 p_line_id,
281 ddp_ctx_parameter_tbl,
282 ddx_function_tbl);
283
284 -- copy data back from the local variables to OUT or IN-OUT args, if any
285
286
287
288
289
290
291
292
293
294 okl_formulaevaluate_pvt_w.rosetta_table_copy_out_p26(ddx_function_tbl, p9_a0
295 , p9_a1
296 , p9_a2
297 , p9_a3
298 , p9_a4
299 );
300 end;
301
302 end okl_formulaevaluate_pvt_w;