‎2007 Feb 09 6:52 AM
Hi,
I have a issue like this.
download the some materials from SAP to file which has in application server.
so the output format file should be of CSV file format.
how can format the output file can any one tell me this.
‎2007 Feb 09 6:53 AM
‎2007 Feb 09 6:58 AM
hi kishan,
in that CG3Y transaction only ASC & BIN formats are there.CSV is not there.
CSV format is I heared that comma seperator value.
can any body tell me about this.
‎2007 Feb 09 7:05 AM
How do I download data in my internal table in a CSV file?
1ST capture file from application server to internal table using open dataset and close data set.
Use the Function Module SAP_CONVERT_TO_CSV_FORMAT to convert the internal table into Comma separated format then download this internal table using the Function Module GUI_DOWNLOAD.
EX-
Coding -
TYPE-POOLS: truxs.
TYPES:
BEGIN OF ty_Line,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
END OF ty_Line.
TYPES: ty_Lines TYPE STANDARD TABLE of ty_Line WITH DEFAULT KEY.
DATA: itab TYPE ty_Lines.
DATA: itab1 TYPE truxs_t_text_data.
SELECT
vbeln
posnr
UP TO 10 ROWS
FROM vbap
INTO TABLE itab.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
i_field_seperator = ';'
TABLES
i_tab_sap_data = itab
CHANGING
i_tab_converted_data = itab1
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
filename = 'C:TEMPtest.txt'
TABLES
data_tab = itab1
EXCEPTIONS
OTHERS = 1.
‎2007 Feb 09 8:25 AM
I want this file data in application server not in a presentation server.
‎2007 Feb 14 7:56 AM
Hi Kishan,
in the FM you specified itab1.
after this FM i need to transfer this itab1 data to application server file.but it is not moving.can you tell me about this.
CALL FUNCTION 'SAP_CONVERT_TO_CSV_FORMAT'
EXPORTING
i_field_seperator = ';'
TABLES
i_tab_sap_data = itab
CHANGING
i_tab_converted_data = itab1
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
‎2007 Feb 09 8:37 AM
Hi Kanath,
Can you use ws_download FM when ever you are trying download data into file.
In that FM filetype parameters you should specify 'CVS'.
I think it will work.
Subbu.
‎2007 Feb 09 8:48 AM
Hi ....
you will mention file name with CSV.
open dataset....
TRANSFER rec TO '/usr/test.csv'.
close dataset.
Is it work.....
Pls give me replay....
Subbu.S