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

ASC Code

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

ASC Code

Postby Bluesky » Sun Jul 13, 2003 7:36 pm

Dear all,

Could you please tell me how to receive its ASC code for a character?
On the contrary,how to receive the character via ASC code?


Thanks
Bluesky
 

Postby Rich » Mon Jul 14, 2003 3:40 am

Create a structure:

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


Then,

Code: Select all
Move 'A' to w_Char.  Write W_Char-Ascii.

Move 67  to w_Char-Ascii.  Write w_Char.
.

Then, once you've copied that. search this forum.... and see how many times this question has been asked. And once you've done that, follow the link in my signature.

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

Postby Bluesky » Mon Jul 14, 2003 6:09 am

Thanks rich,

But the result is 41 when A and
')' when 41

How does it happened?

thanks
Bluesky
 

Postby Rich » Mon Jul 14, 2003 6:23 am

41 is 65 Hex, 41 decimal is 29 hex.

If you want the decimal values, just move the result to an integer.

Code: Select all
Data w_int type i.
Move w_Char-Ascii to w_int.
.

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

Postby Bluesky » Mon Jul 14, 2003 7:14 pm

Hi rich,


Thank you very much!
I have solved my problem by your method .



Thanks
Bluesky
 

Postby Guest » Tue Jul 15, 2003 2:29 am

ah well, I remember the good old days when I could do aritmentic in Hex without a calculator. For future reference, check out http://www.asciitable.com/
Guest
 

Postby Rich » Tue Jul 15, 2003 3:37 am

Anonymous wrote:ah well, I remember the good old days when I could do aritmentic in Hex without a calculator. For future reference, check out http://www.asciitable.com/


Hex ??? Hex ?????

Binary mate!
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 11 guests





loading...


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