Skip to Content
0
Former Member
Oct 19, 2011 at 01:53 PM

Pernr Not getting lockedwhile doing the infotypes updation in sequence

25 Views

Hi All,

We are facing a very strange issue with lock and unlock of the PERNR during updating the several infotypes for the same PERNR in a sequence.

Before posting I searched the forum ,but not able to find any solution.

Scenario : In a FM we are first creating a employee using a PA40 BDC Call Transaction ,once its done we are performing the

call function 'BAPI_EMPLOYEE_ENQUEUE'

exporting

number =p_pernr

importing

return = wa_return.

which will be successful.

After this we are updating Infotype 0002,41,105,007 in sequence using below code in loop for SAME PERNR.

"lock the PERNR 
call function'BAPI_EMPLOYEE_ENQUEUE' 
    exporting 
      number = p_pernr 
    importing 
      return = wa_return. 

Perform the operation 

   call function 'HR_INFOTYPE_OPERATION' 
      exporting 
        infty       = p_infotype 
        number      = p_pernr 
        subtype     = p_subtype 
        record      = <fs_pnnnn_new> 
        operation   = p_oper 
        nocommit    = c_commit 
        dialog_mode = v_dialogmode 
      importing 
        return      = return 
        key         = intpakey 
      exceptions 
        others      = 0. 


*Unlock the PERNR. 

call function 'BAPI_EMPLOYEE_DEQUEUE' 
    exporting 
      number = p_pernr 
    importing 
      return = wa_return. 
If  wa_return is not initital 

   call function 'BAPI_TRANSACTION_ROLLBACK' 
        importing 
          return = return_roleback. 
    else. 
      call function 'BAPI_TRANSACTION_COMMIT' 
        exporting 
          wait   = 'X' 
        importing 
          return = return_commit. 
    endif.

But we are getting error saying "Personal Number could not be locked" for some of the info types.

Do any one have idea what the exact issue is this?

Please help.

Regards

Channa