2006 Dec 13 7:13 AM
hi ,
i have used WS_DOWNLOAD to download my data . i wnat to include the fields name of these data into excel files.?
TABLES
DATA_TAB = IFINAL1 " this is ur contents
FIELDNAMES = .
where ifinal1 is my internal table.
hi ,
i have used WS_DOWNLOAD to download my data . i wnat to include the fields name of these data into excel files.?
TABLES
DATA_TAB = IFINAL1 " this is ur contents
FIELDNAMES = .
where ifinal1 is my internal table.
2006 Dec 13 7:17 AM
Declarate internal table to store field names.
call ws_download : Pass the header internal table, it create the file with header names.
now call ws_download again and pass the second internal table.
here for paratemers MODE pass 'A' it will append the values to the already created file.
2006 Dec 13 7:17 AM
hi,
create a internal table type similar to that in ws_download and poulate it with your field names
2006 Dec 13 8:03 AM
could u show me how to poulate the fields name in the first of internal table that should have the fields name.
best regared,
Ali
2006 Dec 13 7:21 AM
HI,
!st do not use ws_download , its obsulute stmt in sao,use
CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD method
Even if u are using ws_download then for filed name put them in one table and usin the abv fm ws_download, then when dowloading the values use the ab FM ws_download with MODE as append.
Regards,
Vaibhav B Gawali.
2006 Dec 13 7:22 AM
2006 Dec 13 8:08 AM
Hi ali,
1. Download internal table with field names as headings !
2.
a) Use GUI_DOWNLOAD fm instead of WS_DOWNLOAD.
b) we have to write some extra logic, to Fetch the field names
3. Just copy paste to get a taste of it.
report abc.
*----
data : itab like table of t001 with header line.
*----
select * from t001 into table itab.
perform mydownload tables itab using 'D:\t001.txt'.
*----
INDEPENDENT FORM
*----
form mydownload tables ptab using filename.
*----
DAta
DATA : components LIKE rstrucinfo OCCURS 0 WITH HEADER LINE.
DATA : allfields(300) TYPE c.
DATA : fld(100) TYPE c.
data : begin of htab occurs 0,
allfields(300) type c,
end of htab.
*----
Get component list
CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
program = sy-repid
fieldname = 'ITAB'
TABLES
components = components.
*----
construct
LOOP AT components.
CONCATENATE components-compname
CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB INTO fld.
CONCATENATE allfields fld INTO allfields .
ENDLOOP.
htab-allfields = allfields.
append htab.
*----
download first field list
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = 'D:\t001.txt'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = htab
.
*----
then download file data
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = filename
APPEND = 'X'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = ptab
.
endform.
regards,
amit m.
2006 Dec 13 12:39 PM
could i use WS_Download to download txt file.
if yes i want to be downloaded in a prober formate- not mixed fields
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |