[Home] [Help]
23: l_new_param_str varchar2(200);
24: l_ttl_param_str varchar2(200);
25: l_base_col_param varchar2(40);
26: x_dummy number;
27: l_session_id biv_tmp_rt2.session_id % type;
28: l_ttl_recs number;
29: l_ttl_meaning fnd_lookups.meaning % type;
30: l_debug varchar2(30) := fnd_profile.value('BIV:DEBUG');
31: begin
30: l_debug varchar2(30) := fnd_profile.value('BIV:DEBUG');
31: begin
32: biv_core_pkg.g_report_id := 'BIV_RT_BACKLOG_BY_STATUS';
33: l_session_id := biv_core_pkg.get_session_id;
34: biv_core_pkg.clean_dcf_table('biv_tmp_rt2');
35:
36: x_status1 := fnd_profile.value('BIV:INC_STATUS_1');
37: x_status2 := fnd_profile.value('BIV:INC_STATUS_2');
38: x_status3 := fnd_profile.value('BIV:INC_STATUS_3');
64: x_from_list || x_where_clause ||
65: ' group by ' || biv_core_pkg.g_base_column
66: -- || ' order by ' || nvl(biv_core_pkg.g_srt_by,'2')
67: ;
68: x_sql_sttmnt := 'insert into biv_tmp_rt2(report_code,col1,col4,
69: col6,col8,col10,session_id)
70: ' || x_sql_sttmnt ;
71:
72: if (l_debug = 'Y') then
80: dbms_sql.bind_variable(x_cur,':x_stat3', x_status3);
81: dbms_sql.bind_variable(x_cur,':session_id', l_session_id);
82: x_dummy := dbms_sql.execute(x_cur);
83:
84: biv_core_pkg.update_base_col_desc('biv_tmp_rt2');
85: update biv_tmp_rt2
86: set col12 = col4 - col6 - col8 - col10
87: where report_code = 'BACKLOG'
88: and session_id = l_session_id;
81: dbms_sql.bind_variable(x_cur,':session_id', l_session_id);
82: x_dummy := dbms_sql.execute(x_cur);
83:
84: biv_core_pkg.update_base_col_desc('biv_tmp_rt2');
85: update biv_tmp_rt2
86: set col12 = col4 - col6 - col8 - col10
87: where report_code = 'BACKLOG'
88: and session_id = l_session_id;
89:
95: 'col2 asc')
96: into l_order_by from dual;
97:
98: x_sql_sttmnt := '
99: insert into biv_tmp_rt2 (report_code, rowno, col1, col2,
100: col4, col6, col8, col10, col12, session_id)
101: select ''BIV_RT_BACKLOG_BY_STATUS'', rownum,
102: col1, col2, col4, col6, col8, col10, col12,session_id
103: from (select col1, col2, col4, col6, col8, col10, col12,session_id
100: col4, col6, col8, col10, col12, session_id)
101: select ''BIV_RT_BACKLOG_BY_STATUS'', rownum,
102: col1, col2, col4, col6, col8, col10, col12,session_id
103: from (select col1, col2, col4, col6, col8, col10, col12,session_id
104: from biv_tmp_rt2
105: where report_code = ''BACKLOG''
106: and session_id = :session_id
107: order by ' || l_order_by || ')
108: where rownum <= :rows_to_display ';-- || nvl(biv_core_pkg.g_disp,10);
122: 'jtfBinId'||biv_core_pkg.g_value_sep || 'BIV_SERVICE_REQUEST' ||
123: biv_core_pkg.g_param_sep ||
124: biv_core_pkg.param_for_base_col || biv_core_pkg.g_value_sep;
125: --Change for bug 3093779 and enh 2914005 appended P_PREVR
126: update biv_tmp_rt2
127: set col5= l_new_param_str||col1||biv_core_pkg.g_param_sep ||
128: 'P_STS_ID' || biv_core_pkg.g_value_sep || x_status1 ||
129: biv_core_pkg.g_param_sep || 'P_PREVR' || biv_core_pkg.g_value_sep || 'BIV_RT_BACKLOG_BY_STATUS',
130: col7= l_new_param_str||col1||biv_core_pkg.g_param_sep ||
143: creation_date = sysdate
144: where report_code = 'BIV_RT_BACKLOG_BY_STATUS'
145: and session_id = l_session_id
146: ;
147: delete from biv_tmp_rt2
148: where report_code = 'BACKLOG'
149: and session_id = l_session_id;
150:
151: ---
151: ---
152: --- Add a row fot toal of all column
153: ---
154: select count(*) into l_ttl_recs
155: from biv_tmp_rt2
156: where report_code = 'BIV_RT_BACKLOG_BY_STATUS'
157: and session_id = l_session_id;
158: if ( l_ttl_recs > 1 and l_ttl_recs < biv_core_pkg.g_disp ) then
159: if (l_debug = 'Y') then
158: if ( l_ttl_recs > 1 and l_ttl_recs < biv_core_pkg.g_disp ) then
159: if (l_debug = 'Y') then
160: biv_core_pkg.biv_debug('Adding Total row',biv_core_pkg.g_report_id);
161: end if;
162: insert into biv_tmp_rt2 (report_code, rowno,
163: col4, col6, col8, col10, col12, col13,session_id)
164: select report_code, max(rowno) + 1, sum(col4), sum(col6), sum(col8),
165: sum(col10), sum(col12), 'Y', session_id
166: from biv_tmp_rt2
162: insert into biv_tmp_rt2 (report_code, rowno,
163: col4, col6, col8, col10, col12, col13,session_id)
164: select report_code, max(rowno) + 1, sum(col4), sum(col6), sum(col8),
165: sum(col10), sum(col12), 'Y', session_id
166: from biv_tmp_rt2
167: where session_id = l_session_id
168: and report_code = 'BIV_RT_BACKLOG_BY_STATUS'
169: group by report_code, session_id;
170:
180:
181: l_ttl_meaning := biv_core_pkg.get_lookup_meaning('TOTAL');
182: --Change for bug 3093779 appended P_UA=N to all the total urls
183: --Change for enh 2914005 appended P_PREVR to all the urls
184: update biv_tmp_rt2
185: set col5= l_ttl_param_str||
186: 'P_STS_ID' || biv_core_pkg.g_value_sep || x_status1 ||
187: biv_core_pkg.g_param_sep || 'P_UA' || biv_core_pkg.g_value_sep || 'N' ||
188: biv_core_pkg.g_param_sep || 'P_PREVR' || biv_core_pkg.g_value_sep || 'BIV_RT_BACKLOG_BY_STATUS',
232: l_ttl_param_str1 varchar2(2000);
233: l_ttl_param_str2 varchar2(2000);
234: l_param_name varchar2(80);
235: l_dummy number;
236: l_session_id biv_tmp_rt2.session_id % type;
237: l_ttl_recs number;
238: l_ttl_meaning fnd_lookups.meaning % type;
239: l_debug varchar2(30) := fnd_profile.value('BIV:DEBUG');
240: begin
239: l_debug varchar2(30) := fnd_profile.value('BIV:DEBUG');
240: begin
241: biv_core_pkg.g_report_id := 'BIV_RT_TASK_ACTIVITY';
242: l_session_id := biv_core_pkg.get_session_id;
243: biv_core_pkg.clean_dcf_table('biv_tmp_rt2');
244:
245: biv_core_pkg.get_report_parameters(p_param_str);
246: -- Change for Bug 3386946
247: l_from_list := ' from cs_incidents_b_sec sr, jtf_tasks_b task' ||
260: count(distinct sr.incident_id) no_of_srs,
261: count(distinct task.task_id) no_of_tasks';
262:
263: l_sql_sttmnt := '
264: insert into biv_tmp_rt2(report_code,rowno,
265: col1,col4, col6,session_id)
266: select ''X'', rownum,
267: base_col, no_of_srs, no_of_tasks, :session_id
268: from (' || l_sql_sttmnt || l_from_list || l_where_clause ||
274: dbms_sql.parse(l_cur,l_sql_sttmnt,dbms_sql.native);
275: biv_core_pkg.bind_all_variables(l_cur);
276: dbms_sql.bind_variable(l_cur,':session_id',l_session_id);
277: l_dummy := dbms_sql.execute(l_cur);
278: biv_core_pkg.update_base_col_desc('biv_tmp_rt2');
279:
280: select decode(biv_core_pkg.g_srt_by,'2','to_number(col4) desc',
281: '3','to_number(col6) desc',
282: 'col2 asc')
282: 'col2 asc')
283: into l_order_by
284: from dual;
285: l_sql_sttmnt := '
286: insert into biv_tmp_rt2(report_code,rowno, col1,col2,
287: col4, col6,session_id)
288: select ''BIV_RT_TASK_ACTIVITY'', rownum,
289: col1, col2, col4, col6,session_id
290: from ( select col1, col2, col4, col6,session_id
287: col4, col6,session_id)
288: select ''BIV_RT_TASK_ACTIVITY'', rownum,
289: col1, col2, col4, col6,session_id
290: from ( select col1, col2, col4, col6,session_id
291: from biv_tmp_rt2
292: where report_code =''X''
293: and session_id = :session_id
294: order by ' || l_order_by || ' ,col2)
295: where rownum <= :rows_to_display ';--|| nvl(biv_core_pkg.g_disp,'10') ;
323: 'jtfBinId'||biv_core_pkg.g_value_sep || 'BIV_OPEN_TASKS' ||
324: biv_core_pkg.g_param_sep ||
325: biv_core_pkg.param_for_base_col || biv_core_pkg.g_value_sep;
326:
327: update biv_tmp_rt2
328: set col5= l_new_param_str2||nvl(col1,biv_core_pkg.g_null)||
329: biv_core_pkg.g_param_sep,
330: col3= l_new_param_str1|| nvl(col1,biv_core_pkg.g_null) ||
331: biv_core_pkg.g_param_sep || 'P_OTT' ||
333: creation_date = sysdate
334: where report_code = 'BIV_RT_TASK_ACTIVITY'
335: and session_id = l_session_id
336: ;
337: delete from biv_tmp_rt2
338: where report_code = 'X';
339: commit;
340: ---
341: --- Add a row fot toal of all column
340: ---
341: --- Add a row fot toal of all column
342: ---
343: select count(*) into l_ttl_recs
344: from biv_tmp_rt2
345: where report_code = 'BIV_RT_TASK_ACTIVITY'
346: and session_id = l_session_id;
347: if ( l_ttl_recs > 1 and l_ttl_recs < biv_core_pkg.g_disp ) then
348: if (l_debug = 'Y') then
347: if ( l_ttl_recs > 1 and l_ttl_recs < biv_core_pkg.g_disp ) then
348: if (l_debug = 'Y') then
349: biv_core_pkg.biv_debug('Adding Total row',biv_core_pkg.g_report_id);
350: end if;
351: insert into biv_tmp_rt2 (report_code, rowno,
352: col4, col6, col13,session_id)
353: select report_code, max(rowno) + 1, sum(col4), sum(col6),
354: 'Y', session_id
355: from biv_tmp_rt2
351: insert into biv_tmp_rt2 (report_code, rowno,
352: col4, col6, col13,session_id)
353: select report_code, max(rowno) + 1, sum(col4), sum(col6),
354: 'Y', session_id
355: from biv_tmp_rt2
356: where session_id = l_session_id
357: and report_code = 'BIV_RT_TASK_ACTIVITY'
358: group by report_code, session_id;
359: end if;
374: biv_core_pkg.g_param_sep;
375: end if;
376:
377: l_ttl_meaning := biv_core_pkg.get_lookup_meaning('TOTAL');
378: update biv_tmp_rt2
379: set col5= l_ttl_param_str2||
380: biv_core_pkg.g_param_sep,
381: col3= l_ttl_param_str1||
382: biv_core_pkg.g_param_sep || 'P_OTT' ||
406: l_new_param_str1 varchar2(2000);
407: l_new_param_str2 varchar2(2000);
408: l_param_name varchar2(80);
409: l_dummy number;
410: l_session_id biv_tmp_rt2.session_id % type;
411: l_debug varchar2(30) := fnd_profile.value('BIV:DEBUG');
412: begin
413: l_session_id := biv_core_pkg.get_session_id;
414: biv_core_pkg.clean_dcf_table('biv_tmp_rt2');
410: l_session_id biv_tmp_rt2.session_id % type;
411: l_debug varchar2(30) := fnd_profile.value('BIV:DEBUG');
412: begin
413: l_session_id := biv_core_pkg.get_session_id;
414: biv_core_pkg.clean_dcf_table('biv_tmp_rt2');
415:
416: biv_core_pkg.get_report_parameters(p_param_str);
417: -- Change for Bug 3386946
418: l_from_list := ' cs_incidents_b_sec sr,
433: and nvl(tstat.closed_flag,''N'') != ''Y'''
434: ;
435: --''X&SrCreate_SrID='' ||task.source_object_id,
436: l_sql_sttmnt := '
437: insert into biv_tmp_rt2 (report_code, col1, col2, col3, col6,
438: col8, col10,
439: col12, col14, col15,col16, col17,
440: col19,session_id,creation_date)
441: select ''BIV_OPEN_TASKS'', ''task' ||
460: dbms_sql.parse(l_cur,l_sql_sttmnt,dbms_sql.native);
461: biv_core_pkg.bind_all_variables(l_cur);
462: dbms_sql.bind_variable(l_cur,':session_id',l_session_id);
463: l_dummy := dbms_sql.execute(l_cur);
464: biv_core_pkg.update_description('P_AGENT_ID','col3' ,'col4' , 'biv_tmp_rt2');
465: biv_core_pkg.update_description('P_AGENT_ID','col17','col18', 'biv_tmp_rt2');
466: biv_core_pkg.update_description('P_PRD_ID' ,'col19','col20', 'biv_tmp_rt2');
467: exception
468: when others then
461: biv_core_pkg.bind_all_variables(l_cur);
462: dbms_sql.bind_variable(l_cur,':session_id',l_session_id);
463: l_dummy := dbms_sql.execute(l_cur);
464: biv_core_pkg.update_description('P_AGENT_ID','col3' ,'col4' , 'biv_tmp_rt2');
465: biv_core_pkg.update_description('P_AGENT_ID','col17','col18', 'biv_tmp_rt2');
466: biv_core_pkg.update_description('P_PRD_ID' ,'col19','col20', 'biv_tmp_rt2');
467: exception
468: when others then
469: rollback;
462: dbms_sql.bind_variable(l_cur,':session_id',l_session_id);
463: l_dummy := dbms_sql.execute(l_cur);
464: biv_core_pkg.update_description('P_AGENT_ID','col3' ,'col4' , 'biv_tmp_rt2');
465: biv_core_pkg.update_description('P_AGENT_ID','col17','col18', 'biv_tmp_rt2');
466: biv_core_pkg.update_description('P_PRD_ID' ,'col19','col20', 'biv_tmp_rt2');
467: exception
468: when others then
469: rollback;
470: if (l_debug = 'Y') then
478: l_where_clause varchar2(2000);
479: l_sql_sttmnt varchar2(5000);
480: l_order_by varchar2(80);
481: l_dummy number;
482: l_session_id biv_tmp_rt2.session_id % type;
483: l_err varchar2(1000);
484: l_new_param_str varchar2(200);
485: l_pos varchar2(80);
486: l_debug varchar2(30) := fnd_profile.value('BIV:DEBUG');