Skip to Content
avatar image
Former Member

How to convert one data type to another data type in ABAP programing

Hi expert,

I am facing the problem while data is moving is from one data type(I, P, F) to CHAR data type then I am getting '#' and not getting proper value.

So how to get the proper value ?

either any Function module for conversion exit avilable or any other alternate avilable.

Could anyone suggest me on this.

Waiting for quick response.

Best Regards,

Bansi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 08, 2009 at 08:03 AM

    Hi,

    To Convert Float value to char value to send in final file use following FM:

    CALL FUNCTION 'FLTP_CHAR_CONVERSION'
              EXPORTING
                decim = 2
                expon = 0
                input = char_value
                ivalu = 'X'
              IMPORTING
                flstr = v_char.

    In input youu can specify value with float data type

    Regards

    Shrila

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 08, 2009 at 07:55 AM

    Check the length of your CHAR data type...................its length might be less than ur value.........

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 08, 2009 at 07:59 AM

    Dear Bansi,

    Declare Character Type Data with length as follows:

    DATA M_FIELD(100) type c.

    It will automatically adjust the other data type values.

    regds,

    Anil

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 08, 2009 at 09:08 AM

    Hi,

    Firstly, check the length of the character field. It should be adequate. And also use write or move statement instead of '='.

    regards,

    Sourav

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 08, 2009 at 09:13 AM

    Hi Bansidhar Padhy,

    try this FM 'CONVERSION_EXIT_ALPHA_INPUT'

           call function 'CONVERSION_EXIT_ALPHA_INPUT'
              exporting
                input         = import data
              importing
                output        = export data
    

    Regards,

    Davide

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 08, 2009 at 10:04 AM

    Hi Bansi,

    you can do in the following way...

    DATA: text(40) TYPE c,

    data1 type i.

    data1 = 43462.

    text = data1.

    i hope u will get some help..

    Thanks & Regards

    Ashu Singh

    Add comment
    10|10000 characters needed characters exceeded