Skip to Content
-2
Sep 11, 2023 at 07:09 AM

Loop At Group .... merge rows dynamically in html mailer based on one particular field from itab

124 Views Last edit Sep 13, 2023 at 07:58 AM 5 rev

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?

```

LOOP AT lt_wip_plant INTO DATA(wa_wip_plant) GROUP BY wa_wip_plant-wrkng_hrs.


DATA(lv_tabix) = sy-tabix.
add_html:
'<tr>',
'<b>',
'<font color="BLACK" width="75" FACE="Calibri" size="2">',
'<td BGCOLOR="#B0D1ED" align="center" rowspan =', lv_count,'>', wa_wip_plant-wrkng_hrs ,'</td>',
'</b>',
'</tr>'.
CLEAR: lv_span.
LOOP AT GROUP wa_wip_plant INTO DATA(wip_hrs).
lv_count = sy-tabix.
IF sy-tabix EQ lv_tabix.
CONTINUE.
ENDIF.
endloop.
endloop.

```

image.png

I want to merge the rows based on Working Hours as shown below:

image.png

Attachments

image.png (10.9 kB)
image.png (11.7 kB)