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: 

Standard FM to conver the Base unit of measure

Former Member
0 Kudos

what is the standard Function module to convert base unit of measure for the fields

for eg.,

Quantity shipped in BUOM (LIPS-LGMNG), BUOM (LIPS-MEINS) (Should be in BUOM, so if Sales Unit is something else we need to convert this into BUOM.

Thanks in Advance

Rao

6 REPLIES 6

Former Member
0 Kudos

Hi,

Use the Fm MD_CONVERT_MATERIAL_UNIT

Thanks,

Naren

0 Kudos

Hi,

Is there any FM for Sales unit specific..

Tx

Rao.

Former Member
0 Kudos

Hai,

Try this Function Module:

MD_CONVERT_MATERIAL_UNIT

Im sending you a sample code also.

*& Form f2121_convert_price

*&----


  • Convert price to Base UoM

*----


  • -->P_LV_MEINS Conversion UoM

  • -->P_LV_KBETR Converted Rate

  • -->P_LV_KMEIN Condition unit

  • -->P_LV_MATNR Material Number

  • -->P_LV_KSCHL Condition Type

----


FORM f2121_convert_price USING p_lv_meins

p_lv_kbetr

p_lv_kmein

p_lv_matnr

p_lv_kschl.

DATA: lv_imenge LIKE ekpo-menge,

lv_emenge LIKE ekpo-menge.

lv_imenge = p_lv_kbetr.

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

EXPORTING

i_matnr = p_lv_matnr

i_in_me = p_lv_kmein

i_out_me = p_lv_meins

i_menge = lv_imenge

IMPORTING

e_menge = lv_emenge

EXCEPTIONS

error_in_application = 1

error = 2

OTHERS = 3.

IF sy-subrc = 0.

p_lv_kbetr = lv_emenge.

ELSE.

CONCATENATE text-009 p_lv_kschl INTO v_err_msg.

ENDIF.

ENDFORM. " f2121_convert_price

Try this.

UNIT_CONVERSION_SIMPLE convert weights from one UOM to another.

Watch for rounding errors with this function (go with MATERIAL_CONVERT_QUANTITY, MATERIAL_UNIT_CONVERSION means that you have to do conversions to base units which can be more work for you).

Hope your problem could be solved.

<b>Reward points if it helps you.</b>

Regds,

Rama chary.Pammi

Former Member
0 Kudos

Hi,

try this FM

UNIT_OF_MEASURE_ISO_TO_SAP

UNIT_OF_MEASURE_SAP_TO_ISO

OIU_QCI_CONVERT_UOM

CIF_GEN_CONVERT_BASE_UOM

ISA_CONVERT_UOM

regards,

Navneeth.K

Former Member
0 Kudos

Hi,

You can pass the SALES UOM to the function module that I had mentioned..

Thanks,

Naren

Former Member
0 Kudos

HI Hemam,

try using the following function modules,

<b>CONVERSION_FACTOR_GET</b> or <b>MATERIAL_CONVERT_QUANTITY</b> or <b>MATERIAL_UNIT_CONVERSION</b> or <b>MD_CONVERT_MATERIAL_UNIT</b>

reward if helpful,

Thanks,

Ginni