2005 Jul 22 5:36 AM
hi all,
I would like to know how we could relate c type and x type in ABAP.
In terms of size specification.
Thank you all
prasad.
2005 Jul 22 5:50 AM
Hi Prasad,
Consider the following code snippet -
data : char type c,
hexa type x.
Now, both these variables are of 1 byte each. However, they store different kinds of data, so we have -
hexa = '41'.
write : hexa to char.
write: char , hexa.
hexa is going to store the hexadecimal number 41. (the decimal equivalent is 65). The first write statement does the automatic type conversion. so we get the 65th ASCII character in the character variable (which is the capital A).
Hope that helps.
Regards,
Anand MAndalika.
2005 Jul 22 5:50 AM
Hi Prasad,
Consider the following code snippet -
data : char type c,
hexa type x.
Now, both these variables are of 1 byte each. However, they store different kinds of data, so we have -
hexa = '41'.
write : hexa to char.
write: char , hexa.
hexa is going to store the hexadecimal number 41. (the decimal equivalent is 65). The first write statement does the automatic type conversion. so we get the 65th ASCII character in the character variable (which is the capital A).
Hope that helps.
Regards,
Anand MAndalika.
2005 Jul 22 6:56 AM
Hi,
For character.
Data:<var> TYPE C,
<var(10) TYPE C.
For Hexa,
Data: <var> TYPE X.
Also go through this function CHAR_HEX_CONVERSION for your understanding for converting character to Hexa.
Regs,
Venkat