<?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: Field Symbol Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693774#M1103203</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;define the work area as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: if_buffer type ref to data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;if_buffer&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;                     &amp;lt;wa_buffer&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                     &amp;lt;f_tot_disc&amp;gt; type tot_disc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;create data if_buffer type standard table of TABLENAME.&lt;/P&gt;&lt;P&gt;catch cx_root.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign if_buffer-&amp;gt;* to &amp;lt;if_buffer&amp;gt;.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at &amp;lt;if_buffer&amp;gt; assigning &amp;lt;wa_buffer&amp;gt;.&lt;/P&gt;&lt;P&gt;assign component 'TOT_DISC' of structure &amp;lt;wa_buffer&amp;gt; to &amp;lt;f_tot_disc&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Nov 2008 10:06:47 GMT</pubDate>
    <dc:creator>former_member226519</dc:creator>
    <dc:date>2008-11-04T10:06:47Z</dc:date>
    <item>
      <title>Field Symbol Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693769#M1103198</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 have written a code in normal loop expression where it will place the value of total at first vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT END OF vbeln.
  w_output-tot_disc = w_total_disc.
  MODIFY i_output FROM w_output TRANSPORTING tot_disc
                                          WHERE vbeln = w_temp-vbeln.
  CLEAR w_total_disc.

 ENDAT.                             " AT END OF....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and i have written the same code using field symbol for dynamic creation.&lt;/P&gt;&lt;P&gt;where i_output = &amp;lt;l_table&amp;gt;&lt;/P&gt;&lt;P&gt;         w_output = &amp;lt;l_line&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;AT END OF vbeln.
    assign component 'TOT_DISC' of structure &amp;lt;l_line&amp;gt; TO
&amp;lt;l_field&amp;gt;.
    &amp;lt;l_field&amp;gt; = w_total_disc.
      MODIFY &amp;lt;l_table&amp;gt; FROM &amp;lt;l_line&amp;gt; transporting &amp;lt;l_field&amp;gt; where vbeln = w_temp-vbeln.
      CLEAR w_total_disc.

    ENDAT.                             " AT END OF....&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it gives an error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Error: The specified type has no structure and therefore no component called
"&amp;lt;L_FIELD&amp;gt;" . . . .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help.&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 Nov 2008 08:47:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693769#M1103198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T08:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Field Symbol Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693770#M1103199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;How you  have declared (&amp;lt;l_line&amp;gt;) , does it have TOT_DISC ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 08:53:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693770#M1103199</guid>
      <dc:creator>Sandeep_Panghal</dc:creator>
      <dc:date>2008-11-04T08:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Field Symbol Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693771#M1103200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;*Dynamic Creation of columns............&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create a new Table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      it_fieldcatalog = i_fieldcat&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ep_table        = new_table.&lt;/P&gt;&lt;P&gt;*where i_fieldcat table contains 'TOT_DISC' value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Creates a new Line with the same structure of the table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ASSIGN new_table-&amp;gt;* TO &amp;lt;l_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  CREATE DATA new_line LIKE LINE OF &amp;lt;l_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN new_line-&amp;gt;* TO &amp;lt;l_line&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 08:56:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693771#M1103200</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T08:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Field Symbol Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693772#M1103201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Insert this following code....&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
AT END OF vbeln.
    assign component 'TOT_DISC' of structure &amp;lt;l_line&amp;gt; TO
&amp;lt;l_field&amp;gt;.
    if &amp;lt;l_field&amp;gt; is assigned.    "-----&amp;gt; use this..
    &amp;lt;l_field&amp;gt; = w_total_disc.
      MODIFY &amp;lt;l_table&amp;gt; FROM &amp;lt;l_line&amp;gt; transporting &amp;lt;l_field&amp;gt; where vbeln = w_temp-vbeln.
      CLEAR w_total_disc.
     endif.      "-----
    ENDAT.  
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And check whether &amp;lt;l_line&amp;gt; contains a field name 'TOT_DISC' in debugger...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 08:59:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693772#M1103201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T08:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Field Symbol Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693773#M1103202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. &amp;lt;l_line&amp;gt; contains the 'TOT_DISC' at run time.&lt;/P&gt;&lt;P&gt;that's the reason it is throwing an error while compling.&lt;/P&gt;&lt;P&gt;how to define dynamic work area ?? any idea ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 09:27:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693773#M1103202</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T09:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Field Symbol Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693774#M1103203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;define the work area as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: if_buffer type ref to data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;if_buffer&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;                     &amp;lt;wa_buffer&amp;gt; type any,&lt;/P&gt;&lt;P&gt;                     &amp;lt;f_tot_disc&amp;gt; type tot_disc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try.&lt;/P&gt;&lt;P&gt;create data if_buffer type standard table of TABLENAME.&lt;/P&gt;&lt;P&gt;catch cx_root.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign if_buffer-&amp;gt;* to &amp;lt;if_buffer&amp;gt;.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at &amp;lt;if_buffer&amp;gt; assigning &amp;lt;wa_buffer&amp;gt;.&lt;/P&gt;&lt;P&gt;assign component 'TOT_DISC' of structure &amp;lt;wa_buffer&amp;gt; to &amp;lt;f_tot_disc&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 10:06:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693774#M1103203</guid>
      <dc:creator>former_member226519</dc:creator>
      <dc:date>2008-11-04T10:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Field Symbol Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693775#M1103204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Check this code.... this also creates a dynamic internal table and workarea....&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: struct_type TYPE REF TO cl_abap_structdescr,
      comp_tab    TYPE cl_abap_structdescr=&amp;gt;component_table,
      dref        TYPE REF TO data,
      itab_type   TYPE REF TO cl_abap_tabledescr,
      wa_comp     LIKE LINE OF comp_tab,
      index       TYPE char10.

FIELD-SYMBOLS : &amp;lt;tab&amp;gt; TYPE STANDARD TABLE,
                &amp;lt;wa&amp;gt; TYPE ANY,
                &amp;lt;temp&amp;gt;.        "&amp;lt;-----------check how declared

PARAMETER col TYPE i.

DO col TIMES.
  index = sy-index.
  CONCATENATE 'COL' index INTO wa_comp-name.
  CONDENSE wa_comp-name NO-GAPS.
  wa_comp-type ?= cl_abap_datadescr=&amp;gt;describe_by_name( 'I' ).
  APPEND  wa_comp TO comp_tab.
ENDDO.

struct_type = cl_abap_structdescr=&amp;gt;create( comp_tab ).
itab_type   = cl_abap_tabledescr=&amp;gt;create( struct_type ).
CREATE DATA dref TYPE HANDLE itab_type.
ASSIGN dref-&amp;gt;* TO &amp;lt;tab&amp;gt;.
CREATE DATA dref TYPE HANDLE struct_type.
ASSIGN dref-&amp;gt;* TO &amp;lt;wa&amp;gt;.

ASSIGN COMPONENT 'COL2' OF STRUCTURE &amp;lt;wa&amp;gt; TO &amp;lt;temp&amp;gt;.       "This works perfectly....

BREAK-POINT.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 10:15:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693775#M1103204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T10:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Field Symbol Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693776#M1103205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;No need to do all this :&lt;/P&gt;&lt;P&gt;What you are doing is incorrect :&lt;/P&gt;&lt;P&gt;MODIFY &amp;lt;l_table&amp;gt; FROM &amp;lt;l_line&amp;gt; transporting &amp;lt;l_field&amp;gt; where vbeln = w_temp-vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With field symbols, you can directly access the table components of an entry in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now assuming that &amp;lt;l_table&amp;gt; is pointing to the current line of the table i_output. You can just write the code &lt;/P&gt;&lt;P&gt;&amp;lt;l_table&amp;gt;-TOL_disc = w_total_disc. This will update the field tot_disc of the line to which the field-symbol &amp;lt;l_table&amp;gt; is assigned to. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Advait&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 10:21:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693776#M1103205</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T10:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Field Symbol Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693777#M1103206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. problem got solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jul 2010 14:03:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/4693777#M1103206</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-05T14:03:26Z</dc:date>
    </item>
  </channel>
</rss>

