‎2007 Aug 20 12:45 PM
Hi,
How to display header in xl file using gui_download function
‎2007 Aug 20 1:03 PM
‎2007 Aug 20 1:11 PM
‎2007 Aug 20 1:13 PM
Hi,
try with this.
first populate 'I_FCOL' with header data.
and then populate actual data in internal table 'I_FILE'.
try with below code.
DATA: I_FCOL TYPE SY-TITLE OCCURS 0 WITH HEADER LINE. "field name
APPEND 'G/L Account'(089) TO I_FCOL.
APPEND 'Posting Key'(041) TO I_FCOL.
APPEND 'Amount in doc.curr'(040) TO I_FCOL.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = L_FILENAME
FILETYPE = 'DAT'
TABLES
DATA_TAB = I_FILE
FIELDNAMES = I_FCOL
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
OTHERS = 10.
Regards
Sudheer
‎2007 Aug 20 1:16 PM
You should use append = 'X' in exporting parameters.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = FILENAME
WRITE_FIELD_SEPARATOR = 'X'
append = 'X'
TABLES
DATA_TAB = jtab
...
Make sure the filendmaes you added is already in jtab internal table.The code you have given here seems that you are adding in header internal table.
Check the Function module documentation for example.
regards,
srinivas
<b>*reward for useful answers*</b>