Application Development 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: 

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

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

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

regards,

Sourav

former_member998879
Participant
0 Kudos

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

Former Member
0 Kudos

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