Skip to Content
Former Member
Jun 19, 2010 at 08:07 AM

right way to declare field symbols


i am new to field symbols, pls help

i want to know which is the right way of declaration ?

types: begin of typ_tab,
           vbeln  type vbap-vbeln,
           posnr type vbap-posnr,
           matnr  type vbap-matnr,
           - - - - -
          end of typ_tab.
data:  itab type standard table of typ_tab,
          wa  type typ_tab.
field-symbols: <f_t> type standard table,  
                       <f_w> type any,                or      <f_w>  like  line of typ_tab,  ??
                        <f_s> type any.
select  vbeln posnr  ....... into itab......
assign  itab to <f_t>.
assign wa  to <f_w>.
loop at <f_t> assigning <f_w>.
assign component 'vbeln' of structure <f_w>  to <f_s>.
write : / <f_s>.


loop at itab assigning <f_w>.  
write: / <f_w>-vbeln.

r these 2 statements correctt ? if so then which one  to use,  pls show with an example. wats the diff btwn above 2  types of  looping statements ?   how to use read statement on this ?