<?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>internal tables &#8211; SAP EWM Help</title>
	<atom:link href="https://www.sapewmhelp.com/question-tag/internal-tables/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>Sun, 24 Aug 2025 11:23:01 +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>Types of Internal Tables in ABAP</title>
		<link>https://www.sapewmhelp.com/question/types-of-internal-tables-in-abap/</link>
					<comments>https://www.sapewmhelp.com/question/types-of-internal-tables-in-abap/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Sun, 24 Aug 2025 11:22:22 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=types-of-internal-tables-in-abap</guid>

					<description><![CDATA[SAP defines three main types of internal tables based on their structure and access method: 1. Standard Table (STANDARD TABLE) Default type if nothing is specified. Entries are stored unsorted (in the order you append them). Index-based access (like arrays). Duplicate entries allowed. Access time: By index → very fast (O(1)) By key → linear [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>SAP defines <strong>three main types</strong> of internal tables based on their structure and access method:</p>
<h5>1. <strong>Standard Table (<code>STANDARD TABLE</code>)</strong></h5>
<ul>
<li>
<p>Default type if nothing is specified.</p>
</li>
<li>
<p>Entries are stored <strong>unsorted</strong> (in the order you append them).</p>
</li>
<li>
<p><strong>Index-based access</strong> (like arrays).</p>
</li>
<li>
<p><strong>Duplicate entries allowed</strong>.</p>
</li>
<li>
<p><strong>Access time:</strong></p>
<ul>
<li>
<p>By <strong>index</strong> → very fast (O(1))</p>
</li>
<li>
<p>By <strong>key</strong> → linear search (O(n))</p>
</li>
</ul>
</li>
</ul>
<p><strong>Use Case:</strong> Small-to-medium datasets where duplicates are needed, sequential processing.</p>
<p>&nbsp;</p>
<p>DATA: it_mara TYPE STANDARD TABLE OF mara WITH DEFAULT KEY,<br />wa_mara TYPE mara.</p>
<p>SELECT * FROM mara INTO TABLE it_mara UP TO 10 ROWS.<br />READ TABLE it_mara INTO wa_mara INDEX 5. &#8221; Access by index</p>
<p>&nbsp;</p>
<h5>2. <strong>Sorted Table (<code>SORTED TABLE</code>)</strong></h5>
<ul>
<li>
<p>Entries are always stored in a <strong>sorted order</strong> (by key).</p>
</li>
<li>
<p>No need to <code>SORT</code> explicitly.</p>
</li>
<li>
<p><strong>Unique or non-unique keys</strong> possible (depending on definition).</p>
</li>
<li>
<p><strong>Binary search</strong> used internally for key access.</p>
</li>
<li>
<p><strong>Access time:</strong></p>
<ul>
<li>
<p>By <strong>key</strong> → fast (O(log n))</p>
</li>
<li>
<p>By <strong>index</strong> → slower than standard</p>
</li>
</ul>
</li>
</ul>
<p><strong>Use Case:</strong> When you frequently read data by key and want it sorted automatically.</p>
<p>&nbsp;</p>
<p>DATA: it_mara_sorted TYPE SORTED TABLE OF mara<br />WITH UNIQUE KEY matnr.</p>
<p>SELECT * FROM mara INTO TABLE it_mara_sorted UP TO 10 ROWS.<br />READ TABLE it_mara_sorted WITH TABLE KEY matnr = &#8216;MAT001&#8217;<br />INTO DATA(wa_mara).</p>
<p>&nbsp;</p>
<h5>3. <strong>Hashed Table (<code>HASHED TABLE</code>)</strong></h5>
<ul>
<li>
<p>Entries are stored in <strong>hash algorithm format</strong> (like a dictionary).</p>
</li>
<li>
<p><strong>Only unique keys allowed</strong>.</p>
</li>
<li>
<p><strong>No index access</strong> → can only be accessed via key.</p>
</li>
<li>
<p><strong>Access time:</strong> By key → constant (O(1)) on average.</p>
</li>
<li>
<p>Best for <strong>large datasets</strong> when you always access by key.</p>
</li>
</ul>
<p><strong>Use Case:</strong> Fast key-based lookups, like material master lookup by MATNR.</p>
<p>&nbsp;</p>
<p>DATA: it_mara_hashed TYPE HASHED TABLE OF mara<br />WITH UNIQUE KEY matnr.</p>
<p>SELECT * FROM mara INTO TABLE it_mara_hashed UP TO 1000 ROWS.<br />READ TABLE it_mara_hashed WITH TABLE KEY matnr = &#8216;MAT001&#8217;<br />INTO DATA(wa_mara).</p>
<p>Summary : </p>
<table>
<thead>
<tr>
<th>Type</th>
<th>Sorted?</th>
<th>Duplicates?</th>
<th>Access by Index</th>
<th>Access by Key</th>
<th>Performance</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Standard</strong></td>
<td>No</td>
<td>Yes</td>
<td>Yes</td>
<td>Linear Search</td>
<td>Best for small, sequential</td>
</tr>
<tr>
<td><strong>Sorted</strong></td>
<td>Yes</td>
<td>Optional</td>
<td>Yes</td>
<td>Binary Search</td>
<td>Best for ordered + key access</td>
</tr>
<tr>
<td><strong>Hashed</strong></td>
<td>N/A</td>
<td>No</td>
<td>No</td>
<td>Hash Search</td>
<td>Best for large, key-only access</td>
</tr>
</tbody>
</table>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/types-of-internal-tables-in-abap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
