‎2008 Dec 01 9:59 AM
Hi Experts,
We are using HTML commands <table></table> and designing a table fomat & this table will be passed to the standard function module to send email. I have defined one row for heading,but in the next rows,need to take values from internal table.My doubt is how to refer the wa area values within HMTL tags.
Ex:
Material no Material desc
0001 xxx
0002 yyy
0003 zzz
Please provide your inputs.
‎2008 Dec 01 10:39 AM
Hello,
This is a small ABAP program that will help you.
At the end the internal table itab will contain all data with html tags for a table.
report ztest.
data: begin of itab occurs 0,
line(100),
end of itab.
data: begin of wa_material,
w_tr_new(4) value '<tr>',
w_td1_start(4) value '<td>',
matnr like mara-matnr,
w_td1_end(5) value '</td>',
w_td2_start(4) value '<td>',
desc like makt-maktx,
w_td2_end(5) value '</td>',
end of wa_material.
start-of-selection.
itab-line = '<table>'.
append itab.
Material 1
wa_material-matnr = 'MAT001'.
wa_material-desc = 'Material number 1 description'.
itab-line = wa_material.
append itab.
Material 2
wa_material-matnr = 'MAT002'.
wa_material-desc = 'Material number 2 description'.
itab-line = wa_material.
append itab.
itab-line = '</table>'.
append itab.
loop at itab.
write: / itab.
endloop.
**********************
result:
*******
<table>
<tr><td>MAT001 </td><td>Material number 1 description </td>
<tr><td>MAT002 </td><td>Material number 2 description </td>
</table>
Wim Van den Wyngaert
‎2008 Dec 01 10:39 AM
Hello,
This is a small ABAP program that will help you.
At the end the internal table itab will contain all data with html tags for a table.
report ztest.
data: begin of itab occurs 0,
line(100),
end of itab.
data: begin of wa_material,
w_tr_new(4) value '<tr>',
w_td1_start(4) value '<td>',
matnr like mara-matnr,
w_td1_end(5) value '</td>',
w_td2_start(4) value '<td>',
desc like makt-maktx,
w_td2_end(5) value '</td>',
end of wa_material.
start-of-selection.
itab-line = '<table>'.
append itab.
Material 1
wa_material-matnr = 'MAT001'.
wa_material-desc = 'Material number 1 description'.
itab-line = wa_material.
append itab.
Material 2
wa_material-matnr = 'MAT002'.
wa_material-desc = 'Material number 2 description'.
itab-line = wa_material.
append itab.
itab-line = '</table>'.
append itab.
loop at itab.
write: / itab.
endloop.
**********************
result:
*******
<table>
<tr><td>MAT001 </td><td>Material number 1 description </td>
<tr><td>MAT002 </td><td>Material number 2 description </td>
</table>
Wim Van den Wyngaert