9: /* Inventory Value Report */
10:
11: FUNCTION get_inv_val_status_sel_clause (p_view_by_dim IN VARCHAR2,
12: p_join_tbl IN
13: poa_dbi_util_pkg.POA_DBI_JOIN_TBL)
14: RETURN VARCHAR2;
15:
16: FUNCTION get_onhand_sel_clause (p_view_by_dim IN VARCHAR2,
17: p_join_tbl IN
14: RETURN VARCHAR2;
15:
16: FUNCTION get_onhand_sel_clause (p_view_by_dim IN VARCHAR2,
17: p_join_tbl IN
18: poa_dbi_util_pkg.POA_DBI_JOIN_TBL)
19: RETURN VARCHAR2;
20:
21: FUNCTION get_intransit_sel_clause (p_view_by_dim IN VARCHAR2,
22: p_join_tbl IN
19: RETURN VARCHAR2;
20:
21: FUNCTION get_intransit_sel_clause (p_view_by_dim IN VARCHAR2,
22: p_join_tbl IN
23: poa_dbi_util_pkg.POA_DBI_JOIN_TBL)
24: RETURN VARCHAR2;
25:
26: PROCEDURE get_inv_val_item_columns (p_dim_name VARCHAR2,
27: p_description OUT NOCOPY VARCHAR2,
57: l_comparison_type VARCHAR2(1);
58: l_cur_suffix VARCHAR2(5);
59: l_custom_sql VARCHAR2 (10000);
60:
61: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
62: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
63:
64: l_where_clause VARCHAR2 (2000);
65: l_mv VARCHAR2 (30);
58: l_cur_suffix VARCHAR2(5);
59: l_custom_sql VARCHAR2 (10000);
60:
61: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
62: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
63:
64: l_where_clause VARCHAR2 (2000);
65: l_mv VARCHAR2 (30);
66:
75: l_comparison_type := 'Y';
76: l_aggregation_level_flag := '0';
77:
78: -- clear out the tables.
79: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL ();
80: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL ();
81:
82:
83: -- get all the query parameters
76: l_aggregation_level_flag := '0';
77:
78: -- clear out the tables.
79: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL ();
80: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL ();
81:
82:
83: -- get all the query parameters
84: opi_dbi_rpt_util_pkg.process_parameters (p_param => p_param,
100:
101: -- The measure columns that need to be aggregated are
102: -- onhand_value_, intransit_value_,
103: -- wip_value_, inv_total_value_
104: poa_dbi_util_pkg.add_column (l_col_tbl,
105: 'onhand_value_' || l_cur_suffix,
106: 'onhand_value');
107:
108: poa_dbi_util_pkg.add_column (l_col_tbl,
104: poa_dbi_util_pkg.add_column (l_col_tbl,
105: 'onhand_value_' || l_cur_suffix,
106: 'onhand_value');
107:
108: poa_dbi_util_pkg.add_column (l_col_tbl,
109: 'intransit_value_' || l_cur_suffix,
110: 'intransit_value');
111:
112: poa_dbi_util_pkg.add_column (l_col_tbl,
108: poa_dbi_util_pkg.add_column (l_col_tbl,
109: 'intransit_value_' || l_cur_suffix,
110: 'intransit_value');
111:
112: poa_dbi_util_pkg.add_column (l_col_tbl,
113: 'wip_value_' || l_cur_suffix,
114: 'wip_value');
115:
116: poa_dbi_util_pkg.add_column (l_col_tbl,
112: poa_dbi_util_pkg.add_column (l_col_tbl,
113: 'wip_value_' || l_cur_suffix,
114: 'wip_value');
115:
116: poa_dbi_util_pkg.add_column (l_col_tbl,
117: 'inv_total_value_' || l_cur_suffix,
118: 'inv_total_value');
119:
120: --Add filtering condition to suppress rows
135: x_custom_output := BIS_QUERY_ATTRIBUTES_TBL();
136: l_custom_rec := BIS_PMV_PARAMETERS_PUB.INITIALIZE_QUERY_TYPE;
137:
138: -- set the basic bind variables for the status SQL
139: poa_dbi_util_pkg.get_custom_status_binds (x_custom_output);
140:
141: -- Passing OPI_AGGREGATION_LEVEL_FLAG to PMV
142: l_custom_rec.attribute_name := ':OPI_AGGREGATION_LEVEL_FLAG';
143: l_custom_rec.attribute_value := l_aggregation_level_flag;
160: */
161:
162: FUNCTION get_inv_val_status_sel_clause(p_view_by_dim IN VARCHAR2,
163: p_join_tbl IN
164: poa_dbi_util_pkg.POA_DBI_JOIN_TBL)
165: return VARCHAR2
166: IS
167:
168: l_sel_clause varchar2(4500);
383: l_aggregation_level_flag VARCHAR2(1);
384:
385: l_custom_rec BIS_QUERY_ATTRIBUTES;
386:
387: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
388: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
389:
390: BEGIN
391:
384:
385: l_custom_rec BIS_QUERY_ATTRIBUTES;
386:
387: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
388: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
389:
390: BEGIN
391:
392: -- initialization block
394: l_where_clause := '';
395: l_aggregation_level_flag := '0';
396:
397: -- clear out the tables.
398: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL ();
399: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL ();
400:
401: -- get all the query parameters
402: opi_dbi_rpt_util_pkg.process_parameters (p_param => p_param,
395: l_aggregation_level_flag := '0';
396:
397: -- clear out the tables.
398: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL ();
399: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL ();
400:
401: -- get all the query parameters
402: opi_dbi_rpt_util_pkg.process_parameters (p_param => p_param,
403: p_view_by => l_view_by,
420: -- onhand_value_, intransit_value_,
421: -- wip_value_, inv_total_value_
422: -- No Grand totals required.
423:
424: poa_dbi_util_pkg.add_column (l_col_tbl,
425: 'onhand_value_' || l_cur_suffix,
426: 'onhand_value',
427: 'N');
428:
425: 'onhand_value_' || l_cur_suffix,
426: 'onhand_value',
427: 'N');
428:
429: poa_dbi_util_pkg.add_column (l_col_tbl,
430: 'intransit_value_' || l_cur_suffix,
431: 'intransit_value',
432: 'N');
433:
430: 'intransit_value_' || l_cur_suffix,
431: 'intransit_value',
432: 'N');
433:
434: poa_dbi_util_pkg.add_column (l_col_tbl,
435: 'wip_value_' || l_cur_suffix,
436: 'wip_value',
437: 'N');
438:
435: 'wip_value_' || l_cur_suffix,
436: 'wip_value',
437: 'N');
438:
439: poa_dbi_util_pkg.add_column (l_col_tbl,
440: 'inv_total_value_' || l_cur_suffix,
441: 'inv_total_value',
442: 'N');
443:
461:
462: -- get all the basic binds used by POA queries
463: -- Do this before adding any of our binds, since the procedure
464: -- reinitializes the output table
465: poa_dbi_util_pkg.get_custom_trend_binds (l_xtd, l_comparison_type,
466: x_custom_output);
467:
468: -- Passing OPI_AGGREGATION_LEVEL_FLAG to PMV
469: l_custom_rec.attribute_name := ':OPI_AGGREGATION_LEVEL_FLAG';
543: l_comparison_type VARCHAR2(1);
544: l_cur_suffix VARCHAR2(5);
545: l_custom_sql VARCHAR2 (10000);
546:
547: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
548: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
549:
550: l_where_clause VARCHAR2 (2000);
551: l_mv VARCHAR2 (30);
544: l_cur_suffix VARCHAR2(5);
545: l_custom_sql VARCHAR2 (10000);
546:
547: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
548: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
549:
550: l_where_clause VARCHAR2 (2000);
551: l_mv VARCHAR2 (30);
552:
560: l_comparison_type := 'Y';
561: l_aggregation_level_flag := '0';
562:
563: -- clear out the tables.
564: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL ();
565: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL ();
566:
567:
568: -- get all the query parameters
561: l_aggregation_level_flag := '0';
562:
563: -- clear out the tables.
564: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL ();
565: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL ();
566:
567:
568: -- get all the query parameters
569: opi_dbi_rpt_util_pkg.process_parameters (p_param => p_param,
584: p_mv_flag_type => 'INV_VAL_LEVEL');
585:
586: -- The measure columns that need to be aggregated are
587: -- onhand_value_, onhand_qty,
588: poa_dbi_util_pkg.add_column (l_col_tbl,
589: 'onhand_value_' || l_cur_suffix,
590: 'onhand_value');
591:
592: poa_dbi_util_pkg.add_column (l_col_tbl,
588: poa_dbi_util_pkg.add_column (l_col_tbl,
589: 'onhand_value_' || l_cur_suffix,
590: 'onhand_value');
591:
592: poa_dbi_util_pkg.add_column (l_col_tbl,
593: 'onhand_qty',
594: 'onhand_qty');
595:
596: --Add filtering condition to suppress rows
613: x_custom_output := BIS_QUERY_ATTRIBUTES_TBL();
614: l_custom_rec := BIS_PMV_PARAMETERS_PUB.INITIALIZE_QUERY_TYPE;
615:
616: -- set the basic bind variables for the status SQL
617: poa_dbi_util_pkg.get_custom_status_binds (x_custom_output);
618:
619: -- Passing OPI_AGGREGATION_LEVEL_FLAG to PMV
620: l_custom_rec.attribute_name := ':OPI_AGGREGATION_LEVEL_FLAG';
621: l_custom_rec.attribute_value := l_aggregation_level_flag;
633: END onhand_sql;
634:
635: FUNCTION get_onhand_sel_clause(p_view_by_dim IN VARCHAR2,
636: p_join_tbl IN
637: poa_dbi_util_pkg.POA_DBI_JOIN_TBL)
638: return VARCHAR2
639: IS
640:
641: l_sel_clause varchar2(4500);
751: l_comparison_type VARCHAR2(1);
752: l_cur_suffix VARCHAR2(5);
753: l_custom_sql VARCHAR2 (10000);
754:
755: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
756: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
757:
758: l_where_clause VARCHAR2 (2000);
759: l_mv VARCHAR2 (30);
752: l_cur_suffix VARCHAR2(5);
753: l_custom_sql VARCHAR2 (10000);
754:
755: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
756: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
757:
758: l_where_clause VARCHAR2 (2000);
759: l_mv VARCHAR2 (30);
760:
768: l_comparison_type := 'Y';
769: l_aggregation_level_flag := '0';
770:
771: -- clear out the tables.
772: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL ();
773: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL ();
774:
775:
776: -- get all the query parameters
769: l_aggregation_level_flag := '0';
770:
771: -- clear out the tables.
772: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL ();
773: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL ();
774:
775:
776: -- get all the query parameters
777: opi_dbi_rpt_util_pkg.process_parameters (p_param => p_param,
792: p_mv_flag_type => 'INV_VAL_LEVEL');
793:
794: -- The measure columns that need to be aggregated are
795: -- onhand_value_, onhand_qty,
796: poa_dbi_util_pkg.add_column (l_col_tbl,
797: 'intransit_value_' || l_cur_suffix,
798: 'intransit_value');
799:
800: poa_dbi_util_pkg.add_column (l_col_tbl,
796: poa_dbi_util_pkg.add_column (l_col_tbl,
797: 'intransit_value_' || l_cur_suffix,
798: 'intransit_value');
799:
800: poa_dbi_util_pkg.add_column (l_col_tbl,
801: 'intransit_qty',
802: 'intransit_qty');
803:
804: --Add filtering condition to suppress rows
821: x_custom_output := BIS_QUERY_ATTRIBUTES_TBL();
822: l_custom_rec := BIS_PMV_PARAMETERS_PUB.INITIALIZE_QUERY_TYPE;
823:
824: -- set the basic bind variables for the status SQL
825: poa_dbi_util_pkg.get_custom_status_binds (x_custom_output);
826:
827: -- Passing OPI_AGGREGATION_LEVEL_FLAG to PMV
828: l_custom_rec.attribute_name := ':OPI_AGGREGATION_LEVEL_FLAG';
829: l_custom_rec.attribute_value := l_aggregation_level_flag;
841: END intransit_sql;
842:
843: FUNCTION get_intransit_sel_clause(p_view_by_dim IN VARCHAR2,
844: p_join_tbl IN
845: poa_dbi_util_pkg.POA_DBI_JOIN_TBL)
846: return VARCHAR2
847: IS
848:
849: l_sel_clause varchar2(4500);
952: l_cur_suffix VARCHAR2(5);
953: l_custom_sql VARCHAR2 (32767);
954: l_viewby_rank_clause VARCHAR2 (32767);
955:
956: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
957: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
958:
959:
960: l_where_clause VARCHAR2 (2000);
953: l_custom_sql VARCHAR2 (32767);
954: l_viewby_rank_clause VARCHAR2 (32767);
955:
956: l_col_tbl poa_dbi_util_pkg.POA_DBI_COL_TBL;
957: l_join_tbl poa_dbi_util_pkg.POA_DBI_JOIN_TBL;
958:
959:
960: l_where_clause VARCHAR2 (2000);
961: l_mv VARCHAR2 (30);
971: l_comparison_type := 'Y';
972: l_aggregation_level_flag := '0';
973:
974: -- clear out the tables.
975: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL ();
976: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL ();
977:
978:
979: -- get all the query parameters
972: l_aggregation_level_flag := '0';
973:
974: -- clear out the tables.
975: l_col_tbl := poa_dbi_util_pkg.POA_DBI_COL_TBL ();
976: l_join_tbl := poa_dbi_util_pkg.POA_DBI_JOIN_TBL ();
977:
978:
979: -- get all the query parameters
980: opi_dbi_rpt_util_pkg.process_parameters (p_param => p_param,
1056: x_custom_output := BIS_QUERY_ATTRIBUTES_TBL();
1057: l_custom_rec := BIS_PMV_PARAMETERS_PUB.INITIALIZE_QUERY_TYPE;
1058:
1059: -- set the basic bind variables for the status SQL
1060: poa_dbi_util_pkg.get_custom_status_binds (x_custom_output);
1061:
1062: -- Passing OPI_AGGREGATION_LEVEL_FLAG to PMV
1063: l_custom_rec.attribute_name := ':OPI_AGGREGATION_LEVEL_FLAG';
1064: l_custom_rec.attribute_value := l_aggregation_level_flag;