<?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: Example for Widening Cast in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-for-widening-cast/m-p/6289240#M1389576</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhishek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A widening cast is when you declare a reference to the superclass and then copy a subclass reference into it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg: You have vehicle class with subclasses like car, truck, bus etc.&lt;/P&gt;&lt;P&gt;You would have implemented the common attributes and methods in the vehicle class.You want to call a method that has been redefined in each of the subclasses. You can then create an internal table with type reference to the vehicle class and fill it up with all the subclass references. Then the redefined method of each subclass can be individually called using the vehicle class reference.&lt;/P&gt;&lt;P&gt;The widening cast operator is ?=.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link to get a better picture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_70/en/ABAPMOVE.htm" target="test_blank"&gt;http://help.sap.com/abapdocu_70/en/ABAPMOVE.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this has given you an idea. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Nandesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Nov 2009 13:08:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-11-20T13:08:15Z</dc:date>
    <item>
      <title>Example for Widening Cast</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-for-widening-cast/m-p/6289237#M1389573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SDNites,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone give me a simple example for widening cast. I am not able to implement the same. Also please tell me the scenarion where the same will be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Abhi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2009 04:52:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-for-widening-cast/m-p/6289237#M1389573</guid>
      <dc:creator>itabhishek9</dc:creator>
      <dc:date>2009-11-16T04:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Example for Widening Cast</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-for-widening-cast/m-p/6289238#M1389574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhishek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the below link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://help-abap.blogspot.com/2008/09/abap-objects-widening-cast-down-casting.html" target="test_blank"&gt;http://help-abap.blogspot.com/2008/09/abap-objects-widening-cast-down-casting.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar M&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2009 07:04:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-for-widening-cast/m-p/6289238#M1389574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-16T07:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Example for Widening Cast</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-for-widening-cast/m-p/6289239#M1389575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, here goes THAT discussion again. There has been some confusion on this in the past (search SCN for example);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Widening cast = Up Cast&lt;/P&gt;&lt;P&gt;Narrowing cast = Down Cast&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what is says in the current version of the ABAP Help (SAP_ABA 7.01 SP 3):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;down cast &lt;/P&gt;&lt;P&gt;Also called a &lt;STRONG&gt;narrowing cast&lt;/STRONG&gt;, a down cast is an assignment between reference variables in which the typr static type of the target variable more specific than the static type of the source variable. A down cast is only possible in assignments with the casting operator (?=) or MOVE ... ?TO. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also referred to as &lt;STRONG&gt;widening cast&lt;/STRONG&gt;. Assignment between reference variables, where the static type of the target variables is similar or identical to the static type of the source variables. See Down Cast. &lt;/P&gt;&lt;P&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;So now the relevant question would be: Are you actually looking for a narrowing of widening cast (real life) example?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2009 07:22:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-for-widening-cast/m-p/6289239#M1389575</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-11-16T07:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Example for Widening Cast</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/example-for-widening-cast/m-p/6289240#M1389576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhishek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A widening cast is when you declare a reference to the superclass and then copy a subclass reference into it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg: You have vehicle class with subclasses like car, truck, bus etc.&lt;/P&gt;&lt;P&gt;You would have implemented the common attributes and methods in the vehicle class.You want to call a method that has been redefined in each of the subclasses. You can then create an internal table with type reference to the vehicle class and fill it up with all the subclass references. Then the redefined method of each subclass can be individually called using the vehicle class reference.&lt;/P&gt;&lt;P&gt;The widening cast operator is ?=.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link to get a better picture.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_70/en/ABAPMOVE.htm" target="test_blank"&gt;http://help.sap.com/abapdocu_70/en/ABAPMOVE.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this has given you an idea. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Nandesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Nov 2009 13:08:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/example-for-widening-cast/m-p/6289240#M1389576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-20T13:08:15Z</dc:date>
    </item>
  </channel>
</rss>

