cancel
Showing results for 
Search instead for 
Did you mean: 

fox needed

Former Member
0 Kudos

Dear SDN,

the standard planning functions does not allow conditions.

Please could you provide me the fox codes for a top down distribution (by reference).

I believe there should be a standard set of fox codes to perform the same as the planning function.

thanks in advance.

regards

auper.

Accepted Solutions (1)

Accepted Solutions (1)

Soulsurfer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi.

We have to write our own distribution by reference function, because it doesn't work properly when part of data is locked by a dataslice. In our case locking have been made on 0calmonth

Operands: {Key Figure Name,Calendar Year/Month,ZPLAT001}. ZPLAT001 is characteristic like 0sem_posit. ZPLAK004 - is keyfigure containing reference data.

Value to be distributed is in {0AMOUNT,#,200}. ZPLAT001 = 208 contains reference data. ZPLAT001 = 209 are the target values.

Variables for 0calmonth: ZPLAPV17 - all months on which we have to distribute amount, ZPLAPV34 - months which aren't locked yet by dataslice (filled by FM)

The main problem is that we cann't redistribute amounts on locked months. Locking is made because we have fact in this months already. So we have to make distribution only on non locked months, but taking into account already distributed amounts on locked months. This code is written below:

DATA MON TYPE 0CALMONTH.
DATA I TYPE I.
DATA C TYPE I.
DATA SQ TYPE F.
DATA S TYPE F.
DATA SP2 TYPE F.
DATA SQ2 TYPE F.

 I = 1.
 C = VARC('ZPLAPV17').
 DO.
  IF I > C.
   EXIT.
  ENDIF.
  MON = VARI('ZPLAPV17',I).
  SQ = SQ + {0AMOUNT,MON,209}.
  I = I + 1.
 ENDDO.

 I = 1.
 C = VARC('ZPLAPV34').
 DO.
  IF I > C.
   EXIT.
  ENDIF.
  MON = VARI('ZPLAPV34',I).
  SP2 = SP2 + {ZPLAK004,MON,208}.
  SQ2 = SQ2 + {0AMOUNT,MON,209}.
  I = I + 1.
 ENDDO.

S = SQ - SQ2.
S = {0AMOUNT,#,200} - S.

 I = 1.
 C = VARC('ZPLAPV34').
 DO.
  IF I > C.
   EXIT.
  ENDIF.
  MON = VARI('ZPLAPV34',I).
 {0AMOUNT,MON,209} = S * {ZPLAK004,MON,208} / SP2.
   I = I + 1.
 ENDDO.

I hope this code is helpful. Don't forget a standart gratitude of SDN

Message was edited by:

Andrei Bushkevich

Former Member
0 Kudos

Thanks Andrei,

Points awarded for your helpful answer!

I am unclear how should it be determined how many or what characteristics to be included in a {kf,abc,xyz,nn....}

Please continue your good advice.

thanks!!

CLJ

Soulsurfer
Product and Topic Expert
Product and Topic Expert
0 Kudos

There is a great doc about FOX: <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9af68206-0801-0010-029c-c586c707fc80">Tips and tricks for FOX formulas in BW-BPS.</a>

Answers (1)

Answers (1)

Former Member
0 Kudos

There is a standard distribution function available. Use that. FOX will be quite complex for this.