<?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: Inheritance clarification. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance-clarification/m-p/10682723#M1869169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Create one superclass, having one method for fetching GL details, leave it blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now define two subclass , Vendor and Customer inheriting from superclass, here you can redefine the method for fetching GL details based on whether customer or vendor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same code will work irrespective of radio button selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say lcl_super is your superclass&lt;/P&gt;&lt;P&gt;lcl_vendor is vendor&lt;/P&gt;&lt;P&gt;lcl_customer is customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Redefine the method(for fetching GL account )&amp;nbsp; in vendor and customer classes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: lob_super type ref to lcl_super,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lob_vendor type ref to lcl_vendor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lob_cust type ref to lcl_customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if p_rad1 = 'X'.&lt;/P&gt;&lt;P&gt; create object lob_vendor.&lt;/P&gt;&lt;P&gt; lob_super = lob_vendor.&lt;/P&gt;&lt;P&gt;elseif p_rad2 = 'X'.&lt;/P&gt;&lt;P&gt;create object lob_cust.&lt;/P&gt;&lt;P&gt;lob_super = lob_cust.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method lob_super-&amp;gt;fetch_gl( ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Oct 2014 07:30:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-10-17T07:30:16Z</dc:date>
    <item>
      <title>Inheritance clarification.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance-clarification/m-p/10682722#M1869168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am&amp;nbsp; beginner&amp;nbsp; object oriented&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Requirement:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Created&amp;nbsp;&amp;nbsp; two radio buttons as&amp;nbsp; 'VENDOR' and 'Customer' based on radio button get the corresponding vendor/Customer and&amp;nbsp; GL Details .&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Eg: Vendor&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Bsik, Bsak, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer&amp;nbsp; - Bsid, Bsad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Gl&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Bsis,&amp;nbsp; Bsas. (Common For both)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Attempted:&amp;nbsp; &lt;/STRONG&gt;Created two local class Vendor/Customer , Gl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Used &lt;STRONG&gt;Inheritance&lt;/STRONG&gt; Considering Vendor/Customer as Main class and Gl as Subclass&amp;nbsp; while accessing the subclass the main class internal table displayed null.Seen many sample examples displayed only with write statement(&lt;STRONG&gt;Clarification).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;To declare common select&lt;STRONG&gt; &lt;/STRONG&gt;Select Query(GL) for fetching vendor and customer&amp;nbsp; Details&amp;nbsp; Considering Field-Symbols&amp;nbsp; to assign internal table in select query but its never worked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I tried with vendor&amp;nbsp; details first. In&amp;nbsp; &lt;STRONG&gt;inheritance&lt;/STRONG&gt;&amp;nbsp; subclass wrote a select query to fetch data based on main class itab, Code is activated without error and&amp;nbsp; main class itab&amp;nbsp; contains data, but&amp;nbsp; subclass&amp;nbsp;&amp;nbsp; displaying values null&amp;nbsp; ? .&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 06:24:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance-clarification/m-p/10682722#M1869168</guid>
      <dc:creator>VenkatRamesh_V</dc:creator>
      <dc:date>2014-10-17T06:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Inheritance clarification.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance-clarification/m-p/10682723#M1869169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Create one superclass, having one method for fetching GL details, leave it blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now define two subclass , Vendor and Customer inheriting from superclass, here you can redefine the method for fetching GL details based on whether customer or vendor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same code will work irrespective of radio button selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say lcl_super is your superclass&lt;/P&gt;&lt;P&gt;lcl_vendor is vendor&lt;/P&gt;&lt;P&gt;lcl_customer is customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Redefine the method(for fetching GL account )&amp;nbsp; in vendor and customer classes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: lob_super type ref to lcl_super,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lob_vendor type ref to lcl_vendor,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lob_cust type ref to lcl_customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if p_rad1 = 'X'.&lt;/P&gt;&lt;P&gt; create object lob_vendor.&lt;/P&gt;&lt;P&gt; lob_super = lob_vendor.&lt;/P&gt;&lt;P&gt;elseif p_rad2 = 'X'.&lt;/P&gt;&lt;P&gt;create object lob_cust.&lt;/P&gt;&lt;P&gt;lob_super = lob_cust.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method lob_super-&amp;gt;fetch_gl( ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 07:30:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance-clarification/m-p/10682723#M1869169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-10-17T07:30:16Z</dc:date>
    </item>
  </channel>
</rss>

