DBA Data[Home] [Help]

PACKAGE: APPS.PJI_UTILS

Source


1 PACKAGE PJI_UTILS AS
2 /* $Header: PJIUT01S.pls 120.6 2006/07/28 12:13:51 pschandr noship $ */
3 
4   g_debug_level number(15);
5   g_max_roll_days number(15);    /* 5155692  */
6   -- ------------------------------------------------------
7   -- function GET_PARAMETER
8   --
9   -- Function returns PJI parameter values stored in table
10   -- PJI_SYSTEM_PARAMETERS. Function accepts parameter name
11   -- as an argument
12   -- ------------------------------------------------------
13   function GET_PARAMETER (p_name in varchar2) return varchar2;
14 
15   -- ------------------------------------------------------
16   -- procedure SET_PARAMETER
17   --
18   -- Procedure sets PJI system parameter value stored in
19   -- PJI_SYSTEM_PARAMETERS. Procedure has two arguments:
20   -- parameter name and parameter value.
21   -- Note that procedure does not perform commit.
22   -- ------------------------------------------------------
23   procedure SET_PARAMETER
24   (
25     p_name  in varchar2,
26     p_value in varchar2
27   );
28 
29   -- ------------------------------------------------------
30   -- function GET_SETUP_PARAMETER
31   --
32   -- Function returns PJI setup parameter values
33   -- stored in PJI_SYSTEM_SETTINGS.
34   -- Function accepts parameter name as an argument, currently
35   -- parameter name is the same as table column name.
36   -- Parameters that are stored as date columns are converted
37   -- to format 'YYYY/MM/DD'
38   -- ------------------------------------------------------
39   function GET_SETUP_PARAMETER(p_name in varchar2) return varchar2;
40 
41   -- ------------------------------------------------------
42   -- function GET_APPS_SCHEMA_NAME
43   --
44   -- Function returns Oracle schema name of APPS user
45   -- ------------------------------------------------------
46   function GET_APPS_SCHEMA_NAME return varchar2;
47 
48   -- ------------------------------------------------------
49   -- function GET_PA_SCHEMA_NAME
50   -- ------------------------------------------------------
51   function GET_PA_SCHEMA_NAME return varchar2;
52 
53   -- ------------------------------------------------------
54   -- function GET_PJI_SCHEMA_NAME
55   --
56   -- Function returns Oracle schema name of PJI user
57   -- ------------------------------------------------------
58   function GET_PJI_SCHEMA_NAME return varchar2;
59 
60   -- ------------------------------------------------------
61   -- procedure SET_OUTPUT_DEST
62   --
63   -- This procedure is included for debugging purposes.
64   -- Procedure enables to redirect message streams that normally
65   -- go into concurrent program log and out files either to
66   -- the screen (using DBMS_OUTPUT) or to PJI_SYSTEM_DEBUG_MSG
67   -- table. P_DEBUG_DEST can have the following values:
68   --
69   --   'TABLE' - message goes into PJI_SYSTEM_DEBUG_MSG
70   --   'DBMS_OUTPUT' - messsage is displayed using DBMS_OUTPUT;
71   --
72   -- Second parameter can be used when P_DEBUG_DEST is set to
73   -- 'TABLE'. Parameter P_DEBUG_CONTEXT provides content of
74   -- MESSAGE_CONTEXT column in PJI_SYSTEM_DEBUG_MSG.
75   -- If multiple sessions are writing debug info to
76   -- PJI_SYSTEM_DEBUG_MSG this column can be used to
77   -- identify the message owner. By default it stores
78   -- operating system user name concatenated with session id.
79   -- Parameter P_DEBUG_CONTEXT enables to override it.
80   --
81   -- ------------------------------------------------------
82   procedure SET_OUTPUT_DEST(
83     p_debug_dest       varchar2,
84     p_debug_context    varchar2 default NULL
85   );
86 
87   -- ------------------------------------------------------
88   -- procedure SET_CURR_FUNCTION
89   --
90   -- This procedure should be called in the beginning of
91   -- any PJI program unit to put the program unit on
92   -- top of PA debug stack. We should pass program unit
93   -- name in the following format:
94   --
95   --   <package name>.<procedure/function name>
96   --
97   -- Example:
98   --
99   --  PJI_UTILS.SET_CURR_FUNCTION
100   --
101   -- ------------------------------------------------------
102   procedure SET_CURR_FUNCTION( p_function varchar2 );
103 
104   -- ------------------------------------------------------
105   -- procedure RESET_CURR_FUNCTION
106   --
107   -- This procedure removes top element from PA debug stack.
108   -- This is the opposite of SET_CURR_FUNCTION
109   -- ------------------------------------------------------
110   procedure RESET_CURR_FUNCTION;
111 
112   -- ------------------------------------------------------
113   -- function GET_EXTRACTION_START_DATE
114   -- ------------------------------------------------------
115   function GET_EXTRACTION_START_DATE return date;
116 
117   -- ------------------------------------------------------
118   -- procedure WRITE2LOG
119   --
120   -- This procedure is used to write to the concurrent
121   -- request log file. P_MSG is the message text,
122   -- P_TIMER_FLAG indicates if output line contains
123   -- a timestamp, value TRUE indicates that timestamp
124   -- is displayed.
125   -- P_DEBUG_FLAG indicates level of debug information
126   -- ------------------------------------------------------
127   procedure WRITE2LOG
128   (
129     p_msg         in varchar2,
130     p_timer_flag  in boolean  default null,
131     p_debug_level in number   default 1
132   );
133 
134 
135   -- ------------------------------------------------------
136   -- procedure WRITE2OUT
137   --
138   -- Procedure writes to concurrent request output file
139   -- ------------------------------------------------------
140   procedure WRITE2OUT (p_msg in varchar2);
141 
142   -- ------------------------------------------------------
143   -- procedure WRITE2SSWALOG
144   --
145   -- This procedure is used in PMV reports (and potentially
146   -- other SSWA-based pages) to provide debug information.
147   -- Since PMV does not support standard FWK debugging mechanism
148   -- we put PMV log messages into PJI_SYSTEM_DEBUG_MSG table.
149   -- P_MSG is the message text, P_DEBUG_FLAG indicates level of
150   -- debug information, P_MODULE should be used to indicate
151   -- what program unit is writing the message. Usually module is
152   -- set to <package name>.<procedure/function name>.
153   -- ------------------------------------------------------
154   procedure WRITE2SSWALOG
155   (
156     p_msg          in varchar2,
157     p_debug_level  in number  default 0,
158     p_module       in varchar2 default NULL
159   );
160 
161   -- ------------------------------------------------------
162   -- procedure RESET_SSWA_SESSION_CACHE
163   --
164   -- This procedure should be executed one time
165   -- before any calls to WRITE2SSWALOG.
166   -- PJI_UTILS caches apps user context in a set of global
167   -- variables. For example, we provide a variable that
168   -- caches value of PA_DEBUG_MODE profile. Since SSWA
169   -- session can be reused between multiple APPS users
170   -- we need to be able to reset this cache when user
171   -- changes.
172   -- ------------------------------------------------------
173   procedure RESET_SSWA_SESSION_CACHE;
174 
175   -- ------------------------------------------------------
176   -- function GET_PJI_DATA_TSPACE
177   --
178   -- Function returns PJI data tablespace
179   -- ------------------------------------------------------
180   function GET_PJI_DATA_TSPACE return varchar2;
181 
182   -- ------------------------------------------------------
183   -- function GET_PJI_IDX_TSPACE
184   --
185   -- Function returns PJI index tablespace
186   -- ------------------------------------------------------
187   function GET_PJI_INDEX_TSPACE return varchar2;
188 
189   -- ------------------------------------------------------
190   -- function SPREAD_AMOUNT
191   --
192   -- Code of this function was copied from PA_MISC.SPREAD_AMOUNT
193   -- The difference is that we do not round the result as
194   -- we do not have a context of an operating unit.
195   -- ------------------------------------------------------
196   function SPREAD_AMOUNT (
197                         x_type_of_spread    IN VARCHAR2,
198                         x_start_date        IN DATE,
199                         x_end_date          IN DATE,
200                         x_start_pa_date     IN DATE,
201                         x_end_pa_date       IN DATE,
202                         x_amount            IN NUMBER)
203                     RETURN NUMBER;
204 
205   pragma RESTRICT_REFERENCES ( spread_amount, WNDS, WNPS );
206 
207   -- ------------------------------------------------------
208   -- function GET_GLOBAL_RATE_PRIMARY
209   --
210   -- This is a wrapper for FII_CURRENCY.GET_GLOBAL_RATE_PRIMARY
211   -- ------------------------------------------------------
212   function get_global_rate_primary(
213       p_from_currency_code  VARCHAR2,
214       p_exchange_date       DATE
215   ) return number;
216 
217   -- ------------------------------------------------------
218   -- function GET_MAU_PRIMARY
219   --
220   -- This is a wrapper for FII_CURRENCY.GET_MAU_PRIMARY
221   -- ------------------------------------------------------
222   function get_mau_primary return number;
223 
224   -- ------------------------------------------------------
225   -- function GET_GLOBAL_PRIMARY_CURRENCY
226   -- ------------------------------------------------------
227   function GET_GLOBAL_PRIMARY_CURRENCY
228     return varchar2;
229 
230   -- ------------------------------------------------------
231   -- function GET_GLOBAL_RATE_SECONDARY
232   -- ------------------------------------------------------
233   function GET_GLOBAL_RATE_SECONDARY(p_from_currency_code varchar2,
234                                      p_exchange_date date) return number;
235 
236   -- ------------------------------------------------------
237   -- function GET_MAU_SECONDARY
238   -- ------------------------------------------------------
239   function GET_MAU_SECONDARY return number;
240 
241   -- ------------------------------------------------------
242   -- function GET_GLOBAL_SECONDARY_CURRENCY
243   -- ------------------------------------------------------
244   function GET_GLOBAL_SECONDARY_CURRENCY
245     return varchar2;
246 
247   -- ------------------------------------------------------
248   -- function GET_RATE
249   -- ------------------------------------------------------
250   function GET_RATE(p_from_currency_code varchar2,
251                     p_to_currency_code   varchar2,
252                     p_exchange_date      date) return number;
253 
254   -- ------------------------------------------------------
255   -- function GET_RATE_TYPE
256   -- ------------------------------------------------------
257   function GET_RATE_TYPE return varchar2;
258 
259   -- ------------------------------------------------------
260   -- function GET_MAU
261   -- ------------------------------------------------------
262   function GET_MAU (p_currency_code varchar2) return number;
263 
264   -- ------------------------------------------------------
265   -- function GET_DEGREE_OF_PARALLELISM
266   -- ------------------------------------------------------
267   function GET_DEGREE_OF_PARALLELISM return number;
268 
269 -----------------------------------------------------
270 -- function get_period_set_name
271 -- -----------------------------------------------------
272 FUNCTION get_period_set_name RETURN VARCHAR2;
273 
274 -- -----------------------------------------------------
275 -- function get_START_DAY_OF_WEEK_ID
276 -- -----------------------------------------------------
277 FUNCTION get_START_DAY_OF_WEEK_ID  RETURN VARCHAR2;
278 
279 -- -----------------------------------------------------
280 -- function get_period_type
281 -- -----------------------------------------------------
282 FUNCTION get_period_type  RETURN VARCHAR2;
283 
284 -- -----------------------------------------------------
285 -- function getMissingRateHeader
286 -- -----------------------------------------------------
287 FUNCTION  getMissingRateHeader return VARCHAR2;
288 
289 -- -----------------------------------------------------
290 -- function getMissingRateText
291 -- -----------------------------------------------------
292 FUNCTION getMissingRateText(
293 p_rate_type IN VARCHAR2,
294 p_from_currency IN VARCHAR2,
295 p_to_currency in VARCHAR2,
296 p_date IN DATE,
297 p_date_override IN VARCHAR2) return VARCHAR2;
298 
299   -- -----------------------------------------------------
300   -- function CHECK_PROGRAM_RBS
301   -- -----------------------------------------------------
302   function CHECK_PROGRAM_RBS (p_project_id     in number,
303                               p_rbs_version_id in number)
304            return number;
305 
306  -- -----------------------------------------------------
307  -- Function PJI_LOOKUP_VALUE
308  -- For getting the lookup values in project performance setups Audit report
309  -- -----------------------------------------------------
310    FUNCTION PJI_LOOKUP_VALUE (p_lookup_type VARCHAR2,
311                               p_lookup_code VARCHAR2)
312        return VARCHAR2;
313 
314  -- -----------------------------------------------------
315  -- Function Derive_Curr_rep_Info
316  -- For getting Current Reporting period values in project performance setups Audit report
317  -- -----------------------------------------------------
318 
319   FUNCTION Derive_Curr_rep_Info(p_org_id NUMBER
320                               , p_calendar_type VARCHAR2
321 							  , p_active_rep VARCHAR2
322                                )
323         return VARCHAR2;
324  -- -----------------------------------------------------
325   -- Procedure REPORT_PJP_PARAM_SETUP
326   -- For project performance setups Audit report
327  -- -----------------------------------------------------
328    PROCEDURE REPORT_PJP_PARAM_SETUP
329 	(errbuff        OUT NOCOPY VARCHAR2,
330          retcode        OUT NOCOPY VARCHAR2);
331 
332 	  -- -----------------------------------------------------
333  -- Function Is_plantype_upgrade_pending
334  -- Used in the UI pages to show the upgrade pending message
335  -- -----------------------------------------------------
336    FUNCTION Is_plantype_upgrade_pending (p_project_id IN NUMBER)
337        return VARCHAR2;
338 
339  -- Function Fin_Summ_Upgrade_Status
340  -- Used in the UI pages to show the financial summary upgrade status message
341  -- -----------------------------------------------------
342    FUNCTION Fin_Summ_Upgrade_Status
343        return VARCHAR2;
344 
345 end PJI_UTILS;