SAP EM_MERGE Function Module for
EM_MERGE is a standard em 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 merge FM, simply by entering the name EM_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_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_MERGE'".
EXPORTING
* IV_POSL = "
* IV_NEGL = "
* IV_KORRL = "
* IV_TLOGO = "
* IV_DAT_S = "
* IV_DAT_E = "
* IV_TIM_S = "
* IV_TIM_E = "
TABLES
* IT_NEGL = "
* IT_POSL = "
* IR_KORRS = "
* IR_KORRO = "
* IR_STICO_MODE = "
IMPORTING Parameters details for EM_MERGE
IV_POSL -
Data type: E070-TRKORROptional: Yes
Call by Reference: No ( called with pass by value option)
IV_NEGL -
Data type: E070-TRKORROptional: Yes
Call by Reference: No ( called with pass by value option)
IV_KORRL -
Data type: E070-TRKORROptional: Yes
Call by Reference: No ( called with pass by value option)
IV_TLOGO -
Data type: MERGEPARAM-TLOGOOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_DAT_S -
Data type: E070-AS4DATEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_DAT_E -
Data type: E070-AS4DATEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_TIM_S -
Data type: E070-AS4TIMEOptional: Yes
Call by Reference: No ( called with pass by value option)
IV_TIM_E -
Data type: E070-AS4TIMEOptional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for EM_MERGE
IT_NEGL -
Data type: E071Optional: Yes
Call by Reference: No ( called with pass by value option)
IT_POSL -
Data type: E071Optional: Yes
Call by Reference: No ( called with pass by value option)
IR_KORRS -
Data type: SEXP_KORR_LISTOptional: Yes
Call by Reference: No ( called with pass by value option)
IR_KORRO -
Data type: SEXP_KORR_LISTOptional: Yes
Call by Reference: No ( called with pass by value option)
IR_STICO_MODE -
Data type: SEXP_KORR_LISTOptional: Yes
Call by Reference: Yes
Copy and paste ABAP code example for EM_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: | ||||
| lt_it_negl | TYPE STANDARD TABLE OF E071, " | |||
| lv_iv_posl | TYPE E070-TRKORR, " | |||
| lt_it_posl | TYPE STANDARD TABLE OF E071, " | |||
| lv_iv_negl | TYPE E070-TRKORR, " | |||
| lt_ir_korrs | TYPE STANDARD TABLE OF SEXP_KORR_LIST, " | |||
| lv_iv_korrl | TYPE E070-TRKORR, " | |||
| lt_ir_korro | TYPE STANDARD TABLE OF SEXP_KORR_LIST, " | |||
| lv_iv_tlogo | TYPE MERGEPARAM-TLOGO, " | |||
| lv_iv_dat_s | TYPE E070-AS4DATE, " | |||
| lt_ir_stico_mode | TYPE STANDARD TABLE OF SEXP_KORR_LIST, " | |||
| lv_iv_dat_e | TYPE E070-AS4DATE, " | |||
| lv_iv_tim_s | TYPE E070-AS4TIME, " | |||
| lv_iv_tim_e | TYPE E070-AS4TIME. " |
|   CALL FUNCTION 'EM_MERGE' " |
| EXPORTING | ||
| IV_POSL | = lv_iv_posl | |
| IV_NEGL | = lv_iv_negl | |
| IV_KORRL | = lv_iv_korrl | |
| IV_TLOGO | = lv_iv_tlogo | |
| IV_DAT_S | = lv_iv_dat_s | |
| IV_DAT_E | = lv_iv_dat_e | |
| IV_TIM_S | = lv_iv_tim_s | |
| IV_TIM_E | = lv_iv_tim_e | |
| TABLES | ||
| IT_NEGL | = lt_it_negl | |
| IT_POSL | = lt_it_posl | |
| IR_KORRS | = lt_ir_korrs | |
| IR_KORRO | = lt_ir_korro | |
| IR_STICO_MODE | = lt_ir_stico_mode | |
| . " EM_MERGE | ||
ABAP code using 7.40 inline data declarations to call FM EM_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 TRKORR FROM E070 INTO @DATA(ld_iv_posl). | ||||
| "SELECT single TRKORR FROM E070 INTO @DATA(ld_iv_negl). | ||||
| "SELECT single TRKORR FROM E070 INTO @DATA(ld_iv_korrl). | ||||
| "SELECT single TLOGO FROM MERGEPARAM INTO @DATA(ld_iv_tlogo). | ||||
| "SELECT single AS4DATE FROM E070 INTO @DATA(ld_iv_dat_s). | ||||
| "SELECT single AS4DATE FROM E070 INTO @DATA(ld_iv_dat_e). | ||||
| "SELECT single AS4TIME FROM E070 INTO @DATA(ld_iv_tim_s). | ||||
| "SELECT single AS4TIME FROM E070 INTO @DATA(ld_iv_tim_e). | ||||
Search for further information about these or an SAP related objects