on 11-12-2007 3:53 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is a standard distribution function available. Use that. FOX will be quite complex for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.