Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

divide problem

former_member206721
Participant
0 Likes
1,656

Hello friends

im experiencing a divide problem   im dividing 

    divide      gv_tot_rem_dev   by    gv_taux.   and it is giving me always zero   instead of  -37.50

gv_tot_rem_dev  is type  kawrt     curr 15    2 dec   value of the field at divide time  is     24599.62-

gv_taux                 is type kkurs      dec  9    and    5 decimals. value is                            655.95700

i dont know  why , so if you can help me in this it will be great

Tahar Yacoub

1 ACCEPTED SOLUTION
Read only

philipdavy
Contributor
0 Likes
1,620
  • When you create a new program, you have to check the fixed point arithmetic check box. Please find the attached screen shot.

Philip.

7 REPLIES 7
Read only

Former Member
0 Likes
1,620

hi tahar,

i am getting the result as 37.50- when I execute the following code:

DATA: gv_tot_rem_dev  type  kawrt,
       gv_taux type kkurs,
       result type p LENGTH 15 DECIMALS 2.


gv_tot_rem_dev = '-24599.62'.
gv_taux = '655.95700'.
      
result = gv_tot_rem_dev / gv_taux.
      
write: / result.  



May be you are making some mistake. It is better you cross check it.

Read only

0 Likes
1,620

I did the samething than you in a small program  and it works fine  but not in my f=driver program for the PO PRINT PROGRAM  FOR SMARTFORMS WHY I DO NOT KNOW ?

Tahar

Read only

0 Likes
1,619
  • Go to your print program for smart forms and select the attribute radio button.

  • Check whether the Fixed point arithmetic is selected.

Regards,

Philip.

Read only

philipdavy
Contributor
0 Likes
1,621
  • When you create a new program, you have to check the fixed point arithmetic check box. Please find the attached screen shot.

Philip.

Read only

0 Likes
1,619

Yes that is the problem , i checked the fxed point arithmetic  and is ok now. It was driving me nuts

Thanks

Tahar

Read only

Former Member
0 Likes
1,619

Hi,

If you have not checked fixed arithmetic checkbox, then other solution is divide the result amount always by 1000. This is will give you correct result.

Regards,

Pravin

Read only

0 Likes
1,619

Thank you very much for your valuable answer . I prefer to go with  checking the arithmetic box.

Tahar