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

DO statement in Unicode programs

Former Member
0 Likes
366
  • Repeated structure for infotype 221.

DATA: BEGIN OF CHECK,

LGA LIKE P0221-LGA01,

TAX LIKE P0221-TAX01,

BWG LIKE P0221-BWG01,

STD LIKE P0221-STD01,

BET LIKE P0221-BET01,

OPK LIKE P0221-OPK01,

END OF CHECK.

DO 20 TIMES VARYING CHECK

FROM P0221-LGA01

NEXT P0221-LGA02.

Without Unicode this is working fine...the CHECK structure takes all the values for all fields of p0221 structure in this statement. This p0221 gets filled by a Provide statement.

but in Unicode programs it was giving an error that CHECK and p0221-LGA are type incompatible so instead I wrote

DO 20 TIMES VARYING CHECK-LGA

FROM P0221-LGA01

NEXT P0221-LGA02.

Now the CHECK structure values for only the field LGA...the rest of the fields of the structure CHECK do not have any values...

please suggest any other changes in the DO statement which would have the same effect as the previous one.

Thanks in advance,

Archana

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
321

Hi archana,

1. U have to write varying,

for all the 6 fields,

2. something like this.

DO 40 TIMES

VARYING rep-lgart FROM myp0008-lga01 NEXT myp0008-lga02

VARYING rep-betrg FROM myp0008-bet01 NEXT myp0008-bet02

VARYING rep-anzhl FROM myp0008-anz01 NEXT myp0008-anz02

VARYING rep-zeinh FROM myp0008-ein01 NEXT myp0008-ein02

VARYING rep-opken FROM myp0008-opk01 NEXT myp0008-opk02.

3. Just change the field names as per pa0221.

regards,

amit m.

1 REPLY 1
Read only

Former Member
0 Likes
322

Hi archana,

1. U have to write varying,

for all the 6 fields,

2. something like this.

DO 40 TIMES

VARYING rep-lgart FROM myp0008-lga01 NEXT myp0008-lga02

VARYING rep-betrg FROM myp0008-bet01 NEXT myp0008-bet02

VARYING rep-anzhl FROM myp0008-anz01 NEXT myp0008-anz02

VARYING rep-zeinh FROM myp0008-ein01 NEXT myp0008-ein02

VARYING rep-opken FROM myp0008-opk01 NEXT myp0008-opk02.

3. Just change the field names as per pa0221.

regards,

amit m.