‎2007 Jul 31 2:39 PM
Hi all,
can you please explain me how to use hexadecimal value in a program. I dont know how to proceed with hexadecimal stuff. My requirement is i have to check if the hexadecimal value of a character is '000A'. How to implement this in the program.
POINTS PROMISED
regards,
Buvana
‎2007 Jul 31 2:49 PM
hi,
FM for converting Char to HEXA.
CONVERT_FROM_CHAR_SORT_RFW
then compare the rerun value with '000A'.
Rgds
Reshma
‎2007 Jul 31 4:45 PM
Hi,
Here you go.
<b>
*-- CONVERT FROM CHAR TO HEX...</b>
DATA : hex TYPE x .
DATA : v_char TYPE c.
v_char = 'A'.
CALL FUNCTION 'CHAR_HEX_CONVERSION'
EXPORTING
input = v_char
IMPORTING
hexstring = hex.
IF hex EQ '41'.
WRITE 'cORRECT'.
ENDIF.
<b>
*cONVERT FROM hEX TO cHAR OR STRING.</b>
data: char(3) type c,
hex type x.
field-symbols <fs> type any.
hex = '41'.
assign hex to <fs> casting type c.
char = <fs>.
write:/ char.
Thanks
mahesh
‎2007 Aug 01 6:00 AM
Hi Buvana,
Here is ur solution.Just copy this code and execute.
data: d_string_char(1),
d_string_hex(10).
field-symbols: <fs>.
* here d_string_char contains the string value
* for example:
d_string_char = 'A'.
assign d_string_char to <fs> type 'X'.
write <fs> to d_string_hex.
write d_string_hex.Regards
Anversha