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: 

How do we create syntax to call component in another way

former_member835368
Discoverer
0 Kudos
325

Hi folks,

i have a question to create syntax

for example

types: begin of ty_data,
       matnr type matnr,
       end of ty_data.
Data: t_data TYPE TABLE OF ty_data WITH HEADER LINE.

*is there anoter way to create
*t_data-matnr
*into this form
*t_data['MATNR']
*? Thankyou 
* 
3 REPLIES 3

raymond_giuseppi
Active Contributor
274

You could use

DATA: t_data TYPE TABLE OF matnr. " WITH HEADER LINE is obsolete

carlottas
Explorer
0 Kudos
274

Hi jalskyyy,

you can do this in different ways, for example: ASSIGN COMPONENT ...OF STRUCTURE.

You can find more details on this topic:

https://answers.sap.com/questions/4231818/loop-fieldscomponents-of-structure.html

Sandra_Rossi
Active Contributor
0 Kudos
274

I don't understand the question because t_data['MATNR'] is syntactically invalid.