Application Development and Automation 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: 
Read only

unit coversion

Former Member
0 Likes
1,363

hello experts,

I need to get all weights into LB and volumes into CF (cubic feet).

Weight units like KG, Ton (TO & TON), GM (gram), OZ (ounce) - convert to LB (pounds)

Volume units like "3 (cubic inch), CCM (cubic centimeter), M3(cubic meter) - convert to CF.

Pls let me know is there any standard FM to do conversion asap.

thanks in advance,

Moderator message: please do more research before asking, show what you have done yourself when asking, no "asap" please.

Edited by: Thomas Zloch on Oct 7, 2011 10:40 AM

3 REPLIES 3
Read only

madhu_vadlamani
Active Contributor
0 Likes
789

Hi Sunil,

Please check with CH_CONVERT_UNITS.

Check this form help.sap.com

[Unit Conversio|http://help.sap.com/saphelp_wp/helpdata/en/2a/fa013c493111d182b70000e829fbfe/content.htm]

Regards,

Madhu.

Edited by: madhurao123 on Oct 7, 2011 12:02 PM

Read only

Former Member
0 Likes
789

hi sunil,

CONVERSION_FACTOR_GET

this fm helps you to conversion

& also check this link....

http://help.sap.com/saphelp_wp/helpdata/en/2a/fa013c493111d182b70000e829fbfe/content.htm

Read only

Former Member
0 Likes
789

Hi Sunil,

try this..

REPORT Unit_Conversion .

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 value after conversion to the target unit of measure is',

w_target_value.

ENDIF.

Regards

Rajashiva Ram