<?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 Changing Field name Dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-field-name-dynamically/m-p/6343639#M1397877</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to change the Internal table field name dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets say the structure looks like the below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------------" /&gt;&lt;P&gt;NAME | ABSNT01 | ABSNT02 | ABSNT03 | ABSNT04&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I need to populate this ABSNT* fields based upon some index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABSNT+sy-tabix = 'A'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using do varying loop but am not able to acheive the result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Oct 2009 14:39:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-10-27T14:39:00Z</dc:date>
    <item>
      <title>Changing Field name Dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-field-name-dynamically/m-p/6343639#M1397877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to change the Internal table field name dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets say the structure looks like the below,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------------" /&gt;&lt;P&gt;NAME | ABSNT01 | ABSNT02 | ABSNT03 | ABSNT04&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I need to populate this ABSNT* fields based upon some index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABSNT+sy-tabix = 'A'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using do varying loop but am not able to acheive the result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2009 14:39:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-field-name-dynamically/m-p/6343639#M1397877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-27T14:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field name Dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-field-name-dynamically/m-p/6343640#M1397878</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;U need to use the field-symbols:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS: &amp;lt;FS&amp;gt; TYPE ANY.
DATA: FIELD_NAME(30) TYPE C.
DATA: V_INDEX(2) TYPE N.

FIELD_NAME = 'ABSNT'.

DO.
  MOVE SY-INDEX TO V_INDEX.
  FIELD_NAME(5) = 'ABSNT'.
  FIELD_NAME+5(2) = V_INDEX.
  ASSIGN COMPONENT FIELD_NAME OF STRUCTURE ITAB TO &amp;lt;FS&amp;gt;.
  IF SY-SUBRC = 0.
    &amp;lt;FS&amp;gt; = ....
  ELSE. 
    EXIT.
  ENDIF.
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mAX&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2009 14:44:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-field-name-dynamically/m-p/6343640#M1397878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-27T14:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field name Dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-field-name-dynamically/m-p/6343641#M1397879</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;You can use the statement assign component . Dynamically it will populate the fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2009 14:54:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-field-name-dynamically/m-p/6343641#M1397879</guid>
      <dc:creator>Subhankar</dc:creator>
      <dc:date>2009-10-27T14:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field name Dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-field-name-dynamically/m-p/6343642#M1397880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Benu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See below logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:fcat_wa TYPE lvc_s_fcat,&lt;/P&gt;&lt;P&gt;     fcat_itab TYPE lvc_t_fcat,&lt;/P&gt;&lt;P&gt;     poi_itab TYPE REF TO data,&lt;/P&gt;&lt;P&gt;     cha(4) TYPE c.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;itab&amp;gt; TYPE STANDARD TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 5 TIMES.&lt;/P&gt;&lt;P&gt;  cha = sy-index.&lt;/P&gt;&lt;P&gt;  CONCATENATE 'ABSNT' cha INTO cha.&lt;/P&gt;&lt;P&gt;  CONDENSE cha NO-GAPS.&lt;/P&gt;&lt;P&gt;  fcat_wa-fieldname = cha.&lt;/P&gt;&lt;P&gt;  fcat_wa-datatype = 'STRG'.&lt;/P&gt;&lt;P&gt;  APPEND fcat_wa TO fcat_itab.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&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           = fcat_itab&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    ep_table                  = poi_itab&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    generate_subpool_dir_full = 1&lt;/P&gt;&lt;P&gt;    OTHERS                    = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN poi_itab-&amp;gt;* TO &amp;lt;itab&amp;gt;. " &amp;lt;itab&amp;gt;  contains dynamic fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Might help u.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sap Fan on Oct 27, 2009 4:02 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2009 15:00:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-field-name-dynamically/m-p/6343642#M1397880</guid>
      <dc:creator>awin_prabhu</dc:creator>
      <dc:date>2009-10-27T15:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Field name Dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/changing-field-name-dynamically/m-p/6343643#M1397881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Benu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use Dynamic Internal table. the way to create it is given in the following link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechies.com/how-to-declare-an-internal-table-dynamically-2/" target="test_blank"&gt;http://www.saptechies.com/how-to-declare-an-internal-table-dynamically-2/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2009 15:01:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/changing-field-name-dynamically/m-p/6343643#M1397881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-27T15:01:24Z</dc:date>
    </item>
  </channel>
</rss>

