<?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>freind class &#8211; SAP EWM Help</title>
	<atom:link href="https://www.sapewmhelp.com/question-tag/freind-class/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>Wed, 27 Aug 2025 07:38:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>How to implement Friend Class in SAP ?</title>
		<link>https://www.sapewmhelp.com/question/how-to-implement-friend-class-in-sap/</link>
					<comments>https://www.sapewmhelp.com/question/how-to-implement-friend-class-in-sap/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Wed, 27 Aug 2025 07:38:43 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=how-to-implement-friend-class-in-sap</guid>

					<description><![CDATA[A friend class can access the protected and private components of another class. This is useful when you want to allow controlled access to internal details of a class without making them public. CLASS main_class DEFINITION. PUBLIC SECTION. METHODS: display. PRIVATE SECTION. DATA: secret TYPE string VALUE &#8216;Top Secret&#8217;. FRIENDS friend_class. &#8221; grant access ENDCLASS. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A <em>friend class</em> can access the <strong>protected</strong> and <strong>private</strong> components of another class. This is useful when you want to allow controlled access to internal details of a class without making them public.</p>
<p>CLASS main_class DEFINITION.<br />
PUBLIC SECTION.<br />
METHODS: display.<br />
PRIVATE SECTION.<br />
DATA: secret TYPE string VALUE &#8216;Top Secret&#8217;.<br />
FRIENDS friend_class. &#8221; grant access<br />
ENDCLASS.</p>
<p>CLASS main_class IMPLEMENTATION.<br />
METHOD display.<br />
WRITE: / &#8216;Main class display:&#8217;, secret.<br />
ENDMETHOD.<br />
ENDCLASS.</p>
<p>CLASS friend_class DEFINITION.<br />
PUBLIC SECTION.<br />
METHODS: reveal IMPORTING obj TYPE REF TO main_class.<br />
ENDCLASS.</p>
<p>CLASS friend_class IMPLEMENTATION.<br />
METHOD reveal.<br />
&#8221; Directly access the private attribute of main_class<br />
WRITE: / &#8216;Friend class can access:&#8217;, obj-&gt;secret.<br />
ENDMETHOD.<br />
ENDCLASS.</p>
<p>START-OF-SELECTION.<br />
DATA(main) = NEW main_class( ).<br />
DATA(frd) = NEW friend_class( ).</p>
<p>main-&gt;display( ).<br />
frd-&gt;reveal( main ).</p>
<p><strong>Output: </strong></p>
<p>Main class display: Top Secret<br />
Friend class can access: Top Secret</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/how-to-implement-friend-class-in-sap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
