‎2013 Dec 04 9:45 AM
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.
‎2013 Dec 04 9:53 AM
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
‎2013 Dec 04 9:53 AM
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