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

Error while changing non-unicode to unicode programs in offsets

Former Member
0 Likes
274

Hi All,

Its very urgent can you give me a soln to the below code.

data: begin of t_allocate occurs 0.

include structure zsd_allocate.

data: end of t_allocate.

if sy-subrc ne 0.

write: / t_allocate(80),

/ t_allocate+80(80), <------- error

/ t_allocate+160.

uline.

endif.

The above code is throwing an error as: The sum of the offset length (=160) exceeds the length of the start (=93) of the structure.This is not allowed in unicode.

1 REPLY 1
Read only

Former Member
0 Likes
242

Hi ,

In Unicode the there will be a problem for offset .

Use the following code marked in bold.

<b>types : begin of typ_str,

str(80) type c,

end of types .</b><b>data : cf(80).</b>

data: begin of t_allocate occurs 0.

<b> include structure typstr as part1.</b>

include structure zsd_allocate.

data: end of t_allocate.

if sy-subrc ne 0.

<b>cf = t_allocate-part1.</b>

write: / t_allocate(80),

<b>/ cf</b>

the above line will solve your problem

/ t_allocate+80(80), <------- error

/ t_allocate+160.

uline.

endif.

Please reward if useful.