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

HR Function Module to create Position + 1001 + 1008

former_member201275
Active Contributor
1,827

Hi,

I have a program which updates infotype 0001 record for an employee.

Now within this program I have to create a dummy Position and then assign this Position to the employee. Which is the best Function module, or BAPI, to use for this? Also relationship to OU and Job is to be created... once again for this I have dummy values for this, and also 1008 is to be populated.

Is there a Function I can pass these values to i.e. Org Unit, Job, the Account Assignment fields, and then this creates a Position and returns the Position ID to me? Or should I use different Functions e.g. RH_OBJECT_CREATE to create the Position, followed by other Functions for 1001 and 1008 creation?

Unfortunately I am not allowed to use LSMW for this, I have to create this on the fly in the existing program i.e. when infotype 0001 record is created.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
881

Glen,

You can use the FM  'RH_INSERT_INFTY'

DATA : lc_inse   TYPE okcode VALUE 'INSE',
          lc_vtask  TYPE vtask  VALUE 'D'.

   CALL FUNCTION 'RH_INSERT_INFTY'
     EXPORTING
       fcode               = lc_inse
       vtask               = lc_vtask
       authy               = space
       commit_flg          = c_x
     TABLES
       innnn               = pt_table
     EXCEPTIONS
       no_authorization    = 1
       error_during_insert = 2
       repid_form_initial  = 3
       corr_exit           = 4
       begda_greater_endda = 5
       OTHERS              = 6.
   IF sy-subrc <> 0.
     EXIT.
   ENDIF.


Initially use pass the values into the respective structures like P1000, P1001, P1008.


Then pass those internal tables into this FM.



SKR

1 REPLY 1
Read only

Former Member
0 Likes
882

Glen,

You can use the FM  'RH_INSERT_INFTY'

DATA : lc_inse   TYPE okcode VALUE 'INSE',
          lc_vtask  TYPE vtask  VALUE 'D'.

   CALL FUNCTION 'RH_INSERT_INFTY'
     EXPORTING
       fcode               = lc_inse
       vtask               = lc_vtask
       authy               = space
       commit_flg          = c_x
     TABLES
       innnn               = pt_table
     EXCEPTIONS
       no_authorization    = 1
       error_during_insert = 2
       repid_form_initial  = 3
       corr_exit           = 4
       begda_greater_endda = 5
       OTHERS              = 6.
   IF sy-subrc <> 0.
     EXIT.
   ENDIF.


Initially use pass the values into the respective structures like P1000, P1001, P1008.


Then pass those internal tables into this FM.



SKR