SAP Function Modules

ENQUEUE_EWBBH SAP Function module - Request lock for object EWBBH







ENQUEUE_EWBBH is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name ENQUEUE_EWBBH into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: DWBEN/SAPLWEN0001
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM ENQUEUE_EWBBH - ENQUEUE EWBBH





CALL FUNCTION 'ENQUEUE_EWBBH' "Request lock for object EWBBH
* EXPORTING
*   mode_wbbh = 'X'             " enqmode       Lock mode for table WBBH
*   mode_wbbl = 'X'             " enqmode       Lock mode for table WBBL
*   mode_wbbp = 'X'             " enqmode       Lock mode for table WBBP
*   mandt = SY-MANDT            " wbbh-mandt    01th enqueue argument
*   locnr =                     " wbbh-locnr    02th enqueue argument
*   bbtyp =                     " wbbh-bbtyp    03th enqueue argument
*   versnr =                    " wbbh-versnr   04th enqueue argument
*   bbgno =                     " wbbl-bbgno    05th enqueue argument
*   matnr =                     " wbbp-matnr    06th enqueue argument
*   bbrno =                     " wbbp-bbrno    07th enqueue argument
*   x_locnr = SPACE             "               Fill argument 02 with initial value?
*   x_bbtyp = SPACE             "               Fill argument 03 with initial value?
*   x_versnr = SPACE            "               Fill argument 04 with initial value?
*   x_bbgno = SPACE             "               Fill argument 05 with initial value?
*   x_matnr = SPACE             "               Fill argument 06 with initial value?
*   x_bbrno = SPACE             "               Fill argument 07 with initial value?
*   _scope = '2'                "
*   _wait = SPACE               "
*   _collect = ' '              " ddenqcoll     Initially only collect lock
  EXCEPTIONS
    FOREIGN_LOCK = 1            "               Object already locked
    SYSTEM_FAILURE = 2          "               Internal error from enqueue server
    .  "  ENQUEUE_EWBBH

ABAP code example for Function Module ENQUEUE_EWBBH





The ABAP code below is a full code listing to execute function module ENQUEUE_EWBBH including all data declarations. The code uses 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 original method of declaring data variables up front. 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).


DATA(ld_mode_wbbh) = 'Check type of data required'.
DATA(ld_mode_wbbl) = 'Check type of data required'.
DATA(ld_mode_wbbp) = 'Check type of data required'.

SELECT single MANDT
FROM WBBH
INTO @DATA(ld_mandt).


SELECT single LOCNR
FROM WBBH
INTO @DATA(ld_locnr).


SELECT single BBTYP
FROM WBBH
INTO @DATA(ld_bbtyp).


SELECT single VERSNR
FROM WBBH
INTO @DATA(ld_versnr).


SELECT single BBGNO
FROM WBBL
INTO @DATA(ld_bbgno).


SELECT single MATNR
FROM WBBP
INTO @DATA(ld_matnr).


SELECT single BBRNO
FROM WBBP
INTO @DATA(ld_bbrno).

DATA(ld_x_locnr) = 'some text here'.
DATA(ld_x_bbtyp) = 'some text here'.
DATA(ld_x_versnr) = 'some text here'.
DATA(ld_x_bbgno) = 'some text here'.
DATA(ld_x_matnr) = 'some text here'.
DATA(ld_x_bbrno) = 'some text here'.
DATA(ld__scope) = 'some text here'.
DATA(ld__wait) = 'some text here'.
DATA(ld__collect) = 'Check type of data required'. . CALL FUNCTION 'ENQUEUE_EWBBH' * EXPORTING * mode_wbbh = ld_mode_wbbh * mode_wbbl = ld_mode_wbbl * mode_wbbp = ld_mode_wbbp * mandt = ld_mandt * locnr = ld_locnr * bbtyp = ld_bbtyp * versnr = ld_versnr * bbgno = ld_bbgno * matnr = ld_matnr * bbrno = ld_bbrno * x_locnr = ld_x_locnr * x_bbtyp = ld_x_bbtyp * x_versnr = ld_x_versnr * x_bbgno = ld_x_bbgno * x_matnr = ld_x_matnr * x_bbrno = ld_x_bbrno * _scope = ld__scope * _wait = ld__wait * _collect = ld__collect EXCEPTIONS FOREIGN_LOCK = 1 SYSTEM_FAILURE = 2 . " ENQUEUE_EWBBH
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_mode_wbbh  TYPE ENQMODE ,
ld_mode_wbbl  TYPE ENQMODE ,
ld_mode_wbbp  TYPE ENQMODE ,
ld_mandt  TYPE WBBH-MANDT ,
ld_locnr  TYPE WBBH-LOCNR ,
ld_bbtyp  TYPE WBBH-BBTYP ,
ld_versnr  TYPE WBBH-VERSNR ,
ld_bbgno  TYPE WBBL-BBGNO ,
ld_matnr  TYPE WBBP-MATNR ,
ld_bbrno  TYPE WBBP-BBRNO ,
ld_x_locnr  TYPE STRING ,
ld_x_bbtyp  TYPE STRING ,
ld_x_versnr  TYPE STRING ,
ld_x_bbgno  TYPE STRING ,
ld_x_matnr  TYPE STRING ,
ld_x_bbrno  TYPE STRING ,
ld__scope  TYPE STRING ,
ld__wait  TYPE STRING ,
ld__collect  TYPE DDENQCOLL .

ld_mode_wbbh = 'Check type of data required'.
ld_mode_wbbl = 'Check type of data required'.
ld_mode_wbbp = 'Check type of data required'.

SELECT single MANDT
FROM WBBH
INTO ld_mandt.


SELECT single LOCNR
FROM WBBH
INTO ld_locnr.


SELECT single BBTYP
FROM WBBH
INTO ld_bbtyp.


SELECT single VERSNR
FROM WBBH
INTO ld_versnr.


SELECT single BBGNO
FROM WBBL
INTO ld_bbgno.


SELECT single MATNR
FROM WBBP
INTO ld_matnr.


SELECT single BBRNO
FROM WBBP
INTO ld_bbrno.

ld_x_locnr = 'some text here'.
ld_x_bbtyp = 'some text here'.
ld_x_versnr = 'some text here'.
ld_x_bbgno = 'some text here'.
ld_x_matnr = 'some text here'.
ld_x_bbrno = 'some text here'.
ld__scope = 'some text here'.
ld__wait = 'some text here'.
ld__collect = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name ENQUEUE_EWBBH or its description.