SAP Function Modules

ENQUEUE_EKC2OPER SAP Function module - Request lock for object EKC2OPER







ENQUEUE_EKC2OPER 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_EKC2OPER into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM ENQUEUE_EKC2OPER - ENQUEUE EKC2OPER





CALL FUNCTION 'ENQUEUE_EKC2OPER' "Request lock for object EKC2OPER
* EXPORTING
*   mode_ce2oper = 'E'          " enqmode       Lock mode for table CE2OPER
*   mandt = SY-MANDT            " ce2oper-mandt  01th enqueue argument
*   paledger =                  " ce2oper-paledger  02th enqueue argument
*   vrgar =                     " ce2oper-vrgar  03th enqueue argument
*   versi =                     " ce2oper-versi  04th enqueue argument
*   paobjnr =                   " ce2oper-paobjnr  05th enqueue argument
*   pasubnr =                   " ce2oper-pasubnr  06th enqueue argument
*   belnr =                     " ce2oper-belnr  07th enqueue argument
*   perbl =                     " ce2oper-perbl  08th enqueue argument
*   x_paledger = SPACE          "               Fill argument 02 with initial value?
*   x_vrgar = SPACE             "               Fill argument 03 with initial value?
*   x_versi = SPACE             "               Fill argument 04 with initial value?
*   x_paobjnr = SPACE           "               Fill argument 05 with initial value?
*   x_pasubnr = SPACE           "               Fill argument 06 with initial value?
*   x_belnr = SPACE             "               Fill argument 07 with initial value?
*   x_perbl = SPACE             "               Fill argument 08 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_EKC2OPER

ABAP code example for Function Module ENQUEUE_EKC2OPER





The ABAP code below is a full code listing to execute function module ENQUEUE_EKC2OPER 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_ce2oper) = 'Check type of data required'.

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


SELECT single PALEDGER
FROM CE2OPER
INTO @DATA(ld_paledger).


SELECT single VRGAR
FROM CE2OPER
INTO @DATA(ld_vrgar).


SELECT single VERSI
FROM CE2OPER
INTO @DATA(ld_versi).


SELECT single PAOBJNR
FROM CE2OPER
INTO @DATA(ld_paobjnr).


SELECT single PASUBNR
FROM CE2OPER
INTO @DATA(ld_pasubnr).


SELECT single BELNR
FROM CE2OPER
INTO @DATA(ld_belnr).


SELECT single PERBL
FROM CE2OPER
INTO @DATA(ld_perbl).

DATA(ld_x_paledger) = 'some text here'.
DATA(ld_x_vrgar) = 'some text here'.
DATA(ld_x_versi) = 'some text here'.
DATA(ld_x_paobjnr) = 'some text here'.
DATA(ld_x_pasubnr) = 'some text here'.
DATA(ld_x_belnr) = 'some text here'.
DATA(ld_x_perbl) = '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_EKC2OPER' * EXPORTING * mode_ce2oper = ld_mode_ce2oper * mandt = ld_mandt * paledger = ld_paledger * vrgar = ld_vrgar * versi = ld_versi * paobjnr = ld_paobjnr * pasubnr = ld_pasubnr * belnr = ld_belnr * perbl = ld_perbl * x_paledger = ld_x_paledger * x_vrgar = ld_x_vrgar * x_versi = ld_x_versi * x_paobjnr = ld_x_paobjnr * x_pasubnr = ld_x_pasubnr * x_belnr = ld_x_belnr * x_perbl = ld_x_perbl * _scope = ld__scope * _wait = ld__wait * _collect = ld__collect EXCEPTIONS FOREIGN_LOCK = 1 SYSTEM_FAILURE = 2 . " ENQUEUE_EKC2OPER
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_ce2oper  TYPE ENQMODE ,
ld_mandt  TYPE CE2OPER-MANDT ,
ld_paledger  TYPE CE2OPER-PALEDGER ,
ld_vrgar  TYPE CE2OPER-VRGAR ,
ld_versi  TYPE CE2OPER-VERSI ,
ld_paobjnr  TYPE CE2OPER-PAOBJNR ,
ld_pasubnr  TYPE CE2OPER-PASUBNR ,
ld_belnr  TYPE CE2OPER-BELNR ,
ld_perbl  TYPE CE2OPER-PERBL ,
ld_x_paledger  TYPE STRING ,
ld_x_vrgar  TYPE STRING ,
ld_x_versi  TYPE STRING ,
ld_x_paobjnr  TYPE STRING ,
ld_x_pasubnr  TYPE STRING ,
ld_x_belnr  TYPE STRING ,
ld_x_perbl  TYPE STRING ,
ld__scope  TYPE STRING ,
ld__wait  TYPE STRING ,
ld__collect  TYPE DDENQCOLL .

ld_mode_ce2oper = 'Check type of data required'.

SELECT single MANDT
FROM CE2OPER
INTO ld_mandt.


SELECT single PALEDGER
FROM CE2OPER
INTO ld_paledger.


SELECT single VRGAR
FROM CE2OPER
INTO ld_vrgar.


SELECT single VERSI
FROM CE2OPER
INTO ld_versi.


SELECT single PAOBJNR
FROM CE2OPER
INTO ld_paobjnr.


SELECT single PASUBNR
FROM CE2OPER
INTO ld_pasubnr.


SELECT single BELNR
FROM CE2OPER
INTO ld_belnr.


SELECT single PERBL
FROM CE2OPER
INTO ld_perbl.

ld_x_paledger = 'some text here'.
ld_x_vrgar = 'some text here'.
ld_x_versi = 'some text here'.
ld_x_paobjnr = 'some text here'.
ld_x_pasubnr = 'some text here'.
ld_x_belnr = 'some text here'.
ld_x_perbl = '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_EKC2OPER or its description.