‎2009 Jun 03 11:17 AM
Hi Folks,
My requirement is i need to defacult the unit of measure to 'PCE' in my selection screen.
Here my requirement is if the materials base unit of measure is in 'PCE'S and in the selection screen if they passed other unit of measurements like 'KG' 'LB' then i need to convert the quantity of that material form PCE' to KG'S or LB'S.
Please guide me how to achieve this requirement.
Thanks,
Vinay.
‎2009 Jun 03 11:27 AM
‎2009 Jun 03 11:32 AM
hi thankyou for your reply can you please expalin me abt the parameters of this function module.
‎2009 Jun 03 11:38 AM
CALL FUNCTION 'MATERIAL_CONVERT_QUANTITY'
EXPORTING
PI_MATERIAL_SRC = P_MATNR "MATERIAL NUMBER
PI_MEINH_SRC = P_MEINH1 "SOURCE UOM
* PI_MEINS_SRC =
PI_QUANTITY_SRC = P_QUAN1 "QUANTITY
PI_MATERIAL_DST = P_MEINH2 "TARET UOM
* PI_MEINH_DST =
* PI_MEINS_DST =
IMPORTING
PE_QUANTITY_DST = P_QUAN2 "CONVERTED QUANTITY
* PE_MEINH_DST =
* PE_MEINS_DST =
EXCEPTIONS
WRONG_CALL = 1
MATERIAL_NOT_FOUND = 2
NO_CONVERSION = 3
OTHERS = 4
‎2009 Jun 03 11:40 AM
HI i runned the function module manually by your inputs but no luck .
‎2009 Jun 03 11:46 AM
SORY TRY THIS
CALL FUNCTION 'MATERIAL_CONVERT_QUANTITY'
EXPORTING
PI_MATERIAL_SRC = P_MATNR "MATERIAL NUMBER
PI_MEINH_SRC = P_MEINH1 "SOURCE UOM
* PI_MEINS_SRC =
PI_QUANTITY_SRC = P_QUAN1 "QUANTITY
PI_MATERIAL_DST = P_MATNR "MATERIAL NUMBER
PI_MEINH_DST = P_MEINH2 "TARET UOM
* PI_MEINS_DST =
IMPORTING
PE_QUANTITY_DST = P_QUAN2 "CONVERTED QUANTITY
* PE_MEINH_DST =
* PE_MEINS_DST =
EXCEPTIONS
WRONG_CALL = 1
MATERIAL_NOT_FOUND = 2
NO_CONVERSION = 3
OTHERS = 4Edited by: GTREN on Jun 3, 2009 1:46 PM
‎2009 Jun 03 12:32 PM
‎2009 Jun 03 11:31 AM
Hi,
Use FM MD_CONVERT_MATERIAL_UNIT.
call function 'MD_CONVERT_MATERIAL_UNIT'
exporting
i_matnr = i_matnr
i_in_me = i_meinh_in
i_out_me = i_meinh_out
i_menge = ld_menge_in
importing
e_menge = ld_menge_out
exceptions
others = 4.
e_subrc = sy-subrc.
if e_subrc is initial.
********
endif.
Regards,
Raju.
‎2012 Sep 26 7:56 AM
‎2009 Jun 03 11:31 AM
Hi Vinay,
Please try using the below FM for your issue.
CF_UT_UNIT_CONVERSION
Regards,
jana
‎2009 Jun 03 11:38 AM
Hello Vinay,
Please Use below FM:
MATERIAL_CONVERT_QUANTITY
CIF_GEN_CONVERT_QUANTITY_ISO
Have a Nice Day,
Regards,
Sujeet
‎2009 Jun 03 11:49 AM
You need to take care while using the FM 'MD_CONVERT_MATERIAL_UNIT' because, if the quantity conversion factor is not maintained for a particular material that quantity then the FM give the error message.
You can check via T-Code MM03 whether the quantity conversion factor is maintained for that material or not.
use the below code for the quantity conversion
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
i_matnr = material number
i_in_me = from quantity
i_out_me = to quantity
i_menge = input quantity
IMPORTING
e_menge = output quantity
EXCEPTIONS
error_in_application = 1
error = 2
OTHERS = 3.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
‎2009 Jun 03 12:16 PM
hI sheelesh,thankyou for your reply.
Do you have any idea that how we will calculate the sales of the material by using movement types.
‎2009 Jun 03 11:50 AM
Hi,
You may use the FM "UNIT_CONVERSION_SIMPLE".
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = < Total units>
UNIT_IN = <The unit of measurement selected by the user>
UNIT_OUT = <PCE>
IMPORTING
OUTPUT = <Here you will get the converted total units>
EXCEPTIONS
CONVERSION_NOT_FOUND = 1
DIVISION_BY_ZERO = 2
INPUT_INVALID = 3
OUTPUT_INVALID = 4
OVERFLOW = 5
TYPE_INVALID = 6
UNITS_MISSING = 7
UNIT_IN_NOT_FOUND = 8
UNIT_OUT_NOT_FOUND = 9
OTHERS = 10
Hope this will help you.
Regards,
Smart Varghese
‎2009 Jun 03 11:50 AM
Try this FM u will get the desired result.....
CF_UT_UNIT_CONVERSION