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

Excel not generating on FTP

Former Member
0 Likes
1,083

Hi All,

I am facing a problem in file creation on FTP.

The problem is .xls file is getting created but the data inside the file is not in the excel format its in text lines. ..means in a a single column all the sata is coming.

Iam Using FM

CALL FUNCTION 'FTP_R3_TO_SERVER'

EXPORTING

handle = hdl

fname = w_remfile

character_mode = 'X'

  • blob_length = blob_length

TABLES

text = itab

EXCEPTIONS

tcpip_error = 1

command_error = 2

data_error = 3

OTHERS = 4.

IF sy-subrc = 0.

ENDIF.

PlZ Help

Hi All,

I am facing a problem in file creation on FTP.

The problem is .xls file is getting created but the data inside the file is not in the excel format its in text lines. ..means in a a single column all the sata is coming.

Iam Using FM

CALL FUNCTION 'FTP_R3_TO_SERVER'

EXPORTING

handle = hdl

fname = w_remfile

character_mode = 'X'

  • blob_length = blob_length

TABLES

text = itab

EXCEPTIONS

tcpip_error = 1

command_error = 2

data_error = 3

OTHERS = 4.

IF sy-subrc = 0.

ENDIF.

PlZ Help

7 REPLIES 7
Read only

Former Member
0 Likes
958

Hi all ,

Plz input ur suggestions......

Read only

Former Member
0 Likes
958

hi, please tell me if im getting it wrong.

Is your requirement only to download the file on a system on the network ?

If that is so, you can just pass the FTP address in FM--

Also give the field separator 'X' so that the records are shown in different columns in excel..

CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
* BIN_FILESIZE =
filename = '\\10.105.2.20\Data\SAPHCM\sumit.xls'  " FTP path
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
* IMPORTING
* FILELENGTH =
tables
data_tab = IT_ekko.
* FIELDNAMES =

WRITE 'hi'.

Hope it helps

Regards,

Sumit

Read only

Former Member
0 Likes
958

no i don't have to download the file.i have to create an excel file on FTP server.

Excel file is getting created but data is not in the columns ,data of all the columns are combined togather.

PLZ help to resolve the issue.

Read only

0 Likes
958

fill itab correctlyWITH commas to separate the columns.

Read only

Former Member
0 Likes
958

This message was moderated.

Read only

0 Likes
958

your internal table sent via ftp must be of type character or string and the lines must exactly cover whqt you want to write. the ftp function module is not able to convert a structured internal table into a csv stringbased table internally like the gui_download function module. You must do this for your own.

Read only

JackGraus
Active Contributor
0 Likes
958

As you are using excel files try sending in binary mode instead of text mode with function module parameter character_mode = space and by using parameter blob instead of text.

Regards Jack