[Home] [Help]
PACKAGE BODY: APPS.PO_POXBLREL_XMLP_PKG
Source
1 PACKAGE BODY PO_POXBLREL_XMLP_PKG AS
2 /* $Header: POXBLRELB.pls 120.1 2007/12/25 10:45:27 krreddy noship $ */
3
4 USER_EXIT_FAILURE EXCEPTION;
5
6 function BeforeReport return boolean is
7 begin
8
9 DECLARE
10 l_sort po_lookup_codes.displayed_field%type;
11 BEGIN
12 /*SRW.USER_EXIT('FND SRWINIT');*/null;
13
14 QTY_PRECISION:=PO_common_xmlp_pkg.GET_PRECISION(P_QTY_PRECISION);
15 IF P_ORDERBY is NOT NULL THEN
16
17 SELECT displayed_field
18 INTO l_sort
19 FROM po_lookup_codes
20 WHERE lookup_code = P_ORDERBY
21 AND lookup_type = 'SRS ORDER BY';
22
23 P_ORDERBY_DISPLAYED := l_sort;
24
25 ELSE
26
27 P_ORDERBY_DISPLAYED := '';
28
29 END IF;
30
31 if (get_p_struct_num <> TRUE )
32 then /*SRW.MESSAGE('1','P Struct Num Init failed');*/null;
33
34 end if;
35
36
37 null;
38
39
40 null;
41
42
43 null;
44
45
46 null;
47 RETURN TRUE;
48 END; return (TRUE);
49 end;
50
51 procedure get_precision is
52 begin
53 /*srw.attr.mask := SRW.FORMATMASK_ATTR;*/null;
54
55 if P_qty_precision = 0 then /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0';*/null;
56
57 else
58 if P_qty_precision = 1 then /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0.0';*/null;
59
60 else
61 if P_qty_precision = 3 then /*srw.attr.formatmask := '-NN,NNN,NNN,NN0.000';*/null;
62
63 else
64 if P_qty_precision = 4 then /*srw.attr.formatmask := '-N,NNN,NNN,NN0.0000';*/null;
65
66 else
67 if P_qty_precision = 5 then /*srw.attr.formatmask := '-NNN,NNN,NN0.00000';*/null;
68
69 else
70 if P_qty_precision = 6 then /*srw.attr.formatmask := '-NN,NNN,NN0.000000';*/null;
71
72 else /*srw.attr.formatmask := '-NNN,NNN,NNN,NN0.00';*/null;
73
74 end if; end if; end if; end if; end if; end if;
75 /*srw.set_attr(0,srw.attr);*/null;
76
77 end;
78
79 function orderby_clauseFormula return VARCHAR2 is
80 begin
81
82 if upper(P_orderby) = 'VENDOR' then
83 return('pov.vendor_name');
84 elsif upper(P_orderby) = 'PO NUMBER' then
85 return('decode(psp1.manual_po_num_type,''NUMERIC'',
86 null,poh.segment1),
87 decode(psp1.manual_po_num_type,''NUMERIC'',
88 to_number(poh.segment1),null)');
89 end if;
90 RETURN NULL; end;
91
92 function get_p_struct_num return boolean is
93
94 l_p_struct_num number;
95
96 begin
97 select structure_id
98 into l_p_struct_num
99 from mtl_default_sets_view
100 where functional_area_id = 2 ;
101
102 P_STRUCT_NUM := l_p_struct_num ;
103
104 return(TRUE) ;
105
106 RETURN NULL; exception
107 when others then return(FALSE) ;
108 end;
109
110 function AfterPForm return boolean is
111 begin
112
113 /*srw.user_exit('FND SRWINIT');*/null;
114
115 begin
116 SELECT psp.manual_po_num_type manual_po_num_type
117 into P_Po_num_type
118 FROM po_system_parameters psp;
119
120 exception
121 when no_data_found then
122 P_po_num_type := 'ALPHANUMERIC';
123 end;
124
125
126 If P_po_num_from = P_po_num_to THEN
127 P_single_po_print := 1;
128 END IF;
129
130 if ( P_single_po_print = 1 ) then
131 P_WHERE_QUERY := ' AND poh.segment1 = :P_po_num_from ';
132
133 else
134
135 IF ( P_po_num_type = 'NUMERIC' ) THEN
136
137 P_WHERE_QUERY := ' AND decode(rtrim(poh.segment1,''0123456789''),NULL,to_number(poh.segment1),-1)
138 BETWEEN decode(rtrim(nvl(nvl(:P_po_num_from,NULL),poh.segment1),''0123456789''),
139 NULL, to_number(nvl(nvl(:P_po_num_from ,NULL)
140 ,poh.segment1)),-1) AND decode(rtrim(nvl(nvl(:P_po_num_to ,NULL)
141 ,poh.segment1),''0123456789''),NULL, to_number(nvl(nvl(:P_po_num_to,NULL)
142 ,poh.segment1)),-1)' ;
143
144 ELSIF (P_PO_NUM_TYPE = 'ALPHANUMERIC' ) THEN
145
146 IF (P_po_num_from IS NOT NULL AND P_po_num_to IS NOT NULL) THEN
147 P_WHERE_QUERY := ' AND poh.segment1 >= :P_po_num_from AND poh.segment1 <= :P_po_num_to ';
148
149 ELSIF ( P_po_num_from IS NOT NULL AND P_po_num_to IS NULL ) THEN
150 P_WHERE_QUERY := ' AND poh.segment1 >= :P_po_num_from ' ;
151
152 ELSIF ( P_po_num_from IS NULL AND P_po_num_to IS NOT NULL ) THEN
153 P_WHERE_QUERY := ' AND poh.segment1 <= :P_po_num_to ' ;
154
155 ELSE
156 P_WHERE_QUERY := ' AND 1 = 1 ' ;
157 END IF;
158 END IF;
159 END iF;
160 return (TRUE);
161
162 return (TRUE);
163 end;
164
165 function AfterReport return boolean is
166 begin
167 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
168
169 return (TRUE);
170 end;
171
172 --Functions to refer Oracle report placeholders--
173
174 END PO_POXBLREL_XMLP_PKG ;
175