Application Development 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: 

How to read .xls file from FTP server t oInternal table

Former Member
0 Kudos
1,043

Hi

am using the FTP_SERVER_TO_R3 to read xls file from FTP server to internal table

but the data i get in LT_TEXT is special characters.

CALL FUNCTION 'FTP_SERVER_TO_R3'
EXPORTING
handle = hdl
fname = f_name "ProdDataFromCRM.xls.
* CHARACTER_MODE = 'X'
* IMPORTING
* BLOB_LENGTH =
TABLES
BLOB = lt_text
* TEXT = lt_text
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4

can any one help me out to get the exact data..

Really appreciate your quick response..

Thank You

5 REPLIES 5

Clemenss
Active Contributor
170

Hi venkatesh v,

thank you for the amount of details given. I'm convinced it works perfect. You get the data exactly as they are stored on the ftp server in exactly the format you gave here.

Regards,

Clemens

Former Member
0 Kudos
170

Hi Venkatesh,

may be try setting ASCII mode before , like :

call function 'FTP_COMMAND'

exporting

handle = hdl

command = 'ascii'

tables

data = result

exceptions

others = 1.

Or may be because 'character_mode' parameter is commented in your code. Otherwise it looks fine.

Regards,

Pawan

0 Kudos
170

Hi Pawan,

have mercy with venkatesh

fname = f_name "ProdDataFromCRM.xls.

looks like he wants to handle an excel file. For this you'd rather go binary. I think it works as designed.

Regards

Clemens

0 Kudos
170

Yeah I should have noticed its a office document. Internal table lt_text led to the confusion.

Many thanks for the document reference on Desktop office integration , I am yet to learn this.

Clemenss
Active Contributor
0 Kudos
170

Hi, if you really retrieve an excel file, you can not see the data in ABAP. You may see them in Excel. For this you may use

CALL METHOD document->open_document_from_table

of the interface i_oi_document_proxy for OLE objects. You can access the data with reference to the interface i_oi_spreadsheet.

Please check [Desktop Office Integration (BC-CI)|http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIOFFI/BCCIOFFI.pdf] for details.

But, who knows, perhaps you want "And Now For Something Completely Different".

Regards

Clemens