SAP MCB_REBUILD_MM Function Module for NOTRANSL: Statistikdatenneuaufbau Materialbelege
MCB_REBUILD_MM is a standard mcb rebuild mm 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: Statistikdatenneuaufbau Materialbelege 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 mcb rebuild mm FM, simply by entering the name MCB_REBUILD_MM into the relevant SAP transaction such as SE37 or SE38.
Function Group: MCB1
Program Name: SAPLMCB1
Main Program: SAPLMCB1
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MCB_REBUILD_MM 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 'MCB_REBUILD_MM'"NOTRANSL: Statistikdatenneuaufbau Materialbelege.
EXPORTING
VRSIO = "Number of Version in Information Structure
* MODE = ' ' "Mode
SETUP_BW = "Setup of statistical data: Extraction structures BW
* FIRST_TO_PROCESS = ' ' "
* YEAR_FIRST_DOC = 0000 "
RUN_NAME = "
STOP_DATE = "Termination Date
STOP_TIME = "Termination Time
* FLG_ALE = ' ' "
* LOGSYS = ' ' "
IMPORTING
NEXT_TO_PROCESS = "
YEAR_NEXT_DOC = "
TABLES
SEL_MCINF = "
SEL_BUDAT = "
SEL_MBLNR = "
SEL_MJAHR = "Select Ranges for Document Year in Table MKPF
* SEL_WERKS = "
EXCEPTIONS
TIME_OUT = 1 WRONG_SELECTION = 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_SAPLMCB1_001 User Exit for Inventory Controlling
IMPORTING Parameters details for MCB_REBUILD_MM
VRSIO - Number of Version in Information Structure
Data type: VRSIOOptional: No
Call by Reference: No ( called with pass by value option)
MODE - Mode
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SETUP_BW - Setup of statistical data: Extraction structures BW
Data type: RMCSNEUA-NEWBWOptional: No
Call by Reference: No ( called with pass by value option)
FIRST_TO_PROCESS -
Data type: MKPF-MBLNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
YEAR_FIRST_DOC -
Data type: MKPF-MJAHRDefault: 0000
Optional: Yes
Call by Reference: No ( called with pass by value option)
RUN_NAME -
Data type: RMCSNEUA-LAUFNAMEOptional: No
Call by Reference: No ( called with pass by value option)
STOP_DATE - Termination Date
Data type: RMCSNEUA-DATUMOptional: No
Call by Reference: No ( called with pass by value option)
STOP_TIME - Termination Time
Data type: RMCSNEUA-UHRZEITOptional: No
Call by Reference: No ( called with pass by value option)
FLG_ALE -
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LOGSYS -
Data type: T881-LOGSYSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for MCB_REBUILD_MM
NEXT_TO_PROCESS -
Data type: MKPF-MBLNROptional: No
Call by Reference: Yes
YEAR_NEXT_DOC -
Data type: MKPF-MJAHROptional: No
Call by Reference: Yes
TABLES Parameters details for MCB_REBUILD_MM
SEL_MCINF -
Data type: MCSOINFOptional: No
Call by Reference: Yes
SEL_BUDAT -
Data type: SEL_BUDATOptional: No
Call by Reference: Yes
SEL_MBLNR -
Data type: SEL_MBLNROptional: No
Call by Reference: Yes
SEL_MJAHR - Select Ranges for Document Year in Table MKPF
Data type: SEL_MJAHROptional: No
Call by Reference: Yes
SEL_WERKS -
Data type: SEL_WERKSOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
TIME_OUT -
Data type:Optional: No
Call by Reference: Yes
WRONG_SELECTION -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for MCB_REBUILD_MM 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_vrsio | TYPE VRSIO, " | |||
| lv_time_out | TYPE VRSIO, " | |||
| lt_sel_mcinf | TYPE STANDARD TABLE OF MCSOINF, " | |||
| lv_next_to_process | TYPE MKPF-MBLNR, " | |||
| lv_mode | TYPE C, " SPACE | |||
| lv_setup_bw | TYPE RMCSNEUA-NEWBW, " | |||
| lt_sel_budat | TYPE STANDARD TABLE OF SEL_BUDAT, " | |||
| lv_year_next_doc | TYPE MKPF-MJAHR, " | |||
| lv_wrong_selection | TYPE MKPF, " | |||
| lt_sel_mblnr | TYPE STANDARD TABLE OF SEL_MBLNR, " | |||
| lv_first_to_process | TYPE MKPF-MBLNR, " SPACE | |||
| lt_sel_mjahr | TYPE STANDARD TABLE OF SEL_MJAHR, " | |||
| lv_year_first_doc | TYPE MKPF-MJAHR, " 0000 | |||
| lv_run_name | TYPE RMCSNEUA-LAUFNAME, " | |||
| lt_sel_werks | TYPE STANDARD TABLE OF SEL_WERKS, " | |||
| lv_stop_date | TYPE RMCSNEUA-DATUM, " | |||
| lv_stop_time | TYPE RMCSNEUA-UHRZEIT, " | |||
| lv_flg_ale | TYPE C, " SPACE | |||
| lv_logsys | TYPE T881-LOGSYS. " SPACE |
|   CALL FUNCTION 'MCB_REBUILD_MM' "NOTRANSL: Statistikdatenneuaufbau Materialbelege |
| EXPORTING | ||
| VRSIO | = lv_vrsio | |
| MODE | = lv_mode | |
| SETUP_BW | = lv_setup_bw | |
| FIRST_TO_PROCESS | = lv_first_to_process | |
| YEAR_FIRST_DOC | = lv_year_first_doc | |
| RUN_NAME | = lv_run_name | |
| STOP_DATE | = lv_stop_date | |
| STOP_TIME | = lv_stop_time | |
| FLG_ALE | = lv_flg_ale | |
| LOGSYS | = lv_logsys | |
| IMPORTING | ||
| NEXT_TO_PROCESS | = lv_next_to_process | |
| YEAR_NEXT_DOC | = lv_year_next_doc | |
| TABLES | ||
| SEL_MCINF | = lt_sel_mcinf | |
| SEL_BUDAT | = lt_sel_budat | |
| SEL_MBLNR | = lt_sel_mblnr | |
| SEL_MJAHR | = lt_sel_mjahr | |
| SEL_WERKS | = lt_sel_werks | |
| EXCEPTIONS | ||
| TIME_OUT = 1 | ||
| WRONG_SELECTION = 2 | ||
| . " MCB_REBUILD_MM | ||
ABAP code using 7.40 inline data declarations to call FM MCB_REBUILD_MM
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 MBLNR FROM MKPF INTO @DATA(ld_next_to_process). | ||||
| DATA(ld_mode) | = ' '. | |||
| "SELECT single NEWBW FROM RMCSNEUA INTO @DATA(ld_setup_bw). | ||||
| "SELECT single MJAHR FROM MKPF INTO @DATA(ld_year_next_doc). | ||||
| "SELECT single MBLNR FROM MKPF INTO @DATA(ld_first_to_process). | ||||
| DATA(ld_first_to_process) | = ' '. | |||
| "SELECT single MJAHR FROM MKPF INTO @DATA(ld_year_first_doc). | ||||
| DATA(ld_year_first_doc) | = 0000. | |||
| "SELECT single LAUFNAME FROM RMCSNEUA INTO @DATA(ld_run_name). | ||||
| "SELECT single DATUM FROM RMCSNEUA INTO @DATA(ld_stop_date). | ||||
| "SELECT single UHRZEIT FROM RMCSNEUA INTO @DATA(ld_stop_time). | ||||
| DATA(ld_flg_ale) | = ' '. | |||
| "SELECT single LOGSYS FROM T881 INTO @DATA(ld_logsys). | ||||
| DATA(ld_logsys) | = ' '. | |||
Search for further information about these or an SAP related objects