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

floating values multply

Former Member
0 Likes
508

hi friends,

How to multyply floating point values.

what is the data type.

example:

t_final-diff : currency value.

t_final-lbkum : mbewh-lbkum field

t_final-tstock = t_final-diff * t_final-lbkum

near above statement programe go to dump.

please floating values how to multiply and what is the data type.

4 REPLIES 4
Read only

Former Member
0 Likes
484

what is the currency field data type.

Read only

Former Member
0 Likes
484

Hi,

Declare t_final-tstock as TYPE P DECIMALS 2 ( Decimalsa as per ur requirement).

I think dump is because of field length.

You declate t_final-tstock as TYPE P then try once.

Regards,

Rajitha.

Read only

Former Member
0 Likes
484

Hi,

Check this:

DATA:
  W_F1 TYPE P DECIMALS 2 VALUE '100.12',
  W_F2 TYPE F VALUE '200.15',
  W_F3 TYPE P DECIMALS 2.

W_F3 = W_F1 * W_F2.
WRITE: W_F3.

Regards

Adil

Read only

Former Member
0 Likes
484

hi,.....

in declaration for ariables go for type p decimals 2 instead of floating point numbers..you will get calculation accuracy and it will also avoid dump...

just check.....