‎2009 May 18 11:27 AM
Hi Experts,
When i am using this FM HR_INFOTYPE_OPERATION its not modifying the infotype 14.Can you please suggest me. Please see my below code. Can please let me know if i am wrong..
form INSERT_DATA_0014 .
loop at pa_0014.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = pa_0014-pernr
IMPORTING
RETURN = it_return.
.
IF it_return-id EQ 'E'.
WRITE: / v_pernr, 'Enqueue failed'.
else.
write: 'successfully locked'.
ENDIF.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0014'
number = pa_0014-pernr
SUBTYPE = pa_0014-SUBTY
OBJECTID = pa_0014-OBJPS
LOCKINDICATOR = pa_0014-SPRPS
VALIDITYEND = pa_0014-begda
VALIDITYBEGIN = pa_0014-endda
RECORDNUMBER = pa_0014-SEQNR
record = pa_0014
operation = 'MOD'
TCLAS = 'A'
DIALOG_MODE = '0'
NOCOMMIT = ''
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
RETURN = l_bapireturn
KEY = bapipakey_tab
.
IF l_bapireturn-id NE space.
WRITE: / v_pernr, 'error'.
ELSE.
WRITE: /'SUCCESSFULLY INSERTED'.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = v_pernr
IMPORTING
RETURN = l_bapireturn
.
IF l_bapireturn-id NE space.
WRITE: / v_pernr, 'Enqueue failed'.
else.
write: /'record successfully modified'.
ENDIF.
endloop.
endform.
Thanks,
Munna.
‎2009 May 18 11:29 AM
try by adding the BAPI TRANSACTION COMMIT function module after the operation FM..
‎2009 May 18 12:07 PM
Hi,
Check the importing return parameter after the function module in debugging.
Try using dialog mode '1', so that you can understand what exactly is happening and then change the dialog mode to '0'.
‎2009 May 18 12:56 PM
Hi,
Check the entire return internal table I_BAPIRETURN of FM HR_INFOTYPE_OPERATION what it has got to say ( a error message will be there which will tell where is the problem ). If it is initial then check the table PA0014 if the record has been modified. If its still not modified then check if at all it can be manually by PA30. If it doesnt get modified even manually then this is some configuration related issue.
Regards.
‎2009 May 18 3:36 PM
Hi,
Please check following in your code:
1. Start and end dates are set wrongly. They are swapped.
2. If the record is successfully locked, only then call the info type opeartion FM. So, it should be in
your else part.
3. Pass lock indicator as space
4. Pass nocommit indicator as space
Thanks,
SKJ
‎2009 May 18 7:24 PM
check l_bapireturn contents and problem will be solved. I think you have some config Issue in T511 table.