SAP CO_RU_UNIT_CONVERSION Function Module for Mengenumrechnung über T006 und/oder Materialstamm für CIM-Rückmeldung









CO_RU_UNIT_CONVERSION is a standard co ru 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 Mengenumrechnung über T006 und/oder Materialstamm für CIM-Rückmeldung 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 co ru unit conversion FM, simply by entering the name CO_RU_UNIT_CONVERSION into the relevant SAP transaction such as SE37 or SE38.

Function Group: COR0
Program Name: SAPLCOR0
Main Program: SAPLCOR0
Appliation area: C
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function CO_RU_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 'CO_RU_UNIT_CONVERSION'"Mengenumrechnung über T006 und/oder Materialstamm für CIM-Rückmeldung
EXPORTING
* BASIS = ' ' "
* KRUND = ' ' "Indicator: carry out rounding (-/X/+)
* MATNR = ' ' "Material number
* MEINH = ' ' "Alternative unit of measure
* MEINS = ' ' "Base unit of measure
* MGAME = 0 "Quantity in alternative units of measure
* UMREN = 1 "Denominator of conversion factor
* UMREZ = 0 "Numerator of conversion factor
* AUFNR = ' ' "

IMPORTING
O_MGLME = "Quantity in base units of measure

EXCEPTIONS
CONVERSION_NOT_FOUND = 1 DIFFERENT_DIMENSION = 2 DIVISION_BY_ZERO = 3 MATERIAL_NOT_FOUND = 4 OVERFLOW = 5 T006D_ENTRY_MISSING = 6 T006_ENTRY_MISSING = 7 TYPE_INVALID = 8 UNITS_MISSING = 9
.



IMPORTING Parameters details for CO_RU_UNIT_CONVERSION

BASIS -

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

KRUND - Indicator: carry out rounding (-/X/+)

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

MATNR - Material number

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

MEINH - Alternative unit of measure

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

MEINS - Base unit of measure

Data type: MARA-MEINS
Default: 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)

UMREN - Denominator of conversion factor

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

UMREZ - Numerator of conversion factor

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

AUFNR -

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

EXPORTING Parameters details for CO_RU_UNIT_CONVERSION

O_MGLME - Quantity in base units of measure

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)

DIVISION_BY_ZERO - Division by zero stopped

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

MATERIAL_NOT_FOUND -

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 - Entry in T006D (dimensions) missing

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

T006_ENTRY_MISSING - Entry in T006 (unit of measurement) missing

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

TYPE_INVALID -

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

UNITS_MISSING -

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

Copy and paste ABAP code example for CO_RU_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_basis  TYPE MARA-MEINS, "   SPACE
lv_o_mglme  TYPE MARA, "   
lv_conversion_not_found  TYPE MARA, "   
lv_krund  TYPE T006-KZEX3, "   SPACE
lv_different_dimension  TYPE T006, "   
lv_matnr  TYPE MARA-MATNR, "   SPACE
lv_division_by_zero  TYPE MARA, "   
lv_meinh  TYPE MARM-MEINH, "   SPACE
lv_material_not_found  TYPE MARM, "   
lv_meins  TYPE MARA-MEINS, "   SPACE
lv_overflow  TYPE MARA, "   
lv_mgame  TYPE MARA, "   0
lv_t006d_entry_missing  TYPE MARA, "   
lv_umren  TYPE MARA, "   1
lv_t006_entry_missing  TYPE MARA, "   
lv_umrez  TYPE MARA, "   0
lv_type_invalid  TYPE MARA, "   
lv_aufnr  TYPE CAUFVD-AUFNR, "   SPACE
lv_units_missing  TYPE CAUFVD. "   

  CALL FUNCTION 'CO_RU_UNIT_CONVERSION'  "Mengenumrechnung über T006 und/oder Materialstamm für CIM-Rückmeldung
    EXPORTING
         BASIS = lv_basis
         KRUND = lv_krund
         MATNR = lv_matnr
         MEINH = lv_meinh
         MEINS = lv_meins
         MGAME = lv_mgame
         UMREN = lv_umren
         UMREZ = lv_umrez
         AUFNR = lv_aufnr
    IMPORTING
         O_MGLME = lv_o_mglme
    EXCEPTIONS
        CONVERSION_NOT_FOUND = 1
        DIFFERENT_DIMENSION = 2
        DIVISION_BY_ZERO = 3
        MATERIAL_NOT_FOUND = 4
        OVERFLOW = 5
        T006D_ENTRY_MISSING = 6
        T006_ENTRY_MISSING = 7
        TYPE_INVALID = 8
        UNITS_MISSING = 9
. " CO_RU_UNIT_CONVERSION




ABAP code using 7.40 inline data declarations to call FM CO_RU_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 MEINS FROM MARA INTO @DATA(ld_basis).
DATA(ld_basis) = ' '.
 
 
 
"SELECT single KZEX3 FROM T006 INTO @DATA(ld_krund).
DATA(ld_krund) = ' '.
 
 
"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) = ' '.
 
 
 
 
DATA(ld_umren) = 1.
 
 
 
 
"SELECT single AUFNR FROM CAUFVD INTO @DATA(ld_aufnr).
DATA(ld_aufnr) = ' '.
 
 


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!