1 package body okl_open_interface_pvt_w as
2 /* $Header: OKLEKOIB.pls 120.1 2005/10/04 20:21:17 cklee 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 check_input_record(p_init_msg_list VARCHAR2
23 , x_return_status out nocopy VARCHAR2
24 , x_msg_count out nocopy NUMBER
25 , x_msg_data out nocopy VARCHAR2
26 , p_batch_number VARCHAR2
27 , p_start_date_from date
28 , p_start_date_to date
29 , p_contract_number VARCHAR2
30 , p_customer_number VARCHAR2
31 , x_total_checked out nocopy NUMBER
32 )
33
34 as
35 ddp_start_date_from date;
36 ddp_start_date_to date;
37 ddindx binary_integer; indx binary_integer;
38 begin
39
40 -- copy data to the local IN or IN-OUT args, if any
41
42
43
44
45
46 ddp_start_date_from := rosetta_g_miss_date_in_map(p_start_date_from);
47
48 ddp_start_date_to := rosetta_g_miss_date_in_map(p_start_date_to);
49
50
51
52
53 -- here's the delegated call to the old PL/SQL routine
54 okl_open_interface_pvt.check_input_record(p_init_msg_list,
55 x_return_status,
56 x_msg_count,
57 x_msg_data,
58 p_batch_number,
59 ddp_start_date_from,
60 ddp_start_date_to,
61 p_contract_number,
62 p_customer_number,
63 x_total_checked);
64
65 -- copy data back from the local variables to OUT or IN-OUT args, if any
66
67
68
69
70
71
72
73
74
75 end;
76
77 procedure load_input_record(p_init_msg_list VARCHAR2
78 , x_return_status out nocopy VARCHAR2
79 , x_msg_count out nocopy NUMBER
80 , x_msg_data out nocopy VARCHAR2
81 , p_batch_number VARCHAR2
82 , p_start_date_from date
83 , p_start_date_to date
84 , p_contract_number VARCHAR2
85 , p_customer_number VARCHAR2
86 , x_total_loaded out nocopy NUMBER
87 )
88
89 as
90 ddp_start_date_from date;
91 ddp_start_date_to date;
92 ddindx binary_integer; indx binary_integer;
93 begin
94
95 -- copy data to the local IN or IN-OUT args, if any
96
97
98
99
100
101 ddp_start_date_from := rosetta_g_miss_date_in_map(p_start_date_from);
102
103 ddp_start_date_to := rosetta_g_miss_date_in_map(p_start_date_to);
104
105
106
107
108 -- here's the delegated call to the old PL/SQL routine
109 okl_open_interface_pvt.load_input_record(p_init_msg_list,
110 x_return_status,
111 x_msg_count,
112 x_msg_data,
113 p_batch_number,
114 ddp_start_date_from,
115 ddp_start_date_to,
116 p_contract_number,
117 p_customer_number,
118 x_total_loaded);
119
120 -- copy data back from the local variables to OUT or IN-OUT args, if any
121
122
123
124
125
126
127
128
129
130 end;
131
132 function submit_import_contract(p_api_version NUMBER
133 , p_init_msg_list VARCHAR2
134 , x_return_status out nocopy VARCHAR2
135 , x_msg_count out nocopy NUMBER
136 , x_msg_data out nocopy VARCHAR2
137 , p_batch_number VARCHAR2
138 , p_contract_number VARCHAR2
139 , p_start_date date
140 , p_end_date date
141 , p_party_number VARCHAR2
142 ) return number
143
144 as
145 ddp_start_date date;
146 ddp_end_date date;
147 ddindx binary_integer; indx binary_integer;
148 ddrosetta_retval number;
149 begin
150
151 -- copy data to the local IN or IN-OUT args, if any
152
153
154
155
156
157
158
159 ddp_start_date := rosetta_g_miss_date_in_map(p_start_date);
160
161 ddp_end_date := rosetta_g_miss_date_in_map(p_end_date);
162
163
164 -- here's the delegated call to the old PL/SQL routine
165 ddrosetta_retval := okl_open_interface_pvt.submit_import_contract(p_api_version,
166 p_init_msg_list,
167 x_return_status,
168 x_msg_count,
169 x_msg_data,
170 p_batch_number,
171 p_contract_number,
172 ddp_start_date,
173 ddp_end_date,
174 p_party_number);
175
176 -- copy data back from the local variables to OUT or IN-OUT args, if any
177
178
179
180
181
182
183
184
185
186
187 return ddrosetta_retval;
188 end;
189
190 end okl_open_interface_pvt_w;