Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

HTML commands

Former Member
0 Likes
350

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
304

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

1 REPLY 1
Read only

Former Member
0 Likes
305

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