<?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: Need help for retaining the reference variable data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883042#M1888355</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Surendra Prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the solution. If I clear the lref_data it works fine. But my requirement is like I need to clear only the reference attribute in the object. So I am using &lt;STRONG&gt;Free lref_data-&amp;gt;mref_data. &lt;/STRONG&gt;Even if I clear the lref_data, I want the copied data to stay as it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Chitti Babu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Feb 2015 10:41:22 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-02-06T10:41:22Z</dc:date>
    <item>
      <title>Need help for retaining the reference variable data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883040#M1888353</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 have a problem in clearing the class reference. I defined a class with a reference variable as an attribute in the class(type ref to data).&lt;/P&gt;&lt;P&gt;I am some how filling the reference variable with some data in the class method.&lt;/P&gt;&lt;P&gt;Now in my report I am processing the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;Data&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;lref_data&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;Type &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;Ref &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;To &lt;/SPAN&gt;zcl_test&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;Data&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;: &lt;/SPAN&gt;lref_data1 &lt;SPAN class="L0S52"&gt;Type &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;Ref &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;To &lt;/SPAN&gt;zcl_test&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52" style="font-size: 10pt;"&gt;Create &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Object lref_data&lt;/SPAN&gt;&lt;SPAN class="L0S55" style="font-size: 10pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;Create &lt;/SPAN&gt;Object lref_data1&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;call &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;Method &lt;/SPAN&gt;lref_data&lt;SPAN class="L0S70"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;add&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&amp;nbsp; (In this method I am filling the reference variable with some data).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lref_data1 ?= lref_data&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Free lref_data-&amp;gt;mref_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So here when I am clearing the reference variable in lref_data automatically my reference variable in lref_data1 is getting cleared.&lt;/P&gt;&lt;P&gt;I know that since they are both pointing to same reference If one is get cleared other will automatically cleared.&lt;/P&gt;&lt;P&gt;But I want lref_data1-&amp;gt;mref_data not to get cleared.&lt;/P&gt;&lt;P&gt;I thought of passing that reference value first in a local variable and after clearing again I can assign it. But I think it is not a good approach to follow.&lt;/P&gt;&lt;P&gt;Please anybody help me with this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 09:51:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883040#M1888353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-06T09:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for retaining the reference variable data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883041#M1888354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chitti babu,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;after you passed the iref_data to iref_data1.&lt;/P&gt;&lt;P&gt;why can't you clear iref_data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FREE&lt;/STRONG&gt; iref_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why you want to&amp;nbsp; clear &lt;SPAN style="color: #333333; font-size: 12px;"&gt;Free &lt;STRONG&gt;lref_data-&amp;gt;mref_data&lt;/STRONG&gt; alone ?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 10:36:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883041#M1888354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-06T10:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for retaining the reference variable data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883042#M1888355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Surendra Prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the solution. If I clear the lref_data it works fine. But my requirement is like I need to clear only the reference attribute in the object. So I am using &lt;STRONG&gt;Free lref_data-&amp;gt;mref_data. &lt;/STRONG&gt;Even if I clear the lref_data, I want the copied data to stay as it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Chitti Babu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 10:41:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883042#M1888355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-06T10:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for retaining the reference variable data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883043#M1888356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;SPAN class="L0S52"&gt;&lt;/SPAN&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;lref_data1 ?= lref_data&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of the above, call the add method in lref_data1, and pass it the same reference variable. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 11:24:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883043#M1888356</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-06T11:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for retaining the reference variable data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883044#M1888357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your answer. Your idea can work. But according to my requirement the class has lot of attributes and some of them are reference attributes. I am filling them in different places. So according to you I need to write the same code twice I think.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 11:35:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883044#M1888357</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-06T11:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for retaining the reference variable data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883045#M1888358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, to maintain 2 seperate references to the same class, you need 2 sets of code.&amp;nbsp; Instead have 1 reference and append each new instance to an internal table.&amp;nbsp; Then you need only 1 set of code.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 11:58:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883045#M1888358</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-06T11:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for retaining the reference variable data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883046#M1888359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please elaborate your answer how can we append instance to an internal table. I dont have any idea how to append it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 12:46:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883046#M1888359</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-06T12:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for retaining the reference variable data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883047#M1888360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;OL&gt;&lt;LI&gt;Why are you copying the reference from one variable to another?&lt;/LI&gt;&lt;LI&gt;What is the business logic you are trying to realise through your code?&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 13:09:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883047#M1888360</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2015-02-06T13:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for retaining the reference variable data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883048#M1888361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suhas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; According to our logic, we need some backup of all the transactional data. So before&amp;nbsp; navigating from one record to other we ll be copying the data from reference to other. After copying the data to some local reference variable, in order to fill new data we are clearing the first reference object. My issue is coming there itself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 13:26:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883048#M1888361</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-02-06T13:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need help for retaining the reference variable data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883049#M1888362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;So before&amp;nbsp; navigating from one record to other we ll be copying the data from reference to other.&lt;/P&gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This, IMHO, doesn't seem like OO programming. It seems like you want to marry procedural &amp;amp; OO programming techniques &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1103/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway every "object" should have a different instance &amp;amp; you can collect these instances in a collection (e.g., IF_OBJECT_COLLECTION). You can then use the collection later for processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Feb 2015 13:33:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/need-help-for-retaining-the-reference-variable-data/m-p/10883049#M1888362</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2015-02-06T13:33:42Z</dc:date>
    </item>
  </channel>
</rss>

