[Home] [Help]
PACKAGE BODY: APPS.PO_POXPOCOM_XMLP_PKG
Source
1 PACKAGE BODY PO_POXPOCOM_XMLP_PKG AS
2 /* $Header: POXPOCOMB.pls 120.1 2007/12/25 11:12:22 krreddy noship $ */
3
4 USER_EXIT_FAILURE EXCEPTION;
5
6 function BeforeReport return boolean is
7 begin
8
9 declare
10
11 l_sort po_lookup_codes.displayed_field%type ;
12 begin
13 /*SRW.USER_EXIT('FND SRWINIT');*/null;
14
15 P_SORT_1:=P_SORT;
16
17
18 if P_SORT_1 is not null then
19
20 select displayed_field
21 into l_sort
22 from po_lookup_codes
23 where lookup_code = P_SORT_1
24 and lookup_type = 'SRS ORDER BY';
25
26 P_orderby_displayed := l_sort ;
27
28 else
29 select displayed_field
30 into l_sort
31 from po_lookup_codes
32 where lookup_code = 'VENDOR'
33 and lookup_type = 'SRS ORDER BY';
34
35 P_orderby_displayed := l_sort ;
36
37 end if;
38
39
40 if (UPPER(P_SORT_1) = 'VENDOR') THEN
41
42 select displayed_field
43 into l_sort
44 from po_lookup_codes
45 where lookup_code = 'BUYER'
46 and lookup_type = 'SRS ORDER BY';
47
48 P_ALT_orderby_displayed := l_sort ;
49
50 elsif (UPPER(P_SORT_1) = 'BUYER') THEN
51
52 select displayed_field
53 into l_sort
54 from po_lookup_codes
55 where lookup_code = 'VENDOR'
56 and lookup_type = 'SRS ORDER BY';
57
58 P_ALT_orderby_displayed := l_sort ;
59
60 else
61
62 P_ALT_orderby_displayed := 'Buyer Name' ;
63
64 end if;
65
66
67
68 end;
69
70 BEGIN
71 /*SRW.USER_EXIT('FND SRWINIT');*/null;
72
73 EXCEPTION WHEN USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
74 /*SRW.MESSAGE(1,'srw_iinit');*/null;
75
76 END;
77 BEGIN
78 if (get_p_struct_num <> TRUE )
79 then /*SRW.MESSAGE('1','P Struct Num Init failed');*/null;
80
81 end if;
82 if (get_period_num <> TRUE )
83 then begin
84 /*SRW.MESSAGE('2','P Period Num Init failed.') ;*/null;
85
86 raise_application_error(-20101,null);/*SRW.PROGRAM_ABORT;*/null;
87
88 end;
89 end if;
90 END;
91
92 BEGIN
93
94 null;
95
96 /*SRW.MESSAGE('99', P_WHERE_CAT);*/null;
97
98 return(true);
99 EXCEPTION WHEN USER_EXIT_FAILURE /*SRW.USER_EXIT_FAILURE */THEN
100 /*SRW.MESSAGE(1,'Before Cat Where');*/null;
101
102
103 END; return (TRUE);
104 end;
105
106 function get_p_struct_num return boolean is
107
108 l_p_struct_num number;
109
110 begin
111 select structure_id
112 into l_p_struct_num
113 from mtl_default_sets_view
114 where functional_area_id = 2 ;
115
116 P_STRUCT_NUM := l_p_struct_num ;
117
118 return(TRUE) ;
119
120 RETURN NULL; exception
121 when others then return(FALSE) ;
122 end;
123
124 function get_period_num return boolean is
125
126 l_period_num number;
127 l_period_year number;
128
129 begin
130 select distinct gps.period_num, gps.period_year
131 into l_period_num, l_period_year
132 from gl_period_statuses gps,
133 financials_system_parameters fsp
134 where gps.period_name = P_PERIOD
135 and gps.set_of_books_id = fsp.set_of_books_id ;
136
137 P_PERIOD_NUM := l_period_num;
138 P_PERIOD_YEAR := l_period_year;
139
140 return(TRUE) ;
141
142 RETURN NULL; exception
143 when others then return(FALSE) ;
144 end;
145
146 function C_break_headerFormula return VARCHAR2 is
147 begin
148
149
150
151
152
153 declare
154
155 l_sort po_lookup_codes.displayed_field%type ;
156
157 begin
158
159 if P_SORT_1 is null then
160 select displayed_field
161 into l_sort
162 from po_lookup_codes
163 where lookup_code = 'VENDOR'
164 and lookup_type = 'SRS ORDER BY';
165 return(l_sort);
166 elsif (UPPER(P_SORT_1) = 'VENDOR') then
167 select displayed_field
168 into l_sort
169 from po_lookup_codes
170 where lookup_code = 'VENDOR'
171 and lookup_type = 'SRS ORDER BY';
172 return(l_sort);
173 else
174 select displayed_field
175 into l_sort
176 from po_lookup_codes
177 where lookup_code = 'BUYER'
178 and lookup_type = 'SRS ORDER BY';
179 return(l_sort);
180
181 end if;
182 end;
183
184 end;
185
186 function C_other_headerFormula return VARCHAR2 is
187 begin
188
189 if P_SORT_1 is null then return('Buyer') ;
190 elsif P_SORT_1 = 'VENDOR' then return('Buyer') ;
191 else return('Vendor') ;
192 end if;
193 RETURN NULL; end;
194
195 function c_sum_allformula(C_break_per1 in number, C_break_per2 in number, C_break_per3 in number, C_break_per4 in number, c_precision in number) return number is
196 begin
197
198 /*srw.reference(C_break_per1) ;*/null;
199
200 /*srw.reference(C_break_per2) ;*/null;
201
202 /*srw.reference(C_break_per3) ;*/null;
203
204 /*srw.reference(C_break_per4) ;*/null;
205
206 /*srw.reference(c_precision);*/null;
207
208 return(round((nvl(C_break_per1,0) + nvl(C_break_per2,0) + nvl(C_break_per3,0) + nvl(C_break_per4,0)), c_precision)) ;
209 end;
210
211 function G_periodsGroupFilter return boolean is
212 begin
213
214 return true; return (TRUE);
215 end;
216
217 function c_break_per1_round(c_break_per1 in number, c_precision in number) return number is
218 begin
219
220 /*srw.reference(c_precision);*/null;
221
222 /*srw.reference(c_break_per1);*/null;
223
224 return(round(c_break_per1, c_precision));
225
226 end;
227
228 function c_break_per2_round(c_break_per2 in number, c_precision in number) return number is
229 begin
230
231 /*srw.reference(c_precision);*/null;
232
233 /*srw.reference(c_break_per2);*/null;
234
235
236 return(round(c_break_per2, c_precision));
237
238 end;
239
240 function c_break_per3_round(c_break_per3 in number, c_precision in number) return number is
241 begin
242
243 /*srw.reference(c_precision);*/null;
244
245 /*srw.reference(c_break_per3);*/null;
246
247
248 return(round(c_break_per3, c_precision));
249 end;
250
251 function c_break_per4_round(c_break_per4 in number, c_precision in number) return number is
252 begin
253
254 /*srw.reference(c_precision);*/null;
255
256 /*srw.reference(c_break_per4);*/null;
257
258
259 return(round(c_break_per4, c_precision));
260
261 end;
262
263 function c_amt_per1_round(c_amount_per1 in number, c_precision in number) return number is
264 begin
265
266 /*srw.reference(c_precision);*/null;
267
268 /*srw.reference(c_amount_per1);*/null;
269
270
271 return(round(c_amount_per1, c_precision));
272
273 end;
274
275 function c_amt_per2_round(c_amount_per2 in number, c_precision in number) return number is
276 begin
277
278 /*srw.reference(c_precision);*/null;
279
280 /*srw.reference(c_amount_per2);*/null;
281
282
283 return(round(c_amount_per2, c_precision));
284
285 end;
286
287 function c_amt_per3_round(c_amount_per3 in number, c_precision in number) return number is
288 begin
289
290 /*srw.reference(c_precision);*/null;
291
292 /*srw.reference(c_amount_per3);*/null;
293
294
295 return(round(c_amount_per3, c_precision));
296 end;
297
298 function c_amt_per4_round(c_amount_per4 in number, c_precision in number) return number is
299 begin
300
301 /*srw.reference(c_precision);*/null;
302
303 /*srw.reference(c_amount_per4);*/null;
304
305
306 return(round(c_amount_per4, c_precision));
307
308 end;
309
310 function AfterReport return boolean is
311 begin
312 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
313
314 return (TRUE);
315 end;
316
317 --Functions to refer Oracle report placeholders--
318
319 END PO_POXPOCOM_XMLP_PKG ;
320