03-02-2015 7:06 AM
Hi Experts,
I am trying to fetch data from ftp server which is in EXCEL(.XLS) format.Able to connect FTP using FTP_CONNECT,using FTP_COMMAND(to get data). While reading a text file I am getting the data in the internal table successfully, but when I try to read the data from excel file , it returns the data into the internal table , but in different format(may be in binary format).
How to capture the excel file entries,help me regarding this?
Regards,
Binod
03-02-2015 7:15 AM
hi binod,
can you mention which fm you are using to read excel file?
03-02-2015 7:32 AM
03-02-2015 7:32 AM
03-02-2015 7:36 AM
03-02-2015 5:59 PM
Hi Binod,
DATA : it_file TYPE TABLE OF alsmex_tabline WITH HEADER LINE.
DATA : lv_file TYPE rlgrap-filename.
lv_file = gv_file.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = lv_file"Path of the file
i_begin_col = '1'
i_begin_row = '2'
i_end_col = '26'
i_end_row = '256'
TABLES
intern = it_file
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
LOOP AT it_file.
CASE it_file-col.
when 1."columns
Remaining will be according to your excel file columns,
,,,
,,
endcase.
endloop.
Thanks,
sivanadh
11-18-2021 1:53 PM
Please, could you share the solution to read the excel file on ftp server and get it on a internal table. The FM FTP_SERVER_TO_R3 FM, returns a binary table.
11-18-2021 3:01 PM
02-26-2022 5:32 AM
Hello Team,
I am also facing same issue while excel file data from FTP folder. Could you please some one help us to get excel data in to internal table.
fname = wa_file_list-file_name.
CALL FUNCTION 'FTP_SERVER_TO_R3'
EXPORTING
handle = hdl
fname = fname
character_mode = 'X'
TABLES
text = it_data
EXCEPTIONS
tcpip_error = 1
command_error = 2
data_error = 3
OTHERS = 4.
IF sy-subrc NE 0.
* WRITE 'FTP Error'.
ENDIF.
Thanks,
Vijay