SAP MRM_GR_DISTRIBUTE Function Module for GR distribution in case of GR based invoice verification
MRM_GR_DISTRIBUTE is a standard mrm gr distribute SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for GR distribution in case of GR based invoice verification 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 mrm gr distribute FM, simply by entering the name MRM_GR_DISTRIBUTE into the relevant SAP transaction such as SE37 or SE38.
Function Group: MRMH
Program Name: SAPLMRMH
Main Program: SAPLMRMH
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MRM_GR_DISTRIBUTE 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 'MRM_GR_DISTRIBUTE'"GR distribution in case of GR based invoice verification.
EXPORTING
IS_EKPO = "Purchasing Document Item
IS_RBKPV = "
IV_QUANTITY = "Quantity
IV_AMOUNT = "Amount in Document Currency
IV_LFSNR = "Reference Document Number
CHANGING
CT_SUBITEMDATA = "
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_SAPLMRMH_001 Customer Exit: ERS - Change Header Field
EXIT_SAPLMRMH_002 Customer Exit: ERS - Change Item Fields
EXIT_SAPLMRMH_011 Customer Exit: EDI Invoice Receipt - Change Company Code and Vendor
EXIT_SAPLMRMH_012 Customer Exit: EDI Invoice Receipt - Change SAP Tax Code
EXIT_SAPLMRMH_013 Customer Exit: EDI Invoice Receipt - Change Assignment
EXIT_SAPLMRMH_014 Customer Exit: EDI Invoice Receipt - Change IDoc Segment
EXIT_SAPLMRMH_015 Customer Exit: EDI Invoice Receipt - Change Document Item Before Posting
IMPORTING Parameters details for MRM_GR_DISTRIBUTE
IS_EKPO - Purchasing Document Item
Data type: EKPOOptional: No
Call by Reference: Yes
IS_RBKPV -
Data type: MRM_RBKPVOptional: No
Call by Reference: Yes
IV_QUANTITY - Quantity
Data type: MENGE_DOptional: No
Call by Reference: Yes
IV_AMOUNT - Amount in Document Currency
Data type: WRBTROptional: No
Call by Reference: Yes
IV_LFSNR - Reference Document Number
Data type: LFSNR1Optional: No
Call by Reference: Yes
CHANGING Parameters details for MRM_GR_DISTRIBUTE
CT_SUBITEMDATA -
Data type: MMCR_T_SUBITEMDATAOptional: No
Call by Reference: Yes
Copy and paste ABAP code example for MRM_GR_DISTRIBUTE 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_is_ekpo | TYPE EKPO, " | |||
| lv_ct_subitemdata | TYPE MMCR_T_SUBITEMDATA, " | |||
| lv_is_rbkpv | TYPE MRM_RBKPV, " | |||
| lv_iv_quantity | TYPE MENGE_D, " | |||
| lv_iv_amount | TYPE WRBTR, " | |||
| lv_iv_lfsnr | TYPE LFSNR1. " |
|   CALL FUNCTION 'MRM_GR_DISTRIBUTE' "GR distribution in case of GR based invoice verification |
| EXPORTING | ||
| IS_EKPO | = lv_is_ekpo | |
| IS_RBKPV | = lv_is_rbkpv | |
| IV_QUANTITY | = lv_iv_quantity | |
| IV_AMOUNT | = lv_iv_amount | |
| IV_LFSNR | = lv_iv_lfsnr | |
| CHANGING | ||
| CT_SUBITEMDATA | = lv_ct_subitemdata | |
| . " MRM_GR_DISTRIBUTE | ||
ABAP code using 7.40 inline data declarations to call FM MRM_GR_DISTRIBUTE
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.Search for further information about these or an SAP related objects