1 package body ahl_prd_print_pvt_w as
2 /* $Header: AHLWPPRB.pls 120.0 2005/07/05 00:10 bachandr 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 procedure rosetta_table_copy_in_p0(t out nocopy ahl_prd_print_pvt.workorder_tbl_type, a0 JTF_NUMBER_TABLE) as
14 ddindx binary_integer; indx binary_integer;
15 begin
16 if a0 is not null and a0.count > 0 then
17 if a0.count > 0 then
18 indx := a0.first;
19 ddindx := 1;
20 while true loop
21 t(ddindx) := a0(indx);
22 ddindx := ddindx+1;
23 if a0.last =indx
24 then exit;
25 end if;
26 indx := a0.next(indx);
27 end loop;
28 end if;
29 end if;
30 end rosetta_table_copy_in_p0;
31 procedure rosetta_table_copy_out_p0(t ahl_prd_print_pvt.workorder_tbl_type, a0 out nocopy JTF_NUMBER_TABLE) as
32 ddindx binary_integer; indx binary_integer;
33 begin
34 if t is null or t.count = 0 then
35 a0 := JTF_NUMBER_TABLE();
36 else
37 a0 := JTF_NUMBER_TABLE();
38 if t.count > 0 then
39 a0.extend(t.count);
40 ddindx := t.first;
41 indx := 1;
42 while true loop
43 a0(indx) := t(ddindx);
44 indx := indx+1;
45 if t.last =ddindx
46 then exit;
47 end if;
48 ddindx := t.next(ddindx);
49 end loop;
50 end if;
51 end if;
52 end rosetta_table_copy_out_p0;
53
54 procedure gen_wo_xml(p_api_version NUMBER
55 , p_init_msg_list VARCHAR2
56 , p_commit VARCHAR2
57 , p_validation_level NUMBER
58 , p_default VARCHAR2
59 , p_module_type VARCHAR2
60 , x_return_status out nocopy VARCHAR2
61 , x_msg_count out nocopy NUMBER
62 , x_msg_data out nocopy VARCHAR2
63 , p_workorders_tbl JTF_NUMBER_TABLE
64 , p_employee_id NUMBER
65 , p_user_role VARCHAR2
66 , p_material_req_flag VARCHAR2
67 , x_xml_data out nocopy CLOB
68 , p_concurrent_flag VARCHAR2
69 )
70
71 as
72 ddp_workorders_tbl ahl_prd_print_pvt.workorder_tbl_type;
73 ddindx binary_integer; indx binary_integer;
74 begin
75
76 -- copy data to the local IN or IN-OUT args, if any
77
78
79
80
81
82
83
84
85
86 ahl_prd_print_pvt_w.rosetta_table_copy_in_p0(ddp_workorders_tbl, p_workorders_tbl);
87
88
89
90
91
92
93 -- here's the delegated call to the old PL/SQL routine
94 ahl_prd_print_pvt.gen_wo_xml(p_api_version,
95 p_init_msg_list,
96 p_commit,
97 p_validation_level,
98 p_default,
99 p_module_type,
100 x_return_status,
101 x_msg_count,
102 x_msg_data,
103 ddp_workorders_tbl,
104 p_employee_id,
105 p_user_role,
106 p_material_req_flag,
107 x_xml_data,
108 p_concurrent_flag);
109
110 -- copy data back from the local variables to OUT or IN-OUT args, if any
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125 end;
126
127 end ahl_prd_print_pvt_w;