<?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/3064654#M726170</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot use this syntax, since &amp;lt;FS_DYN_TABLE&amp;gt; is dynamic and the system doesn't know it's structure before runtime.&lt;/P&gt;&lt;P&gt;You should assign the component you need to an another field symbol, using:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ASSIGN COMPONENT 'PERCN' OF STRUCTURE &amp;lt;FS_DYN_TABLE_TEMP&amp;gt; TO &amp;lt;FS_PERCN&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you have the value in the new FS, and can check the value.&lt;/P&gt;&lt;P&gt;When modifyng the table, you can use dynamic component specification using a character-type variable (such as comp_name TYPE C LENGTH 20), which should contain the name of the component, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
comp_name = 'PERCN'.
MODIFY &amp;lt;FS_DYN_TABLE&amp;gt; FROM &amp;lt;FS_DYN_TABLE_TEMP&amp;gt; TRANSPORTING (comp_name).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that modify, if a runtime error occurs, triggers a non-catchable exceptions, so do your tries!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Roby.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Dec 2007 13:00:36 GMT</pubDate>
    <dc:creator>former_member199581</dc:creator>
    <dc:date>2007-12-05T13:00:36Z</dc:date>
    <item>
      <title>Field symbol problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/3064650#M726166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I am facing a problem wherein i want to modify &amp;lt;FS_DYN_TABLE&amp;gt; from &amp;lt;FS_DYN_TABLE_TEMP&amp;gt;.It is getting modified,i.e the column for which i want it modified is getting modified but remaining values of that corresponding row are not being displayed.&lt;/P&gt;&lt;P&gt;my declaration for above two are as follows:-&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;FS_DYN_TABLE&amp;gt;      TYPE STANDARD TABLE,"Dynamic table&lt;/P&gt;&lt;P&gt;               &amp;lt;FS_DYN_TABLE_TEMP&amp;gt; TYPE ANY           ,.Temporary Dynamic table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My syntax was&lt;/P&gt;&lt;P&gt;             MODIFY &amp;lt;FS_DYN_TABLE&amp;gt; FROM &amp;lt;FS_DYN_TABLE_TEMP&amp;gt; INDEX W_INDEX TRANSPORTING PERCN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i give&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; MODIFY &amp;lt;FS_DYN_TABLE&amp;gt; FROM &amp;lt;FS_DYN_TABLE_TEMP&amp;gt; TRANSPORTING PERCN ,it gives an error saying :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"The specified type has no structure and therefore no component called		&lt;/P&gt;&lt;P&gt;"PERCN". component called "PERCN".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to resolve this problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 05:56:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/3064650#M726166</guid>
      <dc:creator>rahul2000</dc:creator>
      <dc:date>2007-12-05T05:56:50Z</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/3064651#M726167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure how to "untangle" your code, but  here's a snippet using dynamic tables as an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) define your itab structure e.g &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:  BEGIN OF s_elements,&lt;/P&gt;&lt;P&gt;   tabname  TYPE dd02l-tabname,&lt;/P&gt;&lt;P&gt;   tabclass TYPE dd02l-tabclass,&lt;/P&gt;&lt;P&gt;   as4user  TYPE dd02l-as4user,&lt;/P&gt;&lt;P&gt;   as4date  TYPE dd02l-as4date,&lt;/P&gt;&lt;P&gt;   as4time  TYPE dd02l-as4time,&lt;/P&gt;&lt;P&gt;   viewed(1) TYPE c.&lt;/P&gt;&lt;P&gt;TYPES: END OF    s_elements.&lt;/P&gt;&lt;P&gt;data: my_line type s_elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) some data for getting the structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA:      LR_RTTI_STRUC type ref to  CL_ABAP_STRUCTDESCR,&lt;/P&gt;&lt;P&gt;          zog                     LIKE LINE OF lr_rtti_struc-&amp;gt;components,&lt;/P&gt;&lt;P&gt;          zogt                    LIKE TABLE OF zog .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) get the structure as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; lr_rtti_struc ?= cl_abap_structdescr=&amp;gt;describe_by_data( my_line ).&lt;/P&gt;&lt;P&gt;    zogt[]  = lr_rtti_struc-&amp;gt;components.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4)  Create the field catalog for your dynamic table - you need this so we can reference the individual fields by name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; data WA_IT_FLDCAT type LVC_S_FCAT ,&lt;/P&gt;&lt;P&gt;           IT_FLDCAT type LVC_T_FCAT .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT zogt INTO zog.&lt;/P&gt;&lt;P&gt;      CLEAR wa_it_fldcat.&lt;/P&gt;&lt;P&gt;      wa_it_fldcat-fieldname = zog-name .&lt;/P&gt;&lt;P&gt;      wa_it_fldcat-datatype = zog-type_kind.&lt;/P&gt;&lt;P&gt;      wa_it_fldcat-inttype = zog-type_kind.&lt;/P&gt;&lt;P&gt;      wa_it_fldcat-intlen = zog-length.&lt;/P&gt;&lt;P&gt;      wa_it_fldcat-decimals = zog-decimals.&lt;/P&gt;&lt;P&gt;      wa_it_fldcat-coltext = zog-name.&lt;/P&gt;&lt;P&gt;      wa_it_fldcat-lowercase = 'X'.&lt;/P&gt;&lt;P&gt;      APPEND wa_it_fldcat TO it_fldcat .&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) now we can create a dynamic table based on our data structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: dy_table type ref to DATA;&lt;/P&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 = it_fldcat&lt;/P&gt;&lt;P&gt;       IMPORTING&lt;/P&gt;&lt;P&gt;            ep_table = dy_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5) let's now populate this table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: dy_line            TYPE REF TO data.&lt;/P&gt;&lt;P&gt;field-symbols:&lt;/P&gt;&lt;P&gt;&amp;lt;dyn_table&amp;gt;    TYPE  STANDARD TABLE,&lt;/P&gt;&lt;P&gt;&amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN dy_table-&amp;gt;* TO &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  CREATE DATA dy_line LIKE LINE OF &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN dy_line-&amp;gt;* TO &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;  SELECT *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        FROM dd02l&lt;/P&gt;&lt;P&gt;        INTO  CORRESPONDING FIELDS OF TABLE &amp;lt;dyn_table&amp;gt;&lt;/P&gt;&lt;P&gt;        WHERE tabname LIKE  'ZHR%'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you will now find &amp;lt;dyn_table&amp;gt; contains all the fields by name as defined in your original structure (s_elements in the above example). &lt;/P&gt;&lt;P&gt;Read the table into a work area having the same structure as your dynamic itab e.g  READ TABLE &amp;lt;dyn_table&amp;gt; INDEX e_row INTO wa_elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then refer to individual elements such as wa_elements-tabname. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To update the dynamic table for example simply update the work area and then modify the table from the work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_elements-viewed = 'V'.&lt;/P&gt;&lt;P&gt;  MODIFY &amp;lt;dyn_table&amp;gt; FROM wa_elements INDEX e_row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 10:45:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/3064651#M726167</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-05T10:45:01Z</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/3064652#M726168</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 think you need to deference &amp;lt;FS_DYN_TABLE_TEMP&amp;gt;, &amp;lt;FS_DYN_TABLE&amp;gt; as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;FS_DYN_TABLE&amp;gt; TYPE STANDARD TABLE,"Dynamic table&lt;/P&gt;&lt;P&gt;&amp;lt;FS_DYN_TABLE_TEMP&amp;gt; TYPE ANY ,.Temporary Dynamic table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: dref TYPE REF TO DATA. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create data dref type (your table structure).&lt;/P&gt;&lt;P&gt;Assign dref-&amp;gt;* to &amp;lt;FS_DYN_TABLE_TEMP&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly you need to deference(assign structure) for  &amp;lt;FS_DYN_TABLE&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards,&lt;/P&gt;&lt;P&gt;S. Chandra Mouli.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 10:48:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/3064652#M726168</guid>
      <dc:creator>former_member784222</dc:creator>
      <dc:date>2007-12-05T10:48:05Z</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/3064653#M726169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;What you need to do actually is having got your structure &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then ASSIGN COMPONENT 'XXXXX' of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then fill &amp;lt;fs1&amp;gt; with your value &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;repeat for all components of the structure you want to modify.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;then  modify &amp;lt;dyn_table&amp;gt; from &amp;lt;dyn_wa&amp;gt; index nnn where nnn is the line you want to modify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another easier way of course is to have a work area defined as your structure&lt;/P&gt;&lt;P&gt;in my example above I have wa_elements type s_elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now I can easily modify the dynamic itab as follows&lt;/P&gt;&lt;P&gt;READ TABLE &amp;lt;dyn_table&amp;gt; INDEX e_row INTO wa_elements..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_elements-viewed = 'V'.&lt;/P&gt;&lt;P&gt;  MODIFY &amp;lt;dyn_table&amp;gt; FROM wa_elements INDEX e_row.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 11:27:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/3064653#M726169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-05T11:27:46Z</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/3064654#M726170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot use this syntax, since &amp;lt;FS_DYN_TABLE&amp;gt; is dynamic and the system doesn't know it's structure before runtime.&lt;/P&gt;&lt;P&gt;You should assign the component you need to an another field symbol, using:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
ASSIGN COMPONENT 'PERCN' OF STRUCTURE &amp;lt;FS_DYN_TABLE_TEMP&amp;gt; TO &amp;lt;FS_PERCN&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you have the value in the new FS, and can check the value.&lt;/P&gt;&lt;P&gt;When modifyng the table, you can use dynamic component specification using a character-type variable (such as comp_name TYPE C LENGTH 20), which should contain the name of the component, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
comp_name = 'PERCN'.
MODIFY &amp;lt;FS_DYN_TABLE&amp;gt; FROM &amp;lt;FS_DYN_TABLE_TEMP&amp;gt; TRANSPORTING (comp_name).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that modify, if a runtime error occurs, triggers a non-catchable exceptions, so do your tries!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Roby.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 13:00:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-symbol-problem/m-p/3064654#M726170</guid>
      <dc:creator>former_member199581</dc:creator>
      <dc:date>2007-12-05T13:00:36Z</dc:date>
    </item>
  </channel>
</rss>

