cancel
Showing results for 
Search instead for 
Did you mean: 

Fox Formula

Former Member
0 Kudos

Hello Forum,

I have Fiscal year and Groupaccount in my lead column of my Planning Layout, in BW-BPS

Fiscal year Grpac

2008 A

2008 B

2008 C=A-B

Here i need to subtract the values of A and B and store it to C. Can some one help me with writing the fox formula in order to solve it.

Regards,

KK

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Is groupaccount keyfigure or characteristic?

If you want to get the difference of two keyfigures to be stored in other keyfigure for the same characteristic selections for all the keyfigures, fox code is very simple. Just keep 'keyfigure name' in fields to be changed, and in the fox code write

= - .

For more details of the syntax of fox code, press F1 in fox editor.

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Bindu for your help,

regards,

KK

Former Member
0 Kudos

Hello Bindu,

Thanks for the code, Can you plz tell me whether this code will also work, Bcoz currently now i dont have any data to test.

DATA A TYPE GRPACT.

DATA B TYPE GRPACT.

DATA C TYPE GRPACT.

A = VARC(GRPA).

B = VARC(GRPB).

C = VARC(GRPC).

{IFIAMTPER,C} = {IFIAMTPER,A} - {IFIAMTPER,B}.

Here i am maintaining the values of GRPACT A and B seperately in Planning variables GRPA and GRPB.

regards,

KK

Former Member
0 Kudos

yes, your code will work.

Former Member
0 Kudos

Hello Bindu,

Group account is an characteristic value, we are maintaining values for group accounts A and B seperately. we have only one keyfigure in the data column amtper, which brings in data for all the group accounts.

so i need to bring subtracted data for goup account c into KF AMTPER from grpaccounts A and B which is also maintained in KF AMTPER.

Plz suggest,

regards,

KK

Former Member
0 Kudos

Fine, then keep groupaccount and keyfigure name in fields to be changed and give coding like this.

DATA amountA TYPE I.

DATA amountB TYPE I.

Foreach GroupAccount.

If GroupAccount = 'A'.

amountA = {kf,GroupAccount}.

Else.

If GroupAccount = 'B'.

amountB = {kf,GroupAccount}.

Endif.

Endif.

Endfor.

{kf,'C'} = amountA - amountB.