Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

FM to create/update HR infotypes

Hi,

Does anybody can help ?

Thank you.

Marian

Tags:
Former Member
Former Member replied

Hi Marian,

If you are talking abt inserting updating records to

infotype then ,

Please use the below code for inserting records to

infotype p0006.

* Lock Pernr
  CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
       EXPORTING
            number = dt_0006-pernr
       IMPORTING
            return = dg_return_struc0.

  CALL FUNCTION 'HR_INFOTYPE_OPERATION'
       EXPORTING
            INFTY          = '0006'
            NUMBER         = dt_0006-pernr
            SUBTYPE        = P0006-ANSSA
            VALIDITYEND    = P0006-ENDDA
            VALIDITYBEGIN  = P0006-BEGDA
            RECORD         = P0006
            OPERATION      = 'INS'
       IMPORTING
            RETURN         = dg_return_struc1
            KEY            = dg_record_key
       EXCEPTIONS
            OTHERS         = 0.
  if not  dg_return_struc1 is initial.
    dt_final-mess = dg_return_struc1-message.
  else.
    dt_final-mess = 'Address Record added successfully'(014).
  endif.



* Unlock Pernr
  CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
       EXPORTING
            number = dt_0006-pernr.


or if you want to create new infotype then see the link below.

<a href="http://www.sapdevelopment.co.uk/hr/infotypehome.htm">Infotype modfication</a>

Thanks&Regards,

Siri.

Message was edited by: Srilatha T

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question