<?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: Get the Variable Name dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698328#M624749</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;tell me if this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of myitab occurs 0,
  number type i,
  name(30),
 end of myitab.


data: INT_TABNAME(40).
INT_TABNAME = 'MYITAB'.

* Insert internal table fieldname into itab
DATA : IRSTRUCINFO LIKE RSTRUCINFO OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'GET_COMPONENT_LIST'
  EXPORTING
    PROGRAM    = sy-repid
    FIELDNAME  = INT_TABNAME
  TABLES
    COMPONENTS = IRSTRUCINFO.

loop at IRSTRUCINFO.
  write:/ IRSTRUCINFO-COMPNAME.
endloop.

write:/ 'end'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2007 11:33:31 GMT</pubDate>
    <dc:creator>former_member189059</dc:creator>
    <dc:date>2007-08-16T11:33:31Z</dc:date>
    <item>
      <title>Get the Variable Name dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698323#M624744</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 want to get the variable name dyncamically. Here is a small example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: T_HeadNr  type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: Var_Name type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to move the name of the field T_HeadNr i.e. "T_HeadNr" to Var_Name and not the content of T_HeadNr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any inputs is highly appriciated,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thkx&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:14:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698323#M624744</guid>
      <dc:creator>prabhu_s2</dc:creator>
      <dc:date>2007-08-16T11:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Variable Name dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698324#M624745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why would you want to do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:16:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698324#M624745</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T11:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Variable Name dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698325#M624746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its a kinda requirement which i would want put in my code....any inputs&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont wanna to hardcode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Prabhu  S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:19:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698325#M624746</guid>
      <dc:creator>prabhu_s2</dc:creator>
      <dc:date>2007-08-16T11:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Variable Name dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698326#M624747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you define the fields within a stucture you can use the code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: i_components type standard table of rstrucinfo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data w_repid type syrepid.&lt;/P&gt;&lt;P&gt;  w_repid = sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'GET_COMPONENT_LIST'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            program    = w_repid&lt;/P&gt;&lt;P&gt;            fieldname  = 'ST_RECORDS'&lt;/P&gt;&lt;P&gt;       tables&lt;/P&gt;&lt;P&gt;            components = i_components.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:22:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698326#M624747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T11:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Variable Name dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698327#M624748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i dont want this 'ST_RECORDS' to be hardocded. this is my requirement. i need to pass the name dynamically to this f/n module !!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:25:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698327#M624748</guid>
      <dc:creator>prabhu_s2</dc:creator>
      <dc:date>2007-08-16T11:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Variable Name dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698328#M624749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;tell me if this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: begin of myitab occurs 0,
  number type i,
  name(30),
 end of myitab.


data: INT_TABNAME(40).
INT_TABNAME = 'MYITAB'.

* Insert internal table fieldname into itab
DATA : IRSTRUCINFO LIKE RSTRUCINFO OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'GET_COMPONENT_LIST'
  EXPORTING
    PROGRAM    = sy-repid
    FIELDNAME  = INT_TABNAME
  TABLES
    COMPONENTS = IRSTRUCINFO.

loop at IRSTRUCINFO.
  write:/ IRSTRUCINFO-COMPNAME.
endloop.

write:/ 'end'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:33:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698328#M624749</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2007-08-16T11:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Variable Name dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698329#M624750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thkx kris for ur reply. but again i dont want any hardcoding such as INT_TABNAME = 'MYITAB'. is it possible to get the name of  'MYITAB' into INT_TABNAME??????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:35:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698329#M624750</guid>
      <dc:creator>prabhu_s2</dc:creator>
      <dc:date>2007-08-16T11:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Variable Name dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698330#M624751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MYITAB is the name of an internal table containing the fields&lt;/P&gt;&lt;P&gt;when you ask the program to fetch the fieldnames, you need to tell it from where to fetch it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:41:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698330#M624751</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2007-08-16T11:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Variable Name dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698331#M624752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will have to hardcode something. The program cannot assume what structure/field you require.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is reason you do not want to hardcode the structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Martin Shinks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:48:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698331#M624752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T11:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Variable Name dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698332#M624753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there are some classes that gives u the type references of the internal table. in this case is there any similar case where we can get the name of the variable itself?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:50:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698332#M624753</guid>
      <dc:creator>prabhu_s2</dc:creator>
      <dc:date>2007-08-16T11:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Get the Variable Name dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698333#M624754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For classes, do you not need to specify the internal table name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have to hardcode something.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:56:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-the-variable-name-dynamically/m-p/2698333#M624754</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T11:56:47Z</dc:date>
    </item>
  </channel>
</rss>

