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

Function module needed - Convert price to one unit to another

Former Member
0 Likes
1,765

Hi All,

I need FM to covert price to one unit to another.

Any suggestion welcome.

Regards,

3 REPLIES 3
Read only

Former Member
0 Likes
964

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

EXPORTING

i_matnr = w_lqua-matnr

i_in_me = w_lqua-meins

i_out_me = text-011

i_menge = w_lqua-gesme

IMPORTING

e_menge = w_lqua-gesme.

Read only

Former Member
0 Likes
964

Hello,

Here is another one:

CALL FUNCTION 'CF_UT_UNIT_CONVERSION'

EXPORTING

matnr_imp = itab_pot-matnr

unit_new_imp = ztb_vend_min-min_uom

unit_old_imp = itab_pot-meins

value_old_imp = w_conv_qty

IMPORTING

value_new_exp = w_conv_qty.

Thanks,

Venu

Read only

Former Member
0 Likes
964

sorry the earlier one will convert the quantity this one will covert price

CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'

EXPORTING

date = sy-datum

foreign_amount = w_material-stprs

foreign_currency = t001-waers

local_currency = p_waers

type_of_rate = 'M'

IMPORTING

local_amount = w_material-stprs

EXCEPTIONS

no_rate_found = 1

overflow = 2

no_factors_found = 3

no_spread_found = 4

OTHERS = 5.