<?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: Reading internal table with dynamic fields in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-table-with-dynamic-fields/m-p/3487086#M838381</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you explore more in this.&lt;/P&gt;&lt;P&gt;/Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Mar 2008 15:52:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-13T15:52:56Z</dc:date>
    <item>
      <title>Reading internal table with dynamic fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-table-with-dynamic-fields/m-p/3487085#M838380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;I'm trying to read an internal table with dynamic field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the scenario:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) In the main program I have an internal table itab with fields a, b ,c ,d marked with X's&lt;/P&gt;&lt;P&gt;2) I call a perform in one of my modules and  pass the field name of the internal table itab &lt;/P&gt;&lt;P&gt;in parameter p_field.  &lt;/P&gt;&lt;P&gt;3) This is where I'm stuck. How do I read or even loop thru the internal table passing the field name in a parameter?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_field  USING    P_field&lt;/P&gt;&lt;P&gt;                CHANGING P_HIDE_COL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read the table with key p_det_scrnm&lt;/P&gt;&lt;P&gt;Loop at internal table ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " get_field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion on the syntax?&lt;/P&gt;&lt;P&gt;Tnx&lt;/P&gt;&lt;P&gt;P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 15:04:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-table-with-dynamic-fields/m-p/3487085#M838380</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T15:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal table with dynamic fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-table-with-dynamic-fields/m-p/3487086#M838381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you explore more in this.&lt;/P&gt;&lt;P&gt;/Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 15:52:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-table-with-dynamic-fields/m-p/3487086#M838381</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T15:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal table with dynamic fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-table-with-dynamic-fields/m-p/3487087#M838382</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 believe the column can be dynamic ...but not the entire WITH KEY..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this Example..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code&lt;/P&gt;&lt;P&gt;DATA: itab TYPE STANDARD TABLE OF mara.&lt;/P&gt;&lt;P&gt;DATA: wa TYPE mara.&lt;/P&gt;&lt;P&gt;DATA: where(72).&lt;/P&gt;&lt;P&gt;DATA: where1(72).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Populate. &lt;/P&gt;&lt;P&gt;wa-matnr = 'TEST'.&lt;/P&gt;&lt;P&gt;wa-mtart = 'M1'.&lt;/P&gt;&lt;P&gt;APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where clause &lt;/P&gt;&lt;P&gt;where = 'MATNR'.&lt;/P&gt;&lt;P&gt;where1 = 'MTART'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE itab INTO wa WITH KEY (WHERE) = 'TEST'&lt;/P&gt;&lt;P&gt;(WHERE1) = 'M1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;WRITE: / 'found'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 16:04:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-table-with-dynamic-fields/m-p/3487087#M838382</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T16:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal table with dynamic fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-table-with-dynamic-fields/m-p/3487088#M838383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Not sure what you mean by Explore more on this? Do you mean explain more?&lt;/P&gt;&lt;P&gt;tnx&lt;/P&gt;&lt;P&gt;P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 16:04:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-table-with-dynamic-fields/m-p/3487088#M838383</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T16:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal table with dynamic fields</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-table-with-dynamic-fields/m-p/3487089#M838384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you , thank you Venkat,&lt;/P&gt;&lt;P&gt;It worked!!!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its weird 'coz I did try something similar before I went all crazy doing differenct things but it didn't work. I guess I must have messed up on some comma or period somewhere.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 16:12:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-table-with-dynamic-fields/m-p/3487089#M838384</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T16:12:24Z</dc:date>
    </item>
  </channel>
</rss>

