on 05-29-2014 8:51 PM
Dear Experts,
I am trying to update infotype 0003 using BDC Call transaction method. Before calling BDC, i am using funtion modules to lock the employee. The employee gets successfully locked by the FM and when the program calls the PA30 screen to update the employee, it throws an error "Person is already being processed by user XXXXX".
I know that BDC internally sets a lock on the employee but i have a requirement to explicitly lock the employee.
Any pointers on this is highly appreciated.
Thanks in advance.
Murthy
Hi
Try like below.
* Enqueue personnel number
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = lv_pernr
IMPORTING
return = ls_return.
IF ls_return-type EQ ' '." 'S'.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = lc_infty
number = gs_2001_new-pernr
subtype = gs_2001_new-subty
objectid = gs_2001_new-objps
lockindicator = gs_2001_new-sprps
* VALIDITYEND = GS_2001_NEW-ENDDA
* VALIDITYBEGIN = GS_2001_NEW-BEGDA
* RECORDNUMBER =
record = gs_2001_new
operation = 'INS'
* TCLAS = 'A'
* DIALOG_MODE = '2'
* NOCOMMIT = 'X'
* VIEW_IDENTIFIER =
* SECONDARY_RECORD =
IMPORTING
return = ls_return2
key = ls_key.
IF ls_return2 IS NOT INITIAL.
gs_alv-pernr = gs_2001_new-pernr. "lv_pernr.
gs_alv-ioper = 'INS'. "gs_2001-ioper.
gs_alv-mtype = ls_return2-type.
gs_alv-message = ls_return2-message.
APPEND gs_alv TO gt_alv.
CLEAR: gs_alv.
ELSE.
COMMIT WORK.
WAIT UP TO 1 SECONDS.
ENDIF.
* IF sy-subrc EQ 0 AND ls_return2-type EQ 'S'.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = lv_pernr
IMPORTING
return = ls_return1.
ENDIF.
CLEAR gs_2001.
CLEAR: ls_return,ls_return1,ls_return2,ls_key.
Thanks,
Sreeram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sreeram,
Thanks for your reply.
I think the locking/unlocking function modules will work only with "HR_INFOTYPE_OPERATION".
Currently our requirement is to use BDCs and before calling BDC we need to check whether the employee is locked. While using the enqueue function modules, it locks the employee.
Thanks in advance.
User | Count |
---|---|
94 | |
11 | |
9 | |
5 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.