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

RH_INSERT_INFTY

Former Member
0 Likes
2,262

Hi Guys,

I am trying to insert infotype 1008 by using the following piece of code but it does not work. Can anyone please tell me if I am doing anything wrong in here?

DATA: l_p1008 TYPE STANDARD TABLE OF P1008,

lwt_1008 like line of l_p1008.

lwt_1008-objid = wa_objid.

lwt_1008-begda = sy-datum.

lwt_1008-endda = sy-datum.

lwt_1008-bukrs = p1008-bukrs.

lwt_1008-gsber = p1008-gsber.

lwt_1008-infty = '1008'.

lwt_1008-istat = '1'.

lwt_1008-plvar = '01'.

APPEND lwt_1008 to l_p1008.

call function 'RH_INSERT_INFTY'

EXPORTING

fcode = 'INSE'

vtask = 'B'

TABLES

innnn = l_p1008

EXCEPTIONS

no_authorization = 1

error_during_insert = 2

repid_form_initial = 3

corr_exit = 4

begda_greater_endda = 5

others = 6.

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
0 Likes
1,259

Mark,

You have to the follow-up RH_INSERT_INFTY with another function call ie 'RH_UPDATE_DATABASE'. Depending on the type of update you need, one of the following values can be passed to this function..

S Synchronous update in the update task

V Asynchronous update in the update task

D Update in dialog

B Update in internal buffer

No update via personnel planning update task

I have observed that even an explicit COMMIT WORK is not enough in this case.

~Suresh

8 REPLIES 8
Read only

Former Member
0 Likes
1,259

Hi Mark,

If you are not getting an exception, have you tried putting a commit work statement after the function call.

Regards

Gareth

Read only

suresh_datti
Active Contributor
0 Likes
1,260

Mark,

You have to the follow-up RH_INSERT_INFTY with another function call ie 'RH_UPDATE_DATABASE'. Depending on the type of update you need, one of the following values can be passed to this function..

S Synchronous update in the update task

V Asynchronous update in the update task

D Update in dialog

B Update in internal buffer

No update via personnel planning update task

I have observed that even an explicit COMMIT WORK is not enough in this case.

~Suresh

Read only

0 Likes
1,259

Thanks for your response Suresh.

I will give it a try now. Could you please explain what is the difference between all these update types as I am not sure.

Thanks.

~Mark

Read only

0 Likes
1,259

Use S for immediate Update & V for an Update with a slight delay..

~Suresh

Read only

0 Likes
1,259

Thanks Suresh.

Its working fine now.

I have another question now if you dont mind me asking.

How will I use this function to upload HRP1018 (Cost distribution). There are fields that I want to upload which reside in another table RHCD_TAB but is connected to HRP1018.

I would appreciate your response.

Thanks,

~Mark

Read only

0 Likes
1,259

The RHCD_TAB values are actually stored in HRT1018 with the field TABNR as the link to HRP1018. So I am not sure if you will be able maintain 1018 with a single call to RH_INSERT_INFTY.

~Suresh

Read only

Former Member
0 Likes
1,259

-

Read only

Former Member
0 Likes
1,259

-