[Home] [Help]
PACKAGE BODY: APPS.OKL_INV_FORMAT_DELETE_PVT_W
Source
1 package body okl_inv_format_delete_pvt_w as
2 /* $Header: OKLEIFDB.pls 120.1 2005/07/11 12:50:11 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_p1(t out nocopy okl_inv_format_delete_pvt.inf_del_tbl_type, a0 JTF_NUMBER_TABLE
23 , a1 JTF_NUMBER_TABLE
24 , a2 JTF_VARCHAR2_TABLE_200
25 , a3 JTF_VARCHAR2_TABLE_2000
26 , a4 JTF_VARCHAR2_TABLE_100
27 , a5 JTF_DATE_TABLE
28 , a6 JTF_DATE_TABLE
29 ) as
30 ddindx binary_integer; indx binary_integer;
31 begin
32 if a0 is not null and a0.count > 0 then
33 if a0.count > 0 then
34 indx := a0.first;
35 ddindx := 1;
36 while true loop
37 t(ddindx).id := rosetta_g_miss_num_map(a0(indx));
38 t(ddindx).ilt_id := rosetta_g_miss_num_map(a1(indx));
39 t(ddindx).name := a2(indx);
40 t(ddindx).description := a3(indx);
41 t(ddindx).contract_level_yn := a4(indx);
42 t(ddindx).start_date := rosetta_g_miss_date_in_map(a5(indx));
43 t(ddindx).end_date := rosetta_g_miss_date_in_map(a6(indx));
44 ddindx := ddindx+1;
45 if a0.last =indx
46 then exit;
47 end if;
48 indx := a0.next(indx);
49 end loop;
50 end if;
51 end if;
52 end rosetta_table_copy_in_p1;
53 procedure rosetta_table_copy_out_p1(t okl_inv_format_delete_pvt.inf_del_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
54 , a1 out nocopy JTF_NUMBER_TABLE
55 , a2 out nocopy JTF_VARCHAR2_TABLE_200
56 , a3 out nocopy JTF_VARCHAR2_TABLE_2000
57 , a4 out nocopy JTF_VARCHAR2_TABLE_100
58 , a5 out nocopy JTF_DATE_TABLE
59 , a6 out nocopy JTF_DATE_TABLE
60 ) as
61 ddindx binary_integer; indx binary_integer;
62 begin
63 if t is null or t.count = 0 then
64 a0 := JTF_NUMBER_TABLE();
65 a1 := JTF_NUMBER_TABLE();
66 a2 := JTF_VARCHAR2_TABLE_200();
67 a3 := JTF_VARCHAR2_TABLE_2000();
68 a4 := JTF_VARCHAR2_TABLE_100();
69 a5 := JTF_DATE_TABLE();
70 a6 := JTF_DATE_TABLE();
71 else
72 a0 := JTF_NUMBER_TABLE();
73 a1 := JTF_NUMBER_TABLE();
74 a2 := JTF_VARCHAR2_TABLE_200();
75 a3 := JTF_VARCHAR2_TABLE_2000();
76 a4 := JTF_VARCHAR2_TABLE_100();
77 a5 := JTF_DATE_TABLE();
78 a6 := JTF_DATE_TABLE();
79 if t.count > 0 then
80 a0.extend(t.count);
81 a1.extend(t.count);
82 a2.extend(t.count);
83 a3.extend(t.count);
84 a4.extend(t.count);
85 a5.extend(t.count);
86 a6.extend(t.count);
87 ddindx := t.first;
88 indx := 1;
89 while true loop
90 a0(indx) := rosetta_g_miss_num_map(t(ddindx).id);
91 a1(indx) := rosetta_g_miss_num_map(t(ddindx).ilt_id);
92 a2(indx) := t(ddindx).name;
93 a3(indx) := t(ddindx).description;
94 a4(indx) := t(ddindx).contract_level_yn;
95 a5(indx) := t(ddindx).start_date;
96 a6(indx) := t(ddindx).end_date;
97 indx := indx+1;
98 if t.last =ddindx
99 then exit;
100 end if;
101 ddindx := t.next(ddindx);
102 end loop;
103 end if;
104 end if;
105 end rosetta_table_copy_out_p1;
106
107 procedure delete_format(p_api_version NUMBER
108 , p_init_msg_list VARCHAR2
109 , x_return_status out nocopy VARCHAR2
110 , x_msg_count out nocopy NUMBER
111 , x_msg_data out nocopy VARCHAR2
112 , p5_a0 NUMBER := 0-1962.0724
113 , p5_a1 NUMBER := 0-1962.0724
114 , p5_a2 VARCHAR2 := fnd_api.g_miss_char
115 , p5_a3 VARCHAR2 := fnd_api.g_miss_char
116 , p5_a4 VARCHAR2 := fnd_api.g_miss_char
117 , p5_a5 DATE := fnd_api.g_miss_date
118 , p5_a6 DATE := fnd_api.g_miss_date
119 )
120
121 as
122 ddp_inf_del_rec okl_inv_format_delete_pvt.inf_del_rec_type;
123 ddindx binary_integer; indx binary_integer;
124 begin
125
126 -- copy data to the local IN or IN-OUT args, if any
127
128
129
130
131
132 ddp_inf_del_rec.id := rosetta_g_miss_num_map(p5_a0);
133 ddp_inf_del_rec.ilt_id := rosetta_g_miss_num_map(p5_a1);
134 ddp_inf_del_rec.name := p5_a2;
135 ddp_inf_del_rec.description := p5_a3;
136 ddp_inf_del_rec.contract_level_yn := p5_a4;
137 ddp_inf_del_rec.start_date := rosetta_g_miss_date_in_map(p5_a5);
138 ddp_inf_del_rec.end_date := rosetta_g_miss_date_in_map(p5_a6);
139
140 -- here's the delegated call to the old PL/SQL routine
141 okl_inv_format_delete_pvt.delete_format(p_api_version,
142 p_init_msg_list,
143 x_return_status,
144 x_msg_count,
145 x_msg_data,
146 ddp_inf_del_rec);
147
148 -- copy data back from the local variables to OUT or IN-OUT args, if any
149
150
151
152
153
154 end;
155
156 procedure delete_format(p_api_version NUMBER
157 , p_init_msg_list VARCHAR2
158 , x_return_status out nocopy VARCHAR2
159 , x_msg_count out nocopy NUMBER
160 , x_msg_data out nocopy VARCHAR2
161 , p5_a0 JTF_NUMBER_TABLE
162 , p5_a1 JTF_NUMBER_TABLE
163 , p5_a2 JTF_VARCHAR2_TABLE_200
164 , p5_a3 JTF_VARCHAR2_TABLE_2000
165 , p5_a4 JTF_VARCHAR2_TABLE_100
166 , p5_a5 JTF_DATE_TABLE
167 , p5_a6 JTF_DATE_TABLE
168 )
169
170 as
171 ddp_inf_del_tbl okl_inv_format_delete_pvt.inf_del_tbl_type;
172 ddindx binary_integer; indx binary_integer;
173 begin
174
175 -- copy data to the local IN or IN-OUT args, if any
176
177
178
179
180
181 okl_inv_format_delete_pvt_w.rosetta_table_copy_in_p1(ddp_inf_del_tbl, p5_a0
182 , p5_a1
183 , p5_a2
184 , p5_a3
185 , p5_a4
186 , p5_a5
187 , p5_a6
188 );
189
190 -- here's the delegated call to the old PL/SQL routine
191 okl_inv_format_delete_pvt.delete_format(p_api_version,
192 p_init_msg_list,
193 x_return_status,
194 x_msg_count,
195 x_msg_data,
196 ddp_inf_del_tbl);
197
198 -- copy data back from the local variables to OUT or IN-OUT args, if any
199
200
201
202
203
204 end;
205
206 end okl_inv_format_delete_pvt_w;