<?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: METHOD DESTRUCTOR in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181166#M125838</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;Well just to add to your understanding u can look for documentation on GARBAGE COLLECTOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP uses GARBAGE COLLECTOR TO actually delete all object related resources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During the FREE OBJECT command only the reference is lost , the memory is cleared only when the Garbage collector comes into picture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Sumeet Mishra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jan 2006 09:56:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-01-30T09:56:29Z</dc:date>
    <item>
      <title>METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181155#M125827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a class in ABAP. My constructor is;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method CONSTRUCTOR.&lt;/P&gt;&lt;P&gt; ...&lt;/P&gt;&lt;P&gt; CREATE OBJECT X_APP_EXCEL 'excel.application'.&lt;/P&gt;&lt;P&gt; ...&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to free X_APP_EXCEL object in destructor. And I wrote;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method DESTRUCTOR.&lt;/P&gt;&lt;P&gt;  FREE OBJECT X_APP_EXCEL.&lt;/P&gt;&lt;P&gt;endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, I am getting an error as;&lt;/P&gt;&lt;P&gt;"Within a destructor method, you can only use the system-call c-destructor." What is this? How can I free my object?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 08:48:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181155#M125827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-30T08:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181156#M125828</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;if you see the standard classes there you can see only clear , and refresh.&lt;/P&gt;&lt;P&gt;so i think you can use clear and refresh to destroy.&lt;/P&gt;&lt;P&gt;don't use free.&lt;/P&gt;&lt;P&gt;for reference see the class method &amp;lt;b&amp;gt;cl_gui_alv_grid&amp;lt;/b&amp;gt; 's &amp;lt;b&amp;gt;FREE&amp;lt;/b&amp;gt; method. this is a destructor.&lt;/P&gt;&lt;P&gt;in side destructor you use clear and refresh that will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 08:57:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181156#M125828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-30T08:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181157#M125829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when you created the method (destructor) its self the system would warn you that only c-destructor is supported.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its generally implemented using method FREE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 09:00:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181157#M125829</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2006-01-30T09:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181158#M125830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can not write anything in destructor. When I write refresh and clear commands, the same error occured, and my X_APP_EXCEL is an ole object. I have to free this object. But I do not know how can I do? And what is c-destructor?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 09:09:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181158#M125830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-30T09:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181159#M125831</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;better change the name of the method and see .&lt;/P&gt;&lt;P&gt;change the name from destructor to free or some thing else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 09:12:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181159#M125831</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-30T09:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181160#M125832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes that is alternative for solution. But, this class will be used by another users. Maybe at the end of they will not call the FREE method for free my X_APP_EXCEL. In this case, this is not good for object programming.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 09:16:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181160#M125832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-30T09:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181161#M125833</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;you should ask them to use the FREE method. to free the object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 09:19:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181161#M125833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-30T09:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181162#M125834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But, I want to ask that, why there is a destructor method in ABAP? When and why this method will be used? In another languages such as java, I am declaring destuctor method to free of class's resources. Is there any different concept for ABAP's destructor?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 09:36:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181162#M125834</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-30T09:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181163#M125835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are no destructors in ABAP. Read note 168703 to get details and explanations on this topic. In Java there is also no destructor only method 'Finalize' but you don't have guarantee when it will be called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DESTRUCTOR statement in ABAP is for SAP intrnal use and can call kernel routines written in C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From note 168703:&lt;/P&gt;&lt;P&gt;"&amp;lt;b&amp;gt;In light of all these problems, the designers of ABAP Objects decided no not provide an ABAP Destructor at this time. Instead, there is a provision for a 'C-destructor' that can however only be used by SAP kernel developers.&amp;lt;/b&amp;gt;"&lt;/P&gt;&lt;P&gt;Message was edited by: Tomasz Mackowski&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Tomasz Mackowski&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 09:42:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181163#M125835</guid>
      <dc:creator>former_member182670</dc:creator>
      <dc:date>2006-01-30T09:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181164#M125836</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 no idea where it is used ABAP, &lt;/P&gt;&lt;P&gt;may be it is for internal use.&lt;/P&gt;&lt;P&gt;that is the reason it is throwing errors.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 09:44:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181164#M125836</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-30T09:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181165#M125837</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;&lt;/P&gt;&lt;P&gt;Well I tried finding some documentation on this , but in vain .... so it doesnt seems this a reserved SAP method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it seems that the method destructor does not allow abap calls inside itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that means u can only use direct system call(kernel) to free memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As recommended by Vijay changing the name of method should solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Sumeet Mishra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 09:48:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181165#M125837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-30T09:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181166#M125838</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;Well just to add to your understanding u can look for documentation on GARBAGE COLLECTOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP uses GARBAGE COLLECTOR TO actually delete all object related resources.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During the FREE OBJECT command only the reference is lost , the memory is cleared only when the Garbage collector comes into picture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Sumeet Mishra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 09:56:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181166#M125838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-01-30T09:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: METHOD DESTRUCTOR</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181167#M125839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Garbage Collector is used for managing ABAP Object objects, and FREE OBJECT is used to release OLE object referenced from ABAP code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I think you cannot guarantee freeing  of Excel OLE object in your application after "destruction". You have two choices: &lt;/P&gt;&lt;P&gt;- free this object by yourself , but you must find a goood place where to do it, or&lt;/P&gt;&lt;P&gt;- leave this responsibility to clients of your class giving them some kind of 'free' or 'release' method which will call  FREE OBJECT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jan 2006 10:04:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/method-destructor/m-p/1181167#M125839</guid>
      <dc:creator>former_member182670</dc:creator>
      <dc:date>2006-01-30T10:04:14Z</dc:date>
    </item>
  </channel>
</rss>

