2009 Nov 08 2:03 PM
Hi All,
I am using function module SAP_CONVERT_TO_TEX_FORMAT to convert the internal table into CSV file with headings .
Now, when I use the function GUI_DOWNLOAD to download the file, I get a short dump. Please let me know which parameters I am missing.
When I use the parameter data_tab in GUI_DOWNLOAD, I dont get the file with comma seperated and headings. If I remove that parameter, I get a shortdump.
Please see the code below.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = ','
i_line_header = 'X'
i_filename = 'SALES_FORCE.CSV'
TABLES
i_tab_sap_data = gt_output.CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'SALES_FORCE.CSV'
TABLES
data_tab = gt_output.Thanks for your help.
Salil
2009 Nov 08 2:54 PM
<copy&paste_removed_by_moderator>
Edited by: Julius Bussche on Nov 8, 2009 4:57 PM
=> If you copy&paste again, then your user ID will be drag&dropped...
Hi All,
I am using function module SAP_CONVERT_TO_TEX_FORMAT to convert the internal table into CSV file with headings .
Now, when I use the function GUI_DOWNLOAD to download the file, I get a short dump. Please let me know which parameters I am missing.
When I use the parameter data_tab in GUI_DOWNLOAD, I dont get the file with comma seperated and headings. If I remove that parameter, I get a shortdump.
Please see the code below.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = ','
i_line_header = 'X'
i_filename = 'SALES_FORCE.CSV'
TABLES
i_tab_sap_data = gt_output.CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'SALES_FORCE.CSV'
TABLES
data_tab = gt_output.Thanks for your help.
Salil
2009 Nov 08 2:48 PM
Hi Salil,
What is the dump that you are getting?
Please post the same.
In your FM GUI_download, you need to pass the filename like this.
Hope this code helps. See my next post below....
If that does not fix your issue, please post your dump .
Regards,
SuryaD.
Edited by: SuryaD on Nov 8, 2009 8:26 PM
Edited by: SuryaD on Nov 8, 2009 8:27 PM
2009 Nov 08 2:54 PM
<copy&paste_removed_by_moderator>
Edited by: Julius Bussche on Nov 8, 2009 4:57 PM
=> If you copy&paste again, then your user ID will be drag&dropped...
2009 Nov 08 3:48 PM
Copy paste from [http://searchsap.techtarget.com/tip/0,289483,sid21_gci1166824,00.html]. Donot copy paste other's work without mentioning the source.
2009 Nov 08 5:57 PM
Thanks Vikranth. But the file downloaded does not have headings. How do I get the headings.
2009 Nov 08 7:02 PM
Hello Salil,
If you want to download the internal table in CSV file with the headings, first use SAP_CONVERT_TO_TEX_FORMAT to convert the itab to CSV formatted then use GUI_DOWNLOAD, mentioning the columns headings in a separate internal table and assign it to FIELDNAMES parameter in GUI_DOWNLOAD
TYPE-POOLS: truxs.
DATA: i_data TYPE truxs_t_text_data.
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
i_field_seperator = ','
* I_LINE_HEADER =
* I_FILENAME =
* I_APPL_KEEP = ' '
TABLES
i_tab_sap_data = itab
CHANGING
i_tab_converted_data = i_data
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
FILENAME = 'c:\test.csv'
FILETYPE = 'ASC'
IMPORTING
*FILELENGTH =
TABLES
DATA_TAB = i_data " internal table containing data
FIELDNAMES = i_column " internal table containing headers
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
Vikranth
2009 Nov 08 8:03 PM
Hi Vikranth,
Thank you so much for all the help.
Regards,
Salil
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |