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

Convert Internal Table To HTML

Former Member
0 Likes
1,438

Guys,

Do you now how you can convert an Internal Table To HTML ? Are there any means with which we can do it in SAP 4.6C. I used FM WWW_ITAB_TO_HTML but we are having some alignment issues when the page is rendered,Please let me know if you have a code or some thing where i can work on. I have provided snapshot of my code.Kindly help

data: ifields type table of w3fields with header line,

ihtml type table of w3html with header line,

headers type table of w3head with header line,

PERFORM DEFINE_HTML_TABLE_HEADER.

CALL FUNCTION 'WWW_ITAB_TO_HTML'

TABLES

HTML = ihtml

FIELDS = ifields

ROW_HEADER = headers

ITABLE = int_tab.

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

filename = p_outht

filetype = 'ASC'

TABLES

data_tab = ihtml

EXCEPTIONS

:

FORM DEFINE_HTML_TABLE_HEADER.

headers-nr = 1.

headers-text = 'SAP Plant'.

append headers.

headers-nr = 2.

headers-text = 'Legacy Plant'.

append headers.

headers-nr = 3.

headers-text = 'Material Number'.

append headers.

headers-nr = 4.

headers-text = 'Qty'.

append headers.

headers-nr = 5.

headers-text = 'Total Qty'.

append headers.

ENDFORM.

Regards

Praveen

2 REPLIES 2
Read only

Former Member
0 Likes
684

Hi,

Check this blog this may help you.

Link: [https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3090] [original link is broken] [original link is broken] [original link is broken];

Read only

Former Member
0 Likes
684

Please try the follwoing:

1. define HTML internal table with ref to type W3HTML

2. download it as BIN type and give total lenght of the strings as a parameter in the down load.

See the code extract below:

describe table html lines entries.

read table html into w_html index entries.

size = ( entries - 1 ) * 255 + strlen( w_html ).

concatenate p_path file into file.

call function 'WS_DOWNLOAD'

exporting

bin_filesize = size

filename = file

filetype = 'BIN'

tables

data_tab = html

.

Thie will generate HTML local file with formatting as in the internal table.