‎2006 Oct 26 8:51 AM
hi all,
I have a scenario in which the output displayed using report is to be store in app server as HTML file.
how can i do that?
thanks in advance.
‎2006 Oct 26 9:09 AM
hi
good
try this function module
WWW_LIST_TO_HTML After running a report, call this function to convert the list output to HTML.
thanks
mrutyun^
‎2006 Oct 26 8:59 AM
‎2006 Oct 26 9:07 AM
Maybe this can give you some idea.
DATA: PRIPAR TYPE PRI_PARAMS,
ARCPAR TYPE ARC_PARAMS,
LAY TYPE PRI_PARAMS-PAART,
LINES TYPE PRI_PARAMS-LINCT,
ROWS TYPE PRI_PARAMS-LINSZ.
DATA: val(1).
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
destination = 'LOCL'
no_dialog = 'X'
immediately = ' '
IMPORTING
out_archive_parameters = arcpar
out_parameters = pripar
valid = val
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
pripar-prdsn = 'OSI'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
in_archive_parameters = arcpar
in_parameters = pripar
no_dialog = 'X'
* list_name = 'Testing Purpose Only' "l_list
IMPORTING
out_archive_parameters = arcpar
out_parameters = pripar
valid = val
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc EQ 0.
NEW-PAGE PRINT ON
NEW-SECTION
PARAMETERS pripar
ARCHIVE PARAMETERS arcpar
NO DIALOG.
ELSE.
write:/ 'Unable to create spool'.
ENDIF.
write:/ 'First Line'.
write:/ 'Second Line'.
NEW-PAGE PRINT OFF.
data: l_spool like TSP01-RQIDENT.
DATA: BEGIN OF BUFFER OCCURS 10000,
TEXT(255) TYPE C,
END OF BUFFER.
DATA: STARTLINE TYPE I, ENDLINE TYPE I, fnstr type string.
STARTLINE = 1. l_spool = sy-spono.
REFRESH BUFFER.
ENDLINE = STARTLINE + 9999.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
RQIDENT = l_spool
FIRST_LINE = STARTLINE
LAST_LINE = ENDLINE
DESIRED_TYPE = 'RAW'
* IMPORTING
* real_type =
TABLES
BUFFER = BUFFER
EXCEPTIONS
NO_SUCH_JOB = 1
JOB_CONTAINS_NO_DATA = 2
SELECTION_EMPTY = 3
NO_PERMISSION = 4
CAN_NOT_ACCESS = 5
READ_ERROR = 6
TYPE_NO_MATCH = 7
OTHERS = 8.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
data: l_file like rlgrap-filename.
move '/home/xapplusr/down.html' to l_file.
open dataset l_file for output in text mode encoding default.
if sy-subrc ne 0.
write:/ 'Unable to download to application server'.
else.
loop at buffer.
transfer buffer to l_file.
endloop.
close dataset l_file.
endif.Am trying to create the output as spool, read the output and download as HTML file.
Kind Regards
Eswar
‎2006 Oct 26 9:09 AM
hi
good
try this function module
WWW_LIST_TO_HTML After running a report, call this function to convert the list output to HTML.
thanks
mrutyun^
‎2006 Oct 27 5:30 AM
hi all,
i'm using rao's code. spool was Successfully created.using BUFFER internal table i can't get the HTML file in app.server.i'm using binary mode to open the file.what should be the document type to get BUFFER table CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
DESIRED_TYPE = ?
‎2006 Oct 27 10:41 AM
hi all,
i used FM 'WWW_LIST_TO_HTML'.
i got accurate output.
thanks for all.
thanks Mrutyunjaya Tripathy .