<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: REDUCE not concatenating strings in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reduce-not-concatenating-strings/m-p/14041767#M2041364</link>
    <description>&lt;P&gt;You can achieve the same by sing backticks ` instead of single quotes '.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Mar 2025 08:35:22 GMT</pubDate>
    <dc:creator>MBartsch71</dc:creator>
    <dc:date>2025-03-12T08:35:22Z</dc:date>
    <item>
      <title>REDUCE not concatenating strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reduce-not-concatenating-strings/m-p/14041203#M2041358</link>
      <description>&lt;P&gt;Why does the following code with REDUCE not concatenate the table into the string 'ABC'?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;DATA t TYPE TABLE OF kna1.
t = VALUE #(
  ( kunnr = 'A' )
  ( kunnr = 'B' )
  ( kunnr = 'C' )
).

DATA(log1) = REDUCE string( INIT x1 = '' FOR wa IN t NEXT x1 = x1 &amp;amp;&amp;amp; wa-kunnr ).

WRITE: /, log1. " A

DATA log2 TYPE string.
LOOP AT t INTO DATA(wa2).
  log2 = log2 &amp;amp;&amp;amp; wa2-kunnr.
ENDLOOP.

WRITE: /, log2. " ABC&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The LOOP approach works just fine.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Mar 2025 20:16:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reduce-not-concatenating-strings/m-p/14041203#M2041358</guid>
      <dc:creator>MarcC</dc:creator>
      <dc:date>2025-03-11T20:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: REDUCE not concatenating strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reduce-not-concatenating-strings/m-p/14041206#M2041359</link>
      <description>&lt;P&gt;OK, I discovered it is because x1 was implicitly char(1) and could contain only one character. Here is the corrected code:&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;DATA t TYPE TABLE OF kna1.
t = VALUE #(
  ( kunnr = 'A' )
  ( kunnr = 'B' )
  ( kunnr = 'C' )
).

DATA(log1) = REDUCE string( INIT x1 = CONV STRING( '' ) FOR wa IN t NEXT x1 = x1 &amp;amp;&amp;amp; wa-kunnr ).

WRITE: /, log1. " ABC&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 11 Mar 2025 20:24:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reduce-not-concatenating-strings/m-p/14041206#M2041359</guid>
      <dc:creator>MarcC</dc:creator>
      <dc:date>2025-03-11T20:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: REDUCE not concatenating strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reduce-not-concatenating-strings/m-p/14041767#M2041364</link>
      <description>&lt;P&gt;You can achieve the same by sing backticks ` instead of single quotes '.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 08:35:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reduce-not-concatenating-strings/m-p/14041767#M2041364</guid>
      <dc:creator>MBartsch71</dc:creator>
      <dc:date>2025-03-12T08:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: REDUCE not concatenating strings</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reduce-not-concatenating-strings/m-p/14042519#M2041374</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can declare the type of the X1 variable inside the REDUCE statement. That's what I would do. More details can be found in the &lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abenconstructor_expression_reduce.htm" target="_self"&gt;REDUCE documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Mar 2025 20:15:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reduce-not-concatenating-strings/m-p/14042519#M2041374</guid>
      <dc:creator>Raifloresca</dc:creator>
      <dc:date>2025-03-12T20:15:47Z</dc:date>
    </item>
  </channel>
</rss>

