DBA Data[Home] [Help]

PACKAGE BODY: APPS.ENI_DBI_UTIL_PKG

Source


1 PACKAGE BODY ENI_DBI_UTIL_PKG AS
2 /*$Header: ENIUTILB.pls 120.1 2006/03/23 04:43:02 pgopalar noship $*/
3 
4   -- Following are global variables used to cache full/xtd translated
5   -- string for period types.
6 
7   G_YTD_Label VARCHAR2(8);
8   G_QTD_Label VARCHAR2(8);
9   G_MTD_Label VARCHAR2(8);
10   G_WTD_Label VARCHAR2(8);
11 
12   -- Global variables for primary and secondary currency
13 
14   g_curr_prim     CONSTANT FII_CURRENCIES_V.ID%TYPE := '''FII_GLOBAL1''';
15   g_curr_sec      CONSTANT FII_CURRENCIES_V.ID%TYPE := '''FII_GLOBAL2''';
16 
17 
18 /* ------------------------------------------------------
19    Function : GetXTDLabel
20    The function returns YTD/QTD/PTD. This function is called
21    from the PMV report and relies on cached values of variables
22    called in the package init section.
23    ------------------------------------------------------*/
24 -- Function GetXTDLabel Follows
25   FUNCTION GetXTDLabel( p_page_parameter_tbl    IN BIS_PMV_PAGE_PARAMETER_TBL)
26     RETURN VARCHAR2
27     IS
28       l_Time_Level_Value VARCHAR2(80);
29       l_Label VARCHAR2(8);
30     BEGIN
31 
32       G_YTD_Label :='YTD';
33       G_QTD_Label :='QTD';
34       G_MTD_Label :='MTD';
35       G_WTD_Label :='WTD';
36 
37       FOR i IN 1..p_page_parameter_tbl.COUNT
38       LOOP
39         IF p_page_parameter_tbl(i).parameter_name = 'PERIOD_TYPE' THEN
40           l_Time_Level_Value:=p_page_parameter_tbl(i).parameter_value;
41         END IF;
42       END LOOP;
43 
44       IF l_time_level_value IS NOT NULL THEN
45         CASE (l_time_level_value)
46           WHEN 'FII_TIME_ENT_YEAR' THEN
47             l_Label:=G_YTD_Label;
48           WHEN 'FII_TIME_ENT_QTR' THEN
49             l_Label:=G_QTD_Label;
50           WHEN 'FII_TIME_ENT_PERIOD' THEN
51             l_Label:=G_MTD_Label;
52           WHEN 'FII_TIME_WEEK' THEN
53             l_Label:=G_WTD_Label;
54         END CASE;
55 
56 
57       ELSE
58         l_Label:='';
59       END IF;
60 
61       RETURN l_Label;
62 
63     EXCEPTION
64       WHEN OTHERS THEN
65         RETURN NULL;
66 
67   END GetXTDLabel;
68 
69 
70 
71 
72 
73 /* ------------------------------------------------------
74    Added for BUG # 3394203
75    Function : Rolling_Lab
76    The function returns Rolling 7/30/90/365 Days. This function is called
77    from the PMV report and relies on cached values of variables
78    called in the package init section.
79    ------------------------------------------------------*/
80 -- Function GetXTDLabel Follows
81   FUNCTION Rolling_Lab( p_page_parameter_tbl    IN BIS_PMV_PAGE_PARAMETER_TBL)
82     RETURN VARCHAR2
83     IS
84       l_Time_Level_Value VARCHAR2(80);
85       l_Label VARCHAR2(50);
86     BEGIN
87 
88       FOR i IN 1..p_page_parameter_tbl.COUNT
89       LOOP
90         IF p_page_parameter_tbl(i).parameter_name = 'PERIOD_TYPE' THEN
91           l_Time_Level_Value:=p_page_parameter_tbl(i).parameter_value;
92         END IF;
93       END LOOP;
94 
95       IF l_time_level_value IS NOT NULL THEN
96         CASE (l_time_level_value)
97         WHEN 'FII_ROLLING_WEEK' THEN
98           l_Label:='7 Days';
99         WHEN 'FII_ROLLING_MONTH' THEN
100           l_Label:='30 Days';
101         WHEN 'FII_ROLLING_QTR' THEN
102           l_Label:='90 Days';
103         WHEN 'FII_ROLLING_YEAR' THEN
104           l_Label:='365 Days';
105         END CASE;
106 
107       ELSE
108         l_Label:='';
109       END IF;
110 
111       RETURN l_Label;
112 
113     EXCEPTION
114       WHEN OTHERS THEN
115         RETURN NULL;
116 
117   END Rolling_Lab;
118 
119 
120 -- Use p_measure_type = 'A' for aggregate measures and 'I' for instantaneous measures
121 
122   PROCEDURE get_time_clauses
123     ( p_measure_type IN VARCHAR2,
124       p_summary_alias in VARCHAR2,
125       p_period_type IN VARCHAR2,
126       p_period_bitand IN NUMBER,
127       p_as_of_date  IN DATE,
128       p_prev_as_of_date IN DATE,
129       p_report_start IN DATE,
130       p_cur_period IN NUMBER,
131       p_days_into_period IN NUMBER,
132       p_comp_type IN VARCHAR2,
133       p_id_column IN VARCHAR2,
134       p_from_clause OUT NOCOPY VARCHAR2,
135       p_where_clause OUT NOCOPY VARCHAR2,
136       p_group_by_clause OUT NOCOPY VARCHAR2,
137       p_rolling IN VARCHAR2 DEFAULT 'ENTERPRISE' -- Added for Bug 3394203 for conversion to rolling periods.
138     )
139     IS
140 
141       l_comp_where VARCHAR2(100);
142       l_err_msg    VARCHAR2(100);
143       l_time_table VARCHAR2(20);
144       l_id_column VARCHAR2(30);
145       l_common_clause VARCHAR2(4000);
146       l_offset_factor NUMBER;
147       l_num_rows NUMBER;
148       l_period_type_id NUMBER;
149       l_comp_type VARCHAR2(50);
150       l_period_type VARCHAR2(50);
151 
152     BEGIN
153 
154       IF (p_rolling = 'ROLLING') THEN
155 
156         l_period_type := '''' || p_period_type || '''';
157         l_comp_type := '''' || p_comp_type || '''';
158 
159         -- Returning the SQL for Rolling Periods.
160 
161         l_common_clause :=
162           '(select
163                  TO_CHAR('|| '&' || 'BIS_CURRENT_ASOF_DATE + offset , ''dd-Mon-yyyy'')
164               AS name,
165                  ' || '&' || 'BIS_CURRENT_ASOF_DATE + offset + start_date_offset
166               AS start_date,
167                  ' || '&' || 'BIS_CURRENT_ASOF_DATE + offset AS c_end_date,
168                  ' || '&' || 'BIS_PREVIOUS_ASOF_DATE + offset AS p_end_date
169            from fii_time_rolling_offsets
170            where period_type = :PERIODTYPE --Bug 5083652
171                   AND comparison_type = :COMPARETYPE )t'; --Bug 5083652
172 
173         IF p_measure_type = 'A' THEN
174           -- aggregate measures
175           p_from_clause :=  '
176                   '|| l_common_clause ||', fii_time_structures ftrs';
177           p_where_clause := ' bitand(ftrs.record_type_id,:PERIODAND) = :PERIODAND --Bug 5083652
178             AND (t.c_end_date = ftrs.report_date OR t.p_end_date = ftrs.report_date)
179             AND '|| p_summary_alias ||'.time_id (+) = ftrs.time_id
180             AND '||p_summary_alias||'.period_type_id (+) = ftrs.period_type_id';
181           p_group_by_clause :=   '
182             t.name,
183             t.start_date,
184             t.c_end_date ';
185 
186         ELSE
187           -- instantaneous measures
188           p_from_clause := l_common_clause;
189           p_where_clause :=  ' 1 = 1 ';
190           p_group_by_clause := '
191           t.name,
192           t.start_date,
193           t.c_end_date ';
194         END IF;
195 
196       ELSE
197 
198         -- Returning the SQL for Enterprise Periods.
199 
200         IF p_comp_type = 'SEQUENTIAL' THEN
201           l_comp_where := 'AND c.start_date = p.end_date + 1';
202         ELSIF p_period_type = 'FII_TIME_WEEK' THEN
203           l_comp_where := 'AND c.week_id = p.week_id + 10000';
204         ELSIF p_period_type = 'FII_TIME_ENT_PERIOD' THEN
205           l_comp_where := 'AND c.ent_period_id = p.ent_period_id + 1000';
206         ELSIF p_period_type = 'FII_TIME_ENT_QTR' THEN
207           l_comp_where := 'AND c.ent_qtr_id = p.ent_qtr_id + 10';
208         ELSIF p_period_type = 'FII_TIME_ENT_YEAR' THEN
209           l_comp_where := 'AND c.ent_year_id = p.ent_year_id + 1';
210         END IF;
211 
212         -- aggregate measures
213         IF p_measure_type = 'A' THEN
214 
215           p_from_clause :=  '
216       fii_time_rpt_struct ftrs,
217       (
218        SELECT
219         c.name,
220         c.'||p_id_column||',
221         c.start_date AS start_date,
222         (case when  '|| '&' || 'BIS_CURRENT_ASOF_DATE < c.end_date
223         then  '|| '&' || 'BIS_CURRENT_ASOF_DATE else c.end_date end ) AS c_end_date,
224         (case when  '|| '&' || 'BIS_PREVIOUS_ASOF_DATE < p.end_date
225         then  '|| '&' || 'BIS_PREVIOUS_ASOF_DATE else p.end_date end ) AS p_end_date
226        FROM
227         ' || p_period_type ||' c, ' || p_period_type || ' p
228        WHERE
229         c.start_date >= ' || '&' || 'BIS_CURRENT_REPORT_START_DATE
230         AND c.'||p_id_column||' <= :CUR_PERIOD_ID --Bug 5083652
231         AND p.start_date >= ' || '&' || 'BIS_PREVIOUS_REPORT_START_DATE
232         ' || l_comp_where || '
233       ) t';
234 
235           p_where_clause := '
236          (t.c_end_date = ftrs.report_date OR t.p_end_date = ftrs.report_date)
237       AND '|| p_summary_alias ||'.time_id (+) = ftrs.time_id
238       AND '||p_summary_alias||'.period_type_id (+) = ftrs.period_type_id
239       AND BITAND(ftrs.record_type_id, :PERIODAND) = ftrs.record_type_id'; --Bug 5083652
240 
241           p_group_by_clause :=   '
242       t.name,
243       t.start_date,
244       t.c_end_date
245      ';
246 
247         -- instantaneous measures
248         ELSE
249           p_from_clause := '
250         (
251        SELECT
252         c.name,
253         c.'||p_id_column||',
254         c.start_date AS start_date,
255         (case when  '|| '&' || 'BIS_CURRENT_ASOF_DATE < c.end_date
256         then  '|| '&' || 'BIS_CURRENT_ASOF_DATE else c.end_date end ) AS c_end_date,
257         (case when  '|| '&' || 'BIS_PREVIOUS_ASOF_DATE < p.end_date
258         then  '|| '&' || 'BIS_PREVIOUS_ASOF_DATE else p.end_date end ) AS p_end_date
259        FROM
260         ' || p_period_type ||' c, ' || p_period_type || ' p
261        WHERE
262         c.start_date >= ' || '&' || 'BIS_CURRENT_REPORT_START_DATE
263         AND c.'||p_id_column||' <= :CUR_PERIOD_ID --Bug 5083652
264         AND p.start_date >= ' || '&' || 'BIS_PREVIOUS_REPORT_START_DATE
265         ' || l_comp_where || '
266      ) t';
267 
268           p_where_clause :=  ' 1 = 1 ';
269 
270           p_group_by_clause := '
271       t.name,
272       t.start_date,
273       t.c_end_date ';
274 
275         END IF;
276       END IF;
277 
278     EXCEPTION
279 
280       WHEN OTHERS THEN
281         NULL;
282 
283   END get_time_clauses;
284 
285 
286 /*
287   Modified Date  :  May-28-2003
288   Description    :  modified to include the parameters of product management engineering report
289 
290 */
291   PROCEDURE get_parameters
292     ( p_page_parameter_tbl   IN BIS_PMV_PAGE_PARAMETER_TBL,
293       p_period_type          OUT NOCOPY VARCHAR2,
294       p_period_bitand        OUT NOCOPY NUMBER,
295       p_view_by              OUT NOCOPY VARCHAR2,
296       p_as_of_date           OUT NOCOPY DATE,
297       p_prev_as_of_date      OUT NOCOPY DATE,
298       p_report_start         OUT NOCOPY DATE,
299       p_cur_period           OUT NOCOPY NUMBER,
300       p_days_into_period     OUT NOCOPY NUMBER,
301       p_comp_type            OUT NOCOPY VARCHAR2,
302       p_category             OUT NOCOPY VARCHAR2,
303       p_item                 OUT NOCOPY VARCHAR2,
304       p_org                  OUT NOCOPY VARCHAR2,
305       p_id_column            OUT NOCOPY VARCHAR2,
306       p_order_by             OUT NOCOPY VARCHAR2,
307       p_drill                OUT NOCOPY VARCHAR2,
308       p_status   OUT NOCOPY VARCHAR2,
309       p_priority   OUT NOCOPY VARCHAR2,
310       p_reason   OUT NOCOPY VARCHAR2,
311       p_lifecycle_phase  OUT NOCOPY VARCHAR2,
312       p_currency   OUT NOCOPY VARCHAR2,
313       p_bom_type   OUT NOCOPY VARCHAR2,
314       p_type   OUT NOCOPY VARCHAR2,
315       p_manager   OUT NOCOPY VARCHAR2,
316       p_lob     OUT NOCOPY VARCHAR2
317     )
318     IS
319 
320       l_currency             VARCHAR2(50);
321       l_length               NUMBER;
322       l_dash_index           NUMBER;
323       l_err_msg              VARCHAR2(100);
324       l_org         VARCHAR2(4000);
325       l_rolling              VARCHAR2(15);
326     BEGIN
327 
328       l_rolling := 'ROLLING';
329       p_drill := 'N';
330 
331       IF (p_page_parameter_tbl.count > 0) THEN
332         FOR i IN p_page_parameter_tbl.first..p_page_parameter_tbl.last LOOP
333           IF p_page_parameter_tbl(i).parameter_name = 'PERIOD_TYPE' THEN
334             p_period_type := p_page_parameter_tbl(i).parameter_value;
335           ELSIF p_page_parameter_tbl(i).parameter_name = 'VIEW_BY' THEN
336             p_view_by := p_page_parameter_tbl(i).parameter_value;
337           ELSIF p_page_parameter_tbl(i).parameter_name = 'CURRENCY+FII_CURRENCIES' THEN
338             p_currency := p_page_parameter_tbl(i).parameter_id;
339           ELSIF p_page_parameter_tbl(i).parameter_name= 'AS_OF_DATE' THEN
340             p_as_of_date := to_date(p_page_parameter_tbl(i).parameter_value,'DD-MM-YYYY');
341           ELSIF p_page_parameter_tbl(i).parameter_name= 'BIS_PREVIOUS_ASOF_DATE' THEN
342             p_prev_as_of_date := to_date(p_page_parameter_tbl(i).parameter_value,'DD-MM-YYYY');
343           ELSIF p_page_parameter_tbl(i).parameter_name= 'BIS_CURRENT_REPORT_START_DATE' THEN
344             p_report_start := to_date(p_page_parameter_tbl(i).parameter_value,'DD-MM-YYYY');
345           ELSIF p_page_parameter_tbl(i).parameter_name= 'TIME_COMPARISON_TYPE' THEN
346             p_comp_type := p_page_parameter_tbl(i).parameter_value;
347           ELSIF p_page_parameter_tbl(i).parameter_name = 'ITEM+ENI_ITEM_VBH_CAT' THEN
348             p_category := p_page_parameter_tbl(i).parameter_id;
349           ELSIF p_page_parameter_tbl(i).parameter_name = 'ITEM+ENI_ITEM_ORG'
350             OR p_page_parameter_tbl(i).parameter_name = 'ITEM+ENI_ITEM' THEN
351             -- note: parameter_id will be "'8000-200'" where 8000 is item_id, 200 is org, and single quotes enclose it
352             l_length := length(p_page_parameter_tbl(i).parameter_id);
353             l_dash_index := instr(p_page_parameter_tbl(i).parameter_id, '-');
354             IF l_dash_index > 0 THEN
355               p_item := substr(p_page_parameter_tbl(i).parameter_id, 2, l_dash_index-2);
356               l_org := substr(p_page_parameter_tbl(i).parameter_id, l_dash_index+1, l_length-l_dash_index-1);
357             END IF;
358           ELSIF p_page_parameter_tbl(i).parameter_name = 'TIME+FII_TIME_WEEK_FROM' THEN
359             p_cur_period := p_page_parameter_tbl(i).parameter_id;
360             p_id_column := 'week_id';
361             l_rolling := 'ENTERPRISE';
362           ELSIF p_page_parameter_tbl(i).parameter_name = 'TIME+FII_TIME_ENT_PERIOD_FROM' THEN
363             p_cur_period := p_page_parameter_tbl(i).parameter_id;
364             p_id_column := 'ent_period_id';
365             l_rolling := 'ENTERPRISE';
366           ELSIF p_page_parameter_tbl(i).parameter_name = 'TIME+FII_TIME_ENT_QTR_FROM' THEN
367             p_cur_period := p_page_parameter_tbl(i).parameter_id;
368             p_id_column := 'ent_qtr_id';
369             l_rolling := 'ENTERPRISE';
370           ELSIF p_page_parameter_tbl(i).parameter_name = 'TIME+FII_TIME_ENT_YEAR_FROM' THEN
371             p_cur_period := p_page_parameter_tbl(i).parameter_id;
372             p_id_column := 'ent_year_id';
373             l_rolling := 'ENTERPRISE';
374           ELSIF p_page_parameter_tbl(i).parameter_name = 'ORDERBY' THEN
375             p_order_by := p_page_parameter_tbl(i).parameter_value;
376 
377             IF substr(rtrim(ltrim(p_order_by)), 1, 3) = 'VBT' THEN
378               p_order_by := 't.' || substr(p_page_parameter_tbl(i).parameter_value,
379               instr(p_page_parameter_tbl(i).parameter_value, '.', 1) + 1,
380               length(p_page_parameter_tbl(i).parameter_value) - 2 );
381             ELSE
382               null;
383             END IF;
384 
385           ELSIF p_page_parameter_tbl(i).parameter_name = 'ISD' THEN
386             p_drill := 'Y';
387             -- For now, if 'All' is selected for organization, p_org is defaulted to 207.
388             -- Eventually we should set p_org to null, and handle null orgs in our sql
389           ELSIF p_page_parameter_tbl(i).parameter_name = 'ORGANIZATION+ORGANIZATION' THEN
390             IF (l_org IS NULL) THEN
391               IF p_page_parameter_tbl(i).parameter_id IS NULL THEN
392                 l_org := NULL;
393               ELSE
394                 l_org := TRIM(both '''' from p_page_parameter_tbl(i).parameter_id);
395               END IF;
396             END IF;
397           ELSIF p_page_parameter_tbl(i).parameter_name = 'ENI_CHANGE_MGMT_STATUS+ENI_CHANGE_MGMT_STATUS' THEN
398             p_status := p_page_parameter_tbl(i).parameter_id;
399           ELSIF p_page_parameter_tbl(i).parameter_name = 'ENI_CHANGE_MGMT_PRIORITY+ENI_CHANGE_MGMT_PRIORITY' THEN
400             p_priority := p_page_parameter_tbl(i).parameter_id;
401           ELSIF p_page_parameter_tbl(i).parameter_name = 'ENI_CHANGE_MGMT_REASON+ENI_CHANGE_MGMT_REASON' THEN
402             p_reason   := p_page_parameter_tbl(i).parameter_id;
403           ELSIF p_page_parameter_tbl(i).parameter_name = 'LIFECYCLE_PHASE' THEN
404             p_lifecycle_phase := p_page_parameter_tbl(i).parameter_value;
405           --ELSIF p_page_parameter_tbl(i).parameter_name = 'CURRENCY' THEN
406           --  p_currency  := p_page_parameter_tbl(i).parameter_value;
407           ELSIF p_page_parameter_tbl(i).parameter_name = 'BOM_TYPE' THEN
408             p_bom_type  := p_page_parameter_tbl(i).parameter_value;
409           ELSIF p_page_parameter_tbl(i).parameter_name = 'ENI_CHANGE_MGMT_TYPE+ENI_CHANGE_MGMT_TYPE' THEN
410             p_type := p_page_parameter_tbl(i).parameter_id;
411           ELSIF p_page_parameter_tbl(i).parameter_name = 'MANAGER' THEN
412             p_manager := p_page_parameter_tbl(i).parameter_value;
413           ELSIF p_page_parameter_tbl(i).parameter_name = 'LOB+FII_LOB' THEN
414             p_lob := p_page_parameter_tbl(i).parameter_value;
415           END IF;
416         END LOOP;
417       END IF;
418 
419       -- if viewing by time, we should never sort by VIEWBY, only by t.start_date
420       IF substr(p_view_by,1,5) = 'TIME+' THEN
421 
422         p_order_by := replace(p_order_by, 'VIEWBY', 't.start_date');
423 
424         -- Bug 3966048: PMV messes up its sorting logic and passes NLSSORT DESC for our Time viewbys
425         IF (p_order_by like '%NLSSORT%') THEN
426 
427           p_order_by := 't.start_date ASC';
428 
429         END IF;
430 
431       END IF;
432 
433       -- Bitmasks for the period types
434       --  (from Time Dimension DLD, http://ap103fam.us.oracle.com:9999/servlet/page?_pageid=4889'&'_dad=portal30'&'_schema=PORTAL30)
435       --  11 week
436       --  23 month
437       --  55 qtr
438       --  119 year
439       --  1143 project (247?)
440 
441       IF p_period_type IS NOT NULL THEN
442         CASE p_period_type
443           WHEN 'FII_TIME_WEEK' THEN
444             p_period_bitand := 11;
445             select (p_as_of_date - start_date) into p_days_into_period from fii_time_week where week_id = p_cur_period;
446           WHEN 'FII_TIME_ENT_PERIOD' THEN
447             p_period_bitand := 23;
448             select (p_as_of_date - start_date) into p_days_into_period from fii_time_ent_period where ent_period_id = p_cur_period;
449           WHEN 'FII_TIME_ENT_QTR' THEN
450             p_period_bitand := 55;
451             select (p_as_of_date - start_date) into p_days_into_period from fii_time_ent_qtr where ent_qtr_id = p_cur_period;
452           WHEN 'FII_TIME_ENT_YEAR'   THEN
453             p_period_bitand := 119;
454             select (p_as_of_date - start_date) into p_days_into_period from fii_time_ent_year where ent_year_id = p_cur_period;
455           WHEN 'FII_ROLLING_WEEK' THEN
456             p_period_bitand := 1024;
457             p_days_into_period := 7;   -- Added to fix Bug # 3472006
458           WHEN 'FII_ROLLING_MONTH' THEN
459             p_period_bitand := 2048;
460             p_days_into_period := 30;   -- Added to fix Bug # 3472006
461           WHEN 'FII_ROLLING_QTR' THEN
462             p_period_bitand :=4096;
463             p_days_into_period := 90;   -- Added to fix Bug # 3472006
464           WHEN 'FII_ROLLING_YEAR'   THEN
465             p_period_bitand := 8192;
466             p_days_into_period := 365;   -- Added to fix Bug # 3472006
467           ELSE
468             null;
469         END CASE;
470       ELSE
471         IF (l_rolling = 'ROLLING') THEN
472           p_period_bitand := 1024;
473         ELSE
474           p_period_bitand := 11;
475         END IF;
476       END IF;
477       p_org := l_org;
478 
479     EXCEPTION
480 
481       WHEN OTHERS THEN
482         NULL;
483 
484   END get_parameters;
485 
486 
487   -- This procedure provides a level of indirection between
488   -- the standard DBI logging procedure and the ENI collection
489   -- packages.
490   -- For now, the procedure and parameters have the same meaning as those
491   -- in BIS_COLLECTION_UTILITIES.LOG.
492   PROCEDURE log(p_message VARCHAR2,
493          p_indenting NUMBER DEFAULT 0)
494   IS
495 
496   BEGIN
497     -- for now, we simply pass the parameters through
498     bis_collection_utilities.log(p_message, p_indenting);
499 
500   END log;
501 
502   -- This procedure provides a level of indirection between
503   -- the standard DBI logging procedure and the ENI collection
504   -- packages.
505   -- For now, the procedure and parameters have the same meaning as those
506   -- in BIS_COLLECTION_UTILITIES.debug.
507   PROCEDURE debug(p_message VARCHAR2,
508            p_indenting NUMBER DEFAULT 0)
509   IS
510 
511   BEGIN
512 
513     -- for now, we simply pass the parameters through
514     bis_collection_utilities.debug(p_message, p_indenting);
515 
516   END debug;
517 
518   -- This procedure initializes the debug logging for our
519   -- PL/SQL report packages.
520   --
521   -- Parameters
522   -- p_rpt_name: The FND function name of the report
523   --             which is to be debugged
524   PROCEDURE init_rpt(p_rpt_func_name VARCHAR2)
525   IS
526 
527   BEGIN
528 
529     null;
530 
531   END init_rpt;
532 
533   -- This procedure writes a debug message to the
534   -- file previously opened by the init procedure
535   --
536   -- Parameters
537   -- p_message: The string which is to be written into
538   --            the log
539   PROCEDURE debug_rpt(p_message VARCHAR2)
540   IS
541 
542   BEGIN
543 
544     null;
545 
546   END debug_rpt;
547 
548 
549   --   This wrapper function supplies the mandatory time dimension parameters
550   --   in addition to those returned by the bil_bi_util_pkg.get_dbi_params.
551   --   Form function for the page has been modified to call
552   --   this function instead of bil_bi_util_pkg.get_dbi_params
553   --   Created to fix bug - bug# 3771850
554 
555   FUNCTION get_all_dbi_params(p_region_code varchar2) return varchar2 as
556 
557     params_string varchar2(4000);
558 
559   begin
560 
561 /*
562      Remove the call to avoid nesting and dependency on sales pkg
563                         params_string := bil_bi_util_pkg.get_dbi_params(p_region_code);
564 */
565    params_string := '&JTF_ORG_SALES_GROUP=' || JTF_RS_DBI_CONC_PUB.GET_SG_ID() || '&BIS_ENI_ITEM_VBH_CAT=All';
566                  params_string := params_string ||
567    '&FII_TIME_ENT_PERIOD=TIME+FII_TIME_ENT_QTR' || -- Period type default argument
568    -- PERIOD TYPE CONVERTED TO QTR FOR BUG#3951523
569    '&YEARLY=TIME_COMPARISON_TYPE+YEARLY' ; -- Comparision type default argument
570     return params_string;
571 
572   end get_all_dbi_params;
573 
574   FUNCTION get_curr_prim RETURN VARCHAR2 AS
575     BEGIN
576       return g_curr_prim;
577   END get_curr_prim;
578 
579   FUNCTION get_curr_sec RETURN VARCHAR2 AS
580     BEGIN
581       return g_curr_sec;
582   END get_curr_sec;
583 
584 END ENI_DBI_UTIL_PKG;