Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

employee data

Former Member
0 Likes
430

Hi,

I am loading emp data

Employees existing and non existing (i,e New Employees ).

HR_INFOTYPE_OPERATION.

Please forward Sample code for this

Thanks

3 REPLIES 3
Read only

Former Member
0 Likes
405

Hi Asha,

Check this code sample:

data: p0021_struc TYPE p0021,
      p0106_struc TYPE p0106,
      p_p_pskey   TYPE pskey.

 
  CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
      infty            = p_pskey-infty
      number           = p_pskey-pernr
      subtype          = p_pskey-subty
      objectid         = p_pskey-objps
      lockindicator    = p_pskey-sprps
      validityend      = p0021-endda         " '99991231'
      validitybegin    = p0021-begda
      record           = p0021_struc
      operation        = mode
      tclas            = 'A'
*      dialog_mode      = '2'
      nocommit         = p_test
      VIEW_IDENTIFIER  = p0003-viekn
      secondary_record = p0106_struc
    IMPORTING
      return           = return
      key              = familykey
    EXCEPTIONS
      OTHERS           = 0.

You have complete information with examples in this link:

http://www.sapdev.co.uk/sap-fmodules/fms_HR_INFOTYPE_OPERATION.htm

Hope this helps you.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
405

I dont think you can create new employee's using HR_INFOTYPE_OPERATION. HR_INFOTYPE_OPERATION is only for creating or updating infotypes for existing employees. IF you have to create new employees, you might have to either make a Z FM for HR_INFOTYPE_Operation to avoid the Existence Check or try to Use HR_MAINTAIN_MASTERDATA.

Read only

Former Member
0 Likes
405

Thanks