on 04-17-2007 1:20 PM
Well I'm using the FM 'HR_INFOTYPE_OPERATION' for creating an infotype record.
Using the following sequence of FM's
BAPI_EMPLOYEE_ENQUEUE
HR_INFOTYPE_OPERATION
BAPI_EMPLOYEE_DEQUEUE
The Problem is that, if PERNR is already locked, even then the FM'HR_INFOTYPE_OPERATION' is executed. and a record is created.
So what would be the BEST PRACTICE to avoid the creation of Infotype record. when a Pernr is can't be enqueued(locked).
If a pernr is already locked , the return parameter of the function call to BAPI_EMPLOYEE_ENQUEUE will not be initial. It will hold an error message that impolies that the pernr could not be locked ( as it is already locked). You should check for the RETURN parameter before proceeding with the call to HR_INFOTYPE_OPERATION. This way you will have the control in the Program flow.
~Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Suresh,
I am using the follwoing sequence for inserting the record in the infotype
a) BAPI_EMPLOYEE_enque
b) hr_infotype_operation
c) bapi_employee-Enque.
iam getting the same error (428) a complex error has been occured. I have found your answer suitable to to be so i have checked the retrun value before hr_infotype_ operation, i.e by putting break-point just before hr_infotype_ opeation
if i wait fro few seconds and remove the break point i can see iam not getting any error
from hr_infotype_operation function moudle.
so could you please let me know for the personnel no to get lockec i should pass any
statement like wait?? after the bap_employee_enque..
Please let me know it would be great help for me.
regards
ravi.
Can you use HR_EMPLOYEE_ENQUEUE instead of BAPI_EMPLOYEE_ENQUEUE? When you use the HR function module, you should get a return code other than zero and an error message if you try to enqueue a locked pernr. You can check the return code coming back from this function module and only execute HR_INFOTYPE_OPERATION if it is zero. I hope this helps.
- April King
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
11 | |
11 | |
6 | |
6 | |
5 | |
4 | |
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.