cancel
Showing results for 
Search instead for 
Did you mean: 

Rounding off a value in smartform

Former Member
0 Kudos

Hi all,

I want to round off a value in smartform. I have a field which has a data type FLTP length 16 and dec 16.

If the value of the field is 459600, then it displays something like 4,596 + E7 but I want to display it like 4,59600.

I am using a smartform.

How can I do it?

Points will be awarded immediately.

Regards,

Nikhil Moghe

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Try using the formatting options to avoid the exponential sequence.

like &itab-fld1(E0)& or &itab-fld1(E)&

Chk out and reward if helpful!!

Regards,

Narendra.

Former Member
0 Kudos

Hi,

Use THis FM

&----


*& Form sub_fltp_to_char *

&----


This form converts cycle from floating to character format *

-


FORM sub_fltp_to_char .

*--Local constants

CONSTANTS: lc_dec TYPE i VALUE 0.

*--Clear Variable

CLEAR v_cycle.

IF NOT v_unit IS INITIAL.

*--Call function module to convert cycle & offset from floating to

character

CALL FUNCTION 'FLTP_CHAR_CONVERSION_FROM_SI'

EXPORTING

char_unit = v_unit

decimals = lc_dec

fltp_value_si = v_offset

indicator_value = c_check

IMPORTING

char_value = v_cycle

EXCEPTIONS

no_unit_given = 1

unit_not_found = 2

OTHERS = 3.

IF sy-subrc 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

ENDIF. "IF NOT v_offset IS INITIAL.

ENDFORM. "sub_fltp_to_char