SAP Function Modules

MEREP_RUN_START SAP Function module - Job Open - Get New Run Number and Start an Object







MEREP_RUN_START is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name MEREP_RUN_START into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: MEREP_RUN_UTILITY
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM MEREP_RUN_START - MEREP RUN START





CALL FUNCTION 'MEREP_RUN_START' "Job Open - Get New Run Number and Start an Object
  EXPORTING
    direction =                 " merep_503-direction  SAP Mobile: In/Outbound indicator (link to Inbox/Outbox)
    log_parameters =            " merep_log_parameter  SAP Mobile: Logging parameter
  IMPORTING
    runnum =                    " merep_601-runnum  SAP Mobile: Run Number
    rec_control_record =        " merep_607     SAP Mobile: Receiver Control Record
    hnd_control_record =        " merep_608     SAP Mobile: Handler Control Record
    snd_control_record =        " merep_610     SAP Mobile: Sender Control Record
  EXCEPTIONS
    CONTROL_RECORD_NOT_FOUND = 1  "
    ERROR_IN_NUMBERRANGE = 2    "
    INVALID_JOBTYPE = 3         "
    INVALID_DIRECTION = 4       "
    ENQUEUE_FAILURE = 5         "               ENQUEUE FOR JOB TABLE HAS FAILED
    .  "  MEREP_RUN_START

ABAP code example for Function Module MEREP_RUN_START





The ABAP code below is a full code listing to execute function module MEREP_RUN_START including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_runnum  TYPE MEREP_601-RUNNUM ,
ld_rec_control_record  TYPE MEREP_607 ,
ld_hnd_control_record  TYPE MEREP_608 ,
ld_snd_control_record  TYPE MEREP_610 .


SELECT single DIRECTION
FROM MEREP_503
INTO @DATA(ld_direction).

DATA(ld_log_parameters) = 'Check type of data required'. . CALL FUNCTION 'MEREP_RUN_START' EXPORTING direction = ld_direction log_parameters = ld_log_parameters IMPORTING runnum = ld_runnum rec_control_record = ld_rec_control_record hnd_control_record = ld_hnd_control_record snd_control_record = ld_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
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_runnum  TYPE MEREP_601-RUNNUM ,
ld_direction  TYPE MEREP_503-DIRECTION ,
ld_rec_control_record  TYPE MEREP_607 ,
ld_log_parameters  TYPE MEREP_LOG_PARAMETER ,
ld_hnd_control_record  TYPE MEREP_608 ,
ld_snd_control_record  TYPE MEREP_610 .


SELECT single DIRECTION
FROM MEREP_503
INTO ld_direction.

ld_log_parameters = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name MEREP_RUN_START or its description.