‎2007 Apr 18 12:51 AM
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.
‎2007 Apr 18 2:03 AM
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
‎2007 Apr 18 1:42 AM
Hi Mark,
If you are not getting an exception, have you tried putting a commit work statement after the function call.
Regards
Gareth
‎2007 Apr 18 2:03 AM
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
‎2007 Apr 18 5:28 PM
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
‎2007 Apr 18 5:40 PM
Use S for immediate Update & V for an Update with a slight delay..
~Suresh
‎2007 Apr 18 5:43 PM
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
‎2007 Apr 18 7:02 PM
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
‎2007 Apr 18 6:23 PM
‎2007 Apr 18 6:53 PM