DBA Data[Home] [Help]

PACKAGE BODY: APPS.FA_FAS741_XMLP_PKG

Source


1 PACKAGE BODY FA_FAS741_XMLP_PKG AS
2 /* $Header: FAS741B.pls 120.0.12010000.1 2008/07/28 13:15:24 appldev ship $ */
3 function BookFormula return VARCHAR2 is
4 begin
5 DECLARE
6   l_book       VARCHAR2(15);
7   l_accounting_flex_structure NUMBER(15);
8   l_currency_code VARCHAR2(15);
9   l_distribution_source_book VARCHAR2(15);
10   l_precision NUMBER(15);
11 BEGIN
12   SELECT bc.book_type_code,
13          bc.accounting_flex_structure,
14          bc.distribution_source_book,
15          sob.currency_code,
16          cur.precision
17   INTO   l_book,
18          l_accounting_flex_Structure,
19          l_distribution_source_book,
20          l_currency_code,
21          l_precision
22   FROM   FA_BOOK_CONTROLS bc,
23          GL_SETS_OF_BOOKS sob,
24          FND_CURRENCIES cur
25   WHERE  bc.book_type_code = P_BOOK
26   AND    sob.set_of_books_id = bc.set_of_books_id
27   AND    sob.currency_code    = cur.currency_code;
28   Accounting_Flex_Structure:=l_accounting_flex_structure;
29   Distribution_SOurce_Book :=l_distribution_source_book;
30   Currency_Code := l_currency_code;
31   return(l_book);
32 END;
33 RETURN NULL; end;
34 function Period1Formula return VARCHAR2 is
35 begin
36 DECLARE
37   l_period_name VARCHAR2(15);
38   l_period_POD  DATE;
39 BEGIN
40   SELECT period_name,
41          period_open_date
42   INTO   l_period_name,
43          l_period_POD
44   FROM   FA_DEPRN_PERIODS
45   WHERE  book_type_code = P_BOOK
46   AND    period_name    = P_PERIOD1;
47   Period1_POD := l_period_POD;
48   return(l_period_name);
49 END;
50 RETURN NULL; end;
51 function Report_NameFormula return VARCHAR2 is
52 begin
53 DECLARE
54   l_report_name VARCHAR2(80);
55   l_conc_program_id NUMBER;
56 BEGIN
57 --Added during DT Fixes
58 P_CONC_REQUEST_ID := fnd_global.CONC_REQUEST_ID;
59 --End of DT Fixes
60   SELECT cr.concurrent_program_id
61   INTO l_conc_program_id
62   FROM FND_CONCURRENT_REQUESTS cr
63   WHERE cr.program_application_id = 140
64   AND   cr.request_id = P_CONC_REQUEST_ID;
65   SELECT cp.user_concurrent_program_name
66   INTO   l_report_name
67   FROM    FND_CONCURRENT_PROGRAMS_VL cp
68   WHERE
69       cp.concurrent_program_id= l_conc_program_id
70   and cp.application_id = 140;
71   l_report_name := substr(l_report_name,1,instr(l_report_name,' (XML)'));
72   RETURN(l_report_name);
73 EXCEPTION
74   WHEN OTHERS THEN
75     RETURN(':Asset Reclassification Reconciliation Report:');
76 END;
77 RETURN NULL; end;
78 function Period2Formula return VARCHAR2 is
79 begin
80 DECLARE
81   l_period_name VARCHAR2(15);
82   l_period_PCD  DATE;
83 BEGIN
84   SELECT period_name,
85          nvl(period_close_date, sysdate)
86   INTO   l_period_name,
87          l_period_PCD
88   FROM   FA_DEPRN_PERIODS
89   WHERE  book_type_code = P_BOOK
90   AND    period_name    = P_PERIOD2;
91   Period2_PCD := l_period_PCD;
92   return(l_period_name);
93 EXCEPTION
94     WHEN NO_DATA_FOUND
95     THEN
96         PERIOD2_PCD := sysdate;
97         RETURN(P_PERIOD2);
98 END;
99 RETURN NULL; end;
100 function BeforeReport return boolean is
101 begin
102 /*SRW.USER_EXIT('FND SRWINIT');*/null;
103   return (TRUE);
104 end;
105 function AfterReport return boolean is
106 begin
107 /*SRW.USER_EXIT('FND SRWEXIT');*/null;
108   return (TRUE);
109 end;
110 function MEANING_CIPFormula return VARCHAR2 is
111 begin
112 DECLARE
113          l_meaning VARCHAR2(80);
114 BEGIN
115           select meaning
116           into   l_meaning
117           from fa_lookups
118           where lookup_type = 'ASSET TYPE'
119           and   lookup_code = 'CIP';
120 RETURN(l_meaning);
121 END;
122 RETURN NULL; end;
123 function MEANING_CAPFormula return VARCHAR2 is
124 begin
125 DECLARE
126         l_meaning VARCHAR2(80);
127 BEGIN
128       select meaning
129       into   l_meaning
130       from   fa_lookups
131       where  lookup_type = 'ASSET TYPE'
132       and    lookup_code = 'CAPITALIZED';
133       return(l_meaning);
134 END;
135 RETURN NULL; end;
136 function MEANING_EXPFormula return VARCHAR2 is
137 begin
138 DECLARE
139         l_meaning   VARCHAR2(80);
140 BEGIN
141         select meaning
142         into   l_meaning
143         from   FA_LOOKUPS
144         where  lookup_type = 'ASSET TYPE'
145         and    lookup_code = 'EXPENSED';
146 return(l_meaning);
147 END;
148 RETURN NULL; end;
149 --Functions to refer Oracle report placeholders--
150  Function Accounting_Flex_Structure_p return number is
151 	Begin
152 	 return Accounting_Flex_Structure;
153 	 END;
154  Function ACCT_CC_LPROMPT_p return varchar2 is
155 	Begin
156 	 return ACCT_CC_LPROMPT;
157 	 END;
158  Function Currency_Code_p return varchar2 is
159 	Begin
160 	 return Currency_Code;
161 	 END;
162  Function Distribution_Source_Book_p return varchar2 is
163 	Begin
164 	 return Distribution_Source_Book;
165 	 END;
166  Function Period1_POD_p return date is
167 	Begin
168 	 return Period1_POD;
169 	 END;
170  Function Period2_PCD_p return date is
171 	Begin
172 	 return Period2_PCD;
173 	 END;
174 END FA_FAS741_XMLP_PKG ;
175