Friday, January 12, 2018

UOM conversion logic - Oracle EBS

Using below query we can get the conversion rate for an Inventory Item.



SELECT * FROM
(SELECT MSIB.ORGANIZATION_ID,
                                MSIB.INVENTORY_ITEM_ID,
                                MUCC.TO_UOM_CODE
                                FROM_UOM_CODE,
                                MUCC.FROM_UOM_CODE TO_UOM_CODE,
                                MUCC.CONVERSION_RATE
FROM   MTL_UOM_CLASS_CONVERSIONS MUCC,
                                MTL_SYSTEM_ITEMS_B MSIB
WHERE MUCC.INVENTORY_ITEM_ID=MSIB.INVENTORY_ITEM_ID
UNION ALL
SELECT MSIB.ORGANIZATION_ID,
                                MSIB.INVENTORY_ITEM_ID,
                                MUM.UOM_CODE FROM_UOM_CODE,
                                MSIB.PRIMARY_UOM_CODE TO_UOM_CODE,
                                1/MUC.CONVERSION_RATE
FROM   MTL_SYSTEM_ITEMS_B MSIB,  
                                MTL_UOM_CONVERSIONS MUC,
                                MTL_UNITS_OF_MEASURE MUM
WHERE MSIB.PRIMARY_UOM_CODE=MUC.UOM_CODE
                                AND MUC.INVENTORY_ITEM_ID=0
                                AND MUC.UOM_CLASS=MUM.UOM_CLASS AND BASE_UOM_FLAG='Y'
) SQ_UOM


No comments:

Post a Comment