<?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>me in method &#8211; SAP EWM Help</title>
	<atom:link href="https://www.sapewmhelp.com/question-tag/me-in-method/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:09:22 +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>Use of Me Keyword in SAP ABAP</title>
		<link>https://www.sapewmhelp.com/question/use-of-me-keyword/</link>
					<comments>https://www.sapewmhelp.com/question/use-of-me-keyword/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Tue, 29 Jul 2025 19:32:30 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=use-of-me-keyword</guid>

					<description><![CDATA[When we create a variable in the public section of a class, we can use it within the methods of that class. Let&#8217;s say we assign it an initial value. Later, if we create another variable with the same name inside a method and assign it a new value, this new (local) value will be [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>When we create a variable in the public section of a class, we can use it within the methods of that class. Let&#8217;s say we assign it an initial value. Later, if we create another variable with the same name inside a method and assign it a new value, this new (local) value will be used within that method.</p>
<p>To access the original value from the class, we need to use the <strong>ME operator</strong>.</p>
<p>Example:</p>
<p>We first create a public variable v_txt with an initial value &#8216;Class Variable&#8217;. Then, inside a method, we declare another variable (local to the method) with the same name v_txt, but assign it a different value: &#8216;Method Variable&#8217;.</p>
<p>If we use v_txt directly in the method, it will reference the local variable, and we will get &#8216;Method Variable&#8217;.</p>
<p>If we use me-&gt;v_txt, we explicitly refer to the class attribute, and we get &#8216;Class Variable&#8217;.</p>
<p>Similarly, private and protected methods cannot be accessed directly from outside the class. However, we can call them from within another public method using the ME operator.</p>
<div class="hcb_wrap">
<pre class="prism line-numbers lang-python" data-lang="Python"><code></code><!--StartFragment --><!--StartFragment --><!--StartFragment --><span><span>*&amp;---------------------------------------------------------------------*</span><br /><span>*&amp; Report  ZREP_LCLCLASS</span><br /><span>*&amp;</span><br /><span>*&amp;---------------------------------------------------------------------*</span><br /><span>*&amp;</span><br /><span>*&amp;</span><br /><span>*&amp;---------------------------------------------------------------------*</span><br /><br /><span>REPORT </span>zrep_lclclass<span>.</span><br /><br /><span>" local class definition.</span><br /><span>CLASS </span>lcl_operator  <span>DEFINITION</span><span>.</span><br /><br />  <span>PUBLIC </span><span>SECTION</span><span>.</span><br /><br />    <span>DATA </span><span>: </span>v_txt <span>TYPE </span>string <span>VALUE </span>'Class Variable'<span>.</span><br />    <span>METHODS</span><span>: </span>m_operator<span>.</span><br />    <br />  <span>PROTECTED </span><span>SECTION</span><span>.</span><br />    <span>METHODS</span><span>: </span>m_protectedmethod<span>.</span><br />    <br />  <span>PRIVATE </span><span>SECTION</span><span>.</span><br />    <span>METHODS</span><span>: </span>m_privatemethod<span>.</span><br /><span>ENDCLASS</span><span>.</span><br /><br /><span>" local class implementation</span><br /><span>CLASS </span>lcl_operator <span>IMPLEMENTATION</span><span>.</span><br />  <span>METHOD </span>m_protectedmethod<span>.</span><br />    <span>WRITE </span><span>:</span>/ 'Hi <span>from </span><span>protected </span>method'<span>.</span><br />  <span>ENDMETHOD</span><span>.</span><br />  <span>METHOD </span>m_privatemethod<span>.</span><br />    <span>WRITE </span><span>:</span>/ 'Hi <span>from </span><span>private </span>method'<span>.</span><br />  <span>ENDMETHOD</span><span>.</span><br />  <span>METHOD </span>m_operator<span>.</span><br />    <span>DATA </span>v_txt <span>TYPE </span>string <span>VALUE </span>'Method Variable'<span>.</span><br /><br />    <span>WRITE</span><span>: </span>/ v_txt<span>,</span><br />           / me<span>-&gt;</span>v_txt<span>.</span><br />    me<span>-&gt;</span>m_protectedmethod<span>( </span><span>)</span><span>. </span><span>" protected method</span><br />    me<span>-&gt;</span>m_privatemethod<span>( </span><span>)</span><span>. </span><span>" private method</span><br />  <span>ENDMETHOD</span><span>.</span><br /><span>ENDCLASS</span><span>.</span><br /><br /><br /><span>START-OF-SELECTION</span><span>.</span><br /><br />  <span>" object for class.</span><br />  <span>DATA</span><span>(</span>lo_class<span>) </span><span>= </span><span>NEW </span>lcl_operator<span>( </span><span>)</span><span>.</span><br />  lo_class<span>-&gt;</span>m_operator<span>( </span><span>)</span><span>.<br /><br /><strong>OUTPUT : </strong></span></span></pre>
<p><img decoding="async" class="content-img" src="https://www.sapewmhelp.com/wp-content/uploads/2025/07/Me-operator.png" /></div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/use-of-me-keyword/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
