Skip to Content
-1

Dealing with FLTP type

Jun 09, 2017 at 03:01 PM

91

avatar image

I have a table which has 3 columns of type FLTP (length 16, decimal places 16)

Now i need a simple report which should take the input from user for these 3 fields and update the table.

To take the input, SAP wont allow to create selection screen with FLTP type.

so what are my options here, i tried creating the parameters with type P but when i moved the value into table field, the values gets modified.

Example : 0.25435 is being converted to 2,5435000000000002E-01

10 |10000 characters needed characters left characters exceeded

PS: I'm surprised that SAP describes FLTP as being "length 16 and 16 decimal places" (in the DDIC table, data element and domain screens). The only true fact is that it occupies 8 bytes, and has a precision of 15 digits.

1

You are right.

For whatsoever reasons these attributes have to be filled when defining data types in the dictionary. Could also be left blank. Similar for the INTs.

I will add a note under https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abenddic_builtin_types_int_pack.htm

2
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Horst Keller
Jun 09, 2017 at 04:12 PM
1

"but when i moved the value into table field, the values gets modified"

This has nothing to do with selection screens but reflects the well known and documented fact, that you cannot express any decimal number as a binary floating point number.

See CL_ABAP_MATH how to round.

Share
10 |10000 characters needed characters left characters exceeded
Sandra Rossi Jun 09, 2017 at 08:19 PM
0

If you need to store exact decimal values, don't use a FLTP field in your database table, use a DEC (or QUAN/CURR if it's a quantity/currency) or a decimal floating point number (DF16* or DF34*) field. PS: FLTP is a binary floating point number.

Share
10 |10000 characters needed characters left characters exceeded