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: 

divide problem

former_member206721
Participant
0 Kudos
454

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

philipdavy
Contributor
0 Kudos
419
  • 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

Former Member
0 Kudos
419

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.

0 Kudos
419

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

0 Kudos
419
  • Go to your print program for smart forms and select the attribute radio button.

  • Check whether the Fixed point arithmetic is selected.

Regards,

Philip.

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

Philip.

0 Kudos
419

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

Thanks

Tahar

Former Member
0 Kudos
419

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

0 Kudos
419

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

Tahar