<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>object oriented programming &#8211; SAP EWM Help</title>
	<atom:link href="https://www.sapewmhelp.com/question-tag/object-oriented-programming/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sapewmhelp.com</link>
	<description>SAP EWM questions answered by experts — ABAP, S/4HANA, warehouse management</description>
	<lastBuildDate>Thu, 31 Jul 2025 05:08:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>
	<item>
		<title>What is Inheritance ? Using Inheritance in SAP ABAP</title>
		<link>https://www.sapewmhelp.com/question/what-is-inheritance/</link>
					<comments>https://www.sapewmhelp.com/question/what-is-inheritance/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Wed, 30 Jul 2025 17:04:53 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=what-is-inheritance</guid>

					<description><![CDATA[Inheritance allows one class to reuse the code from another class. In SAP ABAP, this helps in building modular, reusable, and maintainable programs. Use of Inheritance in SAP Purpose Explanation Code Reusability You don&#8217;t need to rewrite common logic; it can be inherited from a base class. Standardization Common functionality can be centralized in a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Inheritance allows one class to <strong>reuse</strong> the code from another class. In SAP ABAP, this helps in building <strong>modular</strong>, <strong>reusable</strong>, and <strong>maintainable</strong> programs.</p>
<h3 data-start="1102" data-end="1133">Use of Inheritance in SAP</h3>
<div class="_tableContainer_16hzy_1">
<div class="_tableWrapper_16hzy_14 group flex w-fit flex-col-reverse">
<table data-start="1135" data-end="1958">
<thead>
<tr>
<th data-start="1135" data-end="1169" data-col-size="sm"><strong>Purpose</strong></th>
<th data-start="1169" data-end="1252" data-col-size="md"><strong>Explanation</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>Code Reusability</td>
<td>You don&#8217;t need to rewrite common logic; it can be inherited from a base class.</td>
</tr>
<tr>
<td>Standardization</td>
<td>Common functionality can be centralized in a superclass and reused.</td>
</tr>
<tr>
<td>Simplifies Maintenance</td>
<td>Changes in the parent class reflect automatically in all child classes.</td>
</tr>
<tr>
<td>Extensibility</td>
<td>Child classes can add or override methods to provide specific functionality.</td>
</tr>
<tr>
<td>Polymorphism Support</td>
<td>You can treat objects of different subclasses uniformly using references.</td>
</tr>
</tbody>
</table>
<h3 data-start="2412" data-end="2451">Types of Inheritance in SAP ABAP</h3>
<ol>
<li><strong>Single Inheritance</strong> – A subclass inherits from only one parent class.</li>
<li><strong>No Multiple Inheritance</strong> – SAP ABAP does not support multiple inheritance, but it allows <strong>interfaces</strong> for similar functionality.</li>
</ol>
<div class="hcb_wrap">
<pre class="prism line-numbers lang-python" data-lang="Python"><code><!--StartFragment --><span><span>*&amp;---------------------------------------------------------------------*</span>
<span>*&amp; Report  ZREP_LCLCLASS</span>
<span>*&amp;</span>
<span>*&amp;---------------------------------------------------------------------*</span>
<span>*&amp;</span>
<span>*&amp;</span>
<span>*&amp;---------------------------------------------------------------------*</span>

<span>REPORT </span>zrep_lclclass<span>.</span>

<span>CLASS </span>parent_class <span>DEFINITION</span><span>.</span>
  <span>PUBLIC </span><span>SECTION</span><span>.</span>
    <span>METHODS</span><span>: </span>display<span>.</span>
<span>ENDCLASS</span><span>.</span>

<span>CLASS </span>parent_class <span>IMPLEMENTATION</span><span>.</span>
  <span>METHOD </span>display<span>.</span>
    <span>WRITE</span><span>: </span>'This <span>is </span>parent class'<span>.</span>
  <span>ENDMETHOD</span><span>.</span>
<span>ENDCLASS</span><span>.</span>

<span>CLASS </span>child_class <span>DEFINITION </span><span>INHERITING </span><span>FROM </span>parent_class<span>.</span>
  <span>PUBLIC </span><span>SECTION</span><span>.</span>
    <span>METHODS</span><span>: </span>show<span>.</span>
<span>ENDCLASS</span><span>.</span>

<span>CLASS </span>child_class <span>IMPLEMENTATION</span><span>.</span>
  <span>METHOD </span>show<span>.</span>
    <span>WRITE</span><span>: </span>'This <span>is </span>child class'<span>.</span>
  <span>ENDMETHOD</span><span>.</span>
<span>ENDCLASS</span><span>.</span>

<span>START-OF-SELECTION</span><span>.</span>
  <span>DATA </span>obj <span>TYPE </span><span>REF </span><span>TO </span>child_class<span>.</span>
  <span>CREATE </span>OBJECT obj<span>.</span>
  obj<span>-&gt;</span>display<span>( </span><span>)</span><span>.   </span><span>"Inherited method</span>
  <span>skip </span><span>2</span><span>.</span>
  obj<span>-&gt;</span>show<span>( </span><span>)</span><span>.      </span><span>"Own method</span></span> </code></pre>
</div>
<p>Output:<br />
<img decoding="async" class="content-img" src="https://www.sapewmhelp.com/wp-content/uploads/2025/07/inheritence-2.png" /></p>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/what-is-inheritance/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
