Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Converting to CSV format...

Former Member
0 Likes
432

Can anyone help me. I want to download a file to local PC in CSV(Comma Seperated Value) format.. IS there any method or Funtion module already available..? If not, please help me with the code...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
406

Hello Ajay,

Download the file with csv extension like this.

<b>

c:temptest.csv.

</b>

Use the FM <b>GUI_DOWNLOAD</b> for this purpose.

Vasanth

3 REPLIES 3
Read only

Former Member
0 Likes
407

Hello Ajay,

Download the file with csv extension like this.

<b>

c:temptest.csv.

</b>

Use the FM <b>GUI_DOWNLOAD</b> for this purpose.

Vasanth

Read only

Former Member
0 Likes
406

Hi,

DATA : LV_FNAME TYPE STRING.

select * from vbap into table itab.

LV_FNAME = 'c:\testfile.csv'.

*-- Download the Error Records into a File.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = LV_FNAME

TABLES

DATA_TAB = I_tab

EXCEPTIONS

OTHERS = 22.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Pls refer:

https://forums.sdn.sap.com/click.jspa?searchID=4274284&messageID=1658915

Regards

Sudheer

Read only

former_member189059
Active Contributor
0 Likes
406

What is the format of the file on the application server ?

GUI_DOWNLOAD will only work if it is already in the CSV format

else you may have to programatically convert it