1 package body ahl_uc_validation_pub_w as
2 /* $Header: AHLWUCVB.pls 120.0.12020000.2 2012/12/14 07:08:32 shnatu 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 rosetta_g_mistake_date_high date := to_date('01/01/+4710', 'MM/DD/SYYYY');
6 rosetta_g_mistake_date_low date := to_date('01/01/-4710', 'MM/DD/SYYYY');
7
8 -- this is to workaround the JDBC bug regarding IN DATE of value GMiss
9 function rosetta_g_miss_date_in_map(d date) return date as
10 begin
11 if d > rosetta_g_mistake_date_high then return fnd_api.g_miss_date; end if;
12 if d < rosetta_g_mistake_date_low then return fnd_api.g_miss_date; end if;
13 return d;
14 end;
15
16 procedure rosetta_table_copy_in_p0(t out nocopy ahl_uc_validation_pub.error_tbl_type, a0 JTF_VARCHAR2_TABLE_2000) as
17 ddindx binary_integer; indx binary_integer;
18 begin
19 if a0 is not null and a0.count > 0 then
20 if a0.count > 0 then
21 indx := a0.first;
22 ddindx := 1;
23 while true loop
24 t(ddindx) := a0(indx);
25 ddindx := ddindx+1;
26 if a0.last =indx
27 then exit;
28 end if;
29 indx := a0.next(indx);
30 end loop;
31 end if;
32 end if;
33 end rosetta_table_copy_in_p0;
34 procedure rosetta_table_copy_out_p0(t ahl_uc_validation_pub.error_tbl_type, a0 out nocopy JTF_VARCHAR2_TABLE_2000) as
35 ddindx binary_integer; indx binary_integer;
36 begin
37 if t is null or t.count = 0 then
38 a0 := JTF_VARCHAR2_TABLE_2000();
39 else
40 a0 := JTF_VARCHAR2_TABLE_2000();
41 if t.count > 0 then
42 a0.extend(t.count);
43 ddindx := t.first;
44 indx := 1;
45 while true loop
46 a0(indx) := t(ddindx);
47 indx := indx+1;
48 if t.last =ddindx
49 then exit;
50 end if;
51 ddindx := t.next(ddindx);
52 end loop;
53 end if;
54 end if;
55 end rosetta_table_copy_out_p0;
56
57 procedure validate_completeness(p_api_version NUMBER
58 , p_init_msg_list VARCHAR2
59 , p_commit VARCHAR2
60 , p_validation_level NUMBER
61 , x_return_status out nocopy VARCHAR2
62 , x_msg_count out nocopy NUMBER
63 , x_msg_data out nocopy VARCHAR2
64 , p_unit_header_id NUMBER
65 , p_visit_id NUMBER
66 , x_error_tbl out nocopy JTF_VARCHAR2_TABLE_2000
67 )
68
69 as
70 ddx_error_tbl ahl_uc_validation_pub.error_tbl_type;
71 ddindx binary_integer; indx binary_integer;
72 begin
73
74 -- copy data to the local IN or IN-OUT args, if any
75
76
77
78
79
80
81
82
83
84
85 -- here's the delegated call to the old PL/SQL routine
86 ahl_uc_validation_pub.validate_completeness(p_api_version,
87 p_init_msg_list,
88 p_commit,
89 p_validation_level,
90 x_return_status,
91 x_msg_count,
92 x_msg_data,
93 p_unit_header_id,
94 p_visit_id,
95 ddx_error_tbl);
96
97 -- copy data back from the local variables to OUT or IN-OUT args, if any
98
99
100
101
102
103
104
105
106
107 ahl_uc_validation_pub_w.rosetta_table_copy_out_p0(ddx_error_tbl, x_error_tbl);
108 end;
109
110 procedure validate_complete_for_pos(p_api_version NUMBER
111 , p_init_msg_list VARCHAR2
112 , p_commit VARCHAR2
113 , p_validation_level NUMBER
114 , x_return_status out nocopy VARCHAR2
115 , x_msg_count out nocopy NUMBER
116 , x_msg_data out nocopy VARCHAR2
117 , p_csi_instance_id NUMBER
118 , x_error_tbl out nocopy JTF_VARCHAR2_TABLE_2000
119 )
120
121 as
122 ddx_error_tbl ahl_uc_validation_pub.error_tbl_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
133
134
135
136 -- here's the delegated call to the old PL/SQL routine
137 ahl_uc_validation_pub.validate_complete_for_pos(p_api_version,
138 p_init_msg_list,
139 p_commit,
140 p_validation_level,
141 x_return_status,
142 x_msg_count,
143 x_msg_data,
144 p_csi_instance_id,
145 ddx_error_tbl);
146
147 -- copy data back from the local variables to OUT or IN-OUT args, if any
148
149
150
151
152
153
154
155
156 ahl_uc_validation_pub_w.rosetta_table_copy_out_p0(ddx_error_tbl, x_error_tbl);
157 end;
158
159 end ahl_uc_validation_pub_w;