Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

offsets into hex string

Currently I am trying to concatenate multiple hex values from a tvarv into a single string. To do this I am trying to dynamically tell the code to write the values in specific positions but when I try to do this the compiler throws a warning that this is obsolete functionality and the debugger is showing value l_low(l_displace) below becomes l_low0. How do I pass a dynamic value to the offset?

DATA: l_low_temp(2000) type x,

l_low(2000) type x,

l_hex_tvarv(8) type x,

l_displace type i.

DATA: BEGIN OF lt_tvarv OCCURS 0,

low LIKE tvarv-low,

END OF lt_tvarv.

CLEAR: lt_tvarv, l_low_temp, l_low.

REFRESH: lt_tvarv.

SELECT low

INTO TABLE lt_tvarv

FROM tvarv

WHERE name = 'Z_EXCLUDE_HEX'.

DESCRIBE TABLE lt_tvarv LINES sy-tabix.

IF sy-tabix > 0.

LOOP AT lt_tvarv.

l_displace = ( sy-tabix - 1 ) * 4.

l_hex_tvarv = lt_tvarv-low(4).

IF sy-tabix = 1.

l_low = l_hex_tvarv.

ELSE.

l_low+(l_displace) = l_hex_tvarv.

ENDIF.

ENDLOOP.

ENDIF.

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question