04-26-2006 12:53 PM
Hi,
I broke the sdata into fields of an internal table and now i want to pass this table to a txt file.But when i pass i think he eliminates the blank spaces and when i look to the file it´s all messed up.what i want is the file to look like like a table with the headers on the top and the fields corresponding to the header allign underneath.
Thanks,
Ricardo
04-26-2006 12:56 PM
I don't think it will be possible with TXT file, you probably can try with XLS file.
Regards,
Ravi
04-26-2006 12:57 PM
Hi ricardo,
1. use like this
just copy paste in new program.
2. the field names will not come.
report abc.
*----
data : t001 like table of t001 with header line.
*----
select * from t001 into table t001.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'd:\t001.txt'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = t001.
regards,
amit m.
04-26-2006 1:00 PM
HI,
CALL FM GUI_DOWNLOAD
SPECIFY FILETYPE AS 'ASC'
AND SET WRITE_FIELD_SEPARATOR = 'X'.
HOPE THIS HELPS,
PRIYA.
04-26-2006 1:01 PM
Hi,
as suggested above using WRITE_FIELD_SEPARATOR = 'X' option of GUI_DOWNLOAD you can achieve that.
try it.
Regards
vijay
04-26-2006 1:28 PM
Hi,
A Sample program.
DATA: BEGIN OF ITAB OCCURS 0,
F1(4) TYPE C,
F2(4) TYPE C,
F3(3) TYPE C,
END OF ITAB.
START-OF-SELECTION.
ITAB-F1 = 'ABCD'. ITAB-F2 = 'EFGH'. ITAB-F3 = 'IJK'.
APPEND ITAB. CLEAR ITAB.
ITAB-F1 = 'ABCD'. ITAB-F2 = ''. ITAB-F3 = 'IJK'.
APPEND ITAB. CLEAR ITAB.
ITAB-F1 = 'ABCD'. ITAB-F2 = 'EFGH'. ITAB-F3 = 'IJK'.
APPEND ITAB. CLEAR ITAB.
ITAB-F1 = 'ABCD'. ITAB-F2 = 'EFGH'. ITAB-F3 = 'IJK'.
APPEND ITAB. CLEAR ITAB.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\481.TXT'
WRITE_FIELD_SEPARATOR = 'X'
tables
data_tab = ITAB.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Sailaja.