This website is not affiliated with, sponsored by, or approved by SAP AG.

Convert to ascii

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Convert to ascii

Postby Faith » Tue May 27, 2003 6:58 am

Hi all,

I would like to know whether there exists any Function module which returns me the ascii value of any character entered.



Thanks & Regards.
Faith.
Faith
 

Postby Rich » Tue May 27, 2003 7:06 am

Code: Select all
Data: Begin of w_char,
            Ascii type x,
      End of w_char.

Move 'A' to w_char.
Write :/ w_char-Ascii.
Move 66 to w_char-Ascii.
Write :/ w_char.


This has been answered many times in this forum.....

Rich

[/code]
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com
Rich
 
Posts: 7112
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool

Postby Rich » Tue May 27, 2003 7:07 am

Code: Select all
Data: Begin of w_char,
            Ascii type x,
      End of w_char.

Move 'A' to w_char.
Write :/ w_char-Ascii.
Move 66 to w_char-Ascii.
Write :/ w_char.


This has been answered many times in this forum.....

Rich

[/code]
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com
Rich
 
Posts: 7112
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool

Postby Faith » Tue May 27, 2003 7:13 am

Thanks Rich.

Thats very nice of u.
:)
Faith
 

Postby Prowl » Sun Jun 01, 2003 10:01 pm

How come it returns the HEX value and not the ASCII value?
Prowl
 
Posts: 54
Joined: Thu Feb 13, 2003 3:27 am
Location: Antarctica

Postby Rich » Mon Jun 02, 2003 2:51 am

It does return the Ascii Value. In Base 16.

You're getting mixed up with base and encoding schemes.

Bases are things like binary, decimal and hexedecimal. Ascii if it was expressed as a base would be base 128 or base 256 for extended ascii.

Encoding schemes include things like Ascii and Ebcdic where 7 or 8 bit numbers are used to represent a character.

Rich
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com
Rich
 
Posts: 7112
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool


Return to ABAP

Who is online

Users browsing this forum: No registered users and 5 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.