<?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: Dynamic class calling in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565329#M1431948</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 could use the class cl_abap_typedesc to achive this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check out this coding &lt;A href="http://help.sap.com/abapdocu_70/de/ABENRTTI_OBJECT_TYPE_ABEXA.htm" target="test_blank"&gt;http://help.sap.com/abapdocu_70/de/ABENRTTI_OBJECT_TYPE_ABEXA.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the informations you need will be in the attributes of the object of cl_abap_typedesc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;dsp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jan 2010 14:12:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-29T14:12:03Z</dc:date>
    <item>
      <title>Dynamic class calling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565328#M1431947</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;I want to know the same class name which I am executing in the constructor of the class. Is there any system variable which stores this information. Like for example sy-repid for reports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then after getting the calss name in string  how I am going instantiate the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Guru Dutt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 10:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565328#M1431947</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T10:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic class calling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565329#M1431948</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 could use the class cl_abap_typedesc to achive this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check out this coding &lt;A href="http://help.sap.com/abapdocu_70/de/ABENRTTI_OBJECT_TYPE_ABEXA.htm" target="test_blank"&gt;http://help.sap.com/abapdocu_70/de/ABENRTTI_OBJECT_TYPE_ABEXA.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the informations you need will be in the attributes of the object of cl_abap_typedesc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;dsp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 14:12:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565329#M1431948</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-29T14:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic class calling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565330#M1431949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the RTTS classes to get to know to the class name but this would only possible once you have the object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CRATE OBJECT ... statement creates the object before calling the CONSTRUCTOR. So, when system calls the CONSTRUCTOR, the attributes and methods can be accessible by the reference of ME. So, you can pass the reference ME to the method DESCRIBE_BY_OBJECT_REF of the class CL_ABAP_TYPEDESCR in the parameter P_OBJECT_REF and get back the Description object. Attribute ABSOLUTE_NAME of the description object would be the name of the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   data: type_ref TYPE REF TO cl_abap_typedescr,
    type_ref = cl_abap_typedescr=&amp;gt;describe_by_object_ref( me ).
    type_ref-&amp;gt;absolute_name " Name of the class
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jan 2010 14:14:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565330#M1431949</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2010-01-29T14:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic class calling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565331#M1431950</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;When I am using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DESCR_REF = CL_ABAP_TYPEDESCR=&amp;gt;DESCRIBE_BY_DATA( ME ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a compile error showing : &lt;EM&gt;The reference 'Me" to the current instance exists only with instance methods.&lt;/EM&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how to overcome this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Guru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 10:10:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565331#M1431950</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-01T10:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic class calling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565332#M1431951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't access the own Object Reference with ME inside the static method because to access static method, you don't need to instantiate the object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mention your overall design and what you are trying to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Feb 2010 14:12:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565332#M1431951</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2010-02-01T14:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic class calling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565333#M1431952</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;There is a standard interface A with methods A1(Instance dependent), A2(static). There is a custom class B which uses the interface A. There is a sub-class C which inherits B as super-class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;A(Interface)-&amp;gt;B(Super Class)-&amp;gt;C(Sub Class)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now method A2 can be modified in class B. So here I can create a object refernce of type B. But when the same method A2 is visible in class C I cannot create obejct reference for class C. in method A2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for the same reason I needed to know the calling class name so that I can make the object  reference dynamic based on calling class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know is there any way to handle this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Guru&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2010 05:35:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565333#M1431952</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-02T05:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic class calling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565334#M1431953</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;for objects you also need to use the method describe_by_object_ref( )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;dsp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2010 06:49:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-class-calling/m-p/6565334#M1431953</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-02T06:49:33Z</dc:date>
    </item>
  </channel>
</rss>

