Tuesday, January 15, 2013

Onhand Quantity from inventory Oracle Applications

ON Hand Quantities by Sub Inventories

 SELECT   msi.segment1, SUM (mq.transaction_quantity) on_hand,
         ood.organization_name, mq.subinventory_code
    FROM apps.org_organization_definitions ood,
         apps.mtl_onhand_quantities mq,
         apps.mtl_system_items_b msi
   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 msi.inventory_item_id = :P_ITEM_ID     --  PASS Item ID
--     AND MSI.organization_id = :P_ORGANIZATION_ID -- Pass Org ID
     AND msi.segment1 = :P_ITEM_NUMBER     --  PASS Item NUMBER
     AND MSI.organization_id = :P_ORGANIZATION_id -- Pass Org id
GROUP BY msi.segment1, ood.organization_name, mq.subinventory_code

No comments:

Post a Comment