DBA Data[Home] [Help]

PACKAGE BODY: APPS.OKL_ACC_CALL_PVT_W

Source


1 package body okl_acc_call_pvt_w as
2   /* $Header: OKLEACCB.pls 120.1 2005/07/07 13:33:46 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_p2(t out nocopy okl_acc_call_pvt.bpd_acc_tbl_type, a0 JTF_NUMBER_TABLE
23     , a1 JTF_VARCHAR2_TABLE_100
24     ) as
25     ddindx binary_integer; indx binary_integer;
26   begin
27   if a0 is not null and a0.count > 0 then
28       if a0.count > 0 then
29         indx := a0.first;
30         ddindx := 1;
31         while true loop
32           t(ddindx).id := rosetta_g_miss_num_map(a0(indx));
33           t(ddindx).source_table := a1(indx);
34           ddindx := ddindx+1;
35           if a0.last =indx
36             then exit;
37           end if;
38           indx := a0.next(indx);
39         end loop;
40       end if;
41    end if;
42   end rosetta_table_copy_in_p2;
43   procedure rosetta_table_copy_out_p2(t okl_acc_call_pvt.bpd_acc_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
44     , a1 out nocopy JTF_VARCHAR2_TABLE_100
45     ) as
46     ddindx binary_integer; indx binary_integer;
47   begin
48   if t is null or t.count = 0 then
49     a0 := JTF_NUMBER_TABLE();
50     a1 := JTF_VARCHAR2_TABLE_100();
51   else
52       a0 := JTF_NUMBER_TABLE();
53       a1 := JTF_VARCHAR2_TABLE_100();
54       if t.count > 0 then
55         a0.extend(t.count);
56         a1.extend(t.count);
57         ddindx := t.first;
58         indx := 1;
59         while true loop
60           a0(indx) := rosetta_g_miss_num_map(t(ddindx).id);
61           a1(indx) := t(ddindx).source_table;
62           indx := indx+1;
63           if t.last =ddindx
64             then exit;
65           end if;
66           ddindx := t.next(ddindx);
67         end loop;
68       end if;
69    end if;
70   end rosetta_table_copy_out_p2;
71 
72   procedure create_acc_trans(p_api_version  NUMBER
73     , p_init_msg_list  VARCHAR2
74     , x_return_status out nocopy  VARCHAR2
75     , x_msg_count out nocopy  NUMBER
76     , x_msg_data out nocopy  VARCHAR2
77     , p5_a0  NUMBER := 0-1962.0724
78     , p5_a1  VARCHAR2 := fnd_api.g_miss_char
79   )
80 
81   as
82     ddp_bpd_acc_rec okl_acc_call_pvt.bpd_acc_rec_type;
83     ddindx binary_integer; indx binary_integer;
84   begin
85 
86     -- copy data to the local IN or IN-OUT args, if any
87 
88 
89 
90 
91 
92     ddp_bpd_acc_rec.id := rosetta_g_miss_num_map(p5_a0);
93     ddp_bpd_acc_rec.source_table := p5_a1;
94 
95     -- here's the delegated call to the old PL/SQL routine
96     okl_acc_call_pvt.create_acc_trans(p_api_version,
97       p_init_msg_list,
98       x_return_status,
99       x_msg_count,
100       x_msg_data,
101       ddp_bpd_acc_rec);
102 
103     -- copy data back from the local variables to OUT or IN-OUT args, if any
104 
105 
106 
107 
108 
109   end;
110 
111   procedure create_acc_trans(p_api_version  NUMBER
112     , p_init_msg_list  VARCHAR2
113     , x_return_status out nocopy  VARCHAR2
114     , x_msg_count out nocopy  NUMBER
115     , x_msg_data out nocopy  VARCHAR2
116     , p5_a0 JTF_NUMBER_TABLE
117     , p5_a1 JTF_VARCHAR2_TABLE_100
118   )
119 
120   as
121     ddp_bpd_acc_tbl okl_acc_call_pvt.bpd_acc_tbl_type;
122     ddindx binary_integer; indx binary_integer;
123   begin
124 
125     -- copy data to the local IN or IN-OUT args, if any
126 
127 
128 
129 
130 
131     okl_acc_call_pvt_w.rosetta_table_copy_in_p2(ddp_bpd_acc_tbl, p5_a0
132       , p5_a1
133       );
134 
135     -- here's the delegated call to the old PL/SQL routine
136     okl_acc_call_pvt.create_acc_trans(p_api_version,
137       p_init_msg_list,
138       x_return_status,
139       x_msg_count,
140       x_msg_data,
141       ddp_bpd_acc_tbl);
142 
143     -- copy data back from the local variables to OUT or IN-OUT args, if any
144 
145 
146 
147 
148 
149   end;
150 
151 end okl_acc_call_pvt_w;