SAP MENGE_UMRECHNEN Function Module for Quantity conversion; --> replaced by UNIT_CONVERSION
MENGE_UMRECHNEN is a standard menge umrechnen SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Quantity conversion; --> replaced by UNIT_CONVERSION 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 menge umrechnen FM, simply by entering the name MENGE_UMRECHNEN into the relevant SAP transaction such as SE37 or SE38.
Function Group: MGUM
Program Name: SAPLMGUM
Main Program:
Appliation area:
Release date: 01-Jan-1970
Mode(Normal, Remote etc): Normal Function Module
Update:
Function MENGE_UMRECHNEN 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 'MENGE_UMRECHNEN'"Quantity conversion; --> replaced by UNIT_CONVERSION.
EXPORTING
* ANDEC = 99 "Number of decimal places for rounding
* UMREA = 0 "Additive constant for conversion
* UMREE = 0 "Base 10 exponent of the conversion numerator
* UMREN = 1 "Conversion factor denominator
* UMREZ = 0 "Conversion factor numerator
* IVAME = ' ' "Flag: MGAME contains value
* IVLME = ' ' "Flag: MGLME contains value
* KRUND = ' ' "Flag: Perform rounding (-/X/+)
* MATNR = ' ' "Material number
* MEINH = ' ' "Alternative unit of measure
* MEINS = ' ' "Base unit of measure
* MGAME = 0 "Quantity in alternative units of measure
* MGLME = 0 "Quantity in base unit of measure
IMPORTING
O_IVAME = "Flag: O_MGAME contains value
O_IVLME = "Flag: O_MGLME contains value
O_MEINH = "
O_MEINS = "
O_MGAME = "Quantity in alternative unit of measure
O_MGLME = "Quantity in base unit of measure
O_UMREA = "Additive constant for conversion
O_UMREN = "Conversion factor denominator
O_UMREZ = "Conversion factor numerator
EXCEPTIONS
CONVERSION_NOT_FOUND = 1 DIFFERENT_DIMENSION = 2 DIVISIONN_BY_ZERO = 3 OVERFLOW = 4 T006D_ENTRY_MISSING = 5 T006_ENTRY_MISSING = 6
IMPORTING Parameters details for MENGE_UMRECHNEN
ANDEC - Number of decimal places for rounding
Data type: T006-EXPONDefault: 99
Optional: Yes
Call by Reference: No ( called with pass by value option)
UMREA - Additive constant for conversion
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
UMREE - Base 10 exponent of the conversion numerator
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
UMREN - Conversion factor denominator
Data type:Default: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
UMREZ - Conversion factor numerator
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
IVAME - Flag: MGAME contains value
Data type: T006-KZEX3Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
IVLME - Flag: MGLME contains value
Data type: T006-KZEX3Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
KRUND - Flag: Perform rounding (-/X/+)
Data type: T006-KZEX3Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MATNR - Material number
Data type: MARA-MATNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MEINH - Alternative unit of measure
Data type: MARM-MEINHDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MEINS - Base unit of measure
Data type: MARA-MEINSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MGAME - Quantity in alternative units of measure
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
MGLME - Quantity in base unit of measure
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for MENGE_UMRECHNEN
O_IVAME - Flag: O_MGAME contains value
Data type: T006-KZEX3Optional: No
Call by Reference: No ( called with pass by value option)
O_IVLME - Flag: O_MGLME contains value
Data type: T006-KZEX3Optional: No
Call by Reference: No ( called with pass by value option)
O_MEINH -
Data type: MARM-MEINHOptional: No
Call by Reference: No ( called with pass by value option)
O_MEINS -
Data type: MARA-MEINSOptional: No
Call by Reference: No ( called with pass by value option)
O_MGAME - Quantity in alternative unit of measure
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
O_MGLME - Quantity in base unit of measure
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
O_UMREA - Additive constant for conversion
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
O_UMREN - Conversion factor denominator
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
O_UMREZ - Conversion factor numerator
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CONVERSION_NOT_FOUND - Conversion factors not found.
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DIFFERENT_DIMENSION - Units have different dimensions
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DIVISIONN_BY_ZERO - Division by zero trapped
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OVERFLOW - Overflow when filling a packed field
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
T006D_ENTRY_MISSING - No entry in T006D (dimensions)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
T006_ENTRY_MISSING - No entry in T006 (units of measurement)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MENGE_UMRECHNEN 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_andec | TYPE T006-EXPON, " 99 | |||
lv_o_ivame | TYPE T006-KZEX3, " | |||
lv_conversion_not_found | TYPE T006, " | |||
lv_umrea | TYPE T006, " 0 | |||
lv_umree | TYPE T006, " 0 | |||
lv_umren | TYPE T006, " 1 | |||
lv_umrez | TYPE T006, " 0 | |||
lv_ivame | TYPE T006-KZEX3, " SPACE | |||
lv_o_ivlme | TYPE T006-KZEX3, " | |||
lv_different_dimension | TYPE T006, " | |||
lv_ivlme | TYPE T006-KZEX3, " SPACE | |||
lv_o_meinh | TYPE MARM-MEINH, " | |||
lv_divisionn_by_zero | TYPE MARM, " | |||
lv_krund | TYPE T006-KZEX3, " SPACE | |||
lv_o_meins | TYPE MARA-MEINS, " | |||
lv_overflow | TYPE MARA, " | |||
lv_matnr | TYPE MARA-MATNR, " SPACE | |||
lv_o_mgame | TYPE MARA, " | |||
lv_t006d_entry_missing | TYPE MARA, " | |||
lv_meinh | TYPE MARM-MEINH, " SPACE | |||
lv_o_mglme | TYPE MARM, " | |||
lv_t006_entry_missing | TYPE MARM, " | |||
lv_meins | TYPE MARA-MEINS, " SPACE | |||
lv_o_umrea | TYPE MARA, " | |||
lv_mgame | TYPE MARA, " 0 | |||
lv_o_umren | TYPE MARA, " | |||
lv_mglme | TYPE MARA, " 0 | |||
lv_o_umrez | TYPE MARA. " |
  CALL FUNCTION 'MENGE_UMRECHNEN' "Quantity conversion; --> replaced by UNIT_CONVERSION |
EXPORTING | ||
ANDEC | = lv_andec | |
UMREA | = lv_umrea | |
UMREE | = lv_umree | |
UMREN | = lv_umren | |
UMREZ | = lv_umrez | |
IVAME | = lv_ivame | |
IVLME | = lv_ivlme | |
KRUND | = lv_krund | |
MATNR | = lv_matnr | |
MEINH | = lv_meinh | |
MEINS | = lv_meins | |
MGAME | = lv_mgame | |
MGLME | = lv_mglme | |
IMPORTING | ||
O_IVAME | = lv_o_ivame | |
O_IVLME | = lv_o_ivlme | |
O_MEINH | = lv_o_meinh | |
O_MEINS | = lv_o_meins | |
O_MGAME | = lv_o_mgame | |
O_MGLME | = lv_o_mglme | |
O_UMREA | = lv_o_umrea | |
O_UMREN | = lv_o_umren | |
O_UMREZ | = lv_o_umrez | |
EXCEPTIONS | ||
CONVERSION_NOT_FOUND = 1 | ||
DIFFERENT_DIMENSION = 2 | ||
DIVISIONN_BY_ZERO = 3 | ||
OVERFLOW = 4 | ||
T006D_ENTRY_MISSING = 5 | ||
T006_ENTRY_MISSING = 6 | ||
. " MENGE_UMRECHNEN |
ABAP code using 7.40 inline data declarations to call FM MENGE_UMRECHNEN
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 EXPON FROM T006 INTO @DATA(ld_andec). | ||||
DATA(ld_andec) | = 99. | |||
"SELECT single KZEX3 FROM T006 INTO @DATA(ld_o_ivame). | ||||
DATA(ld_umren) | = 1. | |||
"SELECT single KZEX3 FROM T006 INTO @DATA(ld_ivame). | ||||
DATA(ld_ivame) | = ' '. | |||
"SELECT single KZEX3 FROM T006 INTO @DATA(ld_o_ivlme). | ||||
"SELECT single KZEX3 FROM T006 INTO @DATA(ld_ivlme). | ||||
DATA(ld_ivlme) | = ' '. | |||
"SELECT single MEINH FROM MARM INTO @DATA(ld_o_meinh). | ||||
"SELECT single KZEX3 FROM T006 INTO @DATA(ld_krund). | ||||
DATA(ld_krund) | = ' '. | |||
"SELECT single MEINS FROM MARA INTO @DATA(ld_o_meins). | ||||
"SELECT single MATNR FROM MARA INTO @DATA(ld_matnr). | ||||
DATA(ld_matnr) | = ' '. | |||
"SELECT single MEINH FROM MARM INTO @DATA(ld_meinh). | ||||
DATA(ld_meinh) | = ' '. | |||
"SELECT single MEINS FROM MARA INTO @DATA(ld_meins). | ||||
DATA(ld_meins) | = ' '. | |||
Search for further information about these or an SAP related objects