<?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: dynamic internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160673#M120367</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dear  Wenceslaus G &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             what is new_line. could u explain in detail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sarangan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Feb 2006 05:55:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-09T05:55:55Z</dc:date>
    <item>
      <title>dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160668#M120362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;  i have created a dynamic internal table which has fields which is in the data of another table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that is it1 has&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data&lt;/P&gt;&lt;P&gt;  new york    10&lt;/P&gt;&lt;P&gt;  london       50&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dynamic table has &lt;/P&gt;&lt;P&gt;field has      new york    london&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to put data in this format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;new york   london&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10           50&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sarangan r&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 05:37:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160668#M120362</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T05:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160669#M120363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for that u need to use ASSIGN COMPONENT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;FS&amp;gt;,&amp;lt;FS1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT city of itab to &amp;lt;FS&amp;gt;.&lt;/P&gt;&lt;P&gt;assign 10 to &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;FS&amp;gt; = &amp;lt;FS1&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 05:40:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160669#M120363</guid>
      <dc:creator>hymavathi_oruganti</dc:creator>
      <dc:date>2006-02-09T05:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160670#M120364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;field-symbols:  &amp;lt;dyn_wa&amp;gt;. 
create data new_line like line of &amp;lt;dyn_table&amp;gt;. "Work Area"
assign new_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.
assign component  fieldname  of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;fs1&amp;gt;.
&amp;lt;fs1&amp;gt; =  fieldvalue.
append &amp;lt;dyn_wa&amp;gt; to &amp;lt;dyn_table&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 05:47:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160670#M120364</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T05:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160671#M120365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ztestaks.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;TYPES: t_source(72).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: v_program(8),&lt;/P&gt;&lt;P&gt;      v_err_message(128),&lt;/P&gt;&lt;P&gt;      v_error_line TYPE i.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;DATA: i_subroutine_code TYPE table of t_source,&lt;/P&gt;&lt;P&gt;      s_source          TYPE t_source.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;s_source = 'REPORT ZDYNAMICPROG'.&lt;/P&gt;&lt;P&gt;APPEND s_source TO i_subroutine_code.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*-- Now prepare the code for the dynamic subroutine&lt;/P&gt;&lt;P&gt;s_source = 'FORM DYNAMIC_SELECT.'.&lt;/P&gt;&lt;P&gt;APPEND s_source TO i_subroutine_code .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*-- Prepare the code for declaring the internal table&lt;/P&gt;&lt;P&gt;s_source = 'DATA: BEGIN OF T_LFA1,'.&lt;/P&gt;&lt;P&gt;APPEND s_source TO i_subroutine_code.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*-- this will dynamically build the fields of internal table&lt;/P&gt;&lt;P&gt;LOOP AT t_unique.&lt;/P&gt;&lt;P&gt;  CLEAR s_source.&lt;/P&gt;&lt;P&gt;  CONCATENATE t_unique-fname&lt;/P&gt;&lt;P&gt;              'LIKE'&lt;/P&gt;&lt;P&gt;              'LFA1-'&lt;/P&gt;&lt;P&gt;         INTO s_source SEPARATED BY SPACE.&lt;/P&gt;&lt;P&gt;  CONCATENATE s_source&lt;/P&gt;&lt;P&gt;              t_unique-fname&lt;/P&gt;&lt;P&gt;              ','&lt;/P&gt;&lt;P&gt;         INTO s_source.&lt;/P&gt;&lt;P&gt;  APPEND s_source TO i_subroutine_code.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;s_source = 'END OF T_LFA1.'.&lt;/P&gt;&lt;P&gt;APPEND s_source TO i_subroutine_code.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*-- Now prepare the code for the select statement&lt;/P&gt;&lt;P&gt;s_source = 'SELECT'.&lt;/P&gt;&lt;P&gt;APPEND s_source TO i_subroutine_code.&lt;/P&gt;&lt;P&gt;LOOP AT t_unique.&lt;/P&gt;&lt;P&gt;  s_source = t_unique-fname.&lt;/P&gt;&lt;P&gt;  APPEND s_source TO i_subroutine_code.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;s_source = 'FROM LFA1'&lt;/P&gt;&lt;P&gt;APPEND s_source TO i_subroutine_code.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;s_source = 'INTO TABLE T_LFA1'.&lt;/P&gt;&lt;P&gt;APPEND s_source TO i_subroutine_code.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;s_source = 'WHERE LAND1 = 'BR'.&lt;/P&gt;&lt;P&gt;APPEND s_source TO i_subroutine_code.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;s_source = 'ENDFORM.'.&lt;/P&gt;&lt;P&gt;APPEND s_source TO i_subroutine_code.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;generate subroutine pool i_subroutine_code &lt;/P&gt;&lt;P&gt;                    name v_program&lt;/P&gt;&lt;P&gt;                 message v_err_message&lt;/P&gt;&lt;P&gt;                    line v_error_line.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;  perform DYNAMIC_SELECT in program (v_program).&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;  write:/ v_err_message.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 05:54:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160671#M120365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T05:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160672#M120366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is new_line&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 05:54:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160672#M120366</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T05:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160673#M120367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dear  Wenceslaus G &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;             what is new_line. could u explain in detail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sarangan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 05:55:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160673#M120367</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T05:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160674#M120368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data: new_table type ref to data,&lt;/P&gt;&lt;P&gt;field-symbols:  &amp;lt;dyn_wa&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do 10 times.&lt;/P&gt;&lt;P&gt;    index = sy-index.&lt;/P&gt;&lt;P&gt;    clear wa_it_fldcat.&lt;/P&gt;&lt;P&gt;    concatenate 'Field' index into&lt;/P&gt;&lt;P&gt;             wa_it_fldcat-fieldname .&lt;/P&gt;&lt;P&gt;    condense  wa_it_fldcat-fieldname no-gaps.&lt;/P&gt;&lt;P&gt;    wa_it_fldcat-datatype = 'CHAR'.&lt;/P&gt;&lt;P&gt;    wa_it_fldcat-intlen = 5.&lt;/P&gt;&lt;P&gt;    append wa_it_fldcat to it_fldcat .&lt;/P&gt;&lt;P&gt;  enddo.&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        = new_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create data new_line like line of &amp;lt;dyn_table&amp;gt;. "Work Area"&lt;/P&gt;&lt;P&gt;assign new_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;assign component  fieldname  of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;fs1&amp;gt; =  fieldvalue.&lt;/P&gt;&lt;P&gt;append &amp;lt;dyn_wa&amp;gt; to &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 06:06:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160674#M120368</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T06:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160675#M120369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;assign component  fieldname  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;you gave fieldname i do not know that is dynamic&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to do it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sarangan r&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 06:07:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160675#M120369</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T06:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160676#M120370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When creating the dynamic fields in the dynamic internal table name it as FIELD1, FIELD2 etc.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;concatenate 'Field' index into wa_it_fldcat-fieldname.
condense  wa_it_fldcat-fieldname no-gaps.
wa_it_fldcat-datatype = 'CHAR'.
wa_it_fldcat-intlen = 5.
append wa_it_fldcat to it_fldcat .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hence when you retrieve it back you can dynamically concatenate and get the field values.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;concatenate 'FIELD' index into fieldname.
condense fieldname  no-gaps.
* Set up field value
concatenate 'FLD' index into fieldvalue.
condense   fieldvalue no-gaps.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ps: Reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 06:18:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160676#M120370</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T06:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160677#M120371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sarangan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table&lt;/P&gt;&lt;P&gt;/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Ankur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 06:20:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160677#M120371</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-09T06:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160678#M120372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;then instead of fieldname u can give index&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT INDEX OF ITAB TO &amp;lt;FS&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2006 06:20:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/1160678#M120372</guid>
      <dc:creator>hymavathi_oruganti</dc:creator>
      <dc:date>2006-02-09T06:20:47Z</dc:date>
    </item>
  </channel>
</rss>

