Skip to Content
author's profile photo Former Member
Former Member

Updating the Infotypes

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 10:53 AM

    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 .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 10:28 AM

    Hi,

    You can update any Infotype using the FM HR_INFOTYPE_OPERATION.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 29, 2007 at 10:23 AM

    Use HR_INFOTYPE_OPERATION instead.

    fm-hrinfotypeoperation

    fm-hrinfotypeoperation

    Regards,

    Amit

    Reward all helpful replies.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Check the operation you are passing to the FM.

      If you are creating a new record, use 'INS', or if you wanna modify an existing one, use 'MOD'.

      And if you are trying to modify an existing record, the begda & endda parameters should match the existing ones.

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 10:59 AM

    Use Fm -

    HR_INFOTYPE_OPERATION

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 24, 2016 at 09:33 AM

    hi,

    I have tried same function module same process for infotype 0014...but it's not working...

    Thanks,

    Santosh.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.