1 package body okl_split_contract_pvt_w as
2 /* $Header: OKLESKHB.pls 115.3 2004/01/24 00:56:50 rravikir 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_split_contract_pvt.ktl_tbl_type, 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).line_number := rosetta_g_miss_num_map(a0(indx));
34 t(ddindx).contract_number := a1(indx);
35 t(ddindx).kle_id := 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_p1;
45 procedure rosetta_table_copy_out_p1(t okl_split_contract_pvt.ktl_tbl_type, 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).line_number);
67 a1(indx) := t(ddindx).contract_number;
68 a2(indx) := rosetta_g_miss_num_map(t(ddindx).kle_id);
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_p1;
78
79 procedure create_split_contract(p_api_version NUMBER
80 , p_init_msg_list VARCHAR2
81 , x_return_status out nocopy VARCHAR2
82 , x_msg_count out nocopy NUMBER
83 , x_msg_data out nocopy VARCHAR2
84 , p_old_contract_number VARCHAR2
85 , p6_a0 JTF_NUMBER_TABLE
86 , p6_a1 JTF_VARCHAR2_TABLE_200
87 , p6_a2 JTF_NUMBER_TABLE
88 , p7_a0 out nocopy JTF_NUMBER_TABLE
89 , p7_a1 out nocopy JTF_VARCHAR2_TABLE_200
90 , p7_a2 out nocopy JTF_NUMBER_TABLE
91 )
92
93 as
94 ddp_new_khr_top_line okl_split_contract_pvt.ktl_tbl_type;
95 ddx_new_khr_top_line okl_split_contract_pvt.ktl_tbl_type;
96 ddindx binary_integer; indx binary_integer;
97 begin
98
99 -- copy data to the local IN or IN-OUT args, if any
100
101
102
103
104
105
106 okl_split_contract_pvt_w.rosetta_table_copy_in_p1(ddp_new_khr_top_line, p6_a0
107 , p6_a1
108 , p6_a2
109 );
110
111
112 -- here's the delegated call to the old PL/SQL routine
113 okl_split_contract_pvt.create_split_contract(p_api_version,
114 p_init_msg_list,
115 x_return_status,
116 x_msg_count,
117 x_msg_data,
118 p_old_contract_number,
119 ddp_new_khr_top_line,
120 ddx_new_khr_top_line);
121
122 -- copy data back from the local variables to OUT or IN-OUT args, if any
123
124
125
126
127
128
129
130 okl_split_contract_pvt_w.rosetta_table_copy_out_p1(ddx_new_khr_top_line, p7_a0
131 , p7_a1
132 , p7_a2
133 );
134 end;
135
136 end okl_split_contract_pvt_w;