How to read XL file from FTP server
Hi all,
I have a requirement like to read file from FTP server using path
ftp:
10.212......\DTR\DTR_ Accounted_Out
and again save other file in same location ,
to doing this RFC connection is required?
give a procedure or program to do this requirement ..
To create rfc for FTP which connection type can i use ?
Give complete settings to create rfc destination
Hi Rakhi,
Use the below code to check if you have received the proper data.
call function 'FTP_SERVER_TO_R3' "Get data as character instead of BLOB
exporting
handle = hdl
fname = docid
character_mode = 'X'
tables
text = chardata.
If the data is incorrect, it is possible that you are in the wrong directory.
Use
call function 'FTP_COMMAND'
exporting
handle = hdl
command = 'cd mydir\mysubdir' "cd <space> your path
tables
data = result
exceptions
tcpip_error = 1
command_error = 2
data_error = 3.
Regards,
Jovito.
Similar Messages
-
How to read .xls file from FTP server t oInternal table
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 YouHi, 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 -
How to read the file from ftp server
Hi
I need to read a file from a ftp server . Iam using apache lib common-net .jar .
FTPClient ftp = new FTPClient();
ftp.connect(server);
ftp.login(username,password);
FTPFile[] files = ftp.listFiles();
for(int i=0 ;i<files.length;i++){
System.out.println(" File : "+ i + " - " + files);
InputStream ip = ftp.retrieveFileStream(path);
I got the inputstream from the ftp server. but iam not able to read the contents of the file ....
help me plzzzzzHi
I have one more problem . first i try to read the file and write the file in local directory . then i try to read the data in the remote file .. iam getting the datas as null.
InputStream ip = ftp.retrieveFileStream(path);
File f = new File("D:\\ftp.txt");
FileOutputStream fo = new FileOutputStream(f);
byte[] buf = new byte[1024];
while ((len = ip.read(buf)) > 0) {
fo.write(buf,0,len);
fo.close();
BufferedReader br = new BufferedReader(new InputStreamReader(ip));
String line;
do {
line = br.readLine();
System.out.println(" data " +line);
}while (line != null); -
Problem while reading the file from FTP server
Hi Friends,
I have a problem while fetching files from FTP server.
I used FTP_Connect, FTP_COMMAND function modules. I can able to put the files into FTP server.
but I cant able to pick the files from FTP server.
anyone have faced similar issues kindly let me know.
Thanks
GowrishankarHi,
try this way..
for reading the file using FTP you need to use different unix command ..
Prabhuda -
Reading a file from ftp server
Hi
I am able to put file on ftp server using ftp adapter.But same settings are not working while polling file on ftp.
Do i need to do some settings for get operation??Hi,
Check the file permissions and for testing give all read/write/execute permissions to the file to be read from FTP. Also check the file modification date of the file.
Check for the logs at 2 places for any error messages:
- SOA server diagnostics logs
- FTP server logs
You can also enable the FINEST level of Adapter logs for adapters and see for the detailed errors in the diagnostic logs.
FMW Console > right click soa-infra > Logs > Log Configuration > expand oracle.soa > set Trace32 : FINEST for oracle.soa.adapter
Regards,
Neeraj Sehgal -
Hi all,
I have to read a file from FTP server, manipulate it and then create another file at the same location.
Currently, I am able to write a file onto FTP server ..but how do I read the file?
Any help will be greatly appreciated.
Thanks,
Harithacan i know how do u placing the file in FTP?
( default path specified in the FTP server, it might be Pre. server address) -
Upload XL file from FTP server
Hi All,
Can anybady help me, how to upload Excel file from FTP server.
Thanks
Sri
Edited by: srikanthn on Apr 14, 2010 6:31 PMHello
How about using SAPFTP?
I hope SAP note 130106 will guide you on this.
Thanks
koju -
Oracle read files from FTP Server
Hi,
Somebody knowns Oracle how to read files from FTP Server ? Which package I can use?Duplicate post
Oracle read files from FTP Server -
How to get file from FTP Server using File Control
Hi,
Any one did getting file from FTP Server?
Please let me know any one help me.
I would need to get file from FTP Server.
Thanks,
MadhuYes I have done that. But In FTP Server I cannt read file, because no previliges. Only I need to copy file from FTP Server to local server then only I can read that file.
I tried all options using FileConrol(getFiles(),read()).
getFiles() - It wont copy the file, it give information about file.
read() - I dont have previliges to read the file.
Please tell me any other procedure would be there for getting file from FTPServer.
Thanks,
Madhu -
How to send a file from FTP to external server
My requirement is to send a file from FTP to D3(External) server.
Now I am able to store the file in Appln server.
I want to send the file created by the program thru FTP to D3 server.
I know the username,Password,HostID,RFC destination details.
How to send the file from FTP to D3.
If u have any program,Plz send it...
I dont want the function modules name...I want the example code ....
Thanks in advance.Hi Sumi,
You could do it so that you create a .bat or .cmd script to your server which does your ftp transfer.
To do this you must use sm69 to create a external operating system command which you can call from FM SXPG_COMMAND_EXECUTE. To SXPG_COMMAND_EXECUTE you the file you need to transfer as a parameter.
What happens is that your abap program passes the file to windows batch script (.bat .cmd) which will then do the transfer for you.
Here's a sample of ftp-script for windows:
echo open IP_ADDRESS_TO_YOUR_SERVER > c:zftp_transfer.ftp
echo USERNAME>> c:zftp_transfer.ftp
echo PASSWORD>> c:zftp_transfer.ftp
echo put YOUR_FILE>> c:zftp_transfer.ftp
echo quit>> c:zftp_transfer.ftp
ftp -s:c:zftp_transfer.ftp
also take a look here for more details:
http://support.microsoft.com/?kbid=96269
Ok, this might be a bit trivial but if your server is unix/aix etc.. Instead of using batch script you must do a shell script.
Regards,
Ville -
Download file from FTP Server to Application Server
Hi Friends,
Using the standard SAP Program RSFTP002, I was able to download the file to my local PC. But my requirement is to download the file from FTP to application server.
For RSFTP002, I am passing the username, password, host and in command 1 I am passing lcd :\temp, command 2 get filename. The file gets downloaded into c:\temp. If I do the same passing the app server path in command 1 as /usr/sap/tmp I get an error that pass cannot be found.
Anyone please help me how to donload the file from ftp to app server.
Thanks,
DeepthiIf I remember correctly the activation type on the technical settings tab must be set to "start on application server" in transaction SM59 for the RFC destination for the FTP server. This should allow the files to be transferred to/from the application server.
Regards,
Steve. -
Copy file from FTP server to sap application server
Hi,
I am able to copy a particular file from FTP server to sap application server using FTP_CONNECT, FTP_COMMAND and FTP_DISCONNECT. But here my problem is, it copies into default application server path(DIR_HIOME). I want to copy into specified folder in the application server. How can I specify the required destination path.
Can you please suggest how to achieve this.
Thanks,
Shiva Kankanalatry something like this:
data: user(30) type c value 'ftpuser', "ftp username
pwd(30) type c value 'ftppass', "ftp password
host(64) type c value '255.255.255.255', "ftp server IP
cmd1(80) type c value 'lcd /dump', "location on app server where you want to copy the file
cmd2(80) type c value 'get', "specifies you are going to get the file from ftp server
dest like rfcdes-rfcdest value 'SAPFTPA',
file(15) type c value 'file.txt'. "specifies file that you want to get from ftp server
data: hdl type i,
key type i value 26101957,
slen type i.
slen = strlen( pwd ).
call function 'HTTP_SCRAMBLE'
EXPORTING
source = pwd
sourcelen = slen
key = key
IMPORTING
destination = pwd.
call function 'FTP_CONNECT'
EXPORTING
user = user
password = pwd
host = host
rfc_destination = dest
IMPORTING
handle = hdl.
call function 'FTP_COMMAND'
EXPORTING
handle = hdl
command = cmd1
TABLES
data = result
EXCEPTIONS
command_error = 1
tcpip_error = 2.
loop at result.
write at / result-line.
endloop.
CONCATENATE cmd2 file INTO cmd2 SEPARATED BY SPACE.
call function 'FTP_COMMAND'
EXPORTING
handle = hdl
command = cmd2
TABLES
data = result
EXCEPTIONS
command_error = 1
tcpip_error = 2.
loop at result.
write at / result-line.
endloop.
refresh result. -
Downloading file from ftp server
hii
how do i download the file from ftp server. plz suggest wat are the function modules for tht.. and plz do give the values of the parameters used in the fn modules
points guranteed:-)<i><b>*--> Scramble the password.</b></i>
CALL FUNCTION 'SCRAMBLE_STRING'
EXPORTING
source = password
key = 26101957
IMPORTING
target = password.
<i><b>*--> Connect to the FTP server.</b></i>
<i>* user is the logon user for the FTP server.
password is the password you have just scrambled.
host is the ip address of the FTP server.
rfc_destination is 'SAPFTPA'.</i>
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = user
password = password
host = host
rfc_destination = rfc_destination
IMPORTING
handle = wa_handle
EXCEPTIONS
not_connected = 1
OTHERS = 2.
<i><b>*--> Carry out the command on the FTP server</b></i>
<i>* wa_command is the command you wish to carry out on the FTP server (e.g.
wa_command = 'ascii' will specify ascii mode). Result_itab will contain the
result of your commands.</i>
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = wa_handle
command = wa_command
TABLES
data = result_itab
EXCEPTIONS
tcpip_error = 1
command_error = 2
data_error = 3
OTHERS = 4.
<b>*--> Disconnect from the target host.</b>
CHECK NOT wa_handle IS INITIAL.
CALL FUNCTION 'FTP_DISCONNECT'
EXPORTING
handle = wa_handle
EXCEPTIONS
OTHERS = 1.
<u><i><b>Hope this helps :)</b></i></u> -
Need to copy .txt file from FTP server and downloaded on local server directory.
I need to figure out a way to copy .txt file from ftp server in local server directory using sql jobs.
Below links will help achieving it:
https://www.virtualobjectives.com.au/sqlserver/ftp_scripts.htm
http://www.mssqltips.com/sqlservertip/2884/sql-server-integration-services-ssis-ftp-task-for-data-exchange/ -
Problem in download file from FTP server
Hi
I want to download a file from FTP server for that i am using the apache FTP module but i am not getting how to download a file with that api i can dispaly the list of files and folders but not able to download the file or folder can any one help me in this
Thanks
NinadHi
I think you miss understood something I am writing a program to download the file in Java where i have used the jakarta.apache api for that and getting problem in that bellow is the code where I have written to print the directory & file names but I don't know how to download the file
FTPClient ftpConnection = new FTPClient();
ftpConnection.connect(host);
ftpConnection.login(FTPConnection.userName,FTPConnection.password);
FTPFile fileList[] = ftpConnection.listFiles();
for(int i=0;i<fileList.length;i++)
System.out.println(fileList.getName());
thanks
Ninad
Maybe you are looking for
-
Windows XP will not run iTunes 10. Clean install of Windows, installed and uninstalled twice. After agreeing to the itunes contact nothing happens. Running AVG free and it was disabled during the second install. What to do?
-
Greetings! I just upgraded to Lion. Finder no longer allows me to search files, e.g., Word files for amounts, e.g., $90, $100, $85. The "$" character ruins the search. What do I do?!
-
Hello. I have just built a website using iWeb but cannot upload it. I curently have the 25gb account. There doesn't appear to be any facility here for the net. Am I correct in thinking I need an upgrade, or am I doing something wrong? Thanks
-
Safari 4.0.3 can't log into FaceBook
Since I updated the Safari software, I've had a problem logging into my Facebook account. Now it won't let me at all. It simply keeps sending me back to the original login page. I've tossed cache and cookies and keep trying with no luck. Firefox has
-
Error in Quotation upload to R3
hello experts, we are working on CRM 5.0 & ECC 6. im having problems when uploading a quotation to R3. after the quotation is released, it is saved, then it shows that the doc is being distributed when i try to enter change mode, b