‎2009 May 21 7:59 AM
Hi All,
I need to convert the quantity to KG ,i have the two function modules 1)UNIT_CONVERSION_SIMPLE 2)CF_UT_UNIT_CONVERSION,can u guys help me out in conversion process in detail..i need to convert to this field VBRP-FKIMG ( Convert into KG using VBRP-VRKME )
with regards,
sumanth reddy
‎2009 May 21 8:34 AM
Hi,
Check it
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = "enter the value to be converted eg: lv_input
UNIT_IN = ' ' "enter the unit which is at present eg. 'LB'
UNIT_OUT = ' ' "enter the unit to which you want to covert eg. 'KG'
IMPORTING
OUTPUT = "displays the converted value eg: lv_output
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.
write:/ lv_output
regards,
John
‎2009 May 21 8:06 AM
Hi Sumanth,
Try using FM MATERIAL_UNIT_CONVERSION.
Regards,
Suresh.D
‎2009 May 21 8:18 AM
hii suresh,
can u pass the field into the fm ,plz let me know
with regards,
sumanth reddy
‎2009 May 21 8:34 AM
Hi,
Check it
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
INPUT = "enter the value to be converted eg: lv_input
UNIT_IN = ' ' "enter the unit which is at present eg. 'LB'
UNIT_OUT = ' ' "enter the unit to which you want to covert eg. 'KG'
IMPORTING
OUTPUT = "displays the converted value eg: lv_output
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.
write:/ lv_output
regards,
John
‎2009 May 21 1:11 PM
Hi ,
use the FM 'CF_UT_UNIT_CONVERSION'. Below is a sample code i had used for one of my development.
V_QUANTITY = WA_RESB-BDMNG .
CALL FUNCTION 'CF_UT_UNIT_CONVERSION'
EXPORTING
MATNR_IMP = WA_RESB-MATNR "Material number
MEINS_IMP = WA_RESB-MEINS "Material base unit of measure
UNIT_NEW_IMP = WA_MARM-MEINH "New unit
UNIT_OLD_IMP = WA_RESB-MEINS "Old unit
VALUE_OLD_IMP = V_QUANTITY "Old value
IMPORTING
VALUE_NEW_EXP = V_QUANTITY "New value
EXCEPTIONS
OVERFLOW = 1
OTHERS = 2
.
hope it helps.
Regards
Amarendra