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

pointers and data references

Former Member
0 Likes
429

I have stored in a variable called var the name of a field. var = noms-n1. I want to assign something in noms-n1 which is the var I use.

var can have different values like noms-n2,noms-n3 etc.. The assignment done should be dinamic.

The table I use is noms which is composed by n1,n2,n3 etc..

2 REPLIES 2
Read only

Former Member
0 Likes
406

field symbols: <fs_var> type any.

data: var type char40.

assign var to <fs_var>.

if sy-subrc EQ 0.

<fs_var> = YOUR VALUE.

endif.

Read only

Former Member
0 Likes
406

Hi,

This can be done using Field Symbols, where in u can assign the structure field dynamically.

ASSIGN COMPONENT fieldname(n1,n2,n3) OF noms TO <field_symbol> .

Regards,

Anil .