DBA Data[Home] [Help]

PACKAGE BODY: APPS.AP_APXEMELR_XMLP_PKG

Source


1 PACKAGE BODY AP_APXEMELR_XMLP_PKG AS
2 /* $Header: APXEMELRB.pls 120.0 2007/12/27 07:38:30 vjaganat noship $ */
3 
4 FUNCTION  get_base_curr_data  RETURN BOOLEAN IS
5 
6   base_curr ap_system_parameters.base_currency_code%TYPE;   prec      fnd_currencies_vl.precision%TYPE;       min_au    fnd_currencies_vl.minimum_accountable_unit%TYPE;  descr     fnd_currencies_vl.description%TYPE;
7 BEGIN
8 
9   base_curr := '';
10   prec      := 0;
11   min_au    := 0;
12   descr     := '';
13 
14   SELECT  p.base_currency_code,
15           c.precision,
16           c.minimum_accountable_unit,
17           c.description
18   INTO    base_curr,
19           prec,
20           min_au,
21           descr
22   FROM    ap_system_parameters p,
23           fnd_currencies_vl c
24   WHERE   p.base_currency_code  = c.currency_code;
25 
26   c_base_currency_code  := base_curr;
27   c_base_precision      := prec;
28   c_base_min_acct_unit  := min_au;
29   c_base_description    := descr;
30 
31   RETURN (TRUE);
32 
33 RETURN NULL; EXCEPTION
34 
35   WHEN   OTHERS  THEN
36     RETURN (FALSE);
37 
38 END;
39 
40 FUNCTION  custom_init         RETURN BOOLEAN IS
41 
42 BEGIN
43 
44 
45 RETURN (TRUE);
46 
47 RETURN NULL; EXCEPTION
48 
49   WHEN   OTHERS  THEN
50     RETURN (FALSE);
51 
52 END;
53 
54 FUNCTION  get_cover_page_values   RETURN BOOLEAN IS
55 
56 BEGIN
57 
58 RETURN(TRUE);
59 
60 RETURN NULL; EXCEPTION
61 WHEN OTHERS THEN
62   RETURN(FALSE);
63 
64 END;
65 
66 FUNCTION  get_nls_strings     RETURN BOOLEAN IS
67    nls_all       ap_lookup_codes.displayed_field%TYPE;    nls_yes       fnd_lookups.meaning%TYPE;     nls_no        fnd_lookups.meaning%TYPE;
68 BEGIN
69 
70    nls_all     := '';
71    nls_yes     := '';
72    nls_no      := '';
73 
74    SELECT  ly.meaning,
75            ln.meaning,
76            la.displayed_field
77    INTO    nls_yes,  nls_no,  nls_all
78    FROM    fnd_lookups ly,  fnd_lookups ln,  ap_lookup_codes la
79    WHERE   ly.lookup_type = 'YES_NO'
80      AND   ly.lookup_code = 'Y'
81      AND   ln.lookup_type = 'YES_NO'
82      AND   ln.lookup_code = 'N'
83      AND   la.lookup_type = 'NLS REPORT PARAMETER'
84      AND   la.lookup_code = 'ALL';
85 
86    c_nls_yes := nls_yes;
87    c_nls_no  := nls_no;
88    c_nls_all := nls_all;
89 
90    /*SRW.USER_EXIT('FND MESSAGE_NAME APPL="SQLAP" NAME="AP_APPRVL_NO_DATA"');*/null;
91 
92    /*SRW.USER_EXIT('FND MESSAGE_GET OUTPUT_FIELD=":c_nls_no_data_exists"');*/null;
93 
94    /*c_nls_no_data_exists := '*** '||c_nls_no_data_exists||' ***';*/
95    c_nls_no_data_exists := 'No Data Found';
96 
97    /*SRW.USER_EXIT('FND MESSAGE_NAME APPL="SQLAP" NAME="AP_ALL_END_OF_REPORT"');*/null;
98 
99    /*SRW.USER_EXIT('FND MESSAGE_GET OUTPUT_FIELD=":c_nls_end_of_report"');*/null;
100 
101    /*c_nls_end_of_report := '*** '||c_nls_end_of_report||' ***';*/
102    c_nls_end_of_report := 'End of Report';
103 
104 RETURN (TRUE);
105 
106 RETURN NULL; EXCEPTION
107    WHEN OTHERS THEN
108       RETURN (FALSE);
109 END;
110 
111 function BeforeReport return boolean is
112 begin
113 
114 
115 
116 DECLARE
117 
118   init_failure    EXCEPTION;
119 
120 BEGIN
121 
122   /*commented by raj P_SUP_CHOSE := nvl(P_SUP_CHOSE,'All');
123   P_LOC_CHOSE := nvl(P_LOC_CHOSE,'All');*/
124 
125 
126   P_SUP_CHOSE_m := P_SUP_CHOSE;
127   P_LOC_CHOSE_m := P_LOC_CHOSE;
128 
129 
130   P_SUP_CHOSE_m := nvl(P_SUP_CHOSE_m,'All');
131   P_LOC_CHOSE_m := nvl(P_LOC_CHOSE_m,'All');
132 
133 
134 
135   /*SRW.USER_EXIT('FND SRWINIT');*/null;
136 
137   IF (p_debug_switch = 'Y') THEN
138      /*SRW.MESSAGE('1','After SRWINIT');*/null;
139 
140   END IF;
141 
142 
143   IF (get_company_name() <> TRUE) THEN       RAISE init_failure;
144   END IF;
145   IF (p_debug_switch = 'Y') THEN
146      /*SRW.MESSAGE('2','After Get_Company_Name');*/null;
147 
148   END IF;
149 
150 
151   IF (get_nls_strings() <> TRUE) THEN      RAISE init_failure;
152   END IF;
153   IF (p_debug_switch = 'Y') THEN
154      /*SRW.MESSAGE('3','After Get_NLS_Strings');*/null;
155 
156   END IF;
157 
158 
159 
160   IF (get_base_curr_data() <> TRUE) THEN        RAISE init_failure;
161   END IF;
162   IF (p_debug_switch = 'Y') THEN
163      /*SRW.MESSAGE('4','After Get_Base_Curr_Data');*/null;
164 
165   END IF;
166 
167 
168 
169 
170 
171 
172 
173 
174 
175 
176 
177 
178 
179    IF (get_flexdata() <> TRUE) THEN
180       RAISE init_failure;
181    END IF;
182    IF (p_debug_switch = 'Y') THEN
183       /*SRW.MESSAGE ('6', 'After Get_Flexdata');*/null;
184 
185    END IF;
186 
187 
188 
189 
190 
191 
192 
193 
194 
195 
196 
197 
198 
199 
200   IF (p_debug_switch = 'Y') THEN
201      /*SRW.BREAK;*/null;
202 
203   END IF;
204 
205 
206 
207   RETURN (TRUE);
208 
209 
210 
211 EXCEPTION
212 
213   WHEN   OTHERS  THEN
214 
215     RAISE_application_error(-20101,null);/*SRW.PROGRAM_ABORT;*/null;
216 
217 
218 END;  return (TRUE);
219 end;
220 
221 function AfterReport return boolean is
222 begin
223 
224 BEGIN
225    /*SRW.USER_EXIT('FND SRWEXIT');*/null;
226 
227    IF (P_DEBUG_SWITCH = 'Y') THEN
228       /*SRW.MESSAGE('20','After SRWEXIT');*/null;
229 
230    END IF;
231 EXCEPTION
232 WHEN OTHERS THEN
233    RAISE_application_error(-20101,null);/*SRW.PROGRAM_ABORT;*/null;
234 
235 END;  return (TRUE);
236 end;
237 
238 FUNCTION  get_company_name    RETURN BOOLEAN IS
239   l_chart_of_accounts_id  gl_sets_of_books.chart_of_accounts_id%TYPE;
240   l_name                  gl_sets_of_books.name%TYPE;
241   l_sob_id                NUMBER;
242   l_report_start_date     DATE;
243 BEGIN
244   l_report_start_date := sysdate;   l_sob_id := p_set_of_books_id;
245   SELECT  name,
246           chart_of_accounts_id
247   INTO    l_name,
248           l_chart_of_accounts_id
249   FROM    gl_sets_of_books
250   WHERE   set_of_books_id = l_sob_id;
251 
252   c_company_name_header     := l_name;
253   c_chart_of_accounts_id    := l_chart_of_accounts_id;
254   c_report_start_date       := l_report_start_date;
255 
256   RETURN (TRUE);
257 
258 RETURN NULL; EXCEPTION
259 
260   WHEN   OTHERS  THEN
261     RETURN (FALSE);
262 
263 END;
264 
265 FUNCTION get_flexdata RETURN BOOLEAN IS
266 
267 BEGIN
268 
269 
270  null;
271    RETURN (TRUE);
272 
273 RETURN NULL; EXCEPTION
274    WHEN OTHERS THEN
275         RETURN(FALSE);
276 END;
277 
278 FUNCTION calculate_run_time RETURN BOOLEAN IS
279 end_date   DATE;
280 start_date DATE;
281 BEGIN
282 end_date   := sysdate;
283 start_date := C_REPORT_START_DATE;
284 C_REPORT_RUN_TIME := to_char(to_date('01/01/0001','DD/MM/YYYY') + ((end_date - start_date)),'HH24:MI:SS');
285 RETURN(TRUE);
286 RETURN NULL; EXCEPTION
287 WHEN OTHERS THEN
288 RAISE_application_error(-20101,null);/*SRW.PROGRAM_ABORT;*/null;
289 
290 END;
291 
292 --Functions to refer Oracle report placeholders--
293 
294  Function C_BASE_CURRENCY_CODE_p return varchar2 is
295 	Begin
296 	 return C_BASE_CURRENCY_CODE;
297 	 END;
298  Function C_BASE_PRECISION_p return number is
299 	Begin
300 	 return C_BASE_PRECISION;
301 	 END;
302  Function C_BASE_MIN_ACCT_UNIT_p return number is
303 	Begin
304 	 return C_BASE_MIN_ACCT_UNIT;
305 	 END;
306  Function C_BASE_DESCRIPTION_p return varchar2 is
307 	Begin
308 	 return C_BASE_DESCRIPTION;
309 	 END;
310  Function C_COMPANY_NAME_HEADER_p return varchar2 is
311 	Begin
312 	 return C_COMPANY_NAME_HEADER;
313 	 END;
314  Function C_REPORT_START_DATE_p return date is
315 	Begin
316 	 return C_REPORT_START_DATE;
317 	 END;
318  Function C_NLS_YES_p return varchar2 is
319 	Begin
320 	 return C_NLS_YES;
321 	 END;
322  Function C_NLS_NO_p return varchar2 is
323 	Begin
324 	 return C_NLS_NO;
325 	 END;
326  Function C_NLS_ALL_p return varchar2 is
327 	Begin
328 	 return C_NLS_ALL;
329 	 END;
330  Function C_NLS_NO_DATA_EXISTS_p return varchar2 is
331 	Begin
332 	 return C_NLS_NO_DATA_EXISTS;
333 	 END;
334  Function C_REPORT_RUN_TIME_p return varchar2 is
335 	Begin
336 	 return C_REPORT_RUN_TIME;
337 	 END;
338  Function C_CHART_OF_ACCOUNTS_ID_p return number is
339 	Begin
340 	 return C_CHART_OF_ACCOUNTS_ID;
341 	 END;
342  Function C_NLS_END_OF_REPORT_p return varchar2 is
343 	Begin
344 	 return C_NLS_END_OF_REPORT;
345 	 END;
346 END AP_APXEMELR_XMLP_PKG ;
347