<?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: [ABAP-OO] Returning vs Changing Method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882329#M1888288</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;yes I know about the different kind of passing data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question concerns the case when we have only one parameter: Which type we have to use CHANGING or RETURNING and &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;also&lt;/STRONG&gt;&lt;/SPAN&gt;, why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rachid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 18 Jan 2015 19:43:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-01-18T19:43:58Z</dc:date>
    <item>
      <title>[ABAP-OO] Returning vs Changing Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882324#M1888283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we have many way to change a variable value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;me-&amp;gt;modif_value( &lt;SPAN style="color: #0000ff;"&gt;CHANGING&lt;/SPAN&gt; field = lv_field ).&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI style="text-align: left;"&gt;&lt;SPAN style="font-size: 13.6000003814697px;"&gt;&lt;STRONG&gt;lv_field = me-&amp;gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.6000003814697px;"&gt;&lt;STRONG&gt;modif_value( lv_field ). &lt;/STRONG&gt;"&lt;EM&gt;// returning&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.6000003814697px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.6000003814697px;"&gt;I would like to know what is the best way to use CHANGING or RETURNING and in which case we have to use it ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.6000003814697px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.6000003814697px;"&gt;Thank your very much.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.6000003814697px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.6000003814697px;"&gt;Rachid.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 14:40:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882324#M1888283</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-16T14:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: [ABAP-OO] Returning vs Changing Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882325#M1888284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you only have ONE returned value, prefer functional method, you will also be allowed to use those as actual parameters of other methods.&lt;/P&gt;&lt;P&gt;Else you don't have any choice...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 14:48:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882325#M1888284</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2015-01-16T14:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: [ABAP-OO] Returning vs Changing Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882326#M1888285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Raymond, for your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I know about nesting methods... I am just wondering about memory allocation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cause in Returning type, at the end of the method we have 2 identical memomry allocation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/626254" width="450" /&gt;&lt;/P&gt;&lt;P&gt;and not through CHANGING type...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rachid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 15:08:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882326#M1888285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-16T15:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: [ABAP-OO] Returning vs Changing Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882327#M1888286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's to wonder about? With &lt;STRONG&gt;returning&lt;/STRONG&gt; you pass by value. With &lt;STRONG&gt;changing&lt;/STRONG&gt; you can choose to pass by value or by reference. Passing by value copies the values, pass by references refers to the data object directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is standard and common and not limited to OO or ABAP for that matter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 19:08:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882327#M1888286</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2015-01-16T19:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: [ABAP-OO] Returning vs Changing Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882328#M1888287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;Hello Rachid,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;newer &lt;A _jive_internal="true" href="https://answers.sap.com/community/abap/blog/2013/06/20/abap-news-for-release-740--abap-objects"&gt;Netweaver releases&lt;/A&gt; allow both a RECEIVING and CHANGING parameters. You can also introduce a &lt;A href="http://sourcemaking.com/refactoring/introduce-parameter-object"&gt;parameter object&lt;/A&gt; and pass it as an IMPORTING parameter. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case I would propose to pass a pointer to your table TYPE REF TO Table_Type so you can change the table entries in the method. You could return the changed table as a value parameter without impact if it was never changed later&amp;nbsp; (check table sharing in&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_740/en/index.htm?file=abaploop_at_itab_group_by.htm" title="http://help.sap.com/abapdocu_740/en/index.htm?file=abaploop_at_itab_group_by.htm"&gt;ABAP Keyword Documentation&lt;/A&gt;&lt;SPAN class="path"&gt; →&amp;nbsp; &lt;A class="blue"&gt;ABAP - Reference&lt;/A&gt; →&amp;nbsp; &lt;A class="blue"&gt;Processing Internal Data&lt;/A&gt; →&amp;nbsp; &lt;A class="blue"&gt;Internal Tables&lt;/A&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Matthew once said: There's the right way of doing things (my way) &lt;SPAN __jive_emoticon_name="wink" __jive_macro_name="emoticon" class="jive_macro_emoticon jive_macro jive_emote" src="https://community.sap.com/1103/images/emoticons/wink.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JNN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 20:38:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882328#M1888287</guid>
      <dc:creator>nomssi</dc:creator>
      <dc:date>2015-01-16T20:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: [ABAP-OO] Returning vs Changing Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882329#M1888288</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;yes I know about the different kind of passing data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question concerns the case when we have only one parameter: Which type we have to use CHANGING or RETURNING and &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;also&lt;/STRONG&gt;&lt;/SPAN&gt;, why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rachid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Jan 2015 19:43:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882329#M1888288</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-01-18T19:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: [ABAP-OO] Returning vs Changing Method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882330#M1888289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Which ever you want. I use returning when I want a function like call for use in expressions, changing when there's more than one value, or I want to pass by reference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 06:42:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-returning-vs-changing-method/m-p/10882330#M1888289</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2015-01-19T06:42:22Z</dc:date>
    </item>
  </channel>
</rss>

