Friday, November 23, 2007

sap abap program for How can I get Ascii value of any letter

How can I get Ascii value of any letter. Is there any function?

This is how you do it :

report demtest.
data : c.
field-symbols : type x.
data : rn type i.
c = 'A'.
assign c to casting.
move to rn.
write rn.

This will convert 'A' to 65.

Tom Demuyt

How to convert ascii value to character.

If I give input as 65 (ascill value) I want display 'A'.

Below logic is for convert from character to ascii value , now I want to know how to convert ascii value to character.

Naveen

report demtest.

*going from A to 65

data : c value 'A'.
field-symbols : type x.
data : rn type i.
assign c to casting.
move to rn.
write rn.

*going from 66 to B

data : i type i value 66.
data : x type x.
field-symbols : type c.
move i to x.
assign x to casting type c.
move to c.
write c.

No comments:

Blog Archive