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 : <n> type x.
data : rn type i.
c = 'A'.
assign c to <n> casting.
move <n> 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 : <n> type x.
data : rn type i.
assign c to <n> casting.
move <n> to rn.
write rn.

*going from 66 to B

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

Tom Demuyt

Related ABAP Topics:
Table CDHDR and CDPOS Usage

Get help for your ABAP problems
Do you have a ABAP Question?

SAP Books
SAP Certification, Interview Questions, Functional, Basis Administration and ABAP Programming Reference Books

More ABAP Tips

Main Index
SAP Basis, ABAP Programming and Other IMG Stuff
http://www.erpgreat.com

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.  The site www.erpgreat.com is in no way affiliated with SAP AG.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.