on 2006 Mar 16 6:09 AM
Hello people,
A few hours ago I asked a couple of guys how to download a file to html. For that I am most thankful, and as mentioned this is a two part question, my other question is about how to proccess downloading the html in background and to automatically send it to a folder or other path. Without any user intervention.
Example, I run a long report to be downloaded in background. The lets say the next day, I can get the file in a folder. Thanks guys take care!
Hi,
Here is the sample code.
data: ifields type table of w3fields with header line.
data: ihtml type table of w3html with header line.
data itab type standard table of pa0001.
select * into corresponding fields of table itab
from pa0001 up to 100 rows.
call function 'WWW_ITAB_TO_HTML'
EXPORTING
TABLE_ATTRIBUTES = 'BORDER=1'
TABLE_HEADER =
ALL_FIELDS = 'X'
tables
html = ihtml
fields = ifields
ROW_HEADER =
itable = itab
.
Local variable Declaration
DATA l_msg(60) TYPE c.
Opening the file for output in text mode
OPEN DATASET '/sapio/outbound/html.txt' FOR OUTPUT
IN TEXT MODE ENCODING DEFAULT MESSAGE l_msg.
IF sy-subrc NE 0.
MESSAGE s000 WITH 'Error in opening file for output'.
LEAVE LIST-PROCESSING.
ENDIF.
LOOP AT ihtml .
TRANSFER ihtml TO '/sapio/outbound/html.txt'.
ENDLOOP.
Closing the file
CLOSE DATASET '/sapio/outbound/html.txt'.
IF sy-subrc NE 0.
MESSAGE s000 with 'Error in closing file'.
LEAVE LIST-PROCESSING.
ENDIF.
Since you want to download in background,you cannot download in presentation server.SO you have to download in application server.
Kindly reward points if it helps.
Message was edited by: Jayanthi Jayaraman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Use
OPEN DATASET FOR OUPUT
&CLOSE DATASET
OPEN DATASET P_PATH FOR OUTPUT IN TEXT MODE.
LOOP AT PR_TBL.
ENDLOOP.
CLOSE DATASET P_PATH.
Regards,
Santosh
Message was edited by: Santosh Kumar Patha
User | Count |
---|---|
62 | |
12 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.