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

To Convert Internal table to HTML format.

Former Member
0 Likes
1,771

Hi Friends,

I am working on report in which i need to send the output of report on FTP server in HTML format, I am right now using function WWW_LIST_TO_HTML to convert report output in to html format, its working fine if done manualy, but when we place the report for back ground processing , it is only sending header .

So I am trying to find some other function module that can be used to convert Internal table to html format so that I can send it on FTP server ..

Please help me out....

Good points wll be rewarded for helpful answer.....

Thanks

Hi Friends,

I am working on report in which i need to send the output of report on FTP server in HTML format, I am right now using function WWW_LIST_TO_HTML to convert report output in to html format, its working fine if done manualy, but when we place the report for back ground processing , it is only sending header .

So I am trying to find some other function module that can be used to convert Internal table to html format so that I can send it on FTP server ..

Please help me out....

Good points wll be rewarded for helpful answer.....

Thanks

2 REPLIES 2
Read only

former_member156446
Active Contributor
0 Likes
638

Hi Soni

check the below code.. it might help you..

data: list type table of abaplist with header line.

data: htmllines type table of w3html with header line.

data: maildata like sodocchgi1.

data: mailtxt like solisti1 occurs 10 with header line.

data: mailrec like somlrec90 occurs 0 with header line.

start-of-selection.

  • Produce a list

do 100 times.

write:/ sy-index, at 30 sy-index, at 50 sy-index.

enddo.

  • Save the list

call function 'SAVE_LIST'

tables

listobject = list

exceptions

list_index_invalid = 1

others = 2.

  • Convert the list

call function 'WWW_LIST_TO_HTML'

tables

html = htmllines.

  • Send mail

maildata-obj_name = 'TEST'.

maildata-obj_descr = 'Test Subject'.

loop at htmllines.

mailtxt = htmllines.

append mailtxt.

endloop.

mailrec-receiver = '[email protected]'.

mailrec-rec_type = 'U'.

append mailrec.

call function 'SO_NEW_DOCUMENT_SEND_API1'

exporting

document_data = maildata

document_type = 'HTM'

put_in_outbox = 'X'

tables

object_header = mailtxt

object_content = mailtxt

receivers = mailrec

exceptions

too_many_receivers = 1

document_not_sent = 2

document_type_not_exist = 3

operation_no_authorization = 4

parameter_error = 5

x_error = 6

enqueue_error = 7

others = 8.

if sy-subrc 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

Read only

0 Likes
638

I am using same function module , that is WWW_LIST_TO_HTML , and its workin fine in forground, bt if i use it in backgound, only header is sent to ftp server.

after using WWW_LIST_TO_HTML function, to send to ftp I am using, HTTP_SCRAMBLE , FTP_CONNECT , FTP_R3_TO_SERVER ,FTP_DISCONNECT and RFC_CONNECTION_CLOSE function modules.

so i am trying to find some other way to convert my Internal table to HTML format.