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

Offset and length not equal

Former Member
0 Likes
583

Hi

I am doing an upgrade and i have a program which have a text element TEXT-001 = -


this text element has 132 length

my programm have a sysntax error at the 2 line below

MOVE TEXT-001 (18) to ITAB-TEXT.

ZDEFINE TEXT-001(43). "

Note: ZDEFINE is a define .. enddefine

i have correct it by modification below

DATA: W_TEXT(132) TYPE C.

MOVE text-001 TO W_text.

MOVE W_text(18) to ITAB-TEXT.

ZDEFINE W_text(43). "

i have use the variable declare instead of text element directly

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
507

I don't see any problem with the code

DATA: W_TEXT(132) TYPE C.

MOVE text-001 TO W_text.

MOVE W_text(18) to ITAB-TEXT.

ZDEFINE W_text(43). "

I've proved this code and no problems appears. If the problem is with zdefine, perhaps you can create a new 43 character length variable, w_text2, and made and additional movement

MOVE W_text(18) to W_text2.

ZDEFINE W_text2. "

Nevertheless, I think this code would works with no changes

Regards,

Jaime

2 REPLIES 2
Read only

Former Member
0 Likes
507

hi,

check out in this way ....

MOVE W_text+0(18) to ITAB-TEXT.

ZDEFINE W_text+0(43). "

Read only

Former Member
0 Likes
508

I don't see any problem with the code

DATA: W_TEXT(132) TYPE C.

MOVE text-001 TO W_text.

MOVE W_text(18) to ITAB-TEXT.

ZDEFINE W_text(43). "

I've proved this code and no problems appears. If the problem is with zdefine, perhaps you can create a new 43 character length variable, w_text2, and made and additional movement

MOVE W_text(18) to W_text2.

ZDEFINE W_text2. "

Nevertheless, I think this code would works with no changes

Regards,

Jaime