Monday, 16 October 2017

Query to get On Hand quantity of Inventory Items in Fusion

select ESI.ITEM_NUMBER ,
  IODV.ORGANIZATION_NAME,
  ESI.DESCRIPTION ,
  IOP.ORGANIZATION_CODE ,
  SUM(IOQD.TRANSACTION_QUANTITY) TRX_QTY,
  UOMT.UNIT_OF_MEASURE ,
  IOQD.SUBINVENTORY_CODE ,
  IOQD.LOT_NUMBER,
  IIL.SEGMENT1,
  IIL.SEGMENT2,
  IIL.SEGMENT3,
  IIL.SEGMENT4
from INV_ONHAND_QUANTITIES_DETAIL IOQD ,
  EGP_SYSTEM_ITEMS ESI ,
  INV_ORG_PARAMETERS IOP ,
  INV_ORGANIZATION_DEFINITIONS_V IODV,
  INV_UNITS_OF_MEASURE_TL UOMT ,
  INV_UNITS_OF_MEASURE_B UOMB,
  INV_ITEM_LOCATIONS IIL
where 1                     = 1
and IODV.ORGANIZATION_ID    =IOP.ORGANIZATION_ID
and IOQD.INVENTORY_ITEM_ID  = ESI.INVENTORY_ITEM_ID
and IOQD.ORGANIZATION_ID    = ESI.ORGANIZATION_ID
and ESI.ORGANIZATION_ID     = IOP.ORGANIZATION_ID
and UOMT.UNIT_OF_MEASURE_ID = UOMB.UNIT_OF_MEASURE_ID
and UOMB.UOM_CODE           = IOQD.TRANSACTION_UOM_CODE
and IOQD.ORGANIZATION_ID    = IIL.ORGANIZATION_ID(+)
and IOQD.SUBINVENTORY_CODE  = IIL.SUBINVENTORY_CODE(+)
and IOQD.LOCATOR_ID         =IIL.INVENTORY_LOCATION_ID(+)
and ESI.ITEM_NUMBER        in '<Item Numbers>'
group by ESI.ITEM_NUMBER ,
  IODV.ORGANIZATION_NAME,
  ESI.DESCRIPTION ,
  IOP.ORGANIZATION_CODE ,
  UOMT.UNIT_OF_MEASURE ,
  IOQD.SUBINVENTORY_CODE ,
  IOQD.LOT_NUMBER,
  IIL.SEGMENT1,
  IIL.SEGMENT2,
  IIL.SEGMENT3,
  IIL.SEGMENT4
order by 1,2

4 comments:

  1. Hi,
    Query is helpful. How we will get on-hand quantity between 2 dates..? Appreciate your help. Thanks!

    ReplyDelete
  2. I tried it , it gives me the same quantity but there is a difference in quantities which system is showing and the one fetched through query.

    ReplyDelete
  3. Hi

    Could you help me to extract the transactions with it's cost setais if possible along with source.

    ReplyDelete
  4. hi Priyanka,

    Could you please help me to get "Available to Transact" and "Available to Reserve" in Fusion.
    Thanks,

    ReplyDelete