<?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>SAP ABAP &#8211; SAP EWM Help</title>
	<atom:link href="https://www.sapewmhelp.com/category/sap-abap/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>Sat, 02 Aug 2025 11:35:45 +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>How can you extract specific fields from an internal table using FOR … WHERE inside a VALUE expression?</title>
		<link>https://www.sapewmhelp.com/how-can-you-extract-specific-fields-from-an-internal-table-using-for-where-inside-a-value-expression/</link>
					<comments>https://www.sapewmhelp.com/how-can-you-extract-specific-fields-from-an-internal-table-using-for-where-inside-a-value-expression/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 02 Aug 2025 11:35:43 +0000</pubDate>
				<category><![CDATA[SAP ABAP]]></category>
		<category><![CDATA[ABAP]]></category>
		<category><![CDATA[abap 7.4 example]]></category>
		<category><![CDATA[New Syntax]]></category>
		<category><![CDATA[Reduce operator example]]></category>
		<category><![CDATA[using For New syntax]]></category>
		<category><![CDATA[Value Operator]]></category>
		<guid isPermaLink="false">https://www.sapewmhelp.com/?p=7292</guid>

					<description><![CDATA[This creates a new string table containing only the names of users whose&#160;status = 'ACTIVE'—short, clean, and readable. — REDUCE Example —Total Amount: 500 Output: — FILTER Example —Alice ACTIVECharlie ACTIVE — FOR Expression Example —AliceCharlie]]></description>
										<content:encoded><![CDATA[
<div class="hcb_wrap"><pre class="prism line-numbers lang-plain"><code>*&---------------------------------------------------------------------*
*& Report  ZREP_LCLCLASS
*&---------------------------------------------------------------------*
*& Demonstrates modern ABAP syntax: REDUCE, FILTER, FOR expressions
*&---------------------------------------------------------------------*

REPORT zrep_lclclass.

*----------------------------
* Example 1: REDUCE Operator
*----------------------------
TYPES: BEGIN OF ty_order,
         id     TYPE i,
         amount TYPE i,
       END OF ty_order.

DATA: lt_orders TYPE STANDARD TABLE OF ty_order WITH EMPTY KEY,
      lv_total  TYPE i.

lt_orders = VALUE #(
  ( id = 1 amount = 100 )
  ( id = 2 amount = 250 )
  ( id = 3 amount = 150 )
).

lv_total = REDUCE i( INIT sum = 0
                     FOR order IN lt_orders
                     NEXT sum = sum + order-amount ).

WRITE: / &#39;--- REDUCE Example ---&#39;,
       / &#39;Total Amount:&#39;, lv_total.

*----------------------------
* Example 2: FILTER Operator
*----------------------------
TYPES: BEGIN OF ty_user,
         name   TYPE string,
         status TYPE string,
       END OF ty_user.

DATA: lt_users TYPE STANDARD TABLE OF ty_user WITH EMPTY KEY,
      lt_active_users TYPE STANDARD TABLE OF ty_user WITH EMPTY KEY.

lt_users = VALUE #(
  ( name = &#39;Alice&#39;   status = &#39;ACTIVE&#39; )
  ( name = &#39;Bob&#39;     status = &#39;INACTIVE&#39; )
  ( name = &#39;Charlie&#39; status = &#39;ACTIVE&#39; )
).

lt_active_users = FILTER #( lt_users WHERE status = &#39;ACTIVE&#39; ).

WRITE: / &#39;--- FILTER Example ---&#39;.

LOOP AT lt_active_users INTO DATA(user).
  WRITE: / user-name, user-status.
ENDLOOP.

*------------------------------------------------------
* Example 3: FOR Expression - Extract Specific Fields
*------------------------------------------------------
DATA: lt_names TYPE STANDARD TABLE OF string WITH EMPTY KEY.

lt_names = VALUE string_table(
  FOR user IN lt_users
  WHERE ( status = &#39;ACTIVE&#39; )
  ( user-name )
).

WRITE: / &#39;--- FOR Expression Example ---&#39;.

LOOP AT lt_names INTO DATA(name).
  WRITE: / name.
ENDLOOP.
 </code></pre></div>



<p class="wp-block-paragraph">This creates a new string table containing only the names of users whose&nbsp;<code>status = 'ACTIVE'</code>—short, clean, and readable.</p>



<p class="wp-block-paragraph"><strong>— REDUCE Example —</strong><br>Total Amount: 500</p>



<p class="wp-block-paragraph"><strong>Output:</strong></p>



<p class="wp-block-paragraph"><strong>— FILTER Example —</strong><br>Alice ACTIVE<br>Charlie ACTIVE</p>



<p class="wp-block-paragraph"><strong>— FOR Expression Example —</strong><br>Alice<br>Charlie</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/how-can-you-extract-specific-fields-from-an-internal-table-using-for-where-inside-a-value-expression/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
