Skip to Content
avatar image
Former Member

The requested object is locked by your own transaction, Infotype

Hi, all expert
M using HR_EMPLOYEE_ENQUEUE to insert data to my custom infotype and it always give me error

"The requested object is locked by your own transaction"

Here is my code:


ALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
         EXPORTING
          number = P9006-pernr.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
   EXPORTING
     infty                  = '9006'
     number                 = P9006-pernr
    SUBTYPE                =  P9006-subty
    OBJECTID               =  P9006-OBJPS
    LOCKINDICATOR          =  P9006-SPRPS
    VALIDITYEND            =  P9006-ENDDA
    VALIDITYBEGIN          =  P9006-BEGDA
    RECORDNUMBER           =  P9006-seqnr
     record                =  p9006
     operation             =  'INS'
    TCLAS                  =  'A'
    DIALOG_MODE            =  '02'
    NOCOMMIT               =  ''
*   VIEW_IDENTIFIER        = '07'
*   SECONDARY_RECORD       =
  IMPORTING
    RETURN                 = w_return
    KEY                    = lo_key
           .

  CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
                     EXPORTING
                       number = lo_P9006-pernr
                     IMPORTING
                       return = w_return2.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • avatar image
    Former Member
    Jan 09, 2015 at 02:36 AM

    Hi

    Go to SM12 check whether there have lock on this object, then delete it first.

    regards,

    Archer

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09, 2015 at 04:16 AM

    Try commenting DIALOG_MODE.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 05:46 AM

    Hi Vong,

    Please let me know at where the above program is called, from outside program or inside some exit?

    Regards

    Rajkumar Narasimman

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09, 2015 at 09:58 AM

    Hi Sophanith,

    Check this link http://scn.sap.com/thread/1838454

    SM12 may not list the locked object, however please check with basis team or you can try checking the table entries of CSL_EOMP as given in above link.

    Pls reward points if it is helpful

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 12:11 PM

    Don't use HR_EMPLOYEE_ENQUEUE, try BAPI_EMPLOYEE_ENQUEUE and then check your return code before HR_INFOTYPE_OPERATION, i.e.:

    .
          call function 'BAPI_EMPLOYEE_ENQUEUE'
          exporting
            number = <ls_alv>-pernr
          importing
            return = ls_return.

        if ls_return-type eq 'E'.
          move lv_icon_err to <ls_alv>-icon.
        else.
          perform HR_INFOTYPE_OPERATION

    ....etc......

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 09, 2015 at 12:14 PM
    • Are you trying to execute this code from inside a running PAxxx transaction that has already locked the employee records ?
    • Are you managing error message at every step (lock, execute, release) ?
    • Do you alway execute a DEQUEUE, COMMIT or ROLLBACK after every call of the ENQUEUE FM.

    Regards,

    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 10, 2015 at 01:47 AM

    Hi all,
    in my case somehow "HR_INFOTYPE_OPERATION" doesn't work. Therefore, i decided to create structure just like PA008 to store my multiple data from table control.

    Thanks for all the help.

    Add comment
    10|10000 characters needed characters exceeded