Skip to Content
0
Former Member
Dec 15, 2006 at 06:16 AM

using variable in accessing itab field

19 Views

Hi all!

is it possible to access a field of an internal table using a variable.

for example, please see my code below.

DATA: BEGIN OF itab,

field1 LIKE mara-matnr,

field2 LIKE mara-matkl,

END OF itab.

data: v_fldname(5).

**- itab is being populated here -**

v_fldname = 'field1'.

**- i want to access the first field of itab, field1-**

***- but instead of doing this code

write itab-field1.

***- i want to do this...

write itab-(v_fldname).

but im getting an error message saying that <<The data object "IT_VAD" does not have a component called "">>

please send me the correct way to deal with this.

Thanks for your usual support.