06-13-2008 3:02 PM
We use the bapi to create costplanning on internal orders
BAPI_COSTACTPLN_POSTACTINPUT
it gets the information on for instance the planned hours from a ztable which the controllers maintain for there projects.
but once a plan record is created like you do with kpf6 the bapi won't update this record when the amount of hours changes ??
is it the wrong bapi when you want to update the planning ?
s_hdr-co_area = ta_zcats_order_plan-kokrs.
s_hdr-fisc_year = ta_zcats_order_plan-begperiod(4).
s_hdr-period_from = '001'.
s_hdr-period_to = '012'.
s_hdr-version = '000'.
s_hdr-plan_currtype = 'C'.
t_obj-object_index = '1'.
t_obj-orderid = ta_zcats_order_plan-aufnr.
append t_obj.
SELECT SINGLE * FROM zcats_0315
WHERE kokrs EQ ta_zcats_order_plan-kokrs
AND pernr EQ ta_zcats_order_plan-pernr
AND begda >= '20080101'.
ta_tval-send_cctr = zcats_0315-kostl.
ta_tval-send_activity = zcats_0315-lstar.
ta_tval-order_celem = '0000055000'.
ta_tval-unit_of_measure = 'U'.
ta_tval-quantity_var = ta_zcats_order_plan-zplanhours.
ta_tval-value_index = '1'.
APPEND ta_tval.
CALL FUNCTION 'BAPI_COSTACTPLN_POSTACTINPUT'
EXPORTING
headerinfo = s_hdr
* DELTA = ' '
TABLES
indexstructure = t_idx
coobject = t_obj
* PERVALUE =
totvalue = ta_tval
return = t_ret
.
kind regards
arthur de smidt
06-13-2008 3:09 PM
HI Arthur,
You need to use BAPI_TRANSACTION_COMMIT to commit the changes done by BAPI_COSTACTPLN_POSTACTINPUT.
Regards,
Kalyan.
06-13-2008 3:15 PM
yep bapi transaction commit is already running afterwards but doesn't change anything , sorry to leave it out of the code here but I was already focusing on input errors
kind regards
arthur de smidt
06-16-2008 10:36 AM
error was in ta_tval-order_celem = '0000055000'.
this was not necessary to enter