Thursday, 29 December 2016

Function to convert Item quantity from one UOM to another UOM

Oracle Standard function APPS.INV_CONVERT.INV_UM_CONVERT can be used to convert quantity from one UOM to another UOM.
Eg:
To convert from primary UOM to Base UOM
DECLARE
   v_primary_uom    VARCHAR2 (25);
   v_uom_quantity   NUMBER;
   v_base_uom       VARCHAR2 (25);
   v_inv_item_id    NUMBER        := 164750;
   v_quantity       NUMBER        := 10;
BEGIN
   SELECT primary_uom_code
     INTO v_primary_uom
     FROM inv.mtl_system_items_b
    WHERE inventory_item_id = v_inv_item_id AND organization_id = 1381;

   SELECT b.uom_code
     INTO v_base_uom
     FROM mtl_units_of_measure a, mtl_units_of_measure b
    WHERE a.uom_code = v_primary_uom
      AND (b.uom_class = a.uom_class AND b.base_uom_flag = 'Y');

   SELECT apps.inv_convert.inv_um_convert (v_inv_item_id,  --Inventory Item Id
                                           NULL,                   --Precision
                                           NVL (v_quantity, 0),     --Quantity
                                           v_primary_uom,           --From UOM
                                           v_base_uom,                --To UOM
                                           NULL,               --From UOM Name
                                           NULL                 -- To UOM Name
                                          )
     INTO v_uom_quantity
     FROM DUAL;

   DBMS_OUTPUT.put_line ('Base Quantity is :' || v_uom_quantity);
END;

9 comments:

  1. Thanks for sharing very good information about OCI Punchout.
    OCI Punchout

    ReplyDelete
  2. Excellent blog I visit this blog it's really awesome. The important thing is that in this blog content written clearly and understandable. The content of information is very informative.
    Oracle Fusion HCM Online Training
    Oracle Fusion SCM Online Training
    Oracle Fusion Financials Online Training
    Big Data and Hadoop Training In Hyderabad

    ReplyDelete
  3. Such a nice blog, I really like what you write in this blog, I also have some relevant information about if you want more information.

    Big Data and Hadoop Online Training

    ReplyDelete
  4. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.

    Spark and Scala Online Training

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Thanks for sharing this great information I am impressed by the information that you have on this blog. Same as your blog i found another one Oracle Project Portfolio Management Cloud. Actually, I was looking for the same information on internet for
    Oracle Financials Cloud and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject, you can learn more about Oracle Cloud Applications
    .

    ReplyDelete

  7. Iam so thrilled because of finding your alluring website here.Actually i was searching for Oracle CPQ BML.Your blog is so astounding and informative too..Iam very happy to find such a creative blog. Iam also find another one by mistake while am searching the same topic Oracle PPM Cloud.Thank you soo much.

    ReplyDelete
  8. sorry, what is precision ='null'. how does it work?

    ReplyDelete