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: 

Conversion Table

Former Member
0 Kudos

Hi Gurus,

Can anybody please tell me the table in which we can get the covertions from one UOM to other.

Thanks & Regards,

Vijaya.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Vijaya,

This is with reference to some website. The follow code will convert the the value from one unit of measure to another.

PARAMETERS :

p_svalue TYPE p DECIMALS 2,

p_sunit TYPE mara-meins,

p_tunit TYPE mara-meins.

DATA: w_target_value TYPE f,

l_factor TYPE f.

CALL FUNCTION 'MC_UNIT_CONVERSION'

EXPORTING

nach_meins = p_tunit " Target unit

von_meins = p_sunit " Source unit

IMPORTING

umref = l_factor

EXCEPTIONS

conversion_not_found = 1

material_not_found = 2

nach_meins_missing = 3

overflow = 4

von_meins_missing = 5

OTHERS = 6

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

w_target_value = p_svalue * l_factor.

WRITE :

'The converted unit of measure is',

w_target_value.

ENDIF.

Cheers!!

VEnk@

4 REPLIES 4

naimesh_patel
Active Contributor
0 Kudos

Check Table MARM.

But I would advice to use the FM MD_CONVERT_MATERIAL_UNIT to convert the One Material quantity from one UOM to another UoM.

Regards,

Naimesh Patel

Former Member
0 Kudos

Check table MARM

This table stores the alternate UOMs and their conversion factors with respect to the Base UOM

Also Chk the FM.

MATERIAL_UNIT_CONVERSION

Former Member
0 Kudos

Hi,

Check this FM

UNIT_CONVERSION_SIMPLE convert weights from one UOM to another.

Regards

ranga

Former Member
0 Kudos

Hi Vijaya,

This is with reference to some website. The follow code will convert the the value from one unit of measure to another.

PARAMETERS :

p_svalue TYPE p DECIMALS 2,

p_sunit TYPE mara-meins,

p_tunit TYPE mara-meins.

DATA: w_target_value TYPE f,

l_factor TYPE f.

CALL FUNCTION 'MC_UNIT_CONVERSION'

EXPORTING

nach_meins = p_tunit " Target unit

von_meins = p_sunit " Source unit

IMPORTING

umref = l_factor

EXCEPTIONS

conversion_not_found = 1

material_not_found = 2

nach_meins_missing = 3

overflow = 4

von_meins_missing = 5

OTHERS = 6

.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ELSE.

w_target_value = p_svalue * l_factor.

WRITE :

'The converted unit of measure is',

w_target_value.

ENDIF.

Cheers!!

VEnk@