Wednesday 23 November 2011

On hand quantity querie

SELECT   org.organization_code ORG_CODE,
          it.segment1 R12_ITEM,
          it.description ITEM_DESCRIPTION,
                     SUM (Q.primary_transaction_quantity) ON_HAND_QTY,
                     cic.item_cost,
          it.primary_uom_code,
          q.subinventory_code,
                     loc.description "LOCATOR",
                     q.lot_number
      FROM   MTL_ONHAND_QUANTITIES_DETAIL Q,
          mtl_system_items_b it,
          org_organization_definitions org,
          MTL_ITEM_LOCATIONS loc,
          cst_item_Costs cic
  WHERE       ORG.ORGANIZATION_ID = it.ORGANIZATION_ID
          AND it.inventory_item_id = q.inventory_item_id
          AND ORG.ORGANIZATION_ID = q.ORGANIZATION_ID
          AND ORG.ORGANIZATION_CODE IN ('50E')
          and q.locator_id = loc.inventory_location_id (+)
          AND q.ORGANIZATION_ID = loc.ORGANIZATION_ID(+)
          and q.organization_id = cic.organization_Id
          and q.inventory_item_id = cic.inventory_item_id
          and cic.cost_type_id = 2
          AND q.subinventory_code = loc.subinventory_code
          --AND it.segment1 IN (
          --)
GROUP BY   it.segment1,
          it.primary_uom_code,
          q.subinventory_code,
          it.description,
          org.organization_code,
          q.lot_number,
         loc.description,
         cic.item_cost
Order by it.segment1

1 comment:

  1. 25% OFF on Oracle Apps R12 Financials Self Paced Course along with 11 Additional Add On Courses (321 Session Videos of 120 Hours Recordings). Our Top Trending Course with 1700 Enrolled Udemy Students

    Please Check https://www.oracleappstechnical.com for details

    ReplyDelete