Skip to Content
0
Former Member
Mar 16, 2007 at 09:47 PM

FOX Formula is not working fine.

17 Views

Hi all;

In the Cube I have the following data:

ZFAM ZSUM 0DC ZGA ZGG 0SO QUANTIY %

1 1 2 20 1 D1 0 0,222

1 1 2 20 1 D1 10 0

1 1 2 40 1 D1 0 0,444

1 1 2 40 1 D1 20 0

1 6 2 20 1 D1 0 0,333

1 6 2 20 1 D1 15 0

And the following fox code:

DATA SM TYPE ZSUM.

DATA CN TYPE 0DC.

DATA OV TYPE 0SO.

DATA EV TYPE ZGG.

DATA FAM TYPE ZFAM.

DATA GA TYPE ZGA.

DATA TOTAL TYPE F.

TOTAL = 0.

FOREACH CN,OV,FAM,GA,EV,SM.

TOTAL = TOTAL + {ZG_QVV010,CN,OV,FAM,GA,EV,SM,ZUNPLAVN}.

ENDFOR.

FOREACH CN,OV,FAM,GA,EV,SM.

{ZPESO2,CN,OV,FAM,GA,EV,SM,ZUNPLAVN} =

{ZG_QVV010,CN,OV,FAM,GA,EV,SM,ZUNPLAVN}/ TOTAL.

ENDFOR.

I want to calculate the weight of ZSUM for all the ZSUM’s, but (what I think the system is doing is to calculate for each master data).

This is:

For ZSUM 1 = 0,667

For ZSUM 6 = 0,333

I had already try to put:

FOREACH SM. (not to calculate the TOTAL)

But it didn’t work.

Can anyone know how can I fix it?

Regards;