SAP MM_ENQUEUE_DOCUMENT Function Module for NOTRANSL: Sperren von Einkaufsbelegen
MM_ENQUEUE_DOCUMENT is a standard mm enqueue document 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: Sperren von Einkaufsbelegen 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 mm enqueue document FM, simply by entering the name MM_ENQUEUE_DOCUMENT into the relevant SAP transaction such as SE37 or SE38.
Function Group: MEXF
Program Name: SAPLMEXF
Main Program: SAPLMEXF
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MM_ENQUEUE_DOCUMENT 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 'MM_ENQUEUE_DOCUMENT'"NOTRANSL: Sperren von Einkaufsbelegen.
EXPORTING
I_EBELN = "
* I_COLLECT = ' ' "Indicator Whether Locks Should Only Be Collected First
* I_SCOPE = '2' "Control Lock Behavior When Calling the Update Task
* I_EBELP = "
* I_BSTYP = "
* I_MODE = 'E' "
* NO_MESSAGE = ' ' "
* HEADER_ONLY = ' ' "
* ITEMS_ONLY = ' ' "
* I_WAIT = ' ' "
* I_LOGSYS = "Logical System
EXCEPTIONS
DOCUMENT_LOCKED = 1 SYSTEM_FAILURE = 2 PARAMETER_ERROR = 3
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_SAPLMEXF_001 No Invoice for Purchase Order Item but Conditions Allowed
IMPORTING Parameters details for MM_ENQUEUE_DOCUMENT
I_EBELN -
Data type: EKKO-EBELNOptional: No
Call by Reference: No ( called with pass by value option)
I_COLLECT - Indicator Whether Locks Should Only Be Collected First
Data type: DDENQCOLLDefault: SPACE
Optional: Yes
Call by Reference: Yes
I_SCOPE - Control Lock Behavior When Calling the Update Task
Data type: DDENQSCOPEDefault: '2'
Optional: Yes
Call by Reference: Yes
I_EBELP -
Data type: EKPO-EBELPOptional: Yes
Call by Reference: No ( called with pass by value option)
I_BSTYP -
Data type: EKKO-BSTYPOptional: Yes
Call by Reference: No ( called with pass by value option)
I_MODE -
Data type: DD26E-ENQMODEDefault: 'E'
Optional: Yes
Call by Reference: No ( called with pass by value option)
NO_MESSAGE -
Data type: SY-CALLDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
HEADER_ONLY -
Data type: SY-CALLDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ITEMS_ONLY -
Data type: SY-CALLDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_WAIT -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_LOGSYS - Logical System
Data type: T000-LOGSYSOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
DOCUMENT_LOCKED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SYSTEM_FAILURE - System Error When Locking
Data type:Optional: No
Call by Reference: Yes
PARAMETER_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MM_ENQUEUE_DOCUMENT 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_i_ebeln | TYPE EKKO-EBELN, " | |||
| lv_document_locked | TYPE EKKO, " | |||
| lv_i_collect | TYPE DDENQCOLL, " SPACE | |||
| lv_i_scope | TYPE DDENQSCOPE, " '2' | |||
| lv_i_ebelp | TYPE EKPO-EBELP, " | |||
| lv_system_failure | TYPE EKPO, " | |||
| lv_i_bstyp | TYPE EKKO-BSTYP, " | |||
| lv_parameter_error | TYPE EKKO, " | |||
| lv_i_mode | TYPE DD26E-ENQMODE, " 'E' | |||
| lv_no_message | TYPE SY-CALLD, " SPACE | |||
| lv_header_only | TYPE SY-CALLD, " SPACE | |||
| lv_items_only | TYPE SY-CALLD, " SPACE | |||
| lv_i_wait | TYPE SY, " SPACE | |||
| lv_i_logsys | TYPE T000-LOGSYS. " |
|   CALL FUNCTION 'MM_ENQUEUE_DOCUMENT' "NOTRANSL: Sperren von Einkaufsbelegen |
| EXPORTING | ||
| I_EBELN | = lv_i_ebeln | |
| I_COLLECT | = lv_i_collect | |
| I_SCOPE | = lv_i_scope | |
| I_EBELP | = lv_i_ebelp | |
| I_BSTYP | = lv_i_bstyp | |
| I_MODE | = lv_i_mode | |
| NO_MESSAGE | = lv_no_message | |
| HEADER_ONLY | = lv_header_only | |
| ITEMS_ONLY | = lv_items_only | |
| I_WAIT | = lv_i_wait | |
| I_LOGSYS | = lv_i_logsys | |
| EXCEPTIONS | ||
| DOCUMENT_LOCKED = 1 | ||
| SYSTEM_FAILURE = 2 | ||
| PARAMETER_ERROR = 3 | ||
| . " MM_ENQUEUE_DOCUMENT | ||
ABAP code using 7.40 inline data declarations to call FM MM_ENQUEUE_DOCUMENT
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 EBELN FROM EKKO INTO @DATA(ld_i_ebeln). | ||||
| DATA(ld_i_collect) | = ' '. | |||
| DATA(ld_i_scope) | = '2'. | |||
| "SELECT single EBELP FROM EKPO INTO @DATA(ld_i_ebelp). | ||||
| "SELECT single BSTYP FROM EKKO INTO @DATA(ld_i_bstyp). | ||||
| "SELECT single ENQMODE FROM DD26E INTO @DATA(ld_i_mode). | ||||
| DATA(ld_i_mode) | = 'E'. | |||
| "SELECT single CALLD FROM SY INTO @DATA(ld_no_message). | ||||
| DATA(ld_no_message) | = ' '. | |||
| "SELECT single CALLD FROM SY INTO @DATA(ld_header_only). | ||||
| DATA(ld_header_only) | = ' '. | |||
| "SELECT single CALLD FROM SY INTO @DATA(ld_items_only). | ||||
| DATA(ld_items_only) | = ' '. | |||
| DATA(ld_i_wait) | = ' '. | |||
| "SELECT single LOGSYS FROM T000 INTO @DATA(ld_i_logsys). | ||||
Search for further information about these or an SAP related objects