<?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: change a table within a method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-a-table-within-a-method/m-p/1471450#M221558</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;To change the values of the passed parameter you should pass it 'BY REFERENCE'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't modify the actuall contents if if is passed by value. because a local copy is made for the variable in the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can copy the contents to the original table in last statement of the method if the table declaration is global.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Aug 2006 10:03:17 GMT</pubDate>
    <dc:creator>dani_mn</dc:creator>
    <dc:date>2006-08-30T10:03:17Z</dc:date>
    <item>
      <title>change a table within a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-a-table-within-a-method/m-p/1471449#M221557</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 am implementing a new method that has an internal table as a changing parameter. But it is passed by value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do to change the data of it within the method?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nerea.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:58:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-a-table-within-a-method/m-p/1471449#M221557</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: change a table within a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-a-table-within-a-method/m-p/1471450#M221558</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;To change the values of the passed parameter you should pass it 'BY REFERENCE'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't modify the actuall contents if if is passed by value. because a local copy is made for the variable in the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can copy the contents to the original table in last statement of the method if the table declaration is global.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 10:03:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-a-table-within-a-method/m-p/1471450#M221558</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-08-30T10:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: change a table within a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-a-table-within-a-method/m-p/1471451#M221559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nerea&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a CHANGING parameter which is a table type (guess that is your situation) you simply work directly on this parameter (e.g. ct_itab). Whether it is passed by value or reference should not matter because when you leave the method the changes will be reflected in the CHANGING parameter. It may make a difference if the flow is prematurely aborted by an exception but I do not know more about that (just give it a try).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 10:50:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-a-table-within-a-method/m-p/1471451#M221559</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2006-08-30T10:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: change a table within a method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/change-a-table-within-a-method/m-p/1471452#M221560</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;thanks Uwe for your answer. I have tried changing the internal table data and it works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whether the parameter is passed by value or by reference, thoufh, does matter. Or at least that's what I have found out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refering to it direcly (e.f. ct_itab) did not work at all, the process jumped the LOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I referenced the internal table before the loop, it processed the loop and inside it I could  directly refer to the internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CLEAR data_ref.&lt;/P&gt;&lt;P&gt;      GET REFERENCE OF it_zeitsatz INTO data_ref.&lt;/P&gt;&lt;P&gt;      CLEAR d_linea.&lt;/P&gt;&lt;P&gt;      LOOP AT it_zeitsatz INTO d_linea.&lt;/P&gt;&lt;P&gt;           CLEAR d_linea.&lt;/P&gt;&lt;P&gt;           MODIFY it_zeitsatz FROM d_linea.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nerea&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 11:18:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/change-a-table-within-a-method/m-p/1471452#M221560</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T11:18:18Z</dc:date>
    </item>
  </channel>
</rss>

