Hi Gurus,
I have a requirement to update the infotype p0014 through report. Am getting all the modified values into the p0014 but it is not updated into the database. Am using the following code for this.
INFOTYPES : 0001,
0007,
0008,
0014 NAME OLD,
0014 NAME NEW.
NEW-AEDTM = SY-DATUM.
NEW-BETRG = WA_BASIC-HEATALLOWANCE.
NEW-UNAME = SY-UNAME.
RP-UPDATE OLD NEW.
Am modifying only these 3 fields in the infotype. RP-UPDATE is not updating the database. Is there any another macro or FM is there to update the database through infotype.
Regards
SC
Hello,
I am sending a sample program , which I have down on infotype 0105 (communication). I hope that this program will help u out............
REPORT ZSAPHR_SAMP.
tables: pa0105.
infotypes: 0105.
DATA : I_RETURN TYPE BAPIRETURN1,
I_KEY TYPE BAPIPAKEY,
PERNR TYPE P0001-PERNR,
I_P0105 TYPE TABLE OF P0105 WITH HEADER LINE,
ENDDA TYPE P0105-ENDDA,
BEGDA TYPE P0105-BEGDA.
MOVE '00000010' TO PERNR.
BEGDA = SY-DATUM + 1.
ENDDA = SY-DATUM + 1.
i_p0105-pernr = PERNR.
i_p0105-infty = '0105'.
i_p0105-subty = '0002'.
i_p0105-endda = ENDDA.
i_p0105-begda = BEGDA.
I_P0105-USRTY = '0002'.
I_P0105-USRID = 'VOICE@YAHOO.COM'.
APPEND i_p0105.
CALL FUNCTION 'DEQUEUE_ALL' .
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = PERNR.
IF SY-SUBRC = 0.
WRITE 'Employee Locked Successfully'.
ENDIF.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0105'
NUMBER = PERNR
SUBTYPE = '0002'
VALIDITYEND = BEGDA
VALIDITYBEGIN = ENDDA
RECORD = i_p0105
OPERATION = 'INS'
TCLAS = 'A'
DIALOG_MODE = '0'
NOCOMMIT = 'X'
IMPORTING
RETURN = I_RETURN
KEY = I_KEY.
IF SY-SUBRC = 0.
WRITE : 'FM returns sy-subrc 0'.
ENDIF.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
give some points if this message helps U .
Use HR_INFOTYPE_OPERATION instead.
Regards,
Amit
Reward all helpful replies.
hi,
I have tried same function module same process for infotype 0014...but it's not working...
Thanks,
Santosh.
Add a comment