Skip to Content
0
Former Member
Sep 04, 2010 at 11:23 AM

BPS FOX Formula to copy data from one period to range of reriod.

650 Views

Hi all,

I need help in writing fox formula for the following requirement.

I want to copy records from one period to a range of period. for example..

Existing data:

C.code, SKU, CG, fiscper, amount

1000, M1, CG1, 001.2010, 120.10

Desired result:

C.code, SKU, CG, fiscper, amount

1000, M1, CG1, 002.2010, 120.10

1000, M1, CG1, 003.2010, 120.10

1000, M1, CG1, 004.2010, 120.10

My design:

1. I created the following variables in planning area

a) "refperiod" and assigned value i.e.last month.(user exit)

b) "rangeperiod" which is being populated via user exit from 2 other variables values ("fromperiod" & "toperiod")- users will feed value of these 2 variable while executing planning function.

2. I used "rangeperiod" variable as a value of period char in Planning level.

3. "Key figure" and "fiscper" are selected as "Fields to be changed" in planning function.

4. I have written the following FOX in Parameter group.

DATA ref_per TYPE 0fiscper.

DATA range_per TYPE 0fiscper.

DATA Amt type F.

ref_per = varv ( "refperiod").

Amt = ( 0amount, ref_per).

FOREACH range_per.

( 0amount, range_per) = Amt.

ENDFOR.

In cube, there is a value for 0amount KF for reference period.

When I execute planning function, I see message records read 0, changed 0 and generated 0.

Can you guys help me in correcting my fox?

Thanks,

SAC

Edited by: SAP ACCOUNTANT on Sep 4, 2010 2:21 PM

Edited by: SAP ACCOUNTANT on Sep 4, 2010 2:30 PM