2007 Mar 13 11:48 AM
Hello All,
I need to print the fieldnames when i was downloading the data by using GUI_DOWNLOAD function module. Can anybody explain how to use this function module for writing the fieldnames.
thanks and regards
Madhavi
Hello All,
I need to print the fieldnames when i was downloading the data by using GUI_DOWNLOAD function module. Can anybody explain how to use this function module for writing the fieldnames.
thanks and regards
Madhavi
2007 Mar 13 11:51 AM
Hello,
U can use WS_DOWNLOAD like this:
L_T_HEADERS TYPE TABLE OF TEXT40.
IF SP_LOCAL = 'X'.
* Headings: TEXT-U01 ... TEXT-U28
DO 28 TIMES.
CLEAR: L_F_INDEX,L_F_NAME,L_F_HEADERS.
L_F_INDEX = SY-INDEX.
CONCATENATE 'TEXT-U' L_F_INDEX INTO L_F_NAME.
ASSIGN (L_F_NAME) TO <FS_HEADER>.
L_F_HEADERS = <FS_HEADER>.
APPEND L_F_HEADERS TO L_T_HEADERS.
ENDDO.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
FILENAME = SP_FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = L_T_OUT
FIELDNAMES = L_T_HEADERS
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.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
LEAVE PROGRAM.
ELSE.
DESCRIBE TABLE L_T_OUT LINES L_F_COUNT.
MESSAGE I145 WITH L_F_COUNT SP_FILE.
ENDIF.
REgrads,
VAsanth
2007 Mar 13 11:54 AM
Hi,
in the GUI_DOWNLOAD FM u have to fill the tables parameter FIELDNAMES.
Regards,
nagaraj
2007 May 30 7:48 AM
The fieldnames table doesn't work in this function. If you define all your fields as text, you can insert headers as the first row in the data table.