Application Development 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: 

Unicode Error: Help in rectifying

Former Member
0 Kudos

Hi,

The below code is giving me an Unicode error.

Especially <number> gives the Unicode error.

Let me know how to rectify the error.

Code: - start-

FIELD-SYMBOLS: <number>.

DATA: BEGIN OF NUMBERS,

ONE TYPE P VALUE 10,

TWO TYPE P VALUE 20,

THREE TYPE P VALUE 30,

FOUR TYPE P VALUE 40,

FIVE TYPE P VALUE 50,

END OF NUMBERS.

DATA SUM TYPE I.

assign NUMBERS-two to <number>.

ADD <number> FROM 1 TO 3 GIVING SUM.

Code: --- end ---

Regards,

Purshoth

2 REPLIES 2

Peranandam
Contributor
0 Kudos

Hi,

you need to change field symbol declaration part like below

FIELD-SYMBOLS: <number> type any.<-------here

DATA: BEGIN OF NUMBERS,

ONE TYPE P VALUE 10,

TWO TYPE P VALUE 20,

THREE TYPE P VALUE 30,

FOUR TYPE P VALUE 40,

FIVE TYPE P VALUE 50,

END OF NUMBERS.

DATA SUM TYPE I.

assign NUMBERS-two to <number>.

ADD <number> FROM 1 TO 3 GIVING SUM.

Regards,

Peranandam

former_member194669
Active Contributor
0 Kudos

Hi,

In Unicode programs, all data objects of the sequence must lie within one structure. If in the syntax check, this cannot be recognized statically, you must specify a structure range with addition RANGE.


ADD numbers-one  THEN numbers-two
                UNTIL numbers-three
                GIVING sum.