cancel
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.

Eg:

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 |
20.04.2009|30.2009|1428.57
21.04.2009|30.2009|1428.57
22.04.2009|30.2009|1428.57
23.04.2009|30.2009|1428.57
24.04.2009|30.2009|1428.57
25.04.2009|30.2009|1428.57
26.04.2009|30.2009|1428.57

Any help would be appreciated.

Thanks

POPS

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

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....

Regards

vamsi

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

Former Member
0 Kudos

Hi,

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.

shanthi_bhaskar
Active Contributor
0 Kudos

please write this code in start routine of the transforamtion

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

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.

enddo.

endloop.

clear result_pacakge.

result_package[] = itab[].

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

Regards

vamsi

Former Member
0 Kudos

Thanks Vamsi,

I will try this code and let you know..

Thanks Again.

POPS