<?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 &#8211; SAP EWM Help</title>
	<atom:link href="https://www.sapewmhelp.com/question-tag/object-oriented/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, 07 Aug 2025 07:37:25 +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>Types of Inheritance in SAP OOABAP</title>
		<link>https://www.sapewmhelp.com/question/types-of-inheritance-in-sap-ooabap/</link>
					<comments>https://www.sapewmhelp.com/question/types-of-inheritance-in-sap-ooabap/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Thu, 07 Aug 2025 07:37:25 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=types-of-inheritance-in-sap-ooabap</guid>

					<description><![CDATA[1. Single Inheritance (Supported in ABAP) Definition: One subclass inherits from one superclass. Use: Most common form of inheritance. CLASS parent_class DEFINITION.  PUBLIC SECTION.    METHODS: display.ENDCLASS.CLASS parent_class IMPLEMENTATION.  METHOD display.    WRITE: 'Parent class method'.  ENDMETHOD.ENDCLASS.CLASS child_class DEFINITION INHERITING FROM parent_class.ENDCLASS.CLASS child_class IMPLEMENTATION.ENDCLASS. 2. Multilevel Inheritance (Supported in ABAP) Definition: A class inherits from a child class, which itself inherited from a parent class. Hierarchy: Grandparent → Parent → Child CLASS grandparent DEFINITION.  PUBLIC SECTION.    METHODS: method_gp.ENDCLASS.CLASS parent DEFINITION INHERITING FROM grandparent.  PUBLIC SECTION.    METHODS: method_p.ENDCLASS.CLASS child DEFINITION INHERITING FROM parent.  PUBLIC SECTION.    METHODS: method_c.ENDCLASS. 3. Hierarchical Inheritance (Supported via multilevel in [&#8230;]]]></description>
										<content:encoded><![CDATA[<h3 data-start="393" data-end="444">1. <strong>Single Inheritance</strong> <em>(Supported in ABAP)</em></h3>
<ul>
<li><strong>Definition:</strong> One subclass inherits from one superclass.</li>
<li><strong>Use:</strong> Most common form of inheritance.</li>
</ul>
<div class="hcb_wrap">
<pre class="prism line-numbers lang-js" data-lang="JavaScript"><code><!--StartFragment --><span><span>CLASS </span>parent_class <span>DEFINITION</span><span>.</span><br />  <span>PUBLIC </span><span>SECTION</span><span>.</span><br />    <span>METHODS</span><span>: </span>display<span>.</span><br /><span>ENDCLASS</span><span>.</span><br /><br /><span>CLASS </span>parent_class <span>IMPLEMENTATION</span><span>.</span><br />  <span>METHOD </span>display<span>.</span><br />    <span>WRITE</span><span>: </span><span>'Parent class method'</span><span>.</span><br />  <span>ENDMETHOD</span><span>.</span><br /><span>ENDCLASS</span><span>.</span><br /><br /><span>CLASS </span>child_class <span>DEFINITION </span><span>INHERITING </span><span>FROM </span>parent_class<span>.</span><br /><span>ENDCLASS</span><span>.</span><br /><br /><span>CLASS </span>child_class <span>IMPLEMENTATION</span><span>.</span><br /><span>ENDCLASS</span><span>.</span><br /></span> </code></pre>
<h3 data-start="972" data-end="1027">2. <strong>Multilevel Inheritance</strong> <em>(Supported in ABAP)</em></h3>
<ul>
<li><strong>Definition:</strong> A class inherits from a child class, which itself inherited from a parent class.</li>
<li><strong>Hierarchy:</strong> Grandparent → Parent → Child</li>
</ul>
<div class="hcb_wrap">
<pre class="prism line-numbers lang-js" data-lang="JavaScript"><code><!--StartFragment --><span><span>CLASS </span>grandparent <span>DEFINITION</span><span>.</span><br />  <span>PUBLIC </span><span>SECTION</span><span>.</span><br />    <span>METHODS</span><span>: </span>method_gp<span>.</span><br /><span>ENDCLASS</span><span>.</span><br /><br /><span>CLASS </span>parent <span>DEFINITION </span><span>INHERITING </span><span>FROM </span>grandparent<span>.</span><br />  <span>PUBLIC </span><span>SECTION</span><span>.</span><br />    <span>METHODS</span><span>: </span>method_p<span>.</span><br /><span>ENDCLASS</span><span>.</span><br /><br /><span>CLASS </span>child <span>DEFINITION </span><span>INHERITING </span><span>FROM </span>parent<span>.</span><br />  <span>PUBLIC </span><span>SECTION</span><span>.</span><br />    <span>METHODS</span><span>: </span>method_c<span>.</span><br /><span>ENDCLASS</span><span>.</span></span> </code></pre>
<h3 data-start="1494" data-end="1566">3. <strong>Hierarchical Inheritance</strong> <em>(Supported via multilevel in ABAP)</em></h3>
<ul>
<li><strong>Definition:</strong> Similar to multilevel, but describes a tree of inheritance.</li>
<li>ABAP supports this by chaining multiple single inheritances.</li>
</ul>
<h3 data-start="1715" data-end="1783">4. <strong>Multiple Inheritance</strong> <em>(❌ Not Supported Directly in ABAP)</em></h3>
<ul>
<li><strong>Definition:</strong> A class inherits from more than one superclass.</li>
<li><strong>ABAP Limitation:</strong> ABAP allows a class to inherit from <strong>only one class</strong> directly.</li>
<li><strong>Alternative:</strong> Use <strong>interfaces</strong> to simulate multiple inheritance.</li>
</ul>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/types-of-inheritance-in-sap-ooabap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>what are access specifiers in SAP and tell the difference between them and explain their use ?</title>
		<link>https://www.sapewmhelp.com/question/what-are-access-specifiers-in-sap-and-tell-the-difference-between-them-and-explain-their-use/</link>
					<comments>https://www.sapewmhelp.com/question/what-are-access-specifiers-in-sap-and-tell-the-difference-between-them-and-explain-their-use/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Mon, 04 Aug 2025 18:30:55 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=what-are-access-specifiers-in-sap-and-tell-the-difference-between-them-and-explain-their-use</guid>

					<description><![CDATA[Access specifiers define the visibility and accessibility of class components such as attributes, methods, and events. They help in implementing encapsulation, a core concept of object-oriented programming (OOP), by controlling which parts of a class can be accessed from outside the class or by its subclasses. There are three main access specifiers in SAP ABAP: [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Access specifiers define the visibility and accessibility of class components such as attributes, methods, and events. They help in implementing encapsulation, a core concept of object-oriented programming (OOP), by controlling which parts of a class can be accessed from outside the class or by its subclasses.</p>
<p>There are three main access specifiers in SAP ABAP:</p>
<p>1. PUBLIC</p>
<p>2. PROTECTED</p>
<p>3. PRIVATE</p>
<p><strong>Steps to Use Access Specifiers in ABAP Classes</strong></p>
<p>1. Create a class using CLASS&#8230;ENDCLASS.</p>
<p>2. Define sections for PUBLIC, PROTECTED, and PRIVATE using PUBLIC SECTION, PROTECTED SECTION, PRIVATE SECTION.</p>
<p>3. Place the methods or attributes under the appropriate section based on the intended visibility.</p>
<p>4. Instantiate the class and test accessibility from outside and inside (e.g., subclasses).</p>
<p><strong>Access Specifier Visibility Scope Accessible From Use Case Example</strong></p>
<p>PUBLIC High Anywhere (outside class too) General methods available to all</p>
<p>PROTECTED Medium Inside class + subclasses Internal logic exposed to subclasses only</p>
<p>PRIVATE Low Only inside the class Helper methods/data hidden from outside</p>
<p><strong>Access specifiers in SAP ABAP enable secure and modular class design:</strong></p>
<p>· Use PUBLIC for features meant to be openly accessible.</p>
<p>· Use PROTECTED when you want subclass access but hide from external calls.</p>
<p>· Use PRIVATE to fully encapsulate internal logic or helper routines.</p>
<p><img decoding="async" class="content-img" src="https://www.sapewmhelp.com/wp-content/uploads/2025/08/ppp.png" /></p>
<p><img decoding="async" class="content-img" src="https://www.sapewmhelp.com/wp-content/uploads/2025/08/ppp2.png" /></p>
<p>so Outside the class</p>
<p>we cannot call the Private and protected Methods or attributes</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/what-are-access-specifiers-in-sap-and-tell-the-difference-between-them-and-explain-their-use/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is an Interface in SAP ABAP?</title>
		<link>https://www.sapewmhelp.com/question/what-is-an-interface-in-sap-abap/</link>
					<comments>https://www.sapewmhelp.com/question/what-is-an-interface-in-sap-abap/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Sun, 03 Aug 2025 06:42:49 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=what-is-an-interface-in-sap-abap</guid>

					<description><![CDATA[An interface in ABAP defines a contract that any implementing class must follow. It contains only declarations of: Methods (without implementation) Constants Types Attributes Interfaces do not contain implementation. Any class that implements an interface must provide the logic for all its methods. Feature Description No implementation Only method signatures are defined. Multiple interfaces A [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>An interface in ABAP defines a contract that any implementing class must follow. It contains only declarations of:</p>
<ul>
<li>Methods (without implementation)</li>
<li>Constants</li>
<li>Types</li>
<li>Attributes</li>
</ul>
<p>Interfaces do not contain implementation. Any class that implements an interface must provide the logic for all its methods.</p>
<table>
<thead>
<tr>
<th>Feature</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>No implementation</td>
<td>Only method signatures are defined.</td>
</tr>
<tr>
<td>Multiple interfaces</td>
<td>A class can implement <strong>more than one</strong> interface.</td>
</tr>
<tr>
<td>Full implementation required</td>
<td>All interface methods <strong>must be implemented</strong> in the class.</td>
</tr>
<tr>
<td>Promotes loose coupling</td>
<td>Ideal for modular, testable, flexible code.</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Code:</p>
<div class="hcb_wrap">
<pre class="prism line-numbers lang-python" data-lang="Python"><code><!--StartFragment --><span><span>REPORT </span>zrep_lclclass<span>.</span>

<span>INTERFACE </span>if_animal<span>.</span>
  <span>METHODS</span><span>:</span>
    speak<span>,</span>
    <span>move</span><span>.</span>
<span>ENDINTERFACE</span><span>.</span>

<span>" Class that implements the interface</span>
<span>CLASS </span>lcl_dog <span>DEFINITION</span><span>.</span>
  <span>PUBLIC </span><span>SECTION</span><span>.</span>
    <span>INTERFACES</span><span>: </span>if_animal<span>.</span>
<span>ENDCLASS</span><span>.</span>

<span>CLASS </span>lcl_dog <span>IMPLEMENTATION</span><span>.</span>
  <span>METHOD </span>if_animal<span>~</span>speak<span>.</span>
    <span>WRITE</span><span>: </span>'Woof!'<span>.</span>
  <span>ENDMETHOD</span><span>.</span>

  <span>METHOD </span>if_animal<span>~</span><span>move</span><span>.</span>
    <span>WRITE</span><span>: </span>'Dog <span>is </span>running'<span>.</span>
  <span>ENDMETHOD</span><span>.</span>
<span>ENDCLASS</span><span>.</span>

<span>START-OF-SELECTION</span><span>.</span>
  <span>DATA</span><span>(</span>lo_dog<span>) </span><span>= </span><span>NEW </span>lcl_dog<span>( </span><span>)</span><span>.</span>
  lo_dog<span>-&gt;</span>if_animal<span>~</span>speak<span>( </span><span>)</span><span>.</span>
  lo_dog<span>-&gt;</span>if_animal<span>~</span><span>move</span><span>( </span><span>)</span><span>.</span></span> </code></pre>
<p>Output:</p>
<p><img decoding="async" class="content-img" src="https://www.sapewmhelp.com/wp-content/uploads/2025/08/interface.png" /></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/what-is-an-interface-in-sap-abap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is an Abstract Class in SAP ABAP?</title>
		<link>https://www.sapewmhelp.com/question/what-is-an-abstract-class-in-sap-abap/</link>
					<comments>https://www.sapewmhelp.com/question/what-is-an-abstract-class-in-sap-abap/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Sun, 03 Aug 2025 06:37:17 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=what-is-an-abstract-class-in-sap-abap</guid>

					<description><![CDATA[An abstract class is a class that cannot be instantiated directly. It serves as a blueprint for other classes. Abstract classes typically include: Abstract methods, which are declared but not implemented. Concrete methods, which can be implemented and inherited. Feature Description Not instantiable Cannot use CREATE OBJECT on abstract classes. Used for inheritance Serve as [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>An abstract class is a class that cannot be instantiated directly. It serves as a blueprint for other classes. Abstract classes typically include:</p>
<ul>
<li>Abstract methods, which are declared but not implemented.</li>
<li>Concrete methods, which can be implemented and inherited.</li>
</ul>
<table>
<thead>
<tr>
<th>Feature</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Not instantiable</td>
<td>Cannot use <code>CREATE OBJECT</code> on abstract classes.</td>
</tr>
<tr>
<td>Used for inheritance</td>
<td>Serve as base classes for child classes.</td>
</tr>
<tr>
<td>Can contain abstract methods</td>
<td>These must be implemented in subclasses.</td>
</tr>
<tr>
<td>Can contain concrete methods</td>
<td>These can be used directly by child classes.</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<div class="hcb_wrap">
<pre class="prism line-numbers lang-python" data-lang="Python"><code><!--StartFragment --><span><span>REPORT </span>zrep_lclclass<span>.</span>

<span>CLASS </span>lcl_animal <span>DEFINITION </span>ABSTRACT<span>.</span>
  <span>PUBLIC </span><span>SECTION</span><span>.</span>
    <span>METHODS</span><span>:</span>
      speak ABSTRACT<span>,</span>
      <span>move</span><span>.         </span><span>" This can be implemented if needed</span>
<span>ENDCLASS</span><span>.</span>

<span>CLASS </span>lcl_animal <span>IMPLEMENTATION</span><span>.</span>
  <span>METHOD </span><span>move</span><span>.</span>
    <span>WRITE</span><span>: </span>'Animal <span>is </span>moving'<span>.</span>
  <span>ENDMETHOD</span><span>.</span>
<span>ENDCLASS</span><span>.</span>

<span>" Concrete subclass</span>
<span>CLASS </span>lcl_dog <span>DEFINITION </span><span>INHERITING </span><span>FROM </span>lcl_animal<span>.</span>
  <span>PUBLIC </span><span>SECTION</span><span>.</span>
    <span>METHODS</span><span>:</span>
      speak <span>REDEFINITION</span><span>.</span>
<span>ENDCLASS</span><span>.</span>

<span>CLASS </span>lcl_dog <span>IMPLEMENTATION</span><span>.</span>
  <span>METHOD </span>speak<span>.</span>
    <span>WRITE</span><span>: </span>'Woof!'<span>.</span>
  <span>ENDMETHOD</span><span>.</span>
<span>ENDCLASS</span><span>.</span>

<span>START-OF-SELECTION</span><span>.</span>
  <span>" Parent Class</span>
  <span>DATA</span><span>(</span>lo_animal<span>) </span><span>= </span><span>NEW </span>lcl_animal<span>( </span><span>)</span><span>.</span>
  lo_animal<span>-&gt;</span>speak<span>( </span><span>)</span><span>.</span>
  <span>WRITE</span><span>: </span>'Animal can speak'<span>.</span>
  <span>SKIP</span><span>.</span>
  <span>" child class</span>
  <span>DATA</span><span>(</span>lo_dog<span>) </span><span>= </span><span>NEW </span>lcl_dog<span>( </span><span>)</span><span>.</span>
  lo_dog<span>-&gt;</span>speak<span>( </span><span>)</span><span>.</span>
  lo_dog<span>-&gt;</span><span>move</span><span>( </span><span>)</span><span>.</span></span> </code></pre>
<p>Output:<br />
Check the Program ( CTRL + F2 ).<br />
<img decoding="async" class="content-img" src="https://www.sapewmhelp.com/wp-content/uploads/2025/08/abstract-class.png" /></p>
<p>if not initated the Parent class then the output will be.<br />
<img decoding="async" class="content-img" src="https://www.sapewmhelp.com/wp-content/uploads/2025/08/abstract-class-2.png" /></p>
<p>Output:<br />
<img decoding="async" class="content-img" src="https://www.sapewmhelp.com/wp-content/uploads/2025/08/abstract-class-3.png" /></p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/what-is-an-abstract-class-in-sap-abap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
