SAP ENQUEUE_E_S012 Function Module for Request lock for object E_S012
ENQUEUE_E_S012 is a standard enqueue e s012 SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Request lock for object E_S012 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 enqueue e s012 FM, simply by entering the name ENQUEUE_E_S012 into the relevant SAP transaction such as SE37 or SE38.
Function Group: /1BCDWBEN/MEN0001
Program Name: /1BCDWBEN/SAPLMEN0001
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function ENQUEUE_E_S012 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 'ENQUEUE_E_S012'"Request lock for object E_S012.
EXPORTING
* MODE_S012 = 'S' "Lock mode for table S012
* LIFNR = "09th enqueue argument
* MATNR = "10th enqueue argument
* WERKS = "11th enqueue argument
* ESOKZ = "12th enqueue argument
* MATKL = "13th enqueue argument
* INFNR = "14th enqueue argument
* LAND1 = "15th enqueue argument
* X_SSOUR = ' ' "Fill argument 02 with initial value?
* X_VRSIO = ' ' "Fill argument 03 with initial value?
* X_SPMON = ' ' "Fill argument 04 with initial value?
* MANDT = SY-MANDT "01th enqueue argument
* X_SPTAG = ' ' "Fill argument 05 with initial value?
* X_SPWOC = ' ' "Fill argument 06 with initial value?
* X_SPBUP = ' ' "Fill argument 07 with initial value?
* X_EKORG = ' ' "Fill argument 08 with initial value?
* X_LIFNR = ' ' "Fill argument 09 with initial value?
* X_MATNR = ' ' "Fill argument 10 with initial value?
* X_WERKS = ' ' "Fill argument 11 with initial value?
* X_ESOKZ = ' ' "Fill argument 12 with initial value?
* X_MATKL = ' ' "Fill argument 13 with initial value?
* X_INFNR = ' ' "Fill argument 14 with initial value?
* SSOUR = "02th enqueue argument
* X_LAND1 = ' ' "Fill argument 15 with initial value?
* _SCOPE = '2' "
* _WAIT = ' ' "
* _COLLECT = ' ' "Initially only collect lock
* VRSIO = "03th enqueue argument
* SPMON = "04th enqueue argument
* SPTAG = "05th enqueue argument
* SPWOC = "06th enqueue argument
* SPBUP = "07th enqueue argument
* EKORG = "08th enqueue argument
EXCEPTIONS
FOREIGN_LOCK = 1 SYSTEM_FAILURE = 2
IMPORTING Parameters details for ENQUEUE_E_S012
MODE_S012 - Lock mode for table S012
Data type: ENQMODEDefault: 'S'
Optional: Yes
Call by Reference: No ( called with pass by value option)
LIFNR - 09th enqueue argument
Data type: S012-LIFNROptional: Yes
Call by Reference: No ( called with pass by value option)
MATNR - 10th enqueue argument
Data type: S012-MATNROptional: Yes
Call by Reference: No ( called with pass by value option)
WERKS - 11th enqueue argument
Data type: S012-WERKSOptional: Yes
Call by Reference: No ( called with pass by value option)
ESOKZ - 12th enqueue argument
Data type: S012-ESOKZOptional: Yes
Call by Reference: No ( called with pass by value option)
MATKL - 13th enqueue argument
Data type: S012-MATKLOptional: Yes
Call by Reference: No ( called with pass by value option)
INFNR - 14th enqueue argument
Data type: S012-INFNROptional: Yes
Call by Reference: No ( called with pass by value option)
LAND1 - 15th enqueue argument
Data type: S012-LAND1Optional: Yes
Call by Reference: No ( called with pass by value option)
X_SSOUR - Fill argument 02 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_VRSIO - Fill argument 03 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_SPMON - Fill argument 04 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
MANDT - 01th enqueue argument
Data type: S012-MANDTDefault: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_SPTAG - Fill argument 05 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_SPWOC - Fill argument 06 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_SPBUP - Fill argument 07 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_EKORG - Fill argument 08 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_LIFNR - Fill argument 09 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_MATNR - Fill argument 10 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_WERKS - Fill argument 11 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_ESOKZ - Fill argument 12 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_MATKL - Fill argument 13 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
X_INFNR - Fill argument 14 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SSOUR - 02th enqueue argument
Data type: S012-SSOUROptional: Yes
Call by Reference: No ( called with pass by value option)
X_LAND1 - Fill argument 15 with initial value?
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
_SCOPE -
Data type:Default: '2'
Optional: Yes
Call by Reference: No ( called with pass by value option)
_WAIT -
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
_COLLECT - Initially only collect lock
Data type: DDENQCOLLDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
VRSIO - 03th enqueue argument
Data type: S012-VRSIOOptional: Yes
Call by Reference: No ( called with pass by value option)
SPMON - 04th enqueue argument
Data type: S012-SPMONOptional: Yes
Call by Reference: No ( called with pass by value option)
SPTAG - 05th enqueue argument
Data type: S012-SPTAGOptional: Yes
Call by Reference: No ( called with pass by value option)
SPWOC - 06th enqueue argument
Data type: S012-SPWOCOptional: Yes
Call by Reference: No ( called with pass by value option)
SPBUP - 07th enqueue argument
Data type: S012-SPBUPOptional: Yes
Call by Reference: No ( called with pass by value option)
EKORG - 08th enqueue argument
Data type: S012-EKORGOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
FOREIGN_LOCK - Object already locked
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SYSTEM_FAILURE - Internal error from enqueue server
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for ENQUEUE_E_S012 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_mode_s012 | TYPE ENQMODE, " 'S' | |||
| lv_foreign_lock | TYPE ENQMODE, " | |||
| lv_lifnr | TYPE S012-LIFNR, " | |||
| lv_matnr | TYPE S012-MATNR, " | |||
| lv_werks | TYPE S012-WERKS, " | |||
| lv_esokz | TYPE S012-ESOKZ, " | |||
| lv_matkl | TYPE S012-MATKL, " | |||
| lv_infnr | TYPE S012-INFNR, " | |||
| lv_land1 | TYPE S012-LAND1, " | |||
| lv_x_ssour | TYPE S012, " SPACE | |||
| lv_x_vrsio | TYPE S012, " SPACE | |||
| lv_x_spmon | TYPE S012, " SPACE | |||
| lv_mandt | TYPE S012-MANDT, " SY-MANDT | |||
| lv_system_failure | TYPE S012, " | |||
| lv_x_sptag | TYPE S012, " SPACE | |||
| lv_x_spwoc | TYPE S012, " SPACE | |||
| lv_x_spbup | TYPE S012, " SPACE | |||
| lv_x_ekorg | TYPE S012, " SPACE | |||
| lv_x_lifnr | TYPE S012, " SPACE | |||
| lv_x_matnr | TYPE S012, " SPACE | |||
| lv_x_werks | TYPE S012, " SPACE | |||
| lv_x_esokz | TYPE S012, " SPACE | |||
| lv_x_matkl | TYPE S012, " SPACE | |||
| lv_x_infnr | TYPE S012, " SPACE | |||
| lv_ssour | TYPE S012-SSOUR, " | |||
| lv_x_land1 | TYPE S012, " SPACE | |||
| lv__scope | TYPE S012, " '2' | |||
| lv__wait | TYPE S012, " SPACE | |||
| lv__collect | TYPE DDENQCOLL, " ' ' | |||
| lv_vrsio | TYPE S012-VRSIO, " | |||
| lv_spmon | TYPE S012-SPMON, " | |||
| lv_sptag | TYPE S012-SPTAG, " | |||
| lv_spwoc | TYPE S012-SPWOC, " | |||
| lv_spbup | TYPE S012-SPBUP, " | |||
| lv_ekorg | TYPE S012-EKORG. " |
|   CALL FUNCTION 'ENQUEUE_E_S012' "Request lock for object E_S012 |
| EXPORTING | ||
| MODE_S012 | = lv_mode_s012 | |
| LIFNR | = lv_lifnr | |
| MATNR | = lv_matnr | |
| WERKS | = lv_werks | |
| ESOKZ | = lv_esokz | |
| MATKL | = lv_matkl | |
| INFNR | = lv_infnr | |
| LAND1 | = lv_land1 | |
| X_SSOUR | = lv_x_ssour | |
| X_VRSIO | = lv_x_vrsio | |
| X_SPMON | = lv_x_spmon | |
| MANDT | = lv_mandt | |
| X_SPTAG | = lv_x_sptag | |
| X_SPWOC | = lv_x_spwoc | |
| X_SPBUP | = lv_x_spbup | |
| X_EKORG | = lv_x_ekorg | |
| X_LIFNR | = lv_x_lifnr | |
| X_MATNR | = lv_x_matnr | |
| X_WERKS | = lv_x_werks | |
| X_ESOKZ | = lv_x_esokz | |
| X_MATKL | = lv_x_matkl | |
| X_INFNR | = lv_x_infnr | |
| SSOUR | = lv_ssour | |
| X_LAND1 | = lv_x_land1 | |
| _SCOPE | = lv__scope | |
| _WAIT | = lv__wait | |
| _COLLECT | = lv__collect | |
| VRSIO | = lv_vrsio | |
| SPMON | = lv_spmon | |
| SPTAG | = lv_sptag | |
| SPWOC | = lv_spwoc | |
| SPBUP | = lv_spbup | |
| EKORG | = lv_ekorg | |
| EXCEPTIONS | ||
| FOREIGN_LOCK = 1 | ||
| SYSTEM_FAILURE = 2 | ||
| . " ENQUEUE_E_S012 | ||
ABAP code using 7.40 inline data declarations to call FM ENQUEUE_E_S012
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.| DATA(ld_mode_s012) | = 'S'. | |||
| "SELECT single LIFNR FROM S012 INTO @DATA(ld_lifnr). | ||||
| "SELECT single MATNR FROM S012 INTO @DATA(ld_matnr). | ||||
| "SELECT single WERKS FROM S012 INTO @DATA(ld_werks). | ||||
| "SELECT single ESOKZ FROM S012 INTO @DATA(ld_esokz). | ||||
| "SELECT single MATKL FROM S012 INTO @DATA(ld_matkl). | ||||
| "SELECT single INFNR FROM S012 INTO @DATA(ld_infnr). | ||||
| "SELECT single LAND1 FROM S012 INTO @DATA(ld_land1). | ||||
| DATA(ld_x_ssour) | = ' '. | |||
| DATA(ld_x_vrsio) | = ' '. | |||
| DATA(ld_x_spmon) | = ' '. | |||
| "SELECT single MANDT FROM S012 INTO @DATA(ld_mandt). | ||||
| DATA(ld_mandt) | = SY-MANDT. | |||
| DATA(ld_x_sptag) | = ' '. | |||
| DATA(ld_x_spwoc) | = ' '. | |||
| DATA(ld_x_spbup) | = ' '. | |||
| DATA(ld_x_ekorg) | = ' '. | |||
| DATA(ld_x_lifnr) | = ' '. | |||
| DATA(ld_x_matnr) | = ' '. | |||
| DATA(ld_x_werks) | = ' '. | |||
| DATA(ld_x_esokz) | = ' '. | |||
| DATA(ld_x_matkl) | = ' '. | |||
| DATA(ld_x_infnr) | = ' '. | |||
| "SELECT single SSOUR FROM S012 INTO @DATA(ld_ssour). | ||||
| DATA(ld_x_land1) | = ' '. | |||
| DATA(ld__scope) | = '2'. | |||
| DATA(ld__wait) | = ' '. | |||
| DATA(ld__collect) | = ' '. | |||
| "SELECT single VRSIO FROM S012 INTO @DATA(ld_vrsio). | ||||
| "SELECT single SPMON FROM S012 INTO @DATA(ld_spmon). | ||||
| "SELECT single SPTAG FROM S012 INTO @DATA(ld_sptag). | ||||
| "SELECT single SPWOC FROM S012 INTO @DATA(ld_spwoc). | ||||
| "SELECT single SPBUP FROM S012 INTO @DATA(ld_spbup). | ||||
| "SELECT single EKORG FROM S012 INTO @DATA(ld_ekorg). | ||||
Search for further information about these or an SAP related objects