SAP Function WWW_ITAB_TO_HTML - Convert Internal Table to HTML Table

Parameter Reference Type Length Default Optional Text
ALL_FIELDS 0 'X' X Flag indicating whether all fields are to be displayed
TABLE_ATTRIBUTES W3HTML u 255 'BORDER=1' X Specification of attributes in HTML syntax
TABLE_HEADER W3HEAD u 460 X Table header

Parameter Reference Length Optional Text
FIELDS W3FIELDS 380 Description table of single fields
HTML W3HTML 255 Table contains finished HTML page
ITABLE 0 Internal table to be formatted
ROW_HEADER W3HEAD 460 X Column headers

Functionality
This function module converts the contents of any internal table to aHTML table. You can specify a table header and a header for eachindividual column, as well as set attributes. To aid input, use thefunction module WWW_ITAB_TO_HTML_HEADERS. For each internal tablefield, you can set attributes. To aid input here, use the functionmodule WWW_ITAB_TO_HTML_LAYOUT which returns headers and single fieldattributes in tables and passes them to the conversion module whichreturns the finished HTML table.
If the flag ALL_FIELDS is set (this is the default), all fields arealways formatted, even if no attributes are defined. If the flag is notset, only those fields with attributes are formatted.

Example
DATA: MY_ROW_HEADER LIKE W3HEAD OCCURS 10 WITH HEADER LINE,
MY_FIELDS LIKE W3FIELDS OCCURS 10 WITH HEADER LINE,
MY_HEADER LIKE W3HEAD.
CALL FUNCTION 'WWW_ITAB_TO_HTML_HEADERS'
EXPORTING
FIELD_NR = 2
TEXT = 'Column 1'
FGCOLOR = 'yellow'
BGCOLOR = 'black'
TABLES HEADER = MY_ROW_HEADER.
CALL FUNCTION 'WWW_ITAB_TO_HTML_LAYOUT'
EXPORTING
FIELD_NR = 3
FGCOLOR = 'green'
TABLES
FIELDS = MY_FIELDS.
MOVE 'My internal table in HTML' TO MY_HEADER-TEXT.
MOVE 'Arial' TO MY_HEADER-FONT.
MOVE '2' TO MY_HEADER-SIZE.
REFRESH HTML.
CALL FUNCTION 'WWW_ITAB_TO_HTML'
EXPORTING
TABLE_HEADER = MY_HEADER
TABLES
HTML = HTML
FIELDS = MY_FIELDS
ROW_HEADER = MY_ROW_HEADER
ITABLE = MY_ITAB.