<?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: Loop At Group .... merge rows dynamically in html mailer based on one particular field from itab in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757473#M2022285</link>
    <description>&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;Really thank you for you response given.&lt;/P&gt;&lt;P&gt;Could you please help me with the solution in a procedural way, based on HTML table in Mailer? Since I am unable to get the expected output based on above solution.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Wed, 13 Sep 2023 12:50:25 GMT</pubDate>
    <dc:creator>anitha_palani</dc:creator>
    <dc:date>2023-09-13T12:50:25Z</dc:date>
    <item>
      <title>Loop At Group .... merge rows dynamically in html mailer based on one particular field from itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757466#M2022278</link>
      <description>&lt;P&gt;Hi, In a mailer with HTML coding I want to merge rows dynamically based on one particular field Working Hours in the Group Loop. How to do that in 7.40?&lt;/P&gt;
  &lt;P&gt;```&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;LOOP AT lt_wip_plant INTO DATA(wa_wip_plant) GROUP BY wa_wip_plant-wrkng_hrs.

&lt;BR /&gt;DATA(lv_tabix) = sy-tabix.

&lt;BR /&gt;add_html:

&lt;BR /&gt;'&amp;lt;tr&amp;gt;',

&lt;BR /&gt;'&amp;lt;b&amp;gt;',

&lt;BR /&gt;'&amp;lt;font color="BLACK" width="75" FACE="Calibri" size="2"&amp;gt;',

&lt;BR /&gt;'&amp;lt;td BGCOLOR="#B0D1ED" align="center" rowspan =', lv_count,'&amp;gt;', wa_wip_plant-wrkng_hrs ,'&amp;lt;/td&amp;gt;',

&lt;BR /&gt;'&amp;lt;/b&amp;gt;',

&lt;BR /&gt;'&amp;lt;/tr&amp;gt;'.

&lt;BR /&gt;CLEAR: lv_span.

&lt;BR /&gt;LOOP AT GROUP wa_wip_plant INTO DATA(wip_hrs).

&lt;BR /&gt;lv_count = sy-tabix.

&lt;BR /&gt;IF sy-tabix EQ lv_tabix.

&lt;BR /&gt;CONTINUE.

&lt;BR /&gt;ENDIF.

&lt;BR /&gt;endloop.

&lt;BR /&gt;endloop.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;```&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212569-image.png" /&gt;&lt;/P&gt;
  &lt;P&gt;I want to merge the rows based on Working Hours as shown below:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2212570-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 07:09:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757466#M2022278</guid>
      <dc:creator>anitha_palani</dc:creator>
      <dc:date>2023-09-11T07:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Loop At Group .... merge rows dynamically in html mailer based on one particular field from itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757467#M2022279</link>
      <description>&lt;P&gt;Welcome to the SAP Community. Thank you for visiting us to get answers to your questions.&lt;/P&gt;&lt;P&gt;Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.&lt;/P&gt;&lt;P&gt;First, please see &lt;A rel="noopener noreferrer" href="https://community.sap.com/resources/questions-and-answers" target="_blank"&gt;https://community.sap.com/resources/questions-and-answers&lt;/A&gt;, as this resource page provides tips for preparing questions that draw responses from our members. Second, feel free to take our Q&amp;amp;A tutorial at &lt;A rel="noopener noreferrer" href="https://developers.sap.com/tutorials/community-qa.html" target="_blank"&gt;https://developers.sap.com/tutorials/community-qa.html&lt;/A&gt;, as that will help you when submitting questions to the community.&lt;/P&gt;&lt;P&gt;I also recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: &lt;A rel="noopener noreferrer" href="https://developers.sap.com/tutorials/community-profile.html" target="_blank"&gt;https://developers.sap.com/tutorials/community-profile.html&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Now for some specific suggestions on how you might improve your question:&lt;/P&gt;&lt;P&gt;* Outline what steps you took to find answers (and why they weren't helpful) -- so members don't make suggestions that you've already tried.&lt;/P&gt;&lt;P&gt;* Share screenshots of what you've seen/done (if possible), as images always helps our members better understand your problem.&lt;/P&gt;&lt;P&gt;Should you wish, you can revise your question by selecting Actions, then Edit. &lt;/P&gt;&lt;P&gt;The more details you provide (in questions tagged correctly), the more likely it is that members will be able to respond. &lt;/P&gt;&lt;P&gt;I hope you find this advice useful, and we're happy to have you as part of SAP Community!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 07:09:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757467#M2022279</guid>
      <dc:creator>moshenaveh</dc:creator>
      <dc:date>2023-09-11T07:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Loop At Group .... merge rows dynamically in html mailer based on one particular field from itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757468#M2022280</link>
      <description>&lt;P&gt;If you don't know what ABAP 7.40 is, but you just want some code, you may ask ChatGPT.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 18:22:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757468#M2022280</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-09-11T18:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Loop At Group .... merge rows dynamically in html mailer based on one particular field from itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757469#M2022281</link>
      <description>&lt;P&gt;Thank you for the Reply Sandra. I have wrote code based on 7.4 only, inside the group loop I am using HTML coding to send the mailer in that I want to do Row Span based on that particular field that's no.of.records will change dynamically so at the end of that specific record I want the row span to be performed. Since it is a group Loop unable to use AT END is there any other alternate option for that?&lt;/P&gt;&lt;P&gt;LOOP AT lt_wip_plant INTO DATA(wa_wip_plant) GROUP BY  wa_wip_plant-wrkng_hrs.&lt;/P&gt;&lt;P&gt;    DATA(lv_tabix) = sy-tabix.&lt;/P&gt;&lt;P&gt;    add_html:&lt;/P&gt;&lt;P&gt;    '&amp;lt;tr&amp;gt;',&lt;/P&gt;&lt;P&gt;    '&amp;lt;b&amp;gt;',&lt;/P&gt;&lt;P&gt;    '&amp;lt;font color="BLACK" width="75" FACE="Calibri" size="2"&amp;gt;',&lt;/P&gt;&lt;P&gt;    '&amp;lt;td BGCOLOR="#B0D1ED" align="center" rowspan =', lv_count,'&amp;gt;', wa_wip_plant-wrkng_hrs ,'&amp;lt;/td&amp;gt;',      &lt;/P&gt;&lt;P&gt;    '&amp;lt;/b&amp;gt;',&lt;/P&gt;&lt;P&gt;    '&amp;lt;/tr&amp;gt;'.&lt;/P&gt;&lt;P&gt;    CLEAR: lv_span.&lt;/P&gt;&lt;P&gt;    LOOP AT GROUP wa_wip_plant INTO DATA(wip_hrs).&lt;/P&gt;&lt;P&gt;      lv_count = sy-tabix.      &lt;/P&gt;&lt;P&gt;      IF sy-tabix EQ lv_tabix.&lt;/P&gt;&lt;P&gt;        CONTINUE.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;Here, I am getting the no.of.records in  lv_count since we are passing it in outside loop the rows get spanned for next record instead of the previous one.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 10:12:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757469#M2022281</guid>
      <dc:creator>anitha_palani</dc:creator>
      <dc:date>2023-09-12T10:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: Loop At Group .... merge rows dynamically in html mailer based on one particular field from itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757470#M2022282</link>
      <description>&lt;P&gt;Thank you for the Reply Sandra. I have wrote code based on 7.4 only, inside the group loop I am using HTML coding to send the mailer in that I want to do Row Span based on that particular field that's no.of.records will change dynamically so at the end of that specific record I want the row span to be performed. Since it is a group Loop unable to use AT END is there any other alternate option for that?&lt;/P&gt;&lt;P&gt;LOOP AT lt_wip_plant INTO DATA(wa_wip_plant) GROUP BY wa_wip_plant-wrkng_hrs.&lt;/P&gt;&lt;P&gt;DATA(lv_tabix) = sy-tabix.&lt;/P&gt;&lt;P&gt;add_html:&lt;/P&gt;&lt;P&gt;'&amp;lt;tr&amp;gt;',&lt;/P&gt;&lt;P&gt;'&amp;lt;b&amp;gt;',&lt;/P&gt;&lt;P&gt;'&amp;lt;font color="BLACK" width="75" FACE="Calibri" size="2"&amp;gt;',&lt;/P&gt;&lt;P&gt;'&amp;lt;td BGCOLOR="#B0D1ED" align="center" rowspan =', lv_count,'&amp;gt;', wa_wip_plant-wrkng_hrs ,'&amp;lt;/td&amp;gt;',&lt;/P&gt;&lt;P&gt;'&amp;lt;/b&amp;gt;',&lt;/P&gt;&lt;P&gt;'&amp;lt;/tr&amp;gt;'.&lt;/P&gt;&lt;P&gt;CLEAR: lv_span.&lt;/P&gt;&lt;P&gt;LOOP AT GROUP wa_wip_plant INTO DATA(wip_hrs).&lt;/P&gt;&lt;P&gt;lv_count = sy-tabix.&lt;/P&gt;&lt;P&gt;IF sy-tabix EQ lv_tabix.&lt;/P&gt;&lt;P&gt;CONTINUE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;Here, I am getting the no.of.records in lv_count since we are passing it in outside loop the rows get spanned for next record instead of the previous one.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 10:13:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757470#M2022282</guid>
      <dc:creator>anitha_palani</dc:creator>
      <dc:date>2023-09-12T10:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: Loop At Group .... merge rows dynamically in html mailer based on one particular field from itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757471#M2022283</link>
      <description>&lt;P&gt;You'd better indicate LOOP AT GROUP BY in the title.&lt;/P&gt;&lt;P&gt;With ABAP 7.40, there's no good reason to use the macro "add_html" &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2210673-image.png" /&gt;&lt;/P&gt;&lt;P&gt;Please edit your question (Actions&amp;gt;Edit), paste your code there and press the button [CODE], which makes the code appear colored/indented, it'll be easier for people to look at it. Thanks!&lt;/P&gt;&lt;P&gt;Concerning your question, use GROUP SIZE:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS ltc_main DEFINITION
      FOR TESTING
      DURATION SHORT
      RISK LEVEL HARMLESS.
  PRIVATE SECTION.
    METHODS test FOR TESTING.
ENDCLASS.
CLASS ltc_main IMPLEMENTATION.
  METHOD test.
    SELECT * FROM sflight INTO TABLE @DATA(flights).
    DATA(lines) = VALUE string_table( ).
    LOOP AT flights REFERENCE INTO DATA(flight)
        GROUP BY ( carrid = flight-&amp;gt;carrid
                   gs     = GROUP SIZE )
        REFERENCE INTO DATA(group_flights).
      INSERT |Airline: { group_flights-&amp;gt;carrid }. Total flights: { group_flights-&amp;gt;gs }|
          INTO TABLE lines.
      LOOP AT GROUP group_flights REFERENCE INTO DATA(flight_2).
        INSERT |   Flight: { flight_2-&amp;gt;connid } { flight_2-&amp;gt;fldate }|
            INTO TABLE lines.
      ENDLOOP.
    ENDLOOP.
  ENDMETHOD.
ENDCLASS.&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2210672-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2023 17:22:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757471#M2022283</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-09-12T17:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Loop At Group .... merge rows dynamically in html mailer based on one particular field from itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757472#M2022284</link>
      <description>&lt;P&gt;Thank you for the Reply Sandra. I have wrote code based on 7.4 only, inside the group loop I am using HTML coding to send the mailer in that I want to do Row Span based on that particular field that's no.of.records will change dynamically so at the end of that specific record I want the row span to be performed. Since it is a group Loop unable to use AT END is there any other alternate option for that?&lt;/P&gt;&lt;P&gt;LOOP AT lt_wip_plant INTO DATA(wa_wip_plant) GROUP BY wa_wip_plant-wrkng_hrs.&lt;/P&gt;&lt;P&gt;DATA(lv_tabix) = sy-tabix.&lt;/P&gt;&lt;P&gt;add_html:&lt;/P&gt;&lt;P&gt;'&amp;lt;tr&amp;gt;',&lt;/P&gt;&lt;P&gt;'&amp;lt;b&amp;gt;',&lt;/P&gt;&lt;P&gt;'&amp;lt;font color="BLACK" width="75" FACE="Calibri" size="2"&amp;gt;',&lt;/P&gt;&lt;P&gt;'&amp;lt;td BGCOLOR="#B0D1ED" align="center" rowspan =', lv_count,'&amp;gt;', wa_wip_plant-wrkng_hrs ,'&amp;lt;/td&amp;gt;',&lt;/P&gt;&lt;P&gt;'&amp;lt;/b&amp;gt;',&lt;/P&gt;&lt;P&gt;'&amp;lt;/tr&amp;gt;'.&lt;/P&gt;&lt;P&gt;CLEAR: lv_span.&lt;/P&gt;&lt;P&gt;LOOP AT GROUP wa_wip_plant INTO DATA(wip_hrs).&lt;/P&gt;&lt;P&gt;lv_count = sy-tabix.&lt;/P&gt;&lt;P&gt;IF sy-tabix EQ lv_tabix.&lt;/P&gt;&lt;P&gt;CONTINUE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;Here, I am getting the no.of.records in lv_count since we are passing it in outside loop the rows get spanned for next record instead of the previous one.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 10:55:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757472#M2022284</guid>
      <dc:creator>anitha_palani</dc:creator>
      <dc:date>2023-09-13T10:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Loop At Group .... merge rows dynamically in html mailer based on one particular field from itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757473#M2022285</link>
      <description>&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;Really thank you for you response given.&lt;/P&gt;&lt;P&gt;Could you please help me with the solution in a procedural way, based on HTML table in Mailer? Since I am unable to get the expected output based on above solution.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 12:50:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757473#M2022285</guid>
      <dc:creator>anitha_palani</dc:creator>
      <dc:date>2023-09-13T12:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Loop At Group .... merge rows dynamically in html mailer based on one particular field from itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757474#M2022286</link>
      <description>&lt;P&gt;If you want ABAP 7.40, it's logical to use ABAP Objects. Otherwise, continue using old ABAP.&lt;/P&gt;&lt;P&gt;Output is debugger of internal table LINES.&lt;/P&gt;&lt;P&gt;But sorry, look at code between METHOD and ENDMETHOD, it's procedural, no?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 17:47:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/loop-at-group-merge-rows-dynamically-in-html-mailer-based-on-one-particular/m-p/12757474#M2022286</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-09-13T17:47:08Z</dc:date>
    </item>
  </channel>
</rss>

