Skip to Content
author's profile photo Former Member
Former Member

Any functinal Modul to Conver Flaoting number to String

Dear all

I need help i am using C14W_NUMBER_CHAR_CONVERSION FM to convert the floating vale to Character but i am getting run time error. coz it is not converting BIG values. I need to convert 9.9999999990000000E+09 this value to 9999999999.0000 any other simple way or any other FM is available plz help me anybody to resolve this issue.

Regards

ACJ

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 10:10 AM

    Use FM FLTP_CHAR_CONVERSION

    CALL FUNCTION 'FLTP_CHAR_CONVERSION'
          EXPORTING
            DECIM         = '3'
    *   EXPON         = 0
            INPUT         = WA_PLMK-TOLERANZOB
    *   IVALU         = ' '
    *   MASKN         = ' '
          IMPORTING
            FLSTR         = V_UPPER

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 10:12 AM

    hi,

    Chcek this

    data: val1 type ausp-atflv.

    data: val2 type p decimals 2.

    val1 = '1.1100000000000000E+00'.

    val2 = val1 .

    write val2.

    Check this link..convert-exponential-value-to-float

    Edited by: Avinash Kodarapu on Feb 27, 2009 3:44 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 10:17 AM

    ACJ,

    try with 'CHAR_FLTP_CONVERSION' FM

    data F type F.

    data C(20) type C value '9.99E-10'.

    Call function 'CHAR_FLTP_CONVERSION'

    exporting string = C

    importing flstr = F.

    Best Regards,

    Syf

    Edited by: syfulla shaik on Feb 27, 2009 3:49 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2009 at 10:35 AM

    Check this sample code.

    DATA:
      w_float TYPE atflv value '9.9999999990000000E+09',
      w_char(20).
    WRITE:
      w_float TO w_char EXPONENT 0 DECIMALS 4.
    CONDENSE w_char NO-GAPS.
    WRITE:
      w_char.                   " 9999999999.0000

    Regards

    Adil

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Adil i need to convert the value from internal table i cant do HOT code for that any FM is a beter way i think so

      actually i used the C14W_NUMBER_CHAR_CONVERSION FM

      it is giving exact result up to 999999999.0000 only after next 9 it is giving run time eroor all other also i tried but i am not getting.

  • Posted on Feb 27, 2009 at 10:50 AM

    Check this sample code,

    DATA:
      w_float TYPE atflv VALUE '9.9999999990000000E+09',
      w_char(20).
    CALL FUNCTION 'FLTP_CHAR_CONVERSION_FROM_SI'
      EXPORTING
        char_unit        = 'EA'
        unit_is_optional = 'X'
        decimals         = 4
        exponent         = 0
        fltp_value_si    = w_float
        indicator_value  = 'X'
        masc_symbol      = '_'
      IMPORTING
        char_value       = w_char
      EXCEPTIONS
        no_unit_given    = 1
        unit_not_found   = 2
        OTHERS           = 3.
    
    CONDENSE w_char NO-GAPS.
    WRITE:
      w_char.                   " 9999999999.0000

    Regards

    Adil

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 27, 2009 at 10:56 AM

    hi,

    use

     call function 'MC_FLTP_CHAR'  
              exporting
                fc_a_fld = wa_qamv-toleranzun  " ur floating variable
              importing
                fc_r_fld = l_v_low.   " ur string variable
    

    кu03B1ятu03B9к

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2009 at 11:01 AM

    To test, copy the code in SE38 and execute it. you will see the expected result.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 27, 2009 at 11:53 AM

    You can try this Function module.

    Check this Function module 'QSS0_FLTP_TO_CHAR_CONVERSION' in SE37

    or Run the below code in SE38

    DATA:
    w_float TYPE qsollwerte VALUE '9.9999999990000000E+09',
    w_char TYPE qsollwertc.
    
    CALL FUNCTION 'QSS0_FLTP_TO_CHAR_CONVERSION'
      EXPORTING
        i_number_of_digits       = 4
        i_fltp_value             = w_float
        i_value_not_initial_flag = 'X'
        i_screen_fieldlength     = 16
      IMPORTING
        e_char_field             = w_char.
    
    WRITE:
      w_char.                   " 9999999999.0000

    Regards

    Adil

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.