SAP EM_INIT_MERGE Function Module for
EM_INIT_MERGE is a standard em init merge SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 em init merge FM, simply by entering the name EM_INIT_MERGE into the relevant SAP transaction such as SE37 or SE38.
Function Group: S2EM
Program Name: SAPLS2EM
Main Program: SAPLS2EM
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function EM_INIT_MERGE 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 'EM_INIT_MERGE'".
EXPORTING
* IV_MAP = "
* IV_NMAP = "
* IV_CMAP = "
* IV_EXP = "
* IV_CREA = 'C' "
* IV_PROT = 'B' "
* IV_NAME = "
* IV_VERI = "
* IV_TABU = "
* IV_RESTART = "
* IV_DELTA = "
* IV_COFI = "
* IV_SREL = "StartRelease
* IV_EREL = "EndRelease
* IV_CLIDEP = ' ' "
* IV_NAME' ' = ' ' "Single-character flag
* IV_VDAT = ' ' "
* IV_IGNORE_LANG = ' ' "
* IV_LSM = 'MASTER' "30 Characters
* IV_FORCE_CREATION = "
* IV_LIMU = "
* IV_MAP_LIMU = "
* IV_TEXT = "
* IV_SPECIAL_AOF_MODE = ' ' "
* IV_IGNORED_OBJ = ' ' "
* IV_TRFU = "
* IV_CLI = "
* IV_TSID = "
* IV_USER = "
* IV_STEP = "
* IV_IMAP = "
IMPORTING Parameters details for EM_INIT_MERGE
IV_MAP -
Data type: MERGEDIR-MAPNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_NMAP -
Data type: MERGEDIR-MAPNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_CMAP -
Data type: MERGEDIR-MAPNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_EXP -
Data type: MERGEPARAM-EXPORTOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_CREA -
Data type: MERGEPARAM-CREATEMODEDefault: 'C'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_PROT -
Data type: MERGEMAPS-LOGTYPEDefault: 'B'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_NAME -
Data type: TSTRF01-FILEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_VERI -
Data type: MERGEDIR-VERIFILTEROptional: Yes
Call by Reference: No ( called with pass by value option)
IV_TABU -
Data type: MERGEDIR-TABUFILTEROptional: Yes
Call by Reference: No ( called with pass by value option)
IV_RESTART -
Data type: MERGEPARAM-RESTARTOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_DELTA -
Data type: MERGEPARAM-DELTAOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_COFI -
Data type: E070-TRKORROptional: Yes
Call by Reference: No ( called with pass by value option)
IV_SREL - StartRelease
Data type: RELEASEMAP-SAPRELEASEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_EREL - EndRelease
Data type: RELEASEMAP-SAPRELEASEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_CLIDEP -
Data type: MERGEPARAM-CREATEMODEDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_NAMESPACE - Single-character flag
Data type: MERGEPARAM-INFO_LEVELDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_VDAT -
Data type: MERGEPARAM-INFO_LEVELDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_IGNORE_LANG -
Data type: MERGEPARAM-LANG_IGNORDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_LSM - 30 Characters
Data type: CHAR30Default: 'MASTER'
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_FORCE_CREATION -
Data type: CHAR1Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_LIMU -
Data type: CHAR1Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_MAP_LIMU -
Data type: MERGEDIR-MAPNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_TEXT -
Data type: E07T-AS4TEXTOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_SPECIAL_AOF_MODE -
Data type: CHAR1Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_IGNORED_OBJ -
Data type: CHAR1Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
IV_TRFU -
Data type: E070-TRFUNCTIONOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_CLI -
Data type: E070C-CLIENTOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_TSID -
Data type: E070-TARSYSTEMOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_USER -
Data type: SY-UNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_STEP -
Data type: MERGEDIR-STEPOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_IMAP -
Data type: MERGEDIR-MAPNAMEOptional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for EM_INIT_MERGE 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_iv_map | TYPE MERGEDIR-MAPNAME, " | |||
| lv_iv_nmap | TYPE MERGEDIR-MAPNAME, " | |||
| lv_iv_cmap | TYPE MERGEDIR-MAPNAME, " | |||
| lv_iv_exp | TYPE MERGEPARAM-EXPORT, " | |||
| lv_iv_crea | TYPE MERGEPARAM-CREATEMODE, " 'C' | |||
| lv_iv_prot | TYPE MERGEMAPS-LOGTYPE, " 'B' | |||
| lv_iv_name | TYPE TSTRF01-FILE, " | |||
| lv_iv_veri | TYPE MERGEDIR-VERIFILTER, " | |||
| lv_iv_tabu | TYPE MERGEDIR-TABUFILTER, " | |||
| lv_iv_restart | TYPE MERGEPARAM-RESTART, " | |||
| lv_iv_delta | TYPE MERGEPARAM-DELTA, " | |||
| lv_iv_cofi | TYPE E070-TRKORR, " | |||
| lv_iv_srel | TYPE RELEASEMAP-SAPRELEASE, " | |||
| lv_iv_erel | TYPE RELEASEMAP-SAPRELEASE, " | |||
| lv_iv_clidep | TYPE MERGEPARAM-CREATEMODE, " ' ' | |||
| lv_iv_namespace | TYPE MERGEPARAM-INFO_LEVEL, " ' ' | |||
| lv_iv_vdat | TYPE MERGEPARAM-INFO_LEVEL, " ' ' | |||
| lv_iv_ignore_lang | TYPE MERGEPARAM-LANG_IGNOR, " ' ' | |||
| lv_iv_lsm | TYPE CHAR30, " 'MASTER' | |||
| lv_iv_force_creation | TYPE CHAR1, " | |||
| lv_iv_limu | TYPE CHAR1, " | |||
| lv_iv_map_limu | TYPE MERGEDIR-MAPNAME, " | |||
| lv_iv_text | TYPE E07T-AS4TEXT, " | |||
| lv_iv_special_aof_mode | TYPE CHAR1, " ' ' | |||
| lv_iv_ignored_obj | TYPE CHAR1, " ' ' | |||
| lv_iv_trfu | TYPE E070-TRFUNCTION, " | |||
| lv_iv_cli | TYPE E070C-CLIENT, " | |||
| lv_iv_tsid | TYPE E070-TARSYSTEM, " | |||
| lv_iv_user | TYPE SY-UNAME, " | |||
| lv_iv_step | TYPE MERGEDIR-STEP, " | |||
| lv_iv_imap | TYPE MERGEDIR-MAPNAME. " |
|   CALL FUNCTION 'EM_INIT_MERGE' " |
| EXPORTING | ||
| IV_MAP | = lv_iv_map | |
| IV_NMAP | = lv_iv_nmap | |
| IV_CMAP | = lv_iv_cmap | |
| IV_EXP | = lv_iv_exp | |
| IV_CREA | = lv_iv_crea | |
| IV_PROT | = lv_iv_prot | |
| IV_NAME | = lv_iv_name | |
| IV_VERI | = lv_iv_veri | |
| IV_TABU | = lv_iv_tabu | |
| IV_RESTART | = lv_iv_restart | |
| IV_DELTA | = lv_iv_delta | |
| IV_COFI | = lv_iv_cofi | |
| IV_SREL | = lv_iv_srel | |
| IV_EREL | = lv_iv_erel | |
| IV_CLIDEP | = lv_iv_clidep | |
| IV_NAMESPACE | = lv_iv_namespace | |
| IV_VDAT | = lv_iv_vdat | |
| IV_IGNORE_LANG | = lv_iv_ignore_lang | |
| IV_LSM | = lv_iv_lsm | |
| IV_FORCE_CREATION | = lv_iv_force_creation | |
| IV_LIMU | = lv_iv_limu | |
| IV_MAP_LIMU | = lv_iv_map_limu | |
| IV_TEXT | = lv_iv_text | |
| IV_SPECIAL_AOF_MODE | = lv_iv_special_aof_mode | |
| IV_IGNORED_OBJ | = lv_iv_ignored_obj | |
| IV_TRFU | = lv_iv_trfu | |
| IV_CLI | = lv_iv_cli | |
| IV_TSID | = lv_iv_tsid | |
| IV_USER | = lv_iv_user | |
| IV_STEP | = lv_iv_step | |
| IV_IMAP | = lv_iv_imap | |
| . " EM_INIT_MERGE | ||
ABAP code using 7.40 inline data declarations to call FM EM_INIT_MERGE
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 MAPNAME FROM MERGEDIR INTO @DATA(ld_iv_map). | ||||
| "SELECT single MAPNAME FROM MERGEDIR INTO @DATA(ld_iv_nmap). | ||||
| "SELECT single MAPNAME FROM MERGEDIR INTO @DATA(ld_iv_cmap). | ||||
| "SELECT single EXPORT FROM MERGEPARAM INTO @DATA(ld_iv_exp). | ||||
| "SELECT single CREATEMODE FROM MERGEPARAM INTO @DATA(ld_iv_crea). | ||||
| DATA(ld_iv_crea) | = 'C'. | |||
| "SELECT single LOGTYPE FROM MERGEMAPS INTO @DATA(ld_iv_prot). | ||||
| DATA(ld_iv_prot) | = 'B'. | |||
| "SELECT single FILE FROM TSTRF01 INTO @DATA(ld_iv_name). | ||||
| "SELECT single VERIFILTER FROM MERGEDIR INTO @DATA(ld_iv_veri). | ||||
| "SELECT single TABUFILTER FROM MERGEDIR INTO @DATA(ld_iv_tabu). | ||||
| "SELECT single RESTART FROM MERGEPARAM INTO @DATA(ld_iv_restart). | ||||
| "SELECT single DELTA FROM MERGEPARAM INTO @DATA(ld_iv_delta). | ||||
| "SELECT single TRKORR FROM E070 INTO @DATA(ld_iv_cofi). | ||||
| "SELECT single SAPRELEASE FROM RELEASEMAP INTO @DATA(ld_iv_srel). | ||||
| "SELECT single SAPRELEASE FROM RELEASEMAP INTO @DATA(ld_iv_erel). | ||||
| "SELECT single CREATEMODE FROM MERGEPARAM INTO @DATA(ld_iv_clidep). | ||||
| DATA(ld_iv_clidep) | = ' '. | |||
| "SELECT single INFO_LEVEL FROM MERGEPARAM INTO @DATA(ld_iv_namespace). | ||||
| DATA(ld_iv_namespace) | = ' '. | |||
| "SELECT single INFO_LEVEL FROM MERGEPARAM INTO @DATA(ld_iv_vdat). | ||||
| DATA(ld_iv_vdat) | = ' '. | |||
| "SELECT single LANG_IGNOR FROM MERGEPARAM INTO @DATA(ld_iv_ignore_lang). | ||||
| DATA(ld_iv_ignore_lang) | = ' '. | |||
| DATA(ld_iv_lsm) | = 'MASTER'. | |||
| "SELECT single MAPNAME FROM MERGEDIR INTO @DATA(ld_iv_map_limu). | ||||
| "SELECT single AS4TEXT FROM E07T INTO @DATA(ld_iv_text). | ||||
| DATA(ld_iv_special_aof_mode) | = ' '. | |||
| DATA(ld_iv_ignored_obj) | = ' '. | |||
| "SELECT single TRFUNCTION FROM E070 INTO @DATA(ld_iv_trfu). | ||||
| "SELECT single CLIENT FROM E070C INTO @DATA(ld_iv_cli). | ||||
| "SELECT single TARSYSTEM FROM E070 INTO @DATA(ld_iv_tsid). | ||||
| "SELECT single UNAME FROM SY INTO @DATA(ld_iv_user). | ||||
| "SELECT single STEP FROM MERGEDIR INTO @DATA(ld_iv_step). | ||||
| "SELECT single MAPNAME FROM MERGEDIR INTO @DATA(ld_iv_imap). | ||||
Search for further information about these or an SAP related objects