Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Wrong amount in calculation in ABAP code.

Dear Friends,

                   Here i am facing one issue on ABAP multiplication code.

for your reference you can see below.

code is:

it_ekpo-netwr = 741.67

dkwert           = 10.00

g_excise1 = ( it_ekpo-netwr / 100 )  * dkwert.

when i execute above line the answer should come  g_excise1  = 74.20 but instead of 74.20 answer coming 7420.00.

.actually all the variables are same data types.  kindly anyone suggest me what is the reason behind this? above program type is executable program.

but  another program ( Type Subroutine pool ) same logic and same block is working well. only Program type is difference.

Regards,

  Thangam.P

Former Member
replied

Hi Perumal,

Check you program attributes->Fixed point Arithmetic  Check box should be checked otherwise the calculations will not be accurate.

I tried an example like below.

Case1 : Fixed point Arithmetic Checked

data : lv_netwr TYPE BPREI VALUE '741.67'.

DATA : lv_drk TYPE BPREI VALUE '10.00'.

DATA : lv_val TYPE BPREI.

lv_val = ( lv_netwr / 100 ) * lv_drk.

WRITE : / lv_val.

OUTPUT :  74.17

Case2 : Fixed point Arithmetic UnChecked

OUTPUT :  7,420.00

Once check and revert.

Regards,

Pavan

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question