‎2006 Nov 24 9:48 AM
Hi,
i want in ABAP to loop for all fields of a structure.
Thanks for help.
Cheers
‎2006 Nov 24 9:53 AM
Please field symbol and more details , have a look at
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
‎2006 Nov 24 9:53 AM
Hi
Create an internal table of the required stucture and loop through it.
Example:
data: itl_demo type zstructure occurs 0 with header line.
Loop at itl_demo.
---
---
---
Endloop.
Pls mark helpful answers.
‎2006 Nov 24 9:54 AM
Use FIELD SYMBOL
More details are at
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
‎2006 Nov 24 10:09 AM
Hi tafkap ,
the code would be like this...here intab and itab are internal table.
FIELD-SYMBOLS : <fs> TYPE ANY.
loop at intab.
do.
assign component sy-index of structure intab to <fs>.
here <fs> will hold the value of column
itab-field = <fs>.
enddo.
append itab.
clear itab.
endloop.
hope this answers your question.
Reward useful answers.
Regards,
Shrita Sharma.