Hi all,
I'm quite new to the costcenter topic and was requested to write a report to update the fields CSKS-VERAK and CSKS-VERAK_USER.
I found BAPI_COSTCENTER_CHANGEMULTIPLE which should be able to update the records. My intention is to get a new validity period in CSKS with the changed values for the mentioned fields.
To achieve this I select the details for the costcenter with BAPI_COSTCENTER_GETDETAIL1 and update then the necessary fields: valid_from with next day, person_in_charge and person_in_charge_user. The current record in the database is valid until 31.12.9999.
DATA: it_cc_getdetail TYPE TABLE OF bapi0012_ccoutputlist WITH HEADER LINE
, ret_cc_getdetail TYPE TABLE OF bapiret2
, wa_cclist TYPE bapi0012_ccinputlist
, it_cclist TYPE TABLE OF bapi0012_ccinputlist.
LOOP AT it_cc_getdetail INTO wa_cclist WHERE costcenter = wa_uebersicht-kostl .
ENDLOOP.
MOVE wa_uebersicht-owner_new TO wa_cclist-person_in_charge.
MOVE wa_uebersicht-owner_user_new TO wa_cclist-person_in_charge_user.
MOVE nextday TO wa_cclist-valid_from.
APPEND wa_cclist TO it_cclist.
CLEAR: wa_cclist.
CALL FUNCTION 'BAPI_COSTCENTER_CHANGEMULTIPLE'
EXPORTING
controllingarea = s_kokrs
* TESTRUN = ' '
* MASTER_DATA_INACTIVE = ' '
* LANGUAGE =
TABLES
costcenterlist = it_cclist
return = ret_cclist
* EXTENSIONIN =
* EXTENSIONOUT =
.
But when committing the changes some strange things happen. The new value for VERAK_USER is set for ALL validity periods, not only for the new one.
And instead of terminating the current validity period and creating a new one the following happens:
- current validity period is terminated correctly
- new validity period is created with valid_from = next day (correct) but valid_to = 99.99.3112
- another new record with validity from 02.01.0001 to 31.12.9999 is created

Can anyone please tell me what I'm doing wrong? Or has someone a complete example? I already read everything in SCN about this BAPI but didn't find the cause. Your help is appreciated a lot and rewards will be given.
Thank you in advance.
Kind regards
Susan