2008 Jul 02 8:14 AM
Hi Gurus,
I am downloading my internal table into .XLS,.doc,.rtf,.txt.
When i am using file type as 'DAT',My XLs file is fine but not other 3.When i am using filetype as 'ASC',My TXT file is fine but not others.Can anyone of please tell me wat is the file type i should pass to download the table into .DOc or .RTF without any formatting issues.
Please help me...Its urgent
Hi Gurus,
I am downloading my internal table into .XLS,.doc,.rtf,.txt.
When i am using file type as 'DAT',My XLs file is fine but not other 3.When i am using filetype as 'ASC',My TXT file is fine but not others.Can anyone of please tell me wat is the file type i should pass to download the table into .DOc or .RTF without any formatting issues.
Please help me...Its urgent
2008 Jul 02 8:19 AM
hi
u can use .DAT
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = v_filename1
filetype = 'DAT'
write_field_separator = 'X'
TABLES
data_tab = it_temp.
Amit
2008 Jul 02 8:21 AM
hi
Diff File type
'ASC' :
ASCII format. The table is transferred as text. Conversion exits are
performed. The output format additionally depends on the parameters
CODEPAGE, TRUNC_TRAILING_BLANKS, and TRUNC_TRAILING_BLANKS_EOL.
'IBM' :
ASCII format with IBM codepage conversion (DOS). This format corresponds
to the 'ASC' format when using target codepage 1103. This codepage is
frequently used for data exchange via floppy disk.
<b>'DAT' :
Column-by-column transfer. With this format, the data is transferred as
text as with ASC. However, no conversion exits are performed and the
columns are separated by tab characters. This format generates files
than can be uploaded again using gui_upload or ws_upload.,</b>
'DBF' :
Data is downloaded in dBase format. Since in this format the data types
of the individual columns are stored as well, you can often avoid import
problems, for example, into Microsoft Excel, especially when
interpreting numeric values.
'WK1' :
Data is downloaded in Lotus 1-2-3 format.
Amit
2008 Jul 02 8:28 AM
Hi
Please check it ..
TYPES: BEGIN OF x_mara,
matnr TYPE matnr,
MATKL TYPE MATKL,
END OF x_mara.
DATA : i_mara TYPE STANDARD TABLE OF x_mara INITIAL SIZE 0,
i_marc TYPE STANDARD TABLE OF marc INITIAL SIZE 0,
wa_mara TYPE mara,
v_field TYPE string,
v_value TYPE string,
v_ref TYPE REF TO cl_salv_table,
l_file TYPE rlgrap-filename.
v_value = 'c:\abc.dat'. " <----
u can use any file type
SELECT matnr MATKL FROM mara UP TO 10 ROWS
INTO TABLE i_mara.
SELECT * FROM marc UP TO 10 ROWS
INTO TABLE i_marc.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = v_value
append = 'X'
changing
data_tab = i_mara .
IF sy-subrc <> 0.
ENDIF.