Application Development and Automation 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: 
Read only

Unicode error, Split Variable at HEX 00 into ITAB

Former Member
0 Likes
728

Hello all,

We will be changing our system to a Unicode system next year. As we are modifying existing programs, we are setting the Unicode flag and correcting any errors. In this one particular program I have run across a situation for which I have not been able to find a solution. Any thoughts would be greatly appreciated.

This error occurs when the following code is checked.

HEX must be a character-type data object

data hex type x. "Binary zeros

data: begin of i_apqd occurs 0.

include structure apqd.

data: end of i_apqd.

data: begin of itab occurs 0,

field(150),

end of itab.

split i_apqd-vardata+20 at hex into table itab.

This is what i_apqd-vardata+20 looks like in the debugger.

##SAPMF05A0100##BKPF-BLDAT#11072006#BKPF-BLART#KR#BKPF-BUKRS#100#BKPF-budat#11072006

This program is a custom developed utility program to display the contents of a BDC session.

Thanks

Bruce

1 ACCEPTED SOLUTION
Read only

former_member186741
Active Contributor
0 Likes
429

try this:

data hex type x value '00'.

field-symbols: <hex> type x,<char> type c.

data: begin of i_apqd occurs 0.

include structure apqd.

data: end of i_apqd.

data: begin of itab occurs 0,

field(150),

end of itab.

assign hex to <hex>.

assign <hex> to <char> casting.

split i_apqd-vardata+20 at <char> into table itab.

2 REPLIES 2
Read only

former_member186741
Active Contributor
0 Likes
430

try this:

data hex type x value '00'.

field-symbols: <hex> type x,<char> type c.

data: begin of i_apqd occurs 0.

include structure apqd.

data: end of i_apqd.

data: begin of itab occurs 0,

field(150),

end of itab.

assign hex to <hex>.

assign <hex> to <char> casting.

split i_apqd-vardata+20 at <char> into table itab.

Read only

0 Likes
429

Thanks Neil,

Your code example worked beautifully.

Bruce