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 issue with DO statement

Former Member
0 Likes
474

What is the solution in unicode system to fix the unicode error in the statement?

data: f1 type n,

f2 type n,

f3 type n.

data: head1(200),

head2(200),

head3(200).

do 200 times varying f1 from head1 next head1+1

varying f2 from head2 next head2+1

varying f3 from head3 next head3+1.

enddo.

3 REPLIES 3
Read only

Former Member
0 Likes
430

In se38->

Menu: Goto->attributes->unicode check active

Kevin

Read only

Former Member
0 Likes
430

Kevin,

The above statement is now obsolete in unicode environment. What could be the alternative?

Read only

former_member386202
Active Contributor
0 Likes
430

Hi,

Try using like this

DATA: BEGIN OF text,

word1 TYPE c LENGTH 4 VALUE 'AAAA',

word2 TYPE c LENGTH 4 VALUE 'BBBB',

word3 TYPE c LENGTH 4 VALUE 'CCCC',

word4 TYPE c LENGTH 4 VALUE 'DDDD',

END OF text.

DATA: word TYPE c LENGTH 4,

char1 TYPE c LENGTH 1,

char2 TYPE c LENGTH 1,

leng TYPE i.

FIELD-SYMBOLS <word> LIKE text-word1.

DATA inc TYPE i.

DESCRIBE FIELD text LENGTH leng IN CHARACTER MODE.

leng = leng / 2.

DO leng TIMES VARYING char1 FROM text(1)

NEXT text+2(1) RANGE text

VARYING char2 FROM text+1(1)

NEXT text+3(1) RANGE text.

WRITE: char1, char2.

char1 = 'x'.

char2 = 'y'.

ENDDO.

DO 4 TIMES VARYING word FROM text-word1 NEXT text-word2.

WRITE / word.

ENDDO.

DO.

inc = sy-index - 1.

ASSIGN text-word1 INCREMENT inc TO <word> RANGE text.

IF sy-subrc = 0.

WRITE / <word>.

ELSE.

EXIT.

ENDIF.

ENDDO.

Regards,

Prashant