‎2008 Aug 14 4:31 PM
Hi Freinds!
I need to save the out of my report into html automatically. I have a report which shows the pro-rate factor for a given period and delivers the output, i have an include program added to it which automates the process to directly save this out into html format and store in my N drive for future use as if this si lost its lost forever..
Unfortunatley I am unable to store it on my N drive , but when I change in my report to C drive it does automatically stores it there but not my N drive and an error pops saying Access denied.
Kind help will be appreciated.
Aarav
‎2008 Aug 14 4:48 PM
‎2008 Aug 14 4:34 PM
The code I have inserted is as follows.
*&---------------------------------------------------------------------*
*& Include ZMM_SAVE_LIST_HMTL
*&---------------------------------------------------------------------*
data: html type table of W3HTML with header line,
gs_html type w3html,
g_file type string,
g_size type i,
g_entries type i.
data: p_file_o(128) type c.
*
constants: p_file(128) type c value 'C:\'.
* 'N:\private\Production Accounting\Production Accounting\2008 Production\MonthEnd\0108\'.
* ---------------------------------------------------------------
concatenate p_file syst-tcode p_werks p_lgort '.HTM' into p_file_o.
CALL FUNCTION 'WWW_LIST_TO_HTML'
* EXPORTING
* LIST_INDEX = 0
TABLES
HTML = html.
describe table html lines g_entries.
read table html into gs_html index g_entries.
g_size = g_entries * 510.
g_file = p_file_o.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE = g_size
FILENAME = g_file
FILETYPE = 'BIN'
* APPEND = ' '
* WRITE_FIELD_SEPARATOR = ' '
* HEADER = '00'
* TRUNC_TRAILING_BLANKS = ' '
* WRITE_LF = 'X'
* COL_SELECT = ' '
* COL_SELECT_MASK = ' '
* DAT_MODE = ' '
* CONFIRM_OVERWRITE = ' '
* NO_AUTH_CHECK = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* WRITE_BOM = ' '
* TRUNC_TRAILING_BLANKS_EOL = 'X'
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = html
* FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
‎2008 Aug 14 4:48 PM
‎2008 Aug 14 5:45 PM
>stores it there but not my N drive and an error pops saying Access denied.
The Folder which you mentioned might be in the shared network, for that folder you don't have the access.
from the message i am thinking in that direction.
‎2008 Aug 15 6:20 PM
I think thst right , I will have the user test the report on hi/her stystem so that if they have access they can get throgh .
Thanks very much.