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: 

Decimal to ASCII conversion

Former Member
0 Kudos

Hello,

Does anyone know whether these is a function module to convert between decimal and ascii representations of characters?

For example, the letter 'A' is '65' in decimal representation.

What I want to ba able to do is convert the '65' back to an 'A' within my code.

Thanks,

Ruby

2 REPLIES 2

former_member194669
Active Contributor
0 Kudos

report  zars no standard page heading
        line-size 170
        line-count 65(4).

data: content    type string ,
      xcontent   type xstring.

xcontent = '61'.
data: conv   type ref to cl_abap_conv_in_ce.
conv = cl_abap_conv_in_ce=>create( input = xcontent ).
conv->read( importing data = content ).

Here content contains the value "a"

0 Kudos

Hello,

Thank-you for your answer. It did answer my question but I have been looking into this a little more and have a further question for you.

I have just been looking at the ASCII Character set and it shows 'A' = 65 (rather than 61) and it is this conversion that I am really looking for.

I guess the method you have given me does some kind of conversion between hexadecimal representation and alphanumeric representation but what I am looking for I think is a conversion between decimal representation and alphanumeric notation.

Is there another method which provides this?

I have looked at the other methods on class cl_abap_conv_in_ce but I don't think any of them do what I need to do.

If you have any suggestions, please let me know.

Thanks,

Ruby