<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Read table fields using Field Symbols in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209834#M133147</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am doing almost the same thing , but I want to assign the value of lit_coss-WTG009  field to lst_coss-WTG001 ( 2nd internal table _ .. USING feild symbol . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How Can I achive this task .. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;usman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Apr 2006 15:30:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-03T15:30:20Z</dc:date>
    <item>
      <title>Read table fields using Field Symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209828#M133141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using COSS tables , I want to read the fields WTG001&amp;#133;..WOG016 . I just want to read the fields where ever it has some value . How can I achieve this task using field symbols ? I just want where ever I find record , I have to get out of select .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am thinking it should be like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select ( using field symbols ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If  not find &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Continue &lt;/P&gt;&lt;P&gt;Else &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exit .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Endselect &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some one post me  the code . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers &lt;/P&gt;&lt;P&gt;Usman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2006 15:49:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209828#M133141</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-29T15:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Read table fields using Field Symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209829#M133142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think that its a good idea to do it that way,  and I don't think it is possible to do a dynamic field list,  try something like this.\&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

data: icoss type table of coss with header line.
data: field_name(30) type c.
data: index(4) type c.
data: n(2) type n.

field-symbols: &amp;lt;fs&amp;gt;.


start-of-selection.

  select * into table icoss from coss
               up to 100 rows.       " For Testing

  loop at icoss.

    do.
      n = sy-index.
      index = n.
      concatenate 'WTG0' index into field_name.
      assign component field_name of structure icoss to &amp;lt;fs&amp;gt;.
      if sy-subrc &amp;lt;&amp;gt; 0.
        exit.
      endif.
      if not &amp;lt;fs&amp;gt; is initial.
        write:/ field_name, 'has a value', &amp;lt;fs&amp;gt;.
      endif.
    enddo.

  endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2006 16:02:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209829#M133142</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-03-29T16:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Read table fields using Field Symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209830#M133143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Usman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are not retrieving any data but just interested in checking if a value exists.. you could use the following ugly SELECT too..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select * from COSS up to 1 rows
         where ( WTGO01 gt 0 or WTGO01 gt 0 or &amp;amp; so on ).
endselect.
if sy-subrc eq 0.
" has a value.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2006 16:12:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209830#M133143</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-03-29T16:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Read table fields using Field Symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209831#M133144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually you don't need filed symbols here, DO... VARYING is more sufficient:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;b&amp;gt;DATA&amp;lt;/b&amp;gt;: wtg TYPE coss-wtg001.
&amp;lt;b&amp;gt;DO &amp;lt;/b&amp;gt; 16 &amp;lt;b&amp;gt;TIMES&amp;lt;/b&amp;gt;
  &amp;lt;b&amp;gt;VARYING&amp;lt;/b&amp;gt; wtg &amp;lt;b&amp;gt;FROM&amp;lt;/b&amp;gt; coss-wtg001 &amp;lt;b&amp;gt;NEXT&amp;lt;/b&amp;gt; coss-wtg002.

&amp;lt;b&amp;gt;ENDDO&amp;lt;/b&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2006 16:16:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209831#M133144</guid>
      <dc:creator>sergey_korolev</dc:creator>
      <dc:date>2006-03-29T16:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Read table fields using Field Symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209832#M133145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used the following logic and able to read the results for table . Now  I have opposite requirement . for example . &lt;/P&gt;&lt;P&gt; After reading the value  from main internal table using field symbol . I have to assign it back to other internal table different fields . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting an input file which has different record  it contain the values from WTG001 TO WTG016.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am declaring another internal  table with same structure , I am reading what is the next empty value in table lets say I find &amp;#145;WTG005&amp;#146; .  In my excel sheet  &amp;#145;WTG001&amp;#146; has value . remember its going to be different for every record in my excel sheet . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now using the old logic I decide next available empty field is &amp;#145;wtg005&amp;#146; .  I have to assign the value of main internal table to the separate field of  new( 2nd  internal table ) using fild symbols .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I explain you , if you still need clarification do let me know .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Usman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2006 23:17:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209832#M133145</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-31T23:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Read table fields using Field Symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209833#M133146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i and doing the same thing with table cosp. this is how you can do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of lst_coss,
       wtg001 like coss-wtg001,
       wtg002 like coss-wtg002,
       wtg003 like coss-wtg003,
       wtg004 like coss-wtg004,
       wtg005 like coss-wtg005,
       wtg006 like coss-wtg006,
       wtg007 like coss-wtg007,
       wtg008 like coss-wtg008,
       wtg009 like coss-wtg009,
       wtg0010 like coss-wtg0010,
       wtg0011 like coss-wtg0011,
       wtg0012 like coss-wtg0012,
       wtg0013 like coss-wtg0013,
       wtg0014 like coss-wtg0014,
       wtg0015 like coss-wtg0015,
       wtg0016 like coss-wtg0016,
   end of lst_coss.

data: lit_coss type table coss with header line.

data: total like coss-wtg001.

field-symbol: &amp;lt;fs&amp;gt;.

select * from coss into table lit_coss upto 10 rows.

loop at lit_coss.
   lst_coss = lit_coss.
   do 16 times.
       assign component sy-index of structure lst_csoo to &amp;lt;fs&amp;gt;.
       total = total + &amp;lt;fs&amp;gt;.
   while.

   write:/0 'object: ' 10 lit_coss-objnr,
                 25 'tran. curr', 40 total.

   clear: lst_coss, total.

endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope this will work for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Pratik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Apr 2006 00:06:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209833#M133146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-01T00:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Read table fields using Field Symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209834#M133147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am doing almost the same thing , but I want to assign the value of lit_coss-WTG009  field to lst_coss-WTG001 ( 2nd internal table _ .. USING feild symbol . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How Can I achive this task .. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;usman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Apr 2006 15:30:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209834#M133147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-03T15:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Read table fields using Field Symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209835#M133148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well I don&amp;#146;t think after reading table using field symbol , and get its value in field symbol and assign it back to another internal table new field using field symbol . I also came across this kind of situation but we use command "DO" Syntax was like that &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do No times varying var1  from table_variable  next last_table variable &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this&amp;#146;ll give you some idea . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Apr 2006 19:53:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209835#M133148</guid>
      <dc:creator>former_member181966</dc:creator>
      <dc:date>2006-04-04T19:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Read table fields using Field Symbols</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209836#M133149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Usman,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did not get your requirement. Can you please explain in detail ( with example if possible )?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Apr 2006 23:21:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-table-fields-using-field-symbols/m-p/1209836#M133149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-04T23:21:41Z</dc:date>
    </item>
  </channel>
</rss>

