DBA Data[Home] [Help]

PACKAGE BODY: APPS.AMS_LISTGENERATION_UTIL_PKG_W

Source


1 package body ams_listgeneration_util_pkg_w as
2   /* $Header: amswlgub.pls 120.0 2006/02/23 00:55 rmbhanda 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_p3(t out nocopy ams_listgeneration_util_pkg.spl_preview_count_tbl, a0 JTF_NUMBER_TABLE
23     , a1 JTF_VARCHAR2_TABLE_32767
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).s_no := rosetta_g_miss_num_map(a0(indx));
34           t(ddindx).sp_query := a1(indx);
35           t(ddindx).prv_count := 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_p3;
45   procedure rosetta_table_copy_out_p3(t ams_listgeneration_util_pkg.spl_preview_count_tbl, a0 out nocopy JTF_NUMBER_TABLE
46     , a1 out nocopy JTF_VARCHAR2_TABLE_32767
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_32767();
54     a2 := JTF_NUMBER_TABLE();
55   else
56       a0 := JTF_NUMBER_TABLE();
57       a1 := JTF_VARCHAR2_TABLE_32767();
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).s_no);
67           a1(indx) := t(ddindx).sp_query;
68           a2(indx) := rosetta_g_miss_num_map(t(ddindx).prv_count);
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_p3;
78 
79   procedure get_split_preview_count(p0_a0 in out nocopy JTF_NUMBER_TABLE
80     , p0_a1 in out nocopy JTF_VARCHAR2_TABLE_32767
81     , p0_a2 in out nocopy JTF_NUMBER_TABLE
82     , p_list_header_id  NUMBER
83     , x_return_status out nocopy  VARCHAR2
84     , x_msg_count out nocopy  NUMBER
85     , x_msg_data out nocopy  VARCHAR2
86   )
87 
88   as
89     ddp_split_preview_count_tbl ams_listgeneration_util_pkg.spl_preview_count_tbl;
90     ddindx binary_integer; indx binary_integer;
91   begin
92 
93     -- copy data to the local IN or IN-OUT args, if any
94     ams_listgeneration_util_pkg_w.rosetta_table_copy_in_p3(ddp_split_preview_count_tbl, p0_a0
95       , p0_a1
96       , p0_a2
97       );
98 
99 
100 
101 
102 
103     -- here's the delegated call to the old PL/SQL routine
104     ams_listgeneration_util_pkg.get_split_preview_count(ddp_split_preview_count_tbl,
105       p_list_header_id,
106       x_return_status,
107       x_msg_count,
108       x_msg_data);
109 
110     -- copy data back from the local variables to OUT or IN-OUT args, if any
111     ams_listgeneration_util_pkg_w.rosetta_table_copy_out_p3(ddp_split_preview_count_tbl, p0_a0
112       , p0_a1
113       , p0_a2
114       );
115 
116 
117 
118 
119   end;
120 
121 end ams_listgeneration_util_pkg_w;