SAP MCS_UNIT_ENQUEUE_DEQUEUE Function Module for NOTRANSL: LIS Ereignis sperren/entsperren
MCS_UNIT_ENQUEUE_DEQUEUE is a standard mcs unit enqueue dequeue 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: LIS Ereignis sperren/entsperren 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 mcs unit enqueue dequeue FM, simply by entering the name MCS_UNIT_ENQUEUE_DEQUEUE into the relevant SAP transaction such as SE37 or SE38.
Function Group: MCSE
Program Name: SAPLMCSE
Main Program: SAPLMCSE
Appliation area: M
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function MCS_UNIT_ENQUEUE_DEQUEUE 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 'MCS_UNIT_ENQUEUE_DEQUEUE'"NOTRANSL: LIS Ereignis sperren/entsperren.
EXPORTING
* I_SFEIN = "Unit (always fill from .._all)
* I_FLG_ENQUEUE = ' ' "Indicates it should be unlocked directly!
* I_FLG_DEQUEUE = ' ' "Indicates it should be unlocked directly!
* I_FLG_DEQUEUE_ALL = ' ' "Indicates release all locked objects
IMPORTING
E_USERNAME = "User already locking this event
E_FLG_OK = "Returncode (1 = locked by other user)
EXCEPTIONS
INTERNAL_ERROR = 1 NO_INPUT_PARAMETERS = 2 NO_UNIT = 3
IMPORTING Parameters details for MCS_UNIT_ENQUEUE_DEQUEUE
I_SFEIN - Unit (always fill from .._all)
Data type: TMC6-SFEINOptional: Yes
Call by Reference: No ( called with pass by value option)
I_FLG_ENQUEUE - Indicates it should be unlocked directly!
Data type: XFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FLG_DEQUEUE - Indicates it should be unlocked directly!
Data type: XFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_FLG_DEQUEUE_ALL - Indicates release all locked objects
Data type: XFLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for MCS_UNIT_ENQUEUE_DEQUEUE
E_USERNAME - User already locking this event
Data type: SY-UNAMEOptional: No
Call by Reference: No ( called with pass by value option)
E_FLG_OK - Returncode (1 = locked by other user)
Data type: SY-SUBRCOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
INTERNAL_ERROR - Problems occurred during locking/unlocking
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_INPUT_PARAMETERS - Do not transfer enqueue or dequeue flag
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_UNIT - Do not transfer unit
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for MCS_UNIT_ENQUEUE_DEQUEUE 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_sfein | TYPE TMC6-SFEIN, " | |||
| lv_e_username | TYPE SY-UNAME, " | |||
| lv_internal_error | TYPE SY, " | |||
| lv_e_flg_ok | TYPE SY-SUBRC, " | |||
| lv_i_flg_enqueue | TYPE XFLAG, " SPACE | |||
| lv_no_input_parameters | TYPE XFLAG, " | |||
| lv_no_unit | TYPE XFLAG, " | |||
| lv_i_flg_dequeue | TYPE XFLAG, " SPACE | |||
| lv_i_flg_dequeue_all | TYPE XFLAG. " SPACE |
|   CALL FUNCTION 'MCS_UNIT_ENQUEUE_DEQUEUE' "NOTRANSL: LIS Ereignis sperren/entsperren |
| EXPORTING | ||
| I_SFEIN | = lv_i_sfein | |
| I_FLG_ENQUEUE | = lv_i_flg_enqueue | |
| I_FLG_DEQUEUE | = lv_i_flg_dequeue | |
| I_FLG_DEQUEUE_ALL | = lv_i_flg_dequeue_all | |
| IMPORTING | ||
| E_USERNAME | = lv_e_username | |
| E_FLG_OK | = lv_e_flg_ok | |
| EXCEPTIONS | ||
| INTERNAL_ERROR = 1 | ||
| NO_INPUT_PARAMETERS = 2 | ||
| NO_UNIT = 3 | ||
| . " MCS_UNIT_ENQUEUE_DEQUEUE | ||
ABAP code using 7.40 inline data declarations to call FM MCS_UNIT_ENQUEUE_DEQUEUE
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 SFEIN FROM TMC6 INTO @DATA(ld_i_sfein). | ||||
| "SELECT single UNAME FROM SY INTO @DATA(ld_e_username). | ||||
| "SELECT single SUBRC FROM SY INTO @DATA(ld_e_flg_ok). | ||||
| DATA(ld_i_flg_enqueue) | = ' '. | |||
| DATA(ld_i_flg_dequeue) | = ' '. | |||
| DATA(ld_i_flg_dequeue_all) | = ' '. | |||
Search for further information about these or an SAP related objects