SAP MEREP_RUN_START Function Module for Job Open - Get New Run Number and Start an Object
MEREP_RUN_START is a standard merep run start SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Job Open - Get New Run Number and Start an Object 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 merep run start FM, simply by entering the name MEREP_RUN_START into the relevant SAP transaction such as SE37 or SE38.
Function Group: MEREP_RUN_UTILITY
Program Name: SAPLMEREP_RUN_UTILITY
Main Program: SAPLMEREP_RUN_UTILITY
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MEREP_RUN_START 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 'MEREP_RUN_START'"Job Open - Get New Run Number and Start an Object.
EXPORTING
DIRECTION = "SAP Mobile: In/Outbound indicator (link to Inbox/Outbox)
LOG_PARAMETERS = "SAP Mobile: Logging parameter
IMPORTING
RUNNUM = "SAP Mobile: Run Number
REC_CONTROL_RECORD = "SAP Mobile: Receiver Control Record
HND_CONTROL_RECORD = "SAP Mobile: Handler Control Record
SND_CONTROL_RECORD = "SAP Mobile: Sender Control Record
EXCEPTIONS
CONTROL_RECORD_NOT_FOUND = 1 ERROR_IN_NUMBERRANGE = 2 INVALID_JOBTYPE = 3 INVALID_DIRECTION = 4 ENQUEUE_FAILURE = 5
IMPORTING Parameters details for MEREP_RUN_START
DIRECTION - SAP Mobile: In/Outbound indicator (link to Inbox/Outbox)
Data type: MEREP_503-DIRECTIONOptional: No
Call by Reference: No ( called with pass by value option)
LOG_PARAMETERS - SAP Mobile: Logging parameter
Data type: MEREP_LOG_PARAMETEROptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for MEREP_RUN_START
RUNNUM - SAP Mobile: Run Number
Data type: MEREP_601-RUNNUMOptional: No
Call by Reference: No ( called with pass by value option)
REC_CONTROL_RECORD - SAP Mobile: Receiver Control Record
Data type: MEREP_607Optional: No
Call by Reference: No ( called with pass by value option)
HND_CONTROL_RECORD - SAP Mobile: Handler Control Record
Data type: MEREP_608Optional: No
Call by Reference: No ( called with pass by value option)
SND_CONTROL_RECORD - SAP Mobile: Sender Control Record
Data type: MEREP_610Optional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CONTROL_RECORD_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_IN_NUMBERRANGE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_JOBTYPE -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_DIRECTION -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ENQUEUE_FAILURE - ENQUEUE FOR JOB TABLE HAS FAILED
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MEREP_RUN_START 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_runnum | TYPE MEREP_601-RUNNUM, " | |||
| lv_direction | TYPE MEREP_503-DIRECTION, " | |||
| lv_control_record_not_found | TYPE MEREP_503, " | |||
| lv_log_parameters | TYPE MEREP_LOG_PARAMETER, " | |||
| lv_rec_control_record | TYPE MEREP_607, " | |||
| lv_error_in_numberrange | TYPE MEREP_607, " | |||
| lv_invalid_jobtype | TYPE MEREP_607, " | |||
| lv_hnd_control_record | TYPE MEREP_608, " | |||
| lv_invalid_direction | TYPE MEREP_608, " | |||
| lv_snd_control_record | TYPE MEREP_610, " | |||
| lv_enqueue_failure | TYPE MEREP_610. " |
|   CALL FUNCTION 'MEREP_RUN_START' "Job Open - Get New Run Number and Start an Object |
| EXPORTING | ||
| DIRECTION | = lv_direction | |
| LOG_PARAMETERS | = lv_log_parameters | |
| IMPORTING | ||
| RUNNUM | = lv_runnum | |
| REC_CONTROL_RECORD | = lv_rec_control_record | |
| HND_CONTROL_RECORD | = lv_hnd_control_record | |
| SND_CONTROL_RECORD | = lv_snd_control_record | |
| EXCEPTIONS | ||
| CONTROL_RECORD_NOT_FOUND = 1 | ||
| ERROR_IN_NUMBERRANGE = 2 | ||
| INVALID_JOBTYPE = 3 | ||
| INVALID_DIRECTION = 4 | ||
| ENQUEUE_FAILURE = 5 | ||
| . " MEREP_RUN_START | ||
ABAP code using 7.40 inline data declarations to call FM MEREP_RUN_START
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 RUNNUM FROM MEREP_601 INTO @DATA(ld_runnum). | ||||
| "SELECT single DIRECTION FROM MEREP_503 INTO @DATA(ld_direction). | ||||
Search for further information about these or an SAP related objects