DBA Data[Home] [Help]

PACKAGE BODY: APPS.PA_PAXARPPR_XMLP_PKG

Source


1 PACKAGE BODY PA_PAXARPPR_XMLP_PKG AS
2 /* $Header: PAXARPPRB.pls 120.0 2008/01/02 11:14:54 krreddy noship $ */
3 
4 FUNCTION  get_cover_page_values   RETURN BOOLEAN IS
5 
6 BEGIN
7 
8 RETURN(TRUE);
9 
10 EXCEPTION
11 WHEN OTHERS THEN
12   RETURN(FALSE);
13 
14 END;
15 
16 function BeforeReport return boolean is
17 begin
18 
19 Declare
20  init_failure exception;
21  ndf char(80);
22  errbuf varchar2(200);
23  ret_code  varchar2(5);
24 BEGIN
25 
26 /*srw.user_exit('FND SRWINIT');*/null;
27 
28 
29 
30 /*srw.user_exit('FND GETPROFILE
31 NAME="PA_DEBUG_MODE"
32 FIELD=":p_debug_mode"
33 PRINT_ERROR="N"');*/null;
34 
35 
36 
37 /*srw.user_exit('FND GETPROFILE
38 NAME="PA_RULE_BASED_OPTIMIZER"
39 FIELD=":p_rule_optimizer"
40 PRINT_ERROR="N"');*/null;
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53   IF (get_company_name <> TRUE) THEN       RAISE init_failure;
54   END IF;
55 
56    select meaning into ndf from pa_lookups where
57     lookup_code = 'NO_DATA_FOUND' and
58     lookup_type = 'MESSAGE';
59   c_no_data_found := ndf;
60 
61 
62 SELECT meaning
63 INTO c_yes
64 FROM fnd_lookups
65 WHERE lookup_type = 'YES_NO'
66 AND lookup_code = 'Y';
67 
68 SELECT meaning
69 INTO c_no
70 FROM fnd_lookups
71 WHERE lookup_type = 'YES_NO'
72 AND lookup_code = 'N';
73 
74 SELECT decode(p_run_purge, 'Y', c_yes, c_no),
75 	p_commit_size
76 INTO c_run_purge, c_commit_size
77 FROM dual;
78 
79 
80 
81  PA_PURGE_ERROR_CODE := 0;
82 /*srw.message(0,'Before ...');*/null;
83 
84 
85 IF P_run_purge = 'Y' THEN
86 	ret_code := '0';
87         /*srw.message(0,ret_code);*/null;
88 
89         pa_purge.purge(p_purge_batch_id,
90                        p_commit_size,
91                         ret_code,
92                         errbuf);
93         /*srw.message(0,ret_code);*/null;
94 
95 
96 	IF (not to_number(ret_code) = 0) THEN
97 
98 	/*srw.message(0, errbuf);*/null;
99 
100 
101              PA_PURGE_ERROR_CODE := ret_code;
102              PA_PURGE_ERROR_BUFF := errbuf;
103         END IF;
104 END IF;
105 
106 
107 /*srw.message(0,'before select into');*/null;
108 
109 SELECT bat.batch_name, bat.description, bat.batch_status_code, bat.txn_to_date,
110 	bat.active_closed_flag, lk.meaning, bat.purged_date
111 INTO c_batch_name, c_batch_description, c_batch_status, c_through_date,
112 	c_batch_active_closed, c_batch_status_meaning, c_batch_purged_date
113 FROM pa_purge_batches bat, pa_lookups lk
114 WHERE purge_batch_id = p_purge_batch_id
115 AND lk.lookup_type = 'PURGE_BATCH_STATUS'
116 AND lk.lookup_code = bat.batch_status_code;
117 /*srw.message(0,'after select into');*/null;
118 
119 
120 
121 EXCEPTION
122   WHEN  NO_DATA_FOUND THEN
123   /*srw.message(0,'in when no data found');*/null;
124 
125    select meaning into ndf from pa_lookups where
126     lookup_code = 'NO_DATA_FOUND' and
127     lookup_type = 'MESSAGE';
128   c_no_data_found := ndf;
129    c_dummy_data := 1;
130   WHEN   OTHERS  THEN
131   /*srw.message(0,'in others exception');*/null;
132 
133      RAISE_application_error(-20101,null);/*SRW.PROGRAM_ABORT;*/null;
134 
135 END;  return (TRUE);
136 end;
137 
138 FUNCTION  get_company_name    RETURN BOOLEAN IS
139   l_name                  gl_sets_of_books.name%TYPE;
140 BEGIN
141   SELECT  gl.name
142   INTO    l_name
143   FROM    gl_sets_of_books gl,pa_implementations pi
144   WHERE   gl.set_of_books_id = pi.set_of_books_id;
145 
146   c_company_name_header     := l_name;
147 
148   RETURN (TRUE);
149 
150 EXCEPTION
151 
152   WHEN   OTHERS  THEN
153     RETURN (FALSE);
154 
155 END;
156 
157 function AfterReport return boolean is
158 begin
159   declare
160 	number_of_messages NUMBER;
161 	message_buf VARCHAR2(256);
162          prog_error exception;
163   BEGIN
164 	  number_of_messages := pa_debug.no_of_debug_messages;
165 
166   IF (p_debug_mode = 'Y' AND  number_of_messages > 0 ) THEN
167     /*srw.message(1,'Debug Messages:');*/null;
168 
169 
170     FOR i IN 1..number_of_messages LOOP
171 
172       pa_debug.get_message(i,message_buf);
173       /*srw.message(1,message_buf);*/null;
174 
175 
176     END LOOP;
177 
178 
179   END IF;
180 
181 
182 
183 IF  PA_PURGE_ERROR_CODE <> '0' then
184    /*srw.message(0,' '||PA_PURGE_ERR_CODE.PA_PURGE_ERROR_CODE || '  '||PA_PURGE_ERR_CODE.PA_PURGE_ERROR_BUFF);*/null;
185 
186    RAISE_application_error(-20101,null);/*SRW.PROGRAM_ABORT;*/null;
187 
188 End If;
189 
190   END;
191 
192 /*srw.user_exit('FND SRWEXIT') ;*/null;
193 
194   return (TRUE);
195 end;
196 
197 function BetweenPage return boolean is
198 begin
199 
200   return (TRUE);
201 end;
202 
203 --Functions to refer Oracle report placeholders--
204 
205  Function C_COMPANY_NAME_HEADER_p return varchar2 is
206 	Begin
207 	 return C_COMPANY_NAME_HEADER;
208 	 END;
209  Function C_no_data_found_p return varchar2 is
210 	Begin
211 	 return C_no_data_found;
212 	 END;
213  Function C_dummy_data_p return number is
214 	Begin
215 	 return C_dummy_data;
216 	 END;
217  Function C_batch_name_p return varchar2 is
218 	Begin
219 	 return C_batch_name;
220 	 END;
221  Function C_batch_description_p return varchar2 is
222 	Begin
223 	 return C_batch_description;
224 	 END;
225  Function C_batch_status_p return varchar2 is
226 	Begin
227 	 return C_batch_status;
228 	 END;
229  Function C_Through_date_p return date is
230 	Begin
231 	 return C_Through_date;
232 	 END;
233  Function C_batch_status_meaning_p return varchar2 is
234 	Begin
235 	 return C_batch_status_meaning;
236 	 END;
237  Function C_batch_active_closed_p return varchar2 is
238 	Begin
239 	 return C_batch_active_closed;
240 	 END;
241  Function C_YES_p return varchar2 is
242 	Begin
243 	 return C_YES;
244 	 END;
245  Function C_NO_p return varchar2 is
246 	Begin
247 	 return C_NO;
248 	 END;
249  Function C_RUN_PURGE_p return varchar2 is
250 	Begin
251 	 return C_RUN_PURGE;
252 	 END;
253  Function C_COMMIT_SIZE_p return number is
254 	Begin
255 	 return C_COMMIT_SIZE;
256 	 END;
257  Function C_Batch_Purged_Date_p return varchar2 is
258 	Begin
259 	 return to_char(C_Batch_Purged_Date,'DD-MON-YYYY hh24:mm');
260 	 END;
261 END PA_PAXARPPR_XMLP_PKG ;
262