Hi,
I have written a fox formula which copies some information from one cube to another - but the time characteristic is different from the source cube to destination cube. The source cube is planned in weeks whereas the destination cube is in fiscal year/period.
I have a function module which works out the fiscal year/period from the weeks characteristic.
My problem is when I loop around the data using the 'FOREACH' statement - the data overwrites itself for each period. This is because I have a for each statement on the weeks so it loops around the weeks - translates it into period/year and then loops around the next record and translates this into period/year; and when this period/year is the same as one its already looped around (can have many weeks into period) then it overwrites the value - but I need for it to add to the KF value not overwrite!
I need to loop around the fisc year/period but I don't have this value available in the source cube to do this. Any ideas? Please see sample code below:
FOR EACH cha_engagement, cha_weeks.
cha_date = ATRV( 0datefrom, cha weeks ).
CALL FUNCTION 'DATE to PERIOD CONVERT'
EXPORTING
date = cha_date
IMPORTING
fiscal_yp = cha_fisc_per.
{KF,#,#,#, cha_fisc_per,#,#,#} = {KF,#,#,#,0000000,#,#,cha_weeks}.
ENFOR.