01-09-2015 2:13 AM
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.
01-09-2015 2:36 AM
Hi
Go to SM12 check whether there have lock on this object, then delete it first.
regards,
Archer
01-09-2015 2:37 AM
01-09-2015 4:16 AM
01-09-2015 5: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
01-09-2015 7:26 AM
i call it in a module.
My purpose is that i want to insert multiple data from the table control.
01-09-2015 7:45 AM
Hi yong,
Kindly change the below variable in DEQUEUE as shown below.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
" number = lo_P9006-pernr "Comment this line
number = P9006-pernr
IMPORTING
return = w_return2.
Also use BAPI commit as shown below.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
If still the problem exist, use below command, after DEQUEUE.
WAIT UPTO 1 SECONDS.
If still the problem exist, kindly try with BDC with Mode 'A' that help you to find out where the problem exist.
Regards
Rajkumar Narasimman
01-09-2015 7:58 AM
01-09-2015 8:05 AM
01-09-2015 8:10 AM
it's the same error : "The requested object is locked by your own transaction".
01-09-2015 9: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
01-09-2015 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......
01-09-2015 12:14 PM
Regards,
Raymond
01-10-2015 1: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.