<?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: code error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3336253#M799612</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are mixing a few things up here. The field symbol &amp;lt;fs&amp;gt; is &lt;/P&gt;&lt;P&gt;now pointing at a field (that does not exist), for example WTG001. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the statement should be: SELECT SINGLE (lv_fname) FROM COSP INTO &lt;/P&gt;&lt;P&gt;&amp;lt;fs&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(lv_fname) is called a dynamic token and replaced at runtime by the &lt;/P&gt;&lt;P&gt;fieldname . &lt;/P&gt;&lt;P&gt;Actually, I also think the field-symbol assignment doesn't work either. &lt;/P&gt;&lt;P&gt;Just check the sy-subrc after the assign statement! You also need the &lt;/P&gt;&lt;P&gt;COSP- part of the name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at this example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: wa_t001 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE t001. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: tp_fieldlist TYPE string VALUE 'BUKRS'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: tp_fieldname TYPE string VALUE 'WA_T001-BUKRS'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE ANY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN (tp_fieldname) TO &amp;lt;fs&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF &amp;lt;fs&amp;gt; IS ASSIGNED. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE (tp_fieldlist) FROM t001 INTO &amp;lt;fs&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE &amp;lt;fs&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just check help on SELECT statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 27 Jan 2008 09:07:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-27T09:07:34Z</dc:date>
    <item>
      <title>code error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3336251#M799610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CONCATENATE 'WTG0' LV_MON INTO LV_FNAME. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN (LV_FNAME) TO &amp;lt;FS&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE &amp;lt;FS&amp;gt; FROM COSP INTO LV_SAPRST &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE OBJNR = LV_OBJ AND GJAHR = LV_YEAR AND WRTTP = '4' AND KSTAR &lt;/P&gt;&lt;P&gt;= GT_INOUT-SAKNR &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error message : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unknown column name "&amp;lt;FS&amp;gt;" . field list. . field list. &lt;/P&gt;&lt;P&gt;field list. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;actually , if i use if command, i can do, but i want to use simple &lt;/P&gt;&lt;P&gt;code by fieldsymbol.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jan 2008 04:43:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3336251#M799610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-27T04:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: code error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3336252#M799611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sashi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using the addition NO-GAPS (or NO GAPS) in the Concatenate statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aabhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jan 2008 08:41:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3336252#M799611</guid>
      <dc:creator>aabhas_wilmar</dc:creator>
      <dc:date>2008-01-27T08:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: code error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3336253#M799612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are mixing a few things up here. The field symbol &amp;lt;fs&amp;gt; is &lt;/P&gt;&lt;P&gt;now pointing at a field (that does not exist), for example WTG001. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the statement should be: SELECT SINGLE (lv_fname) FROM COSP INTO &lt;/P&gt;&lt;P&gt;&amp;lt;fs&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(lv_fname) is called a dynamic token and replaced at runtime by the &lt;/P&gt;&lt;P&gt;fieldname . &lt;/P&gt;&lt;P&gt;Actually, I also think the field-symbol assignment doesn't work either. &lt;/P&gt;&lt;P&gt;Just check the sy-subrc after the assign statement! You also need the &lt;/P&gt;&lt;P&gt;COSP- part of the name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at this example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: wa_t001 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE t001. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: tp_fieldlist TYPE string VALUE 'BUKRS'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: tp_fieldname TYPE string VALUE 'WA_T001-BUKRS'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE ANY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN (tp_fieldname) TO &amp;lt;fs&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF &amp;lt;fs&amp;gt; IS ASSIGNED. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE (tp_fieldlist) FROM t001 INTO &amp;lt;fs&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE &amp;lt;fs&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just check help on SELECT statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jan 2008 09:07:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3336253#M799612</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-27T09:07:34Z</dc:date>
    </item>
  </channel>
</rss>

