cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Integer to Hexadecimal

Calcifer
Explorer
0 Kudos
124

Hi Experts,

Hope you're having a good day!
Just wanted to ask how do you convert an integer to hexadecimal?
Currently I have this line of code.

DATA(lt_tabix) = sy-tabix.

which is then used to compare a hexadecimal value.

LOOP AT lt_table ASSIGNING FIELD-SYMBOL(<fs_var>) WHERE hex = lt_tabix

It will give me an error since 10 is not 0000000000000010 in hexa.
Really appreciate your replies in advance.

View Entire Topic
Sandra_Rossi
Active Contributor
0 Kudos

It works as expected, the line is found:

TYPES:
  BEGIN OF ts_itab_line,
    hex TYPE x LENGTH 8,
  END OF ts_itab_line.
TYPES tt_itab TYPE STANDARD TABLE OF ts_itab_line WITH EMPTY KEY.
DATA(itab) = VALUE tt_itab( ( hex = '000000000000000A' ) ).
LOOP AT itab ASSIGNING FIELD-SYMBOL(<line>) WHERE hex = 10.
  WRITE / 'found'.
ENDLOOP.