Query to find onhand quantity Oracle Apps
SELECT ON_HAND.SUBINVENTORY_CODE,ITEM.SEGMENT1 ITEM_CODE, ITEM.DESCRIPTION ITEM_DESCRIPTION,
SUM (ON_HAND.ON_HAND) ON_HAND
FROM MTL_SYSTEM_ITEMS_B ITEM, MTL_ONHAND_TOTAL_MWB_V ON_HAND
WHERE ITEM.ORGANIZATION_ID = 3762 --ORG
AND ITEM.INVENTORY_ITEM_ID = ON_HAND.INVENTORY_ITEM_ID
AND ON_HAND.SUBINVENTORY_CODE IN ('PI6.FG','PI7.FG') --SUB INVENTORY
-- AND ITEM.SEGMENT1 = '886631' ---ITEM
GROUP BY ON_HAND.SUBINVENTORY_CODE,ITEM.SEGMENT1, ITEM.DESCRIPTION ORDER BY ON_HAND.SUBINVENTORY_CODE;
------------second
SELECT ON_HAND.ORGANIZATION_CODE,ON_HAND.SUBINVENTORY_CODE, ITEM.DESCRIPTION ITEM_DESCRIPTION,ITEM.SEGMENT1 ITEM_CODE,
SUM (ON_HAND.ON_HAND) ON_HAND
FROM MTL_SYSTEM_ITEMS_B ITEM, MTL_ONHAND_TOTAL_MWB_V ON_HAND
WHERE ITEM.ORGANIZATION_ID = 3759 --ORG ID
AND ITEM.INVENTORY_ITEM_ID = ON_HAND.INVENTORY_ITEM_ID
--AND ON_HAND.SUBINVENTORY_CODE IN ('PA0.FG') --SUB INVENTORY
-- AND ITEM.SEGMENT1 = '886631' ---ITEM NAME
GROUP BY ON_HAND.ORGANIZATION_CODE,ON_HAND.SUBINVENTORY_CODE,ITEM.SEGMENT1, ITEM.DESCRIPTION ORDER BY ON_HAND.ORGANIZATION_CODE;
select * from xx_org_info --where ORG_CODE='PH0'
Comments
Post a Comment