Dear experts,

I have a problem on an arithmetic equation that looks simple, but still ends up in an incorrect value. This arithmetic equation is written in a routine at VOFM -> Formulas -> Condition base value.

DATA: lv_scale_base_new TYPE p LENGTH 16 DECIMALS 3.
DATA: lv_whole_num TYPE i.
DATA: lv_new_kawrt TYPE kawrt.
* Values:-
* XKAWRT = '3117.00'
* LV_SCALE_BASE_NEW = '3.333'
* LV_WHOLE_NUM = '3'
lv_new_kawrt = xkawrt / lv_scale_base_new * lv_whole_num.
xkawrt = lv_new_kawrt.
* Values:-
* LV_NEW_KAWRT = '2.82'
* XKAWRT = '2.82'

What could I be doing wrong here? Any insights to this, please?

How can I resolve this issue?

The value of LV_NEW_KAWRT and XKAWRT should actually be '2805.58'.

P/S:-

When I ran the exact same codes separately in a new local program, the results are correct instead:- screen-2.jpg

REPORT z_qty_test.
DATA: lv_new_kawrt TYPE kawrt.
DATA: lv_xkawrt TYPE kawrt.
DATA: lv_scale_base_new TYPE p LENGTH 16 DECIMALS 3.
DATA: lv_whole_num TYPE i.
lv_xkawrt = '3117.00'.
lv_scale_base_new = '3.333'.
lv_whole_num = '3'.
lv_new_kawrt = lv_xkawrt / lv_scale_base_new * lv_whole_num.
WRITE:/ lv_new_kawrt.

## Add comment