Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9218

Re: Field-symbols appending to ITAB

$
0
0

DATA : gt_table  TYPEtable of gt_data.,

      gw_line  like line of gw_line.   

 

FIELD-SYMBOLS: <gfs_line>,<gfs_line1>,
<gfs_dyn_table>
TYPESTANDARDTABLE,
<fs1>.

 

* Assign the new table to field symbol
ASSIGN gt_table->* TO<gfs_dyn_table>.

ASSIGN gw_line->* TO<gfs_line>.

 

loop at itab into wa_tab.

 

ASSIGNCOMPONENT'FIELD1'OFSTRUCTURE<gfs_line> TO<fs1>.

<fs1> = wa_tab-field1.
UNASSIGN <fs1>.

ASSIGNCOMPONENT'FIELD2'OFSTRUCTURE<gfs_line> TO<fs1>.

<fs1> = wa_tab-field2.
UNASSIGN <fs1>.


APPEND<gfs_line> TO<gfs_dyn_table>.


clear : wa_tab.

CLEAR: <gfs_line>.


ENDLOOP.

 


 

Check this link, it explains clearly on how to populate a table using field symbols by looping through another table.

 

http://scn.sap.com/docs/DOC-42525


Viewing all articles
Browse latest Browse all 9218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>