DBA Data[Home] [Help]

VIEW: APPS.MSC_SRVLVL_PROFIT_V

Source

View Text - Preformatted

SELECT sum(nvl(mbid.production_cost,0)), sum(nvl(mbid.carrying_cost,0)), sum(nvl(mbid.purchasing_cost,0)), sum(nvl(mbid.int_repair_cost,0)), sum(nvl(mbid.ext_repair_cost,0)), sum(nvl(mbid.production_cost + mbid.carrying_cost + mbid.int_repair_cost + mbid.ext_repair_cost + mbid.purchasing_cost,0)), sum(nvl(mbid.mds_price,0)), nvl(sum(mbid.mds_price) - sum(mbid.production_cost + mbid.carrying_cost + mbid.purchasing_cost),0), decode(sum(mbid.production_cost + mbid.carrying_cost + mbid.purchasing_cost), 0, 0, nvl((sum(mbid.mds_price) - sum(mbid.production_cost + mbid.carrying_cost + mbid.purchasing_cost)) /sum(mbid.production_cost + mbid.carrying_cost + mbid.purchasing_cost),0)*100), sum(mbid.inventory_value), mbid.plan_id FROM msc_bis_inv_detail mbid WHERE nvl(mbid.period_type,0) = 0 and nvl(mbid.detail_level,0) = 0 GROUP BY mbid.plan_id
View Text - HTML Formatted

SELECT SUM(NVL(MBID.PRODUCTION_COST
, 0))
, SUM(NVL(MBID.CARRYING_COST
, 0))
, SUM(NVL(MBID.PURCHASING_COST
, 0))
, SUM(NVL(MBID.INT_REPAIR_COST
, 0))
, SUM(NVL(MBID.EXT_REPAIR_COST
, 0))
, SUM(NVL(MBID.PRODUCTION_COST + MBID.CARRYING_COST + MBID.INT_REPAIR_COST + MBID.EXT_REPAIR_COST + MBID.PURCHASING_COST
, 0))
, SUM(NVL(MBID.MDS_PRICE
, 0))
, NVL(SUM(MBID.MDS_PRICE) - SUM(MBID.PRODUCTION_COST + MBID.CARRYING_COST + MBID.PURCHASING_COST)
, 0)
, DECODE(SUM(MBID.PRODUCTION_COST + MBID.CARRYING_COST + MBID.PURCHASING_COST)
, 0
, 0
, NVL((SUM(MBID.MDS_PRICE) - SUM(MBID.PRODUCTION_COST + MBID.CARRYING_COST + MBID.PURCHASING_COST)) /SUM(MBID.PRODUCTION_COST + MBID.CARRYING_COST + MBID.PURCHASING_COST)
, 0)*100)
, SUM(MBID.INVENTORY_VALUE)
, MBID.PLAN_ID
FROM MSC_BIS_INV_DETAIL MBID
WHERE NVL(MBID.PERIOD_TYPE
, 0) = 0
AND NVL(MBID.DETAIL_LEVEL
, 0) = 0 GROUP BY MBID.PLAN_ID