<?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 Retrieve data from internal table dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821025#M1314902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi every body,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an internal table which is generated by a function, this table contains two fields:  id_field and value_field.&lt;/P&gt;&lt;P&gt;when the internal table is created, it will be completed as follows:&lt;/P&gt;&lt;P&gt;___________________________________________&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;id_field&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;value_field&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;|________________|__________________________|				&lt;/P&gt;&lt;P&gt;|  PARTNER           |     0020023658   	                   |			&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;TYPE&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;type 1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;BPKIND&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;val1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;BU_GROUP&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;val2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;BPEXT&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;val3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;|________________|__________________________|	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to retrieve the values of each field in id_field in a structure, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_struct-partner      =  '0020023658'.&lt;/P&gt;&lt;P&gt;ls_struct-type          =  'type 1'.  &lt;/P&gt;&lt;P&gt;ls_struct-bpkind       =  'val1'.&lt;/P&gt;&lt;P&gt;ls_struct-bu_group   =  'val2'.&lt;/P&gt;&lt;P&gt;ls_struct-bpext        =  'val3'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it should dynamically, because I have more than one partner and I have lot of fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have any idea, help !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mll Mat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Jun 2009 16:33:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-24T16:33:29Z</dc:date>
    <item>
      <title>Retrieve data from internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821025#M1314902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi every body,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an internal table which is generated by a function, this table contains two fields:  id_field and value_field.&lt;/P&gt;&lt;P&gt;when the internal table is created, it will be completed as follows:&lt;/P&gt;&lt;P&gt;___________________________________________&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;id_field&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;value_field&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;|________________|__________________________|				&lt;/P&gt;&lt;P&gt;|  PARTNER           |     0020023658   	                   |			&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;TYPE&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;type 1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;BPKIND&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;val1&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;BU_GROUP&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;val2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;BPEXT&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;val3&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;|________________|__________________________|	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to retrieve the values of each field in id_field in a structure, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_struct-partner      =  '0020023658'.&lt;/P&gt;&lt;P&gt;ls_struct-type          =  'type 1'.  &lt;/P&gt;&lt;P&gt;ls_struct-bpkind       =  'val1'.&lt;/P&gt;&lt;P&gt;ls_struct-bu_group   =  'val2'.&lt;/P&gt;&lt;P&gt;ls_struct-bpext        =  'val3'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it should dynamically, because I have more than one partner and I have lot of fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have any idea, help !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mll Mat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2009 16:33:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821025#M1314902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-24T16:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve data from internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821026#M1314903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey..&lt;/P&gt;&lt;P&gt;try with field symbols..&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;KC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2009 17:19:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821026#M1314903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-24T17:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve data from internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821027#M1314904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Krishna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I use Fied symbol ? I never use it &lt;/P&gt;&lt;P&gt;can you help me please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mll Mat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2009 17:28:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821027#M1314904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-24T17:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve data from internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821028#M1314905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can achive this with READ also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With symbols you can do as follows:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: &amp;lt;fs&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;assign component wa-id_field of structure ls_struct&lt;/P&gt;&lt;P&gt;to &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;fs&amp;gt; = wa-value_field.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now ls_struct will contain all the values in the corresponding fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ankur Parab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2009 17:57:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821028#M1314905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-24T17:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve data from internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821029#M1314906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi every body,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; I have an internal table which is generated by a function, this table contains two fields:  id_field and value_field.&lt;/P&gt;&lt;P&gt;&amp;gt; when the internal table is created, it will be completed as follows:&lt;/P&gt;&lt;P&gt;&amp;gt; ___________________________________________&lt;/P&gt;&lt;P&gt;&amp;gt; |  id_field                |      value_field                         |&lt;/P&gt;&lt;P&gt;&amp;gt; |________________|__________________________|				&lt;/P&gt;&lt;P&gt;&amp;gt; |  PARTNER           |     0020023658   	                   |			&lt;/P&gt;&lt;P&gt;&amp;gt; |  TYPE                  |     type 1                               |&lt;/P&gt;&lt;P&gt;&amp;gt; |  BPKIND              |     val1                                   |&lt;/P&gt;&lt;P&gt;&amp;gt; |  BU_GROUP        |     val2                                   |&lt;/P&gt;&lt;P&gt;&amp;gt; |  BPEXT                |     val3                                   |&lt;/P&gt;&lt;P&gt;&amp;gt; |________________|__________________________|	&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; I want to retrieve the values of each field in id_field in a structure, like this:&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; ls_struct-partner      =  '0020023658'.&lt;/P&gt;&lt;P&gt;&amp;gt; ls_struct-type          =  'type 1'.  &lt;/P&gt;&lt;P&gt;&amp;gt; ls_struct-bpkind       =  'val1'.&lt;/P&gt;&lt;P&gt;&amp;gt; ls_struct-bu_group   =  'val2'.&lt;/P&gt;&lt;P&gt;&amp;gt; ls_struct-bpext        =  'val3'.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: itab_struct type standard table of struct,
        ls_struct type struct.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let &lt;STRONG&gt;itab_fm&lt;/STRONG&gt; be the internal table that will be populated after executing the FM and wa_fm be the work area of the same.&lt;/P&gt;&lt;P&gt;Let &lt;STRONG&gt;struct&lt;/STRONG&gt; be the structure of the &lt;STRONG&gt;ls_struct&lt;/STRONG&gt; that you have mentioned containing &lt;STRONG&gt;id_field and value_field as elements.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab_fm into wa_fm.

      ls_struct-(wa_fm-id_field) = wa_fm-value_field.

endloop.

append ls_struct to itab_struct.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps. This is without field-symbols for your ease.&lt;/P&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;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Anand Patil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jun 2009 19:13:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821029#M1314906</guid>
      <dc:creator>former_member189420</dc:creator>
      <dc:date>2009-06-24T19:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve data from internal table dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821030#M1314907</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;Thank you for reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Thank you very very much Ankur Parab for your reply, it works well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Thank you Anand Patil for your reply but it dosn't work, "ls_struct-(wa_fm-id_field)" is&lt;/P&gt;&lt;P&gt;unknown  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mll Mat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Jun 2009 08:59:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/retrieve-data-from-internal-table-dynamically/m-p/5821030#M1314907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-25T08:59:44Z</dc:date>
    </item>
  </channel>
</rss>

