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

populating workarea dynamically

Former Member
0 Likes
697

we have a scenario, where the work area field that i need to populate is not known till runtime. how do i dynamically populate the correct workarea field.

presently i am doing :

case job-keyfig.

when 'Z_FFORD'.

wa-zfford = keyval.

endcase.

what i need is something like this :

wa-(job-keyfig) = keyval.

any answers ? please reply asap.

3 REPLIES 3
Read only

Former Member
0 Likes
532

Hi,

have look at this, hope this will help.

DATA name(20).

name = 'SBOOK'.

FIELD-SYMBOLS <fs> TYPE ANY.

ASSIGN name TO <fs>.

CASE <fs>.

WHEN 'BOOK'.

WHEN 'SBOOK'.

WRITE ' SBOOK'.

ENDCASE.

Regards,

Prabhu Rajesh.

Read only

0 Likes
532

The best solution for this is to use the Field-symbol of type any and use the assign statement. Using that you can solve your problem.

Regards,

amit

Read only

Former Member
0 Likes
532

Hello,

A small example could be :

PARAMETERS: pa_fname TYPE fieldname.

FIELD-SYMBOLS: = 'XX'.

Regards,

Sükrü