SAP MC_PG_UNIT_CONVERSION Function Module for NOTRANSL: Einheitenumrechnung für Produktgruppen
MC_PG_UNIT_CONVERSION is a standard mc pg 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: Einheitenumrechnung für Produktgruppen 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 mc pg unit conversion FM, simply by entering the name MC_PG_UNIT_CONVERSION into the relevant SAP transaction such as SE37 or SE38.
Function Group: MCP2
Program Name: SAPLMCP2
Main Program: SAPLMCP2
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MC_PG_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 'MC_PG_UNIT_CONVERSION'"NOTRANSL: Einheitenumrechnung für Produktgruppen.
EXPORTING
IMEINSN = "Base Unit of Measure
IMEINSV = "Base Unit of Measure
IPRGRPN = "Material Number
IPRGRPV = "Material Number
IVSNDAN = "Production version
IWERKSN = "Plant
IWERKSV = "Plant
IMPORTING
EUMREF = "Conversion factor: quantities
EXCEPTIONS
CONVERSION_ERROR = 1 MATERIAL_NOT_FOUND = 2
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLMCP2_008 User Exit: Processing Header Data in a Purchase Order from an IDoc
EXIT_SAPLMCP2_009 User Exit: Processing Item Data in a Purchase Order from an IDoc
IMPORTING Parameters details for MC_PG_UNIT_CONVERSION
IMEINSN - Base Unit of Measure
Data type: MARA-MEINSOptional: No
Call by Reference: No ( called with pass by value option)
IMEINSV - Base Unit of Measure
Data type: MARA-MEINSOptional: No
Call by Reference: No ( called with pass by value option)
IPRGRPN - Material Number
Data type: MARA-MATNROptional: No
Call by Reference: No ( called with pass by value option)
IPRGRPV - Material Number
Data type: MARA-MATNROptional: No
Call by Reference: No ( called with pass by value option)
IVSNDAN - Production version
Data type: PGZU-VSNDAOptional: No
Call by Reference: No ( called with pass by value option)
IWERKSN - Plant
Data type: MARC-WERKSOptional: No
Call by Reference: No ( called with pass by value option)
IWERKSV - Plant
Data type: MARC-WERKSOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for MC_PG_UNIT_CONVERSION
EUMREF - Conversion factor: quantities
Data type: PGZU-UMREFOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CONVERSION_ERROR -
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)
Copy and paste ABAP code example for MC_PG_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_eumref | TYPE PGZU-UMREF, " | |||
| lv_imeinsn | TYPE MARA-MEINS, " | |||
| lv_conversion_error | TYPE MARA, " | |||
| lv_imeinsv | TYPE MARA-MEINS, " | |||
| lv_material_not_found | TYPE MARA, " | |||
| lv_iprgrpn | TYPE MARA-MATNR, " | |||
| lv_iprgrpv | TYPE MARA-MATNR, " | |||
| lv_ivsndan | TYPE PGZU-VSNDA, " | |||
| lv_iwerksn | TYPE MARC-WERKS, " | |||
| lv_iwerksv | TYPE MARC-WERKS. " |
|   CALL FUNCTION 'MC_PG_UNIT_CONVERSION' "NOTRANSL: Einheitenumrechnung für Produktgruppen |
| EXPORTING | ||
| IMEINSN | = lv_imeinsn | |
| IMEINSV | = lv_imeinsv | |
| IPRGRPN | = lv_iprgrpn | |
| IPRGRPV | = lv_iprgrpv | |
| IVSNDAN | = lv_ivsndan | |
| IWERKSN | = lv_iwerksn | |
| IWERKSV | = lv_iwerksv | |
| IMPORTING | ||
| EUMREF | = lv_eumref | |
| EXCEPTIONS | ||
| CONVERSION_ERROR = 1 | ||
| MATERIAL_NOT_FOUND = 2 | ||
| . " MC_PG_UNIT_CONVERSION | ||
ABAP code using 7.40 inline data declarations to call FM MC_PG_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 UMREF FROM PGZU INTO @DATA(ld_eumref). | ||||
| "SELECT single MEINS FROM MARA INTO @DATA(ld_imeinsn). | ||||
| "SELECT single MEINS FROM MARA INTO @DATA(ld_imeinsv). | ||||
| "SELECT single MATNR FROM MARA INTO @DATA(ld_iprgrpn). | ||||
| "SELECT single MATNR FROM MARA INTO @DATA(ld_iprgrpv). | ||||
| "SELECT single VSNDA FROM PGZU INTO @DATA(ld_ivsndan). | ||||
| "SELECT single WERKS FROM MARC INTO @DATA(ld_iwerksn). | ||||
| "SELECT single WERKS FROM MARC INTO @DATA(ld_iwerksv). | ||||
Search for further information about these or an SAP related objects