on 08-07-2007 2:34 PM
Hi,
I would like to multiply a keyfigure with a percentage-value inside a loop. The code looks like this:
DATA QUARTAL TYPE 0CALQUARTER.
DATA PVALUE TYPE I.
PVALUE = { 0PERCENT, # ,'0000000000000500', 'I', YASPARA }.
FOREACH QUARTAL.
IF QUARTAL <> '#'.
{ 0AMOUNT, QUARTAL, '0000000000000700', # , YASPLAN } =
{ 0AMOUNT, QUARTAL, '0000000000000700', # , YASPLAN } * PVALUE.
ENDIF.
ENDFOR.
After i run the function, i always get 0 for all quarters although before the function there are different values. After debugging using a BREAK-POINT i found out that before the loop PVALUE is 30 and inside the loop becomes 0. Any suggestions why PVALUE is set to 0 in the loop?
Thanks,
Holger
Dear Hogler,
Can you once try adding this line after the statment PVALUE = { 0PERCENT, # ,'0000000000000500', 'I', YASPARA }. in your original code?
MESSAGE I001(UPF) WITH 'Percent is ' PVALUE.
and see what output you get?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
looks strange.There is nothing inside the loop which could make pvalue to 0.If you hardcode 30 in place of pvalue inside the loop will the function work? This is just to make sure that the other operand is not getting 0 value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ragav,
if i set PVALUE=30. it works fine. If i copy the whole expression ({ 0PERCENT, # ,'0000000000000500', 'I', YASPARA }.) inside the loop....
IF QUARTAL <> '#'.
{ 0AMOUNT, QUARTAL, '0000000000000700', # , YASPLAN } =
{ 0AMOUNT, QUARTAL, '0000000000000700', # , YASPLAN } *
{ 0PERCENT, # ,'0000000000000500', 'I', YASPARA }.
ENDIF.
its 0 again....
> looks strange.There is nothing inside the loop which
> could make pvalue to 0.If you hardcode 30 in place of
> pvalue inside the loop will the function work? This
> is just to make sure that the other operand is not
> getting 0 value.
sure.....
the cube with percent-values looks like this....
0SEM_POSIT / 0VERSION / YA_MIMPTY / 0DAY / 0CALQUARTER / 0AMOUNT / 0PERCENT / 0QUANTITY
0000000000000500 001 I 03.07.2007 0,00 30,000 0,000
0000000000000500 001 S 03.07.2007 0,00 30,000 0,000
0000000000000500 001 T 03.07.2007 0,00 40,000 0,000
the cube with amount-values looks like this....
0SEM_POSIT / 0VERSION / 0DAY / 0CALQUARTER / 0AMOUNT
0000000000000700 001 03.07.2007 20074 5.737,87
0000000000000700 003 03.07.2007 20074 5.737,87
0000000000000700 002 03.07.2007 20074 5.737,87
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.