<?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 an internal table name from a variable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243813#M1526739</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And how exactly does the subroutine look like? I mean, how is this variable declared in the subroutine?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM buil_itab using value(table).

ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Sep 2010 16:30:50 GMT</pubDate>
    <dc:creator>Sm1tje</dc:creator>
    <dc:date>2010-09-17T16:30:50Z</dc:date>
    <item>
      <title>Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243806#M1526732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an itab and a variable as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: Begin of ITAB_HDR OCCURS 0,&lt;/P&gt;&lt;P&gt; DOCNUM(10),&lt;/P&gt;&lt;P&gt;END OF ITAB_HDR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: VAR(10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate 'ITAB_' 'HDR' into VAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITAB_HDR = 'ABC'&lt;/P&gt;&lt;P&gt;append ITAB_HDR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to read the internal table ITAB_HDR from the variable as follows:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table VAR with key DOCNUM = 'ABC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VAR as you can see has the name of the internal table....why is it not working and how can i make it work???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Sep 17, 2010 10:40 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 14:37:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243806#M1526732</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-17T14:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243807#M1526733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to the syntax error, this is something that is just not possible. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But what exactly is it you are trying to do here? What do you want to achieve?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 15:10:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243807#M1526733</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2010-09-17T15:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243808#M1526734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to generate an internal table name at runtime and read from it. The internal table is not dynamic and its already been defined. Only the name of the internal table is dynamic (that is the name is generated at runtime)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cant believe no one has ever asked this question &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 15:22:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243808#M1526734</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-17T15:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243809#M1526735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wont it be easier to achieve this with pointers?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 15:38:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243809#M1526735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-17T15:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243810#M1526736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please can you help with the syntax?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 15:41:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243810#M1526736</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-17T15:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243811#M1526737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The name of the internal table is generated, you say. Now, at what point (where) do you have access to this internal table (dynamic name, but structure is static). Is it an import parameter into your method, or function module? Do you have extract of the coding perhaps, something that can help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 16:04:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243811#M1526737</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2010-09-17T16:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243812#M1526738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;**************&lt;STRONG&gt;ITABS&lt;/STRONG&gt;**************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: Begn of ITAB_HDR&lt;/P&gt;&lt;P&gt;         .......&lt;/P&gt;&lt;P&gt;        ........&lt;/P&gt;&lt;P&gt;        End of ITAB_HDR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: Begn of ITAB_TAX&lt;/P&gt;&lt;P&gt;         .......&lt;/P&gt;&lt;P&gt;        ........&lt;/P&gt;&lt;P&gt;        End of ITAB_TAX.&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;perform build_itab using&lt;/P&gt;&lt;P&gt;                              'HDR'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform build_itab using&lt;/P&gt;&lt;P&gt;                              'TAX'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The parameter 'HDR' and "TAX"  are passed via subroutines as shown above. The internal ITAB_HDR and ITAB_TAX are globally defined hence accessable from the subroutines. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The name of the ITAB's are generated within the subroutines to either ITAB_HDR and ITAB_TAX in a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it clarifies the situation further...Appreciate your help!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 16:16:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243812#M1526738</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-17T16:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243813#M1526739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And how exactly does the subroutine look like? I mean, how is this variable declared in the subroutine?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM buil_itab using value(table).

ENDFORM.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 16:30:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243813#M1526739</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2010-09-17T16:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243814#M1526740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if you are bound to the syntax you have given, but here is an example of how it could work, without knowing the exact conditions (restrictions) you have to work under.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: BEGIN OF ty_header,
  field1(20).
TYPES: END OF ty_header.

TYPES: BEGIN OF ty_tax,
  field2(10).
TYPES: END OF ty_tax.

DATA:
  itab_header TYPE TABLE OF ty_header,
  itab_tax    TYPE TABLE OF ty_tax.

START-OF-SELECTION.

  PERFORM build_itab USING itab_header.

  PERFORM build_itab USING itab_tax.

END-OF-SELECTION.

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  build_itab
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      --&amp;gt;VALUE(TABLE)  text
*----------------------------------------------------------------------*
FORM build_itab USING table TYPE ANY TABLE.

  FIELD-SYMBOLS:
     &amp;lt;line&amp;gt;  TYPE ANY.


  LOOP AT table ASSIGNING &amp;lt;line&amp;gt;.
*   DO SOME CODING HERE.

  ENDLOOP.

ENDFORM.                    "build_itab

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 16:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243814#M1526740</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2010-09-17T16:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243815#M1526741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes it looks like as below where ITAB_TYP contains string either "HDR" or "TAX" that was passed while calling the subroutine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM BUILD_ITAB  USING &lt;/P&gt;&lt;P&gt;                                 VALUE(ITAB_TYP).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 16:46:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243815#M1526741</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-17T16:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243816#M1526742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. Now if there were any changes to be made to the table in the loop (within the sub routine) how can those reflect in the original internal tables for header and tax?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 16:55:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243816#M1526742</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-17T16:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reading an internal table name from a variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243817#M1526743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks alot for your help Micky. Based on your code I used the logic of passing the table as parameter to the subroutine and it did the trick, I was wanting to apply!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very grateful for your direction and full points given!!!! Wish could give you more!! &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Sep 2010 23:57:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-an-internal-table-name-from-a-variable/m-p/7243817#M1526743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-17T23:57:21Z</dc:date>
    </item>
  </channel>
</rss>

