2010年5月11日 星期二

ABAP : 如何轉換ASCII code與字元

From : http://www.sap-img.com/abap/how-can-i-get-ascii-value-of-any-letter.htm

report Demotest.

* 1.將字元轉成ASCII code

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

* 2. 將ASCII code轉成字元

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.

沒有留言: