<?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 dyamic variable name in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dyamic-variable-name/m-p/3067907#M727079</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I want to know if we can name variables dynamically. I am to create a report that summarizes the payment of all the employees against few suppliers.&lt;/P&gt;&lt;P&gt;Let me try to expain u&lt;/P&gt;&lt;P&gt;A supplier means essentially 2-3 wagetypes.&lt;/P&gt;&lt;P&gt;I have &lt;/P&gt;&lt;P&gt;1.Get pernr, Then I get itab1 which stores all the values for all wagetypes for an employee.&lt;/P&gt;&lt;P&gt;Now I loop through the suppliers and find the relevant wagetypes.&lt;/P&gt;&lt;P&gt;now i have itab2 with all the wagetypes i need.&lt;/P&gt;&lt;P&gt;Now &lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;read itab2 wid wagetype itab1-wagetype.&lt;/P&gt;&lt;P&gt;this is all fine&lt;/P&gt;&lt;P&gt;Issue is where do is store value?&lt;/P&gt;&lt;P&gt;as in I cannot use a temporary variable since I dont knw&lt;/P&gt;&lt;P&gt;a. how many wagetypes a supplier mite have&lt;/P&gt;&lt;P&gt;Also I will have to loop through suppliers again and that would be a different set of wagetypes.&lt;/P&gt;&lt;P&gt;can I somehow name a variable such as it is dynamic&lt;/P&gt;&lt;P&gt;i.e temp_8790 for 8790&lt;/P&gt;&lt;P&gt;and temp_8779 for 8779?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;HM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Nov 2007 10:43:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-19T10:43:33Z</dc:date>
    <item>
      <title>dyamic variable name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dyamic-variable-name/m-p/3067907#M727079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I want to know if we can name variables dynamically. I am to create a report that summarizes the payment of all the employees against few suppliers.&lt;/P&gt;&lt;P&gt;Let me try to expain u&lt;/P&gt;&lt;P&gt;A supplier means essentially 2-3 wagetypes.&lt;/P&gt;&lt;P&gt;I have &lt;/P&gt;&lt;P&gt;1.Get pernr, Then I get itab1 which stores all the values for all wagetypes for an employee.&lt;/P&gt;&lt;P&gt;Now I loop through the suppliers and find the relevant wagetypes.&lt;/P&gt;&lt;P&gt;now i have itab2 with all the wagetypes i need.&lt;/P&gt;&lt;P&gt;Now &lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;read itab2 wid wagetype itab1-wagetype.&lt;/P&gt;&lt;P&gt;this is all fine&lt;/P&gt;&lt;P&gt;Issue is where do is store value?&lt;/P&gt;&lt;P&gt;as in I cannot use a temporary variable since I dont knw&lt;/P&gt;&lt;P&gt;a. how many wagetypes a supplier mite have&lt;/P&gt;&lt;P&gt;Also I will have to loop through suppliers again and that would be a different set of wagetypes.&lt;/P&gt;&lt;P&gt;can I somehow name a variable such as it is dynamic&lt;/P&gt;&lt;P&gt;i.e temp_8790 for 8790&lt;/P&gt;&lt;P&gt;and temp_8779 for 8779?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;HM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 10:43:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dyamic-variable-name/m-p/3067907#M727079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-19T10:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: dyamic variable name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dyamic-variable-name/m-p/3067908#M727080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of dynamic variable, you can store the values in a internal table(dynamicly created ) and the report summary will look like this: Hope this helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Supplier | WagesType1 | WagesType2 | WagesType3 | ... |WagesTypeN|  &lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are already many posting on dynamic internal table. It is easy and this will&lt;/P&gt;&lt;P&gt;enhance readabilty of your report also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First determine the maximun number of Wagestype (N).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than in the fieldcatalog of the internal table(this is first step to dynamic internal table creation) declare the fields like&lt;/P&gt;&lt;P&gt;DATA: WAGESXXX(8) VALUE 'WAGESXXX',&lt;/P&gt;&lt;P&gt;           WAGES_TYPE(8),&lt;/P&gt;&lt;P&gt;           COUNT(3)        TYPE N,           &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;Do N times.&lt;/P&gt;&lt;P&gt;ADD 1 TO COUNT.&lt;/P&gt;&lt;P&gt;MOVE WAGESXXX TO WAGES_TYPE.&lt;/P&gt;&lt;P&gt;REPLACE 'XXX' WITH COUNT IN WAGES_TYPE.&lt;/P&gt;&lt;P&gt;WA_FIELDCAT-FIELDNAME = WAGES_TYPE    (001 -&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt;999)&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;APPEND WA_FIELDCAT TO TAB_FIELDCAT.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you have a field of wages_type as many as you want for the report.&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;Amarjit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 12:39:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dyamic-variable-name/m-p/3067908#M727080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-19T12:39:52Z</dc:date>
    </item>
  </channel>
</rss>

