DBA Data[Home] [Help]

VIEW: APPS.GMF_LOT_COSTS_V

Source

View Text - Preformatted

SELECT DISTINCT dtl.organization_id, dtl.inventory_item_id, item.item_number, item.description as item_description, item.primary_uom_code, dtl.cost_type_id, mthd.cost_mthd_code, mthd.cost_mthd_desc, NVL(dtl.lot_number,' ') as lot_number, gfp.base_currency_code as base_currency, dtl.header_id, dtl.unit_cost, dtl.cost_date, dtl.onhand_qty, dtl.delete_mark, rank () OVER (partition by dtl.inventory_item_id, dtl.organization_id, dtl.cost_type_id, dtl.lot_number order by cost_date desc, dtl.header_id desc) lot_cost_rank, dtl.final_cost_flag FROM gmf_fiscal_policies gfp, cm_mthd_mst mthd, mtl_item_flexfields item, gmf_lot_costs dtl, org_organization_definitions ood WHERE item.inventory_item_id = dtl.inventory_item_id AND item.organization_id = dtl.organization_id AND mthd.cost_type_id = dtl.cost_type_id AND ood.organization_id = dtl.organization_id AND ood.legal_entity = gfp.legal_entity_id
View Text - HTML Formatted

SELECT DISTINCT DTL.ORGANIZATION_ID
, DTL.INVENTORY_ITEM_ID
, ITEM.ITEM_NUMBER
, ITEM.DESCRIPTION AS ITEM_DESCRIPTION
, ITEM.PRIMARY_UOM_CODE
, DTL.COST_TYPE_ID
, MTHD.COST_MTHD_CODE
, MTHD.COST_MTHD_DESC
, NVL(DTL.LOT_NUMBER
, ' ') AS LOT_NUMBER
, GFP.BASE_CURRENCY_CODE AS BASE_CURRENCY
, DTL.HEADER_ID
, DTL.UNIT_COST
, DTL.COST_DATE
, DTL.ONHAND_QTY
, DTL.DELETE_MARK
, RANK () OVER (PARTITION BY DTL.INVENTORY_ITEM_ID
, DTL.ORGANIZATION_ID
, DTL.COST_TYPE_ID
, DTL.LOT_NUMBER ORDER BY COST_DATE DESC
, DTL.HEADER_ID DESC) LOT_COST_RANK
, DTL.FINAL_COST_FLAG
FROM GMF_FISCAL_POLICIES GFP
, CM_MTHD_MST MTHD
, MTL_ITEM_FLEXFIELDS ITEM
, GMF_LOT_COSTS DTL
, ORG_ORGANIZATION_DEFINITIONS OOD
WHERE ITEM.INVENTORY_ITEM_ID = DTL.INVENTORY_ITEM_ID
AND ITEM.ORGANIZATION_ID = DTL.ORGANIZATION_ID
AND MTHD.COST_TYPE_ID = DTL.COST_TYPE_ID
AND OOD.ORGANIZATION_ID = DTL.ORGANIZATION_ID
AND OOD.LEGAL_ENTITY = GFP.LEGAL_ENTITY_ID