Query to Fetch Serialized Quantity based on Subinventory Name, Locator Name, organization id and Item Name

Query to Fetch Serialized Quantity based on Sub inventory Name, Locator Name, organization id and Item Name

SELECT msi.segment1,
         ood.ORGANIZATION_ID,
         mq.subinventory_code,
         mq.LOCATOR_ID,
         mil.SEGMENT1,
         msn.SERIAL_NUMBER
    FROM apps.org_organization_definitions ood,
         apps.mtl_onhand_quantities mq,
         apps.mtl_system_items_b msi,
         mtl_item_locations MIL,
         apps.mtl_serial_numbers msn
   WHERE     1 = 1
         AND mq.organization_id = msi.organization_id
         AND ood.organization_id = msi.organization_id
         AND mq.inventory_item_id = msi.inventory_item_id
         AND MQ.LOCATOR_ID = MIL.INVENTORY_LOCATION_ID
         AND msn.INVENTORY_ITEM_ID = mQ.INVENTORY_ITEM_ID
         AND MSN.CURRENT_LOCATOR_ID = MQ.LOCATOR_ID
         AND msi.SEGMENT1='CISCO'  -- Give Your Item Name
         AND ood.organization_id = 126   -- Give your organization_id
         AND msi.serial_number_control_code = 5
         AND mil.SEGMENT1 LIKE 'LOC%'  --Give  Locator Name
         AND mq.subinventory_code = 'XX-RTV'  -- Give Subinventory Name
GROUP BY msi.segment1,
         ood.ORGANIZATION_ID,
         mq.subinventory_code,
         mq.LOCATOR_ID,
         mil.SEGMENT1,
         msn.SERIAL_NUMBER

Comments

Post a Comment

Popular posts from this blog

Deleting the Sourcing Rule Assignments API

BarCode with XML Publisher