04-13-2007 6:11 AM
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
04-13-2007 6:12 AM
04-13-2007 6:37 AM
04-13-2007 6:29 AM
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
04-13-2007 6:32 AM
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
04-13-2007 6:39 AM
Hi,
You can pass the SALES UOM to the function module that I had mentioned..
Thanks,
Naren
04-13-2007 6:56 AM
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