Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

hexadecimal declaration.

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

hi,

FM for converting Char to HEXA.

CONVERT_FROM_CHAR_SORT_RFW

then compare the rerun value with '000A'.

Rgds

Reshma

Former Member
0 Kudos

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

anversha_s
Active Contributor
0 Kudos

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