2018 Nov 27 1:54 PM
Hello guys,
is there any function which can split some inputed yearly amount into the 12 periods? Of course I can do this like calculate amount /12 but I have the problem with rounding. It can happen that the sum of the months amounts is bigger than the original inputed yearly amount. And I do not want to just add the difference to the last months. I prefer doing it like e.g. transaction CJR2 which puts e.g. the value 50000 EUR like:
01 4.166,67
02 4.166,66
03 4.166,67
04 4.166,67
05 4.166,66
06 4.166,67
07 4.166,67
08 4.166,66
09 4.166,67
10 4.166,67
11 4.166,66
12 4.166,67
How can I rebuild this?
Regards
Michael
Hello guys,
is there any function which can split some inputed yearly amount into the 12 periods? Of course I can do this like calculate amount /12 but I have the problem with rounding. It can happen that the sum of the months amounts is bigger than the original inputed yearly amount. And I do not want to just add the difference to the last months. I prefer doing it like e.g. transaction CJR2 which puts e.g. the value 50000 EUR like:
01 4.166,67
02 4.166,66
03 4.166,67
04 4.166,67
05 4.166,66
06 4.166,67
07 4.166,67
08 4.166,66
09 4.166,67
10 4.166,67
11 4.166,66
12 4.166,67
How can I rebuild this?
Regards
Michael
2018 Nov 27 3:34 PM
In some DO/LOOP you memorize amount to split and number of record to generate
amount = total_amount. " work area
number = total_number.
WHILE number GT 0.
IF number = 1. " last record, no rounding
value = amount.
CLEAR amount.
ELSE.
value = amount / number. " rounding allowed
SUBTRACT value FROM amount.
ENDIF.
" save value somewhere
SUBTRACT 1 FROM number.
ENDWHILE.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |