SAP ENQUEUE_EMHNK Function Module for Request lock for object EMHNK









ENQUEUE_EMHNK is a standard enqueue emhnk 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 EMHNK 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 emhnk FM, simply by entering the name ENQUEUE_EMHNK into the relevant SAP transaction such as SE37 or SE38.

Function Group: /1BCDWBEN/FEN0002
Program Name: /1BCDWBEN/SAPLFEN0002
Main Program:
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function ENQUEUE_EMHNK 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_EMHNK'"Request lock for object EMHNK
EXPORTING
* MODE_MHNK = 'E' "Lock mode for table MHNK
* SKNRZE = "09th enqueue argument
* SMABER = "10th enqueue argument
* SMAHSK = "11th enqueue argument
* BUSAB = "12th enqueue argument
* X_LAUFD = ' ' "Fill argument 02 with initial value?
* X_LAUFI = ' ' "Fill argument 03 with initial value?
* X_KOART = ' ' "Fill argument 04 with initial value?
* X_BUKRS = ' ' "Fill argument 05 with initial value?
* X_KUNNR = ' ' "Fill argument 06 with initial value?
* X_LIFNR = ' ' "Fill argument 07 with initial value?
* MANDT = SY-MANDT "01th enqueue argument
* X_CPDKY = ' ' "Fill argument 08 with initial value?
* X_SKNRZE = ' ' "Fill argument 09 with initial value?
* X_SMABER = ' ' "Fill argument 10 with initial value?
* X_SMAHSK = ' ' "Fill argument 11 with initial value?
* X_BUSAB = ' ' "Fill argument 12 with initial value?
* _SCOPE = '2' "
* _WAIT = ' ' "
* _COLLECT = ' ' "Initially only collect lock
* LAUFD = "02th enqueue argument
* LAUFI = "03th enqueue argument
* KOART = "04th enqueue argument
* BUKRS = "05th enqueue argument
* KUNNR = "06th enqueue argument
* LIFNR = "07th enqueue argument
* CPDKY = "08th enqueue argument

EXCEPTIONS
FOREIGN_LOCK = 1 SYSTEM_FAILURE = 2
.



IMPORTING Parameters details for ENQUEUE_EMHNK

MODE_MHNK - Lock mode for table MHNK

Data type: ENQMODE
Default: 'E'
Optional: Yes
Call by Reference: No ( called with pass by value option)

SKNRZE - 09th enqueue argument

Data type: MHNK-SKNRZE
Optional: Yes
Call by Reference: No ( called with pass by value option)

SMABER - 10th enqueue argument

Data type: MHNK-SMABER
Optional: Yes
Call by Reference: No ( called with pass by value option)

SMAHSK - 11th enqueue argument

Data type: MHNK-SMAHSK
Optional: Yes
Call by Reference: No ( called with pass by value option)

BUSAB - 12th enqueue argument

Data type: MHNK-BUSAB
Optional: Yes
Call by Reference: No ( called with pass by value option)

X_LAUFD - Fill argument 02 with initial value?

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

X_LAUFI - Fill argument 03 with initial value?

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

X_KOART - Fill argument 04 with initial value?

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

X_BUKRS - Fill argument 05 with initial value?

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

X_KUNNR - Fill argument 06 with initial value?

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

X_LIFNR - Fill argument 07 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: MHNK-MANDT
Default: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)

X_CPDKY - Fill argument 08 with initial value?

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

X_SKNRZE - Fill argument 09 with initial value?

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

X_SMABER - Fill argument 10 with initial value?

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

X_SMAHSK - Fill argument 11 with initial value?

Data type:
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

X_BUSAB - Fill argument 12 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: DDENQCOLL
Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)

LAUFD - 02th enqueue argument

Data type: MHNK-LAUFD
Optional: Yes
Call by Reference: No ( called with pass by value option)

LAUFI - 03th enqueue argument

Data type: MHNK-LAUFI
Optional: Yes
Call by Reference: No ( called with pass by value option)

KOART - 04th enqueue argument

Data type: MHNK-KOART
Optional: Yes
Call by Reference: No ( called with pass by value option)

BUKRS - 05th enqueue argument

Data type: MHNK-BUKRS
Optional: Yes
Call by Reference: No ( called with pass by value option)

KUNNR - 06th enqueue argument

Data type: MHNK-KUNNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

LIFNR - 07th enqueue argument

Data type: MHNK-LIFNR
Optional: Yes
Call by Reference: No ( called with pass by value option)

CPDKY - 08th enqueue argument

Data type: MHNK-CPDKY
Optional: 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_EMHNK 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_mhnk  TYPE ENQMODE, "   'E'
lv_foreign_lock  TYPE ENQMODE, "   
lv_sknrze  TYPE MHNK-SKNRZE, "   
lv_smaber  TYPE MHNK-SMABER, "   
lv_smahsk  TYPE MHNK-SMAHSK, "   
lv_busab  TYPE MHNK-BUSAB, "   
lv_x_laufd  TYPE MHNK, "   SPACE
lv_x_laufi  TYPE MHNK, "   SPACE
lv_x_koart  TYPE MHNK, "   SPACE
lv_x_bukrs  TYPE MHNK, "   SPACE
lv_x_kunnr  TYPE MHNK, "   SPACE
lv_x_lifnr  TYPE MHNK, "   SPACE
lv_mandt  TYPE MHNK-MANDT, "   SY-MANDT
lv_system_failure  TYPE MHNK, "   
lv_x_cpdky  TYPE MHNK, "   SPACE
lv_x_sknrze  TYPE MHNK, "   SPACE
lv_x_smaber  TYPE MHNK, "   SPACE
lv_x_smahsk  TYPE MHNK, "   SPACE
lv_x_busab  TYPE MHNK, "   SPACE
lv__scope  TYPE MHNK, "   '2'
lv__wait  TYPE MHNK, "   SPACE
lv__collect  TYPE DDENQCOLL, "   ' '
lv_laufd  TYPE MHNK-LAUFD, "   
lv_laufi  TYPE MHNK-LAUFI, "   
lv_koart  TYPE MHNK-KOART, "   
lv_bukrs  TYPE MHNK-BUKRS, "   
lv_kunnr  TYPE MHNK-KUNNR, "   
lv_lifnr  TYPE MHNK-LIFNR, "   
lv_cpdky  TYPE MHNK-CPDKY. "   

  CALL FUNCTION 'ENQUEUE_EMHNK'  "Request lock for object EMHNK
    EXPORTING
         MODE_MHNK = lv_mode_mhnk
         SKNRZE = lv_sknrze
         SMABER = lv_smaber
         SMAHSK = lv_smahsk
         BUSAB = lv_busab
         X_LAUFD = lv_x_laufd
         X_LAUFI = lv_x_laufi
         X_KOART = lv_x_koart
         X_BUKRS = lv_x_bukrs
         X_KUNNR = lv_x_kunnr
         X_LIFNR = lv_x_lifnr
         MANDT = lv_mandt
         X_CPDKY = lv_x_cpdky
         X_SKNRZE = lv_x_sknrze
         X_SMABER = lv_x_smaber
         X_SMAHSK = lv_x_smahsk
         X_BUSAB = lv_x_busab
         _SCOPE = lv__scope
         _WAIT = lv__wait
         _COLLECT = lv__collect
         LAUFD = lv_laufd
         LAUFI = lv_laufi
         KOART = lv_koart
         BUKRS = lv_bukrs
         KUNNR = lv_kunnr
         LIFNR = lv_lifnr
         CPDKY = lv_cpdky
    EXCEPTIONS
        FOREIGN_LOCK = 1
        SYSTEM_FAILURE = 2
. " ENQUEUE_EMHNK




ABAP code using 7.40 inline data declarations to call FM ENQUEUE_EMHNK

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_mhnk) = 'E'.
 
 
"SELECT single SKNRZE FROM MHNK INTO @DATA(ld_sknrze).
 
"SELECT single SMABER FROM MHNK INTO @DATA(ld_smaber).
 
"SELECT single SMAHSK FROM MHNK INTO @DATA(ld_smahsk).
 
"SELECT single BUSAB FROM MHNK INTO @DATA(ld_busab).
 
DATA(ld_x_laufd) = ' '.
 
DATA(ld_x_laufi) = ' '.
 
DATA(ld_x_koart) = ' '.
 
DATA(ld_x_bukrs) = ' '.
 
DATA(ld_x_kunnr) = ' '.
 
DATA(ld_x_lifnr) = ' '.
 
"SELECT single MANDT FROM MHNK INTO @DATA(ld_mandt).
DATA(ld_mandt) = SY-MANDT.
 
 
DATA(ld_x_cpdky) = ' '.
 
DATA(ld_x_sknrze) = ' '.
 
DATA(ld_x_smaber) = ' '.
 
DATA(ld_x_smahsk) = ' '.
 
DATA(ld_x_busab) = ' '.
 
DATA(ld__scope) = '2'.
 
DATA(ld__wait) = ' '.
 
DATA(ld__collect) = ' '.
 
"SELECT single LAUFD FROM MHNK INTO @DATA(ld_laufd).
 
"SELECT single LAUFI FROM MHNK INTO @DATA(ld_laufi).
 
"SELECT single KOART FROM MHNK INTO @DATA(ld_koart).
 
"SELECT single BUKRS FROM MHNK INTO @DATA(ld_bukrs).
 
"SELECT single KUNNR FROM MHNK INTO @DATA(ld_kunnr).
 
"SELECT single LIFNR FROM MHNK INTO @DATA(ld_lifnr).
 
"SELECT single CPDKY FROM MHNK INTO @DATA(ld_cpdky).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!