<?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 Doubt in abap report program. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-abap-report-program/m-p/12123387#M1974450</link>
    <description>&lt;P&gt;Can any one help me to Build a best logic for my internal table data to my output as i mentioned in PICTURE.&lt;/P&gt;
  &lt;P&gt;I have done it by using grouping concept it is working fine but i want to minimize the logic and increase the performance.&lt;/P&gt;
  &lt;P&gt;In the below picture there is an internal table and I want the output as in the picture.&lt;/P&gt;
  &lt;P&gt;And Don't forget to include commas please.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1741487-sap.png" /&gt;&lt;/P&gt;
  &lt;P&gt;************************************************************************************&lt;/P&gt;
  &lt;P&gt;LOOP AT it_manufacture INTO lw_manufacture GROUP BY lw_manufacture-name.&lt;BR /&gt; WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; lw_manufacture-name.&lt;BR /&gt; LOOP AT GROUP lw_manufacture INTO lw_manufacture_group.&lt;BR /&gt; IF lv_var EQ 1.&lt;BR /&gt; CONCATENATE ':' lw_manufacture_group-description INTO lv_str.&lt;BR /&gt; WRITE lv_str.&lt;BR /&gt; ELSE.&lt;BR /&gt; lv_str = lw_manufacture_group-description.&lt;BR /&gt; CONCATENATE ',' lv_str INTO lv_str.&lt;BR /&gt; WRITE lv_str.&lt;BR /&gt; ENDIF.&lt;BR /&gt; lv_var = lv_var + 1.&lt;BR /&gt; ENDLOOP.&lt;BR /&gt; CLEAR lv_var.&lt;BR /&gt; lv_var = 1.&lt;BR /&gt; ENDLOOP.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Oct 2019 14:52:24 GMT</pubDate>
    <dc:creator>former_member657791</dc:creator>
    <dc:date>2019-10-24T14:52:24Z</dc:date>
    <item>
      <title>Doubt in abap report program.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-abap-report-program/m-p/12123387#M1974450</link>
      <description>&lt;P&gt;Can any one help me to Build a best logic for my internal table data to my output as i mentioned in PICTURE.&lt;/P&gt;
  &lt;P&gt;I have done it by using grouping concept it is working fine but i want to minimize the logic and increase the performance.&lt;/P&gt;
  &lt;P&gt;In the below picture there is an internal table and I want the output as in the picture.&lt;/P&gt;
  &lt;P&gt;And Don't forget to include commas please.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1741487-sap.png" /&gt;&lt;/P&gt;
  &lt;P&gt;************************************************************************************&lt;/P&gt;
  &lt;P&gt;LOOP AT it_manufacture INTO lw_manufacture GROUP BY lw_manufacture-name.&lt;BR /&gt; WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; lw_manufacture-name.&lt;BR /&gt; LOOP AT GROUP lw_manufacture INTO lw_manufacture_group.&lt;BR /&gt; IF lv_var EQ 1.&lt;BR /&gt; CONCATENATE ':' lw_manufacture_group-description INTO lv_str.&lt;BR /&gt; WRITE lv_str.&lt;BR /&gt; ELSE.&lt;BR /&gt; lv_str = lw_manufacture_group-description.&lt;BR /&gt; CONCATENATE ',' lv_str INTO lv_str.&lt;BR /&gt; WRITE lv_str.&lt;BR /&gt; ENDIF.&lt;BR /&gt; lv_var = lv_var + 1.&lt;BR /&gt; ENDLOOP.&lt;BR /&gt; CLEAR lv_var.&lt;BR /&gt; lv_var = 1.&lt;BR /&gt; ENDLOOP.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 14:52:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-abap-report-program/m-p/12123387#M1974450</guid>
      <dc:creator>former_member657791</dc:creator>
      <dc:date>2019-10-24T14:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in abap report program.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-abap-report-program/m-p/12123388#M1974451</link>
      <description>&lt;P&gt;I don't understand your question: which is your doubt? &lt;BR /&gt;PS.&lt;/P&gt;&lt;P&gt;Better if you format your code &lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 15:03:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-abap-report-program/m-p/12123388#M1974451</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2019-10-24T15:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in abap report program.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-abap-report-program/m-p/12123389#M1974452</link>
      <description>&lt;P&gt;Hello &lt;A href="https://answers.sap.com/users/888894/padamatintimaharshi.html"&gt;MAHARSHI PADAMATINTI&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;You want to make use of Control Break Statements, I can help with the pseudo code as below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Below CODE is Just Pseudo Code to explain the concept.
DATA: LV_CHAR type CHAR50.
SORT it_manufacture by FIELD1.
LOOP AT it_manufacture into lw_manufacture.
AT NEW FIELD1.
DATA(LV_NEW = ABAP_TRUE.
ENDAT.
IF LV_NEW EQ ABAP_TRUE.
CLEAR: LV_CHAR.
LV_CHAR = LW_MANUFACTURE-FIELD2.
CLEAR: LV_NEW.
ELSE.
CONCATENATE LV_CHAR ','  LW_MANUFACTURE-FIELD2 INTO LV_CHAR.
ENDIF.
AT END OF FIELD1.
DATA(LV_END) = ABAP_TRUE.
ENDAT
IF LV_END EQ ABAP_TRUE.
WRITE: LV_CHAR.
ENDIF.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 15:21:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-abap-report-program/m-p/12123389#M1974452</guid>
      <dc:creator>former_member1716</dc:creator>
      <dc:date>2019-10-24T15:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in abap report program.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-abap-report-program/m-p/12123390#M1974453</link>
      <description>&lt;P&gt;Hey Thanks, I got to know this by friend also Is there any other easy way,&lt;/P&gt;&lt;P&gt;Your answer is good!!!!&lt;/P&gt;&lt;P&gt;Just searching for different techiques/ways,&lt;/P&gt;&lt;P&gt;Any other simpler way you can guide me please.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 15:27:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-abap-report-program/m-p/12123390#M1974453</guid>
      <dc:creator>former_member657791</dc:creator>
      <dc:date>2019-10-24T15:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in abap report program.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-abap-report-program/m-p/12123391#M1974454</link>
      <description>&lt;P&gt;&lt;A href="https://answers.sap.com/users/888894/padamatintimaharshi.html"&gt;MAHARSHI PADAMATINTI&lt;/A&gt;&lt;/P&gt;&lt;P&gt;From F1 help for Control Level Processing:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;If possible, the use of the addition GROUP BY is recommended, since the grouping is not determined by the structure of the rows and the processing order in this case. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You can check the demo: DEMO_INT_TABLES_AT_UNSORTED to understand the difference in outcome of them.&lt;/P&gt;&lt;P&gt;For your sample, you just need to concatenate the string and write it when finish:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT it_manufacture INTO lw_manufacture GROUP BY lw_manufacture-name.
  lv_str = |{ lw_manufacture-name }: |.
  LOOP AT GROUP lw_manufacture INTO lw_manufacture_group.
    lv_str = COND #( WHEN sy-tabix = 1 
                     THEN |{ lv_str } { lw_manufacture_group-description }|
                     ELSE |{ lv_str },{ lw_manufacture_group-description }| ).
  ENDLOOP.  
  WRITE / lv_str.  
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;another way is use REDUCE, I updated the answer &lt;A href="https://answers.sap.com/questions/12895318/doubt-in-abap-report-program-1.html?childToView=12897255#answer-12897255" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;U&gt;&lt;/U&gt;&lt;SUB&gt;&lt;/SUB&gt;&lt;SUP&gt;&lt;/SUP&gt;&lt;DEL&gt;&lt;/DEL&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 01:29:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-abap-report-program/m-p/12123391#M1974454</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2019-10-25T01:29:54Z</dc:date>
    </item>
  </channel>
</rss>

