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

Dynamic read from work area

Former Member
0 Likes
350

Hello, me again ...

I have a work area declared like this:

data: begin of wa,

fld1 type c,

fld2 type c,

fld3 type c,

end of wa.

I want to check a different field's value at each iteration, meaning somthing like this:

concatenate 'fld' sy-tabix into var.

if wa-var eq ......

I know it's possible by using field-symbols, does anyone can write me the specific syntax pls ?

Thanks in advance,

Rebeka.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
319
field-symbols: <fs>.
data: var(20) type c.
data: tabix(4) type c.


tabix = sy-tabix.
   concatenate 'FLD' tabix into var.
   condense var no-gaps.

assign component var of structure wa to <fs>.
if <fs> = 'X'.

endif.

Regards,

Rich Heilman

1 REPLY 1
Read only

RichHeilman
Developer Advocate
Developer Advocate
320
field-symbols: <fs>.
data: var(20) type c.
data: tabix(4) type c.


tabix = sy-tabix.
   concatenate 'FLD' tabix into var.
   condense var no-gaps.

assign component var of structure wa to <fs>.
if <fs> = 'X'.

endif.

Regards,

Rich Heilman