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

Re-FLOATING POINT VALUE CONVERSION.

Former Member
0 Likes
3,133

Hi,

I have value lile this : 1.000000000000000E03, or 1.090000000000000E02 , is there

any function module to convert it into actual value like 1,00.00 or 1,099.00 etc.

Thanks in advance.

Shyam.

5 REPLIES 5
Read only

Former Member
0 Likes
1,671

Hi,

Check the following code:

data: fld1 type f value '1.000000000000000E+03',

fld2 type p decimals 2.

fld2 = fld1.

write:/ fld1,

/ fld2.

Regards,

Bhaskar

Read only

Former Member
0 Likes
1,671

Hi,

Try with this fm C14W_NUMBER_CHAR_CONVERSION

Regards

Debarshi

Read only

Former Member
0 Likes
1,671

hi

call fm CONVERT_WITH_OVERFLOW_CHECK.

data lv_num type f .

data: p10_4(10) type p decimals 4.

lv_num = 27.

CALL FUNCTION 'CONVERT_WITH_OVERFLOW_CHECK'

EXPORTING

i_value = lv_num

I_UNIT = ' '

I_KRUND = ' '

IMPORTING

E_VALUE = p10_4

EXCEPTIONS

UNIT_CONVERSION_ERROR = 1

WRONG_E_VALUE_TYPE = 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.

the variable p10_4 will be having your result. its format will be driven by the type you have taken.

regards

Vishal Kapoor

Read only

Former Member
0 Likes
1,671

Hi,

try this FM...


DATA: num TYPE qsollwertc.

CALL FUNCTION 'QSS0_FLTP_TO_CHAR_CONVERSION'
  EXPORTING
    i_number_of_digits = 3
    i_fltp_value       = '4.3500000000000000E+00'
*   I_VALUE_NOT_INITIAL_FLAG       = 'X'
*   I_SCREEN_FIELDLENGTH           = 16
IMPORTING
e_char_field                   = num
.
WRITE: num.

Arunima

Read only

Former Member
0 Likes
1,671

Thanks all