Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unit Conversion

Former Member
0 Kudos
197

Hi

I have a requirement like i want to change the material value from one unit to other.

Example: i have 123 material value in KG 1200 and i want to convert the value to Grams.

Can you please let me know is there any function module?

I have tried different functin modules but none of them are giving correct result.

Regards,

Srinath

1 ACCEPTED SOLUTION

Former Member
0 Kudos
128

You can use function module "MD_CONVERT_MATERIAL_UNIT"

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

EXPORTING

I_MATNR = I_MATNR "Material number

I_IN_ME = I_MEINH_IN "Input unit

I_OUT_ME = I_MEINH_OUT "Output unit

I_MENGE = LD_MENGE_IN "Inout quantity

IMPORTING

E_MENGE = LD_MENGE_OUT "Output quantity

EXCEPTIONS

OTHERS = 4.

4 REPLIES 4

Former Member
0 Kudos
129

You can use function module "MD_CONVERT_MATERIAL_UNIT"

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

EXPORTING

I_MATNR = I_MATNR "Material number

I_IN_ME = I_MEINH_IN "Input unit

I_OUT_ME = I_MEINH_OUT "Output unit

I_MENGE = LD_MENGE_IN "Inout quantity

IMPORTING

E_MENGE = LD_MENGE_OUT "Output quantity

EXCEPTIONS

OTHERS = 4.

raymond_giuseppi
Active Contributor
0 Kudos
128

UNIT_CONVERSION_SIMPLE should fulfil you requirement. You could also look at the sample at [To convert the Unit of Measure to alternate UOM |http://wiki.sdn.sap.com/wiki/display/ABAP/ToconverttheUnitofMeasuretoalternateUOM] (or use the search tool at SDN. )

Regards,

Raymond

Former Member
0 Kudos
128

Hi Srinath,

Check Table MARM, here cobversions will get stored with its conversion factor. I used this table for a similar requirement.

Thanks & Regards,

Rock.

Former Member
0 Kudos
128

Thanks All !!