<?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 Dynamic programing in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487007#M1062176</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to load data from flat file. The first line of the flat file is the field names(header names). &lt;/P&gt;&lt;P&gt;I'm storing the field names into wa_header then dynamically reading the value of the field from w_infile. &lt;/P&gt;&lt;P&gt;My question is, can I get the internal table field names dynamically  (i.e t_good-&amp;lt;fs_comp&amp;gt; = &amp;lt;fs_dat&amp;gt;). &lt;/P&gt;&lt;P&gt;Any help or suggestion is highly received.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below is my code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION. &lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'DB_GET_TABLE_FIELDS' "Returns the description of fields in a database table &lt;/P&gt;&lt;P&gt;    EXPORTING &lt;/P&gt;&lt;P&gt;      tabname  = 'ZHR_INCENTIVE' &lt;/P&gt;&lt;P&gt;    TABLES &lt;/P&gt;&lt;P&gt;      dbfields = lt_dbfields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_infile INTO w_infile. &lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt;    WHILE sy-subrc = 0. &lt;/P&gt;&lt;P&gt;      IF sy-index = 1. CONTINUE. ENDIF. "Do not process index 1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*wa_header holds the table headers such field names. &lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT sy-index OF STRUCTURE wa_header TO &amp;lt;fs_comp&amp;gt;. &lt;/P&gt;&lt;P&gt;      READ TABLE lt_dbfields WITH KEY name = &amp;lt;fs_comp&amp;gt; INTO ls_dbfields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT &amp;lt;fs_comp&amp;gt; OF STRUCTURE w_infile TO &amp;lt;fs_dat&amp;gt;. &lt;/P&gt;&lt;P&gt;              t_good-&amp;lt;fs_comp&amp;gt; = &amp;lt;fs_dat&amp;gt;. "This code is not compiling or working &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDWHILE. &lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Sep 2008 13:58:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-15T13:58:31Z</dc:date>
    <item>
      <title>Dynamic programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487007#M1062176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to load data from flat file. The first line of the flat file is the field names(header names). &lt;/P&gt;&lt;P&gt;I'm storing the field names into wa_header then dynamically reading the value of the field from w_infile. &lt;/P&gt;&lt;P&gt;My question is, can I get the internal table field names dynamically  (i.e t_good-&amp;lt;fs_comp&amp;gt; = &amp;lt;fs_dat&amp;gt;). &lt;/P&gt;&lt;P&gt;Any help or suggestion is highly received.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below is my code: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIALIZATION. &lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'DB_GET_TABLE_FIELDS' "Returns the description of fields in a database table &lt;/P&gt;&lt;P&gt;    EXPORTING &lt;/P&gt;&lt;P&gt;      tabname  = 'ZHR_INCENTIVE' &lt;/P&gt;&lt;P&gt;    TABLES &lt;/P&gt;&lt;P&gt;      dbfields = lt_dbfields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT t_infile INTO w_infile. &lt;/P&gt;&lt;P&gt;     &lt;/P&gt;&lt;P&gt;    WHILE sy-subrc = 0. &lt;/P&gt;&lt;P&gt;      IF sy-index = 1. CONTINUE. ENDIF. "Do not process index 1 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*wa_header holds the table headers such field names. &lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT sy-index OF STRUCTURE wa_header TO &amp;lt;fs_comp&amp;gt;. &lt;/P&gt;&lt;P&gt;      READ TABLE lt_dbfields WITH KEY name = &amp;lt;fs_comp&amp;gt; INTO ls_dbfields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT &amp;lt;fs_comp&amp;gt; OF STRUCTURE w_infile TO &amp;lt;fs_dat&amp;gt;. &lt;/P&gt;&lt;P&gt;              t_good-&amp;lt;fs_comp&amp;gt; = &amp;lt;fs_dat&amp;gt;. "This code is not compiling or working &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDWHILE. &lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 13:58:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487007#M1062176</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-15T13:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487008#M1062177</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;Do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: gv_temp TYPE string.

FIELD-SYMBOLS: &amp;lt;fs_new&amp;gt; TYPE ANY.

CONCATENATE 'T_GOOD' &amp;lt;fs_comp&amp;gt; INTO gv_temp.

ASSIGN (gv_temp) to &amp;lt;fs_new&amp;gt;.

&amp;lt;fs_new&amp;gt; = &amp;lt;fs_dat&amp;gt;. " Here you can assign the value
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 14:17:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487008#M1062177</guid>
      <dc:creator>asik_shameem</dc:creator>
      <dc:date>2008-09-15T14:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487009#M1062178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to move data to internal table daynamically. If you look my previous code you will see it.  But I have problem getting internal table fields dynamically.&lt;/P&gt;&lt;P&gt; How can I get the internal table field name daynamicaly(t_good-&amp;lt;fs_comp&amp;gt;)?&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT &amp;lt;fs_comp&amp;gt; OF STRUCTURE w_infile TO &amp;lt;fs_dat&amp;gt;. &lt;/P&gt;&lt;P&gt;t_good-&amp;lt;fs_comp&amp;gt; = &amp;lt;fs_dat&amp;gt;. "This code is not compiling or working &lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 14:37:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487009#M1062178</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-15T14:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487010#M1062179</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;For that only I am telling. Do in the following way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: gv_temp TYPE string.
 
FIELD-SYMBOLS: &amp;lt;fs_new&amp;gt; TYPE ANY.
 
CONCATENATE 'T_GOOD-' &amp;lt;fs_comp&amp;gt; INTO gv_temp. " Add '-'
 
ASSIGN (gv_temp) to &amp;lt;fs_new&amp;gt;. " gv_temp will have T_GOOD-FIELD1
 
&amp;lt;fs_new&amp;gt; = &amp;lt;fs_dat&amp;gt;.  " Now T_GOOD(work area or hearder) will have the value &amp;lt;fs_dat&amp;gt;

APPEND T_GOOD. " Append the value to internal table&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 14:53:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487010#M1062179</guid>
      <dc:creator>asik_shameem</dc:creator>
      <dc:date>2008-09-15T14:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487011#M1062180</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 another field-symbols in order to move the data to structure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT T_INFILE INTO W_INFILE.

    WHILE SY-SUBRC = 0.
      IF SY-INDEX = 1. CONTINUE. ENDIF. "Do not process index 1

*wa_header holds the table headers such field names.
      ASSIGN COMPONENT SY-INDEX OF STRUCTURE WA_HEADER TO &amp;lt;FS_COMP&amp;gt;.
      READ TABLE LT_DBFIELDS WITH KEY NAME = &amp;lt;FS_COMP&amp;gt; INTO LS_DBFIELDS.

      ASSIGN COMPONENT &amp;lt;FS_COMP&amp;gt; OF STRUCTURE W_INFILE TO &amp;lt;FS_DAT&amp;gt;.

*     T_GOOD-&amp;lt;FS_COMP&amp;gt; = &amp;lt;FS_DAT&amp;gt;. "This code is not compiling or
* working

* U need another field-symbols:
     ASSIGN COMPONENT &amp;lt;FS_COMP&amp;gt; OF STRUCTURE T_GOOD TO &amp;lt;FS_TAB&amp;gt;.
     &amp;lt;FS_TAB&amp;gt; = &amp;lt;FS_DAT&amp;gt;.

    ENDWHILE.
  ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 15:12:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487011#M1062180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-15T15:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487012#M1062181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &amp;lt;h4&amp;gt;Asik shameem,&amp;lt;/h4&amp;gt; your answer really did solve my questions, I have really apreciated your prompt, quick and correct solution to my questions. &lt;/P&gt;&lt;P&gt;Than you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 16:15:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487012#M1062181</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-15T16:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487013#M1062182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;lt;h3&amp;gt;Max bianchi&amp;lt;/h3&amp;gt; , Your answer was really helpfull. &lt;/P&gt;&lt;P&gt;Great people here&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 16:19:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487013#M1062182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-15T16:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic programing</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487014#M1062183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome Hassan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2008 04:33:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-programing/m-p/4487014#M1062183</guid>
      <dc:creator>asik_shameem</dc:creator>
      <dc:date>2008-09-16T04:33:38Z</dc:date>
    </item>
  </channel>
</rss>

