Showing results for 
Search instead for 
Did you mean: 

Split records from FISCALWEEK to CALDAY - need some ABAP help

Former Member
0 Kudos

Hi Gurus,

I am trying to load Budgets data into a cube via DSO.

The problem here is i have budgets data aggregated at FISCALWEEK level. but i need to split this data into 7 equal days and update 7 recrods in cube. Total amount should be divided by 7.


Data in DSO is

WEEK | Cost |
*30.2009 | 10000|*
29.2009 | 12000|

Now i need to split these budgets into Day level and load to the cube.

CALDAY | WEEK | Cost |

Any help would be appreciated.



Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos


Use this function module WEEK_GET_FIRST_DAY to get the first day of the week based on the calweek.

U will give calweek as input and u will get the first day of the week and based on that u can split the amount / 7 and increment date upto 6 more days and keep the amount/7 value for all....

and 30.2009 the start date of this week is 20.07.2009 ..

this function module will bring for calweek but not fiscalweek....but for 30.2009 the start date will not be 20.04.2009 it may be around 20.10.2009 i guess ...........

hope this helps....



Edited by: vamsi talluri on May 6, 2009 10:40 AM

Former Member
0 Kudos


Using FIRST_DAY_IN_PERIOD_GET will give you the first day of the fiscal week.

You have to split your WWW.YYYY input into Week and Year seprately and input along with your weekly FISCVARNT.

Former Member
0 Kudos

Thanks Vamsi and Praveen for your replies.

I tested the FM 's you both have suggested. For my requirement the FIST_DAY_IN_PERIOD_GET suits well.

But i am little confused about where to write this code in my transformations ???

In BW3.x we used to have a Return Table functionality. Now in BI 7 i dont know how i can achieve that.

Any thoughts on this please.

Active Contributor
0 Kudos

please write this code in start routine of the transforamtion

Answers (1)

Answers (1)

Former Member
0 Kudos


U can solve using end routine............first map fisc week and cost of dso to fisc week and cost of dso one to one mapping also take fiscal varaint......and in the end routine we will split the amount/7 and add start date of week to one more internal table and in this internal table we will update the other fields also..

this internal table is of the target structure i.e.the cube structure and once all the records are sent to the internal table we will flush the result_package and then the data from internal table to the result_package....

it will work...

some sample coding...

data : itab_ty type tys_TG_1.

data : itab type standard table of itab_ty,

wa_itab like line of itab.

data : l_calday type /bi0/calday.

data : wa_result_package type tys_TG_1.

sort result_package by /bi0/fiscweek ascending. ( use proper technical name)...

loop at result_package into wa_result_package.

call FIRST_DAY_IN_PERIOD_GET ( give all conditions and get the start date suppose it is l_calday)

exporting l_calday.

do 7 times.

wa_itab-calday = l_calday.

wa_itab-fiscweek = wa_result_pacakge-fiscweek.

wa_itab-amount = wa_result_pacakge-amount / 7 .

l_calday = l_calday + 1.

****use proper technical names and if any more fields send to wa_itab ....

append wa_itab to itab.



clear result_pacakge.

result_package[] = itab[].

i almost gave all the code use proper technical names and the function module calling statements...



Former Member
0 Kudos

Thanks Vamsi,

I will try this code and let you know..

Thanks Again.