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: 

structure field names at run time.

praveen_kumar194
Active Contributor
0 Kudos

Hi Experts ,

i am not sure whether this is right question or not. i have on structure say X with fields name and age. is there any way to represent this field with the help of another variable at runtime.

ex : Can i represent X-name as X-i where 'I' is s a string and will hold 'NAME' as a value.

can this be achievable. kindly give reply.

Thanks in advance.

4 REPLIES 4

kesavadas_thekkillath
Active Contributor
0 Kudos

types:begin of ty_x,
      name type c,
      end of ty_x.
data:wa type ty_x.
data:v type string.

field-symbols:<fs> type any.
data:field(4) type c.

start-of-selection.
field = 'NAME'.

concatenate 'WA-' field into v.
assign (v) to <fs>.
<fs> = 'A'.
write wa-name.

jj
Active Contributor
0 Kudos

FIELD-SYMBOLS: <fp> TYPE ANY.

CONCATENATE 'X-' lv_register INTO gv_fn.

ASSIGN (gv_fn) TO <fp>.

so this field symbol wil have the value of x-name

Former Member
0 Kudos

instead of that why cant you use work variable which holds data temporarily in report

praveen_kumar194
Active Contributor
0 Kudos

Thank you very much