SAP MATERIAL_UNIT_CONVERSION Function Module for NOTRANSL: Materialspezifische Umrechnung von Maßeinheiten









MATERIAL_UNIT_CONVERSION is a standard material unit conversion SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Materialspezifische Umrechnung von Maßeinheiten processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for material unit conversion FM, simply by entering the name MATERIAL_UNIT_CONVERSION into the relevant SAP transaction such as SE37 or SE38.

Function Group: MAME
Program Name: SAPLMAME
Main Program: SAPLMAME
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function MATERIAL_UNIT_CONVERSION pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'"NOTRANSL: Materialspezifische Umrechnung von Maßeinheiten
EXPORTING
* INPUT = 0 "Quantity to be converted
* CHARG_CUOBJ = "
* WERKS = "Plant
* KZMEINH = ' ' "Indicator: INPUT refers to MEINH (-> F2)
MATNR = "Material
MEINH = "Alternative Unit of Measure for Material
* MEINS = ' ' "Base Unit of Measure for the Material
* EXTENDED_CONV = ' ' "Also consider volume/weight unit (-> F2)
* TYPE_UMR = ' ' "Type of conversion factors (->F2)
* NO_OUTPUT = ' ' "Indicator: No OUTPUT is to be calculated
* CHARGE = "Batch

IMPORTING
ADDKO = "Additive constant (for sake of completeness)
MEINS = "Base Unit of Measure for the Material
OUTPUT = "Output value
UMREN = "Conversion factor denominator
UMREZ = "Conversion factor numerator
BATCH_CONVERSION_ERROR = "
KZWSO = "

EXCEPTIONS
CONVERSION_NOT_FOUND = 1 INPUT_INVALID = 2 MATERIAL_NOT_FOUND = 3 MEINH_NOT_FOUND = 4 MEINS_MISSING = 5 NO_MEINH = 6 OUTPUT_INVALID = 7 OVERFLOW = 8
.



IMPORTING Parameters details for MATERIAL_UNIT_CONVERSION

INPUT - Quantity to be converted

Data type:
Optional: Yes
Call by Reference: No ( called with pass by value option)

CHARG_CUOBJ -

Data type: INOB-CUOBJ
Optional: Yes
Call by Reference: No ( called with pass by value option)

WERKS - Plant

Data type: MARC-WERKS
Optional: Yes
Call by Reference: No ( called with pass by value option)

KZMEINH - Indicator: INPUT refers to MEINH (-> F2)

Data type: SY-MARKY
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

MATNR - Material

Data type: MARA-MATNR
Optional: No
Call by Reference: No ( called with pass by value option)

MEINH - Alternative Unit of Measure for Material

Data type: MARA-MEINS
Optional: No
Call by Reference: No ( called with pass by value option)

MEINS - Base Unit of Measure for the Material

Data type: MARA-MEINS
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXTENDED_CONV - Also consider volume/weight unit (-> F2)

Data type: SY-MARKY
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TYPE_UMR - Type of conversion factors (->F2)

Data type: SY-MARKY
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

NO_OUTPUT - Indicator: No OUTPUT is to be calculated

Data type: SY-MARKY
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

CHARGE - Batch

Data type: MCHA-CHARG
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for MATERIAL_UNIT_CONVERSION

ADDKO - Additive constant (for sake of completeness)

Data type: T006-ADDKO
Optional: No
Call by Reference: No ( called with pass by value option)

MEINS - Base Unit of Measure for the Material

Data type: MARA-MEINS
Optional: No
Call by Reference: No ( called with pass by value option)

OUTPUT - Output value

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

UMREN - Conversion factor denominator

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

UMREZ - Conversion factor numerator

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

BATCH_CONVERSION_ERROR -

Data type: C
Optional: No
Call by Reference: No ( called with pass by value option)

KZWSO -

Data type: MARM-KZWSO
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

CONVERSION_NOT_FOUND - Conversion factor could not be determined

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INPUT_INVALID - The quantity to be converted is not a number

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MATERIAL_NOT_FOUND - Material does not exist

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MEINH_NOT_FOUND - Alternative unit of measure not allowed

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MEINS_MISSING - No base unit of measure exists for the material

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_MEINH - No alternative unit of measure specified

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

OUTPUT_INVALID - Quantity to be calculated is not a number (-> F2)

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

OVERFLOW - Field overflow

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for MATERIAL_UNIT_CONVERSION Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_addko  TYPE T006-ADDKO, "   
lv_input  TYPE T006, "   0
lv_conversion_not_found  TYPE T006, "   
lv_charg_cuobj  TYPE INOB-CUOBJ, "   
lv_werks  TYPE MARC-WERKS, "   
lv_meins  TYPE MARA-MEINS, "   
lv_kzmeinh  TYPE SY-MARKY, "   SPACE
lv_input_invalid  TYPE SY, "   
lv_matnr  TYPE MARA-MATNR, "   
lv_output  TYPE MARA, "   
lv_material_not_found  TYPE MARA, "   
lv_meinh  TYPE MARA-MEINS, "   
lv_umren  TYPE MARA, "   
lv_meinh_not_found  TYPE MARA, "   
lv_meins  TYPE MARA-MEINS, "   SPACE
lv_umrez  TYPE MARA, "   
lv_meins_missing  TYPE MARA, "   
lv_no_meinh  TYPE MARA, "   
lv_extended_conv  TYPE SY-MARKY, "   SPACE
lv_batch_conversion_error  TYPE C, "   
lv_kzwso  TYPE MARM-KZWSO, "   
lv_type_umr  TYPE SY-MARKY, "   SPACE
lv_output_invalid  TYPE SY, "   
lv_overflow  TYPE SY, "   
lv_no_output  TYPE SY-MARKY, "   SPACE
lv_charge  TYPE MCHA-CHARG. "   

  CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'  "NOTRANSL: Materialspezifische Umrechnung von Maßeinheiten
    EXPORTING
         INPUT = lv_input
         CHARG_CUOBJ = lv_charg_cuobj
         WERKS = lv_werks
         KZMEINH = lv_kzmeinh
         MATNR = lv_matnr
         MEINH = lv_meinh
         MEINS = lv_meins
         EXTENDED_CONV = lv_extended_conv
         TYPE_UMR = lv_type_umr
         NO_OUTPUT = lv_no_output
         CHARGE = lv_charge
    IMPORTING
         ADDKO = lv_addko
         MEINS = lv_meins
         OUTPUT = lv_output
         UMREN = lv_umren
         UMREZ = lv_umrez
         BATCH_CONVERSION_ERROR = lv_batch_conversion_error
         KZWSO = lv_kzwso
    EXCEPTIONS
        CONVERSION_NOT_FOUND = 1
        INPUT_INVALID = 2
        MATERIAL_NOT_FOUND = 3
        MEINH_NOT_FOUND = 4
        MEINS_MISSING = 5
        NO_MEINH = 6
        OUTPUT_INVALID = 7
        OVERFLOW = 8
. " MATERIAL_UNIT_CONVERSION




ABAP code using 7.40 inline data declarations to call FM MATERIAL_UNIT_CONVERSION

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single ADDKO FROM T006 INTO @DATA(ld_addko).
 
 
 
"SELECT single CUOBJ FROM INOB INTO @DATA(ld_charg_cuobj).
 
"SELECT single WERKS FROM MARC INTO @DATA(ld_werks).
 
"SELECT single MEINS FROM MARA INTO @DATA(ld_meins).
 
"SELECT single MARKY FROM SY INTO @DATA(ld_kzmeinh).
DATA(ld_kzmeinh) = ' '.
 
 
"SELECT single MATNR FROM MARA INTO @DATA(ld_matnr).
 
 
 
"SELECT single MEINS FROM MARA INTO @DATA(ld_meinh).
 
 
 
"SELECT single MEINS FROM MARA INTO @DATA(ld_meins).
DATA(ld_meins) = ' '.
 
 
 
 
"SELECT single MARKY FROM SY INTO @DATA(ld_extended_conv).
DATA(ld_extended_conv) = ' '.
 
 
"SELECT single KZWSO FROM MARM INTO @DATA(ld_kzwso).
 
"SELECT single MARKY FROM SY INTO @DATA(ld_type_umr).
DATA(ld_type_umr) = ' '.
 
 
 
"SELECT single MARKY FROM SY INTO @DATA(ld_no_output).
DATA(ld_no_output) = ' '.
 
"SELECT single CHARG FROM MCHA INTO @DATA(ld_charge).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!