cancel
Showing results for 
Search instead for 
Did you mean: 

Comparison with a float field

Former Member
0 Kudos

Hi,

I have to compare two float fields, one fetched from database and one passed as importing parameter.

Now, i get "0.1" as a value in importing parameter for comparison. and the same is stored in the database, i.e. "0.1".

But when I put a select query on the table and read the value, the value i get is 9.9999999999999995E-02.

as a result, my comparison fails and the rest of logic crumbles.

I am aware of the usual standard - not to compare two float variables, but in this case, it is a equipment reading - it has to be in float, which i am comparing against a threshold, which again has to be float.

Is there any way to fix this through ABAP program?

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member199125
Active Contributor
0 Kudos

I think ,

you have to use conversion exits then you have to compare.

Regards

Srinivas

Former Member
0 Kudos

There are no conversion exits for floating type of data fields.

The fields used for comparison are MRMIN, and MRMAX from the table IMPTT.

Former Member
0 Kudos

There are no conversion exits for floating type of data fields.

The fields used for comparison are MRMIN, and MRMAX from the table IMPTT.

Former Member
0 Kudos

I am not sure about it but you could try to assign them to a variable of type p and then compare them.