<?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: What is Static refrence and Dynamic reference in Inheritance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-static-refrence-and-dynamic-reference-in-inheritance/m-p/2004111#M408317</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go through this link,might help you to solve your problem&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappressbooks.com/downloads/h958_preview.pdf" target="test_blank"&gt;http://www.sappressbooks.com/downloads/h958_preview.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Mar 2007 12:20:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-14T12:20:28Z</dc:date>
    <item>
      <title>What is Static refrence and Dynamic reference in Inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-static-refrence-and-dynamic-reference-in-inheritance/m-p/2004108#M408314</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;  Can any one explain what is static and dynamic type reference variable in OOABAP. I didnt uderstand this statement can anyone explain this with an example.&lt;/P&gt;&lt;P&gt;             obj1 type ref to class1&lt;/P&gt;&lt;P&gt;            obj2 type ref to class2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      create object obj2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        obj1 ?= obj2.  ****what does this statement mean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 09:18:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-static-refrence-and-dynamic-reference-in-inheritance/m-p/2004108#M408314</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T09:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: What is Static refrence and Dynamic reference in Inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-static-refrence-and-dynamic-reference-in-inheritance/m-p/2004109#M408315</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;The static type is the type (class or interface) with which the reference variable has been typed. &lt;/P&gt;&lt;P&gt; DATA : oref type ref to c1.   &amp;#147;Static type of oref is pointing to class c1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dynamic type is the class of the object to which the reference in a reference variable points.&lt;/P&gt;&lt;P&gt; CREATE OBJECT OREF . &amp;#147;Dynamic type also points to c1&lt;/P&gt;&lt;P&gt; CREATE OBJECT OREF TYPE C2. &amp;#147;Dynamic type points to subclass c2 of C1&lt;/P&gt;&lt;P&gt;If the static and dynamic types of a reference variable are different, the static type should always be  more general than the dynamic type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:o_ref1 TYPE REF TO object,
	o_ref2 TYPE REF TO class.
o_ref2 ?= o_ref1.
CATH SYSTEM-EXCEPTIONS move_cast_error = 4.
	o_ref2 ?= o_ref1.
ENDCATCH.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;"object(most general class) is the base class to all the classes and all other class(special classes) are subclasses of object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In some cases, you may wish to make an assignment in which the static type of the target variable is less general than the static type of the source variable. This is known as a widening cast. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result of the assignment must still adhere to the rule that the static type of the target variable must be the same or more general than the dynamic type of the source variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this can only be checked during runtime. To avoid the check on static type, use the special casting operator &amp;#147;?=&amp;#147; and catch the potential runtime error move_cast_error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this explaination helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 09:30:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-static-refrence-and-dynamic-reference-in-inheritance/m-p/2004109#M408315</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T09:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: What is Static refrence and Dynamic reference in Inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-static-refrence-and-dynamic-reference-in-inheritance/m-p/2004110#M408316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Richa .Now the concept is clear to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;sam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 12:01:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-static-refrence-and-dynamic-reference-in-inheritance/m-p/2004110#M408316</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T12:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: What is Static refrence and Dynamic reference in Inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-static-refrence-and-dynamic-reference-in-inheritance/m-p/2004111#M408317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go through this link,might help you to solve your problem&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappressbooks.com/downloads/h958_preview.pdf" target="test_blank"&gt;http://www.sappressbooks.com/downloads/h958_preview.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2007 12:20:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-static-refrence-and-dynamic-reference-in-inheritance/m-p/2004111#M408317</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-14T12:20:28Z</dc:date>
    </item>
  </channel>
</rss>

