Lock object for table EKES

Hi experts,
I developed a function module to update the confirmations tab of a PO on ME22N screen. Now, I want to have a lock object in the FM so that a user cant make changes while this FM is in use. I do not know if there is any standard lock object for this purpose. I created a lock object in SE11 'EZEKES' since table EKES corresponds to vendor confirmations details. The Enqueue function was called into the program. The code is below:
CALL FUNCTION 'ENQUEUE_EZPHLOCK'
EXPORTING
   MODE_EKES            = 'E'
   MANDT                = SY-MANDT
   EBELN                = ponumber
EXCEPTIONS
   FOREIGN_LOCK         = 1
   SYSTEM_FAILURE       = 2
   OTHERS               = 3
The problem is, i'm not able to have a lock on the confirmations tab when the FM is in use. Is there any problem with the lock object i have created. The lock mode is Exclusive,Cumulative.
Please help me with this.

Code:
""Local Interface:
*"  IMPORTING
*"     REFERENCE(PONUMBER) TYPE  EKKO-EBELN
*"  TABLES
*"      ITAB STRUCTURE  UEKES
TABLES: EKES, EKKO.
  DATA: BEGIN OF I_EKKO OCCURS 0,
        EBELN LIKE EKKO-EBELN,
        END OF I_EKKO.
  DATA: X LIKE EKES-ETENS.
  data: i_tab like itab occurs 0 with header line.
  move itab[] to i_tab[].
  DATA: i_ekes LIKE uekes OCCURS 0 WITH HEADER LINE.
  SELECT EBELN FROM EKKO INTO TABLE I_EKKO WHERE EBELN = PONUMBER.
  IF NOT I_EKKO[] IS INITIAL.
    SELECT  * FROM EKES INTO TABLE I_EKES
    FOR ALL ENTRIES IN I_EKKO
  WHERE EBELN = I_EKKO-EBELN.
  ENDIF.
  select single etens from ekes into x WHERE EBELN = PONUMBER.
  x = x + 1.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
DATA: VARKEY LIKE RSTABLE-VARKEY.
  CALL FUNCTION 'ENQUEUE_E_TABLE'
   EXPORTING
    MODE_RSTABLE         = 'E'
     TABNAME              = EKES
     VARKEY               = VARKEY
    X_TABNAME            = ' '
    X_VARKEY             = ' '
    _SCOPE               = '2'
    _WAIT                = ' '
    _COLLECT             = ' '
  EXCEPTIONS
    FOREIGN_LOCK         = 1
    SYSTEM_FAILURE       = 2
    OTHERS               = 3
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
    LOOP AT I_TAB. "WHERE EBELN = PONUMBER.
    READ TABLE I_TAB.
    LOOP AT i_ekes WHERE ebelp EQ ITAB-EBELP "itemnumber
                      AND ebtyp EQ 'LA'.
      i_ekes-menge = ITAB-MENGE. "quantity.
      i_ekes-kz   = 'U'.
      i_ekes-eindt = ITAB-EINDT. "deldate.
      I_EKES-XBLNR = ITAB-XBLNR.
      i_ekes-erdat = sy-datum.
      i_ekes-ezeit = sy-uzeit.
      MODIFY i_ekes.
    ENDLOOP.
  ENDLOOP.
  IF sy-subrc NE 0.
    LOOP AT I_TAB. "WHERE EBELN = PONUMBER.
      READ TABLE I_TAB.
      LOOP AT i_ekes WHERE ebelp EQ ITAB-EBELP "itemnumber
                     AND ebtyp EQ 'AB'.
        i_ekes-menge = ITAB-MENGE. "quantity.
        i_ekes-ebtyp = 'LA'.
        i_ekes-kz   = 'I'.
        i_ekes-etens   = x.
        i_ekes-eindt = ITAB-EINDT. "deldate.
        I_EKES-XBLNR = ITAB-XBLNR.
        i_ekes-erdat = sy-datum.
        i_ekes-ezeit = sy-uzeit.
        APPEND i_ekes.
      ENDLOOP.
    ENDLOOP.
  ENDIF.
To update the confirmations tab
  CALL FUNCTION 'ME_CONFIRMATION_UPDATE'
    EXPORTING
      I_EBELN = PONUMBER
    TABLES
      XEKES   = i_ekes[].
        YEKES         = I_EKES[].
  IF SY-SUBRC = 0.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
  ENDIF.
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
  MODE_RSTABLE       = 'E'
   TABNAME            = EKES.
   VARKEY             = VARKEY
  X_TABNAME          = ' '
  X_VARKEY           = ' '
  _SCOPE             = '3'
  _SYNCHRON          = ' '
  _COLLECT           = ' '
ENDFUNCTION.

Similar Messages

  • Lock object for table KNVP and KNVK

    Hello Friends,
    Can you please tell me the standard lock object for the table KNVP and KNVK.
    Thank and regards,
    Kuldeep

    Hi
    see this and do accordingly
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    - Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    - Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    - Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    You have to use these function module in your program.
    check this link for example.
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    tables:vbak.
    call function 'ENQUEUE_EZLOCK3'
    exporting
    mode_vbak = 'E'
    mandt = sy-mandt
    vbeln = vbak-vbeln
    X_VBELN = ' '
    _SCOPE = '2'
    _WAIT = ' '
    _COLLECT = ' '
    EXCEPTIONS
    FOREIGN_LOCK = 1
    SYSTEM_FAILURE = 2
    OTHERS = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Normally ABAPers will create the Lock objects, because we know when to lock and how to lock and where to lock the Object then after completing our updations we unlock the Objects in the Tables
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    purpose: If multiple user try to access a database object, inconsistency may occer. To avoid that inconsistency and to let multiple user give the accessibility of the database objects the locking mechanism is used.
    Steps: first we create a loc object in se11 . Suppose for a table mara. It will create two functional module.:
    1. enque_lockobject
    1. deque_lockobject
    before updating any table first we lock the table by calling enque_lockobject fm and then after updating we release the lock by deque_lockobject.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    GO TO SE11
    Select the radio button "Lock object"..
    Give the name starts with EZ or EY..
    Example: EYTEST
    Press Create button..
    Give the short description..
    Example: Lock object for table ZTABLE..
    In the tables tab..Give the table name..
    Example: ZTABLE
    Save and generate..
    Your lock object is now created..You can see the LOCK MODULES..
    In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function
    Lock objects:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    Match Code Objects:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci553386,00.html
    See this link:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Check these links -
    lock objects
    Lock Objects
    Lock Objects
    Regards
    Anji

  • To get Lock object for Standard Table

    Hi all,
    i want to update table FKK_GPSHAD,so i need corresponding lock object for this table.can any one sughgest me the solution for this.
    Thanks in advance,...

    Hi,
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    You have to use these function module in your program.
    check this link for example.
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    tables:vbak.
    call function 'ENQUEUE_EZLOCK3'
    exporting
    mode_vbak = 'E'
    mandt = sy-mandt
    vbeln = vbak-vbeln
    X_VBELN = ' '
    _SCOPE = '2'
    _WAIT = ' '
    _COLLECT = ' '
    EXCEPTIONS
    FOREIGN_LOCK = 1
    SYSTEM_FAILURE = 2
    OTHERS = 3
    if sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Normally ABAPers will create the Lock objects, because we know when to lock and how to lock and where to lock the Object then after completing our updations we unlock the Objects in the Tables
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    purpose: If multiple user try to access a database object, inconsistency may occer. To avoid that inconsistency and to let multiple user give the accessibility of the database objects the locking mechanism is used.
    Steps: first we create a loc object in se11 . Suppose for a table mara. It will create two functional module.:
    1. enque_lockobject
    1. deque_lockobject
    before updating any table first we lock the table by calling enque_lockobject fm and then after updating we release the lock by deque_lockobject.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    GO TO SE11
    Select the radio button "Lock object"..
    Give the name starts with EZ or EY..
    Example: EYTEST
    Press Create button..
    Give the short description..
    Example: Lock object for table ZTABLE..
    In the tables tab..Give the table name..
    Example: ZTABLE
    Save and generate..
    Your lock object is now created..You can see the LOCK MODULES..
    In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function
    Lock objects:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    Match Code Objects:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci553386,00.html
    See this link:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Check these links -
    lock objects
    Lock Objects
    Lock Objects
    Please reward points if useful.
    Regards
    Rose

  • Existing Lock Objects for a table

    Is there a function module or program to get a list of existing lock objects for a given table?

    Hi,
    I am not sure of function module..
    But you can get the lock objects for the a table..
    Go to SE16..Give the table name DD25L
    In the ROOTTAB field give the table name.
    In the field AGGTYPE give 'E' which is for lock object.
    Thanks,
    Naren

  • Lock object for knvv

    Hi,
    is there any lock object for KNVV table for EIKTO field.
    If yes please help me.
    Thanks,
    Sandeep Garg

    Hi,
    According to my search i found lock objects only for KNA1 table. you may try it by,
    GOTO se11.
    select Lock object Radio button.
    Press F4.
    A popup appears, in that popup, under Short Description, type
    CustomerMaster* or what ever description you feel and press enter. you will get a list of lock objects, if they match your description.
    One tip is always give the first letter in CAPS. like CustomerMaster*.

  • Unable to create Entity objects for tables in TimesTen database using ADF

    Hi,
    I am not able to create Entity and View objects for tables in TimesTen database using ADF. I have installed TimesTen client on my machine.
    I have created a database connection by using connection type as "Generic JDBC" and giving driver class and JDBC URL. I am attaching screen shot of the same.
    I am right clicking on Model project and selecting New option after that I am selecting ADF Business components and in it I am selecting Business components from tables and there I am querying for tables.I am getting list of tables and when I am trying to create a Entity object from the table after clicking finish Jdev is closing by itself giving an error.
    Can anyone please help me how to create Entity objects for tables using TimesTen as database.I might be missing some jars or the way I am creating connection might be wrong or any plugins required to connect to TimesTen.

    What is the actual error being given by Jdev? Are you sure that the JDBC connection is using the TimesTen JDBC driver JAR and not some other JDBC driver or the Generic JDBC/ODBC bridge?
    Is ADF even supported with TimesTen?
    Chris

  • Find lock object for field

    Hi Friends,
    I have one qurey. I would like to know the lock object for field MATNR.
    Any suggestion how I can find it out the lock object for specific field.
    Regards,
    Poonam

    hi,
    GOTO se11.
    select Lock object Radio button.
    Press F4.
    A popup appears, in that popup, under Short Description, type
    *Material* and press enter. you will get a list of lock objects, select your required.
    Always give the first letter in CAPS. like *Material*.

  • Customizing Object for table TB019?

    Hello all,
    Can you please tell me the Customizing Object for table TB019? The only object I could find was DNL_CUST_CUST3 but this includes TB020 and not TB019.
    Rgds
    Priyanka

    Hi!
    I think you already found the object. It is the TB020 that triggers the override. It is very often so that the language dependent tables are the ones being transferred.
    A genereal methodology to figure out which load object is involved for a specific R/3-table is to go to transactionse16 in CRM and check the SMOFTABLES-table.
    The field R3TABNAME is where you put in your R/3-table. It also allows generic searches such as TB0*.
    BR
    /fredric

  • Lock object for KONV table/Cluster table ??

    Hi All,
    Is it possible to set Lock/Enqueue cluster tables or in my case table:KONV (KNUMV field) ?.
    OSS provided some programs without locks so was hoping if I could add before performing data manipulation.
    Regards,
    Neeth

    Hi Nameeth,
    you can use generic lock object E_TABLE with function modules ENQUEUE_E_TABLE, DEQUEUE_E_TABLE for locking and unlocking with parameters table name and key field.
    Regards,
    Satya

  • Archiving object for tables GLPCC and GLPCO

    Hi All,
      GLPCA table stores the actual line items in PCA and GLPCT table stores the totals records of PCA.
    What are the transactions which get affected in regular course by these tables?
       GLPCC - EC-PCA: Transaction Attributes
       GLPCO - EC-PCA: Object Table for Account Assignment
    There is no archiving object for the tables GLPCC and GLPCO when checked in DB15. What is the alternative for archiving the entries in those tables?
    Thanks in advance
    Regards
    Anupama

    Hello Anupama,
    The standard archiving objects for PCA are EC_PCA_ITM & EC_PCA_SUM. Most of the data is archived with above two objects.  Hence it would be better to use given archiving object. About 80% of data can be archived through standard archiving objects.
    For more information you may read SAP Data Management Guide.
    Regds
    Ambadas

  • Lock object for Purchase Order

    Dear Experts.
    I am searching the function module "ENQUEUE_   " , which is for locking & Unlocking
    the Purchase order(ekko-ebeln).
    Please help me.
    Thanks in advance,
    Regards,
    Rahul.

    Hi,
    Use the Lock object EMEKKOE to Lock and Unloack the Purchase orders
    Use this FM to lock
    MM_ENQUEUE_DOCUMENT
    This is also used in the standard program. While enqueing,
    if there is any error (sy-subrc 0), then it means,
    that particular purchase order is already locked
    Use Fm DEQUEUE_ALL to release all lock at the end of report execution.
    Regards,
    Shamma
    Edited by: Shamma Firdous on Aug 20, 2009 10:22 AM

  • Authorization object for table

    Hi All,
    I have created a table in Se11 and not allowing maintance generator.
    Can any one please suggest if I am not allowing table maintaince then how I can attach authorization object to the tabe.
    Thanks,
    Sandeep.

    Hi sandy,
    1.  I am not allowing table maintaince
        If u are not allowing the table for maintenance,
       then authorisation group is NOT REQUIRED.
    2. Authorisation group is required only,
       in case where we allow table maintenance thru sm30.
      (other wise there is no use of authorisation group for table)
    regards,
    amit m.

  • Creating Lock object for a field in a sap table

    Hi ,
           I need to lock a field in sap table
    eg.  To lock a Standard price(stprs) field in Material Valuation (mbew) table.

    Try with the following Code :
    CALL FUNCTION 'ENQUEUE_EZMBEW'
    EXPORTING
       MODE_MBEW      = 'S'
       MANDT                = SY-MANDT
       MATNR                = '000000000000000043'
       BWKEY                =  '0001'
        STPRS                =  '20,00'
    EXCEPTIONS
      FOREIGN_LOCK         = 1
      SYSTEM_FAILURE       = 2
      OTHERS               = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Thank you,
    Sekhar.

  • Error while working with POP-IN object for Table UI

    Hi Expert,
    I am creating a pop-in for one column of table UI. I have a LinkToAction object to open pop-in. i have some lable and input fields in pop-in. I dont know the flow to display the pop-in and where should i assign data to pop-in fields. how system will know which row i am clicking? Please help to know all details. I have a lots of questions.
    I am able to create link on the column and when i am clicking on link i am getting below error.
    "Node VIEW_VAL.1.POP_IN does not contain any elements" but i have attributes in node POP-_N.
    Please help me.
    Thanks and Regards,
    Anil
    Details from ST22----
    An exception occurred which is explained in detail below.
    The exception, which is assigned to class 'CX_WDR_ADAPTER_EXCEPTION', was not
    caught and
    therefore caused a runtime error.
    The reason for the exception is:
    Adapterfehler im  INPUT_FIELD "INPUT_FIELD01" des Views
    "Z_BP_GENERAL.VIEW_VAL": Context-Bindung des Properties VALUE kann nicht
    aufgelöst werden: Node VIEW_VAL.1.POP_IN does not contain any elements
    The occurrence of the exception is closely related to the occurrence of
    a previous exception "CX_WD_CONTEXT", which was raised in the program
    "CL_WDR_CONTEXT_NODE===========CP",
    specifically in line 9 of the (include) program
    "CL_WDR_CONTEXT_NODE===========CM00R".
    The cause of the exception was:
    Node VIEW_VAL.1.POP_IN does not contain any elements

    hi,
    Use this code in OnAction of LinktoAction UI element.
    This code will give you index of the row from which Link to Action is Triggered.
    <cn_popin> is my node binded to Table.
    data: lr_element type ref to if_wd_context_element.
    DATA ls_cn_popin TYPE wd_this->element_cn_popin.
    lr_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).
    get all declared attributes
      lr_element->get_static_attributes(
        IMPORTING
          static_attributes = ls_cn_popin ).
    data lv type I.
    lv = lr_element->GET_INDEX( ).
    Finally you have the index in varialbe lv.

  • Searching for Archiving Object for table COMH PP-PI messages header

    Hallo,
    i am faced to archive records from table COMH (PP-PI message headers).
    And searched SMP, SDN, Dataguides but i could not find any objects or delete-reports for this table.
    Could anyone give input on how to get rid of the records in COMH?
    with regards
    ingo

    Hello Ute,
    thanks for your informations.
    We are going to start RCOCB009 as batchjob periodical, once per month, to get rid of elder messages.
    with regrads
    ingo

Maybe you are looking for