How to download n files to FTP server in background using single report?
Hi all,
I have one requriement where i have to download 7 different text ( *.txt ) files to FTP server weekly using single program in background mode.
I have populated all the 7 internal tables with their corresponding data. But i dont know how to proceed further.
Please help me out .....
Thanks in advance..
hi,
U can store the Internal table name and File name in an internal table.
Then loop at that table and call function called 'GUI_DOWNLOAD' inside that loop.
Rgds,
Sanjeet
Similar Messages
-
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); -
Error while downloading PDF file from FTP Server
Hi Friends,
I have sent a PDF file with data to FTP , Then i want to check that uploaded pdf file , whether that is correct or not?
for that , i have downloaded that file from FTP and i am trying to open the file . but it is giving this problem .
"There was an error opening the document . The file is damaged and could not be repaired."
will you suggest me regarding this.
thanks in advance.
balaji.T.CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = spoolno
src_spoolid = wa_file-rqident
no_dialog = ' '
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
OTF_PAGECOUNT =
btc_jobname = jobname
btc_jobcount = jobcount
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_dstdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11.
because of this one PDF internal table is obtained.
OPEN DATASET L_FILENAME FOR OUTPUT in text mode MESSAGE MSG.
LOOP AT pdf.
CONCATENATE pdf-tdformat "Material group
pdf-TDLINE "Basic Material
INTO ITEXT-TLINE ..
APPEND ITEXT.
TRANSFER ITEXT TO L_FILENAME.
ENDLOOP. -
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 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 destinationHi 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. -
How to download a file from application server to presentation server
Hi experts,
I want to download a file from application server to presentaion server, file contaims three fields customer name, customer email id and status..
help me out i m new into sap.Dear Aditya,
Please check below thread
http://scn.sap.com/thread/1010164
it will help you.
BR
Atul -
How to access a file in Unix server from windows using java
I want to access a file in unix server from windows using java program.
I have the following code. I am able to open the url in a web browser.
String urlStr="ftp:user:passwd@unix-server:ftp-port//javatest/test.csv;type=i";
URL url = new URL(urlStr);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream)));
String inputLine;
while((inputLine=in.readLine()))!=null){
System.out.println(inputLine);
in.close();
I get the following error
java.io.FileNotFoundException: /javatest/test.csv
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:333)
at java.net.URL.openStream(URL.java:960)
at com.test.samples.Test.main(Test.java:45)urlStr="ftp:user:passwd@unix-server:ftp-port//javatest/test.csv;type=i";
I have given the format of the urlStr that I am using in the code. The actiual values are used in my code. I have tried pasting this url in the browser and it opens the file. -
How to download data to the presentation server in background?
Hi,
I would like to download data to the presentation server in background.
Currently, the report uses FM GUI_DOWNLOAD to download in foreground.
However, this FM does not work in the background.
But please let me know how to download to the presentation server in background.
Thanks and regards,
AnishurModerator message - FAQ - Please search before asking - post locked
Rob -
How to download a file from a server path?
Is it possible to attach files on the server to a web dynpro response with cl_wd_runtime_services=>attach_file_to_response? All the examples I have seen assume you have the file content as an XSTRING. But how can one just send a file from a known path?
Is it really necessary to first load the file (e.g. a 50Mb TIFF) as an XSTRING before downloading it? If so, how is this done?Hi Marc,
Try using this FM to convert String to Xstring.
SCMS_STRING_TO_XSTRING
HR_KR_STRING_TO_XSTRING
and also check this...Error document.getElementById(...) in function 'SCMS_STRING_TO_XSTRING'
Might Helps you.
Cheers,
Kris. -
How to download a file from a server
Hi,
I have a question with a general design implementation. Hope anyone more skilled than me helps me.
I want to do an application based on an android client and a java server. Local wifi transmission, no 3G.
Basically, the client must connect to the server and request a file to download using a code.
How can I do that?
Things I know:
* I must create a background thread in the client to create a file in the SD card and update a progress bar using a Handler to communicate with the UI thread.
* The server must be multithread and non-blocking.
* The file is a binary file like a mp3 audio. So the server has to:
1. Send information about the file: name and total length.
2. Open the file, read and send bytes while it does not reach the end.
* The client has to:
1. Receive the information about the file and create an empty file.
2. Read bytes and dump them into the empty file. Update progress bar.
3. When all bytes are recieved close the file.
I have knowledge implementing a client and server in C (very awful) but I am beginning with a real client-server application done in java.
Questions:
* How can I download a binary file like an mp3 from a server to a client?
* Where I have to put my server application? I supose that I must create a jar, save it on a folder and execute it at PC start-up, right?
Thanks!
PD: I know this is not an android forum but I only need help with the download process.
Edited by: user13425637 on 06-dic-2010 11:08Questions:
* How can I download a binary file like an mp3 from a server to a client?There are a ton of examples on the internet on how to download files. If you are having a problem, please post your code.
>
* Where I have to put my server application? I supose that I must create a jar, save it on a folder and execute it at PC start-up, right?Your server application will exist on a server and will run the application. hence the reason for the server. The best best for you is to read some online tutorials on client/server and how it works. -
How to Download a file from web server using servlets
how do we download a file from Java Web Server connecting to oracle database
it should start as soon a i click a button in my html browser
please reply as it is needed to complete my project to submited to the collageWith SQLJ you can do it.
When you look at:
http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/basic/basic.htm
or
http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/advanced.htm
There are samples for reading LONGRAW / BLOB from Database. If you want use it in servlet you have to pass the result to the responce object, set the correct mime-type and set the response.setContentLength( xx). This is for some PlugIns nessessary (pdf).
regards Dietmar -
How to transfer excel files(on ftp server) into internal table?
hello,everyone
pls tell me how to transfer excel files those on a ftp server into internal table?
ps.i know the function 'ftp_server_to_r3',it can help to transfer flat file.Hi,
I believe you want to get the data from the FTP Server to R3.
I am also sending the code. Have a look and it would help you.
First get the Password and user name and the FTP Server Path where file is stored and FTP Server Host name
FUNCTION zfi_ftp_get.
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_FILENAME) TYPE C
*" TABLES
*" T_BLOB STRUCTURE ZFI_TLM_LENGTH OPTIONAL " is a table type with a field called line of length 992
*" RETURN STRUCTURE BAPIRET2 OPTIONAL
DATA : i_password(30) TYPE c,
i_user(30) TYPE c,
i_host(30) TYPE c,
i_rfc_destination TYPE rfcdes-rfcdest,
i_length TYPE i,
i_folder_path(100) TYPE c.
DATA: lv_blob_length TYPE i.
DATA: lv_length TYPE i, "Password length
lv_key TYPE i VALUE 26101957,
lv_password(30) TYPE c,
lv_ftp_handle TYPE i,
lv_cmd(80) TYPE c.
DATA: BEGIN OF result OCCURS 0,
line(100) TYPE c,
END OF result.
TYPES: BEGIN OF ty_dummy,
line(392) TYPE c,
END OF ty_dummy.
DATA: lt_dummy TYPE TABLE OF ty_dummy,
ls_dummy LIKE LINE OF lt_dummy.
i_password = 'vnhdh'.
i_user = 'sdkgd'.
i_host = 'sbnksbg'.
i_rfc_destination = 'SAPFTP'.
i_length = '992'.
i_folder_path = '/hioj/hohjk/hh'.
lv_length = STRLEN( i_password ).
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = i_password
sourcelen = lv_length
key = lv_key
IMPORTING
destination = lv_password.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = i_user
password = lv_password
host = i_host
rfc_destination = i_rfc_destination
IMPORTING
handle = lv_ftp_handle
EXCEPTIONS
not_connected = 1
OTHERS = 2.
IF sy-subrc = 1.
return-type = 'E' .
return-message = 'FTP Connection not Successful'.
APPEND return.
ELSEIF sy-subrc = 2.
return-type = 'E' .
return-message = 'FTP Connection not Successful'.
APPEND return.
ELSEIF sy-subrc EQ 0.
return-type = 'S' .
return-message = 'FTP Connection Successful'.
APPEND return.
CONCATENATE 'cd' i_folder_path INTO lv_cmd SEPARATED BY space.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = lv_ftp_handle
command = lv_cmd
TABLES
data = result
EXCEPTIONS
command_error = 1
tcpip_error = 2.
IF sy-subrc = 1.
return-type = 'E' .
return-message = 'Command Error Occured during open of FTP Folder'.
APPEND return.
ELSEIF sy-subrc = 2.
return-type = 'E' .
return-message = 'TCIP Error Occured during open of FTP Folder'.
APPEND return.
ELSE.
REFRESH t_blob.
lv_blob_length = 992.
TRANSLATE i_filename TO LOWER CASE.
CALL FUNCTION 'FTP_SERVER_TO_R3'
EXPORTING
handle = lv_ftp_handle
fname = i_filename
IMPORTING
blob_length = lv_blob_length
TABLES
blob = lt_dummy.
t_blob[] = lt_dummy[].
ENDIF.
ENDIF.
ENDFUNCTION.
Regards
Sajid
Edited by: shaik sajid on Nov 16, 2010 7:25 AM -
Downloading excel file from FTP Server to Application Server
Hi,
I have to get data from an excel file available on FTP server into an Internal table.Can I use FTP_SERVER_TO_R3 to do so.
Please let me know if there are any function modules available to do this.
Thanks,
Prasuna.Dear Gayatri,
You can get the file from FTP to internal table...
I am sending you the code with inline comments ....Hope this will be helpful to you.
Data: lv_key TYPE i VALUE 26101957.
Data: lv_password(30) TYPE c.
i_rfc_destination = 'SAPFTP'.
lv_length = STRLEN( i_password ).
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = i_password "give ftp server pwd
sourcelen = lv_length
key = lv_key
IMPORTING
destination = lv_password.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
user = i_user "give ftp user name
password = lv_password
host = i_host
rfc_destination = i_rfc_destination
IMPORTING
handle = lv_ftp_handle
EXCEPTIONS
not_connected = 1
OTHERS = 2.
CONCATENATE 'cd' i_folder_path INTO lv_cmd SEPARATED BY space.
*i_folder path is the path in ftp server where file is stored
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
handle = lv_ftp_handle
command = lv_cmd
TABLES
data = result
EXCEPTIONS
command_error = 1
tcpip_error = 2.
lv_blob_length = 392.
TRANSLATE i_filename TO LOWER CASE.
CALL FUNCTION 'FTP_SERVER_TO_R3'
EXPORTING
handle = lv_ftp_handle
fname = i_filename "give required file name
IMPORTING
blob_length = lv_blob_length
TABLES
blob = lt_dummy.
Regards
Sajid -
How to download a file from Middleware server
Hi,
I have a requirement to list file names in a table layout and when user clicks on file name, file must be downloaded to the client tier. Source files are located in 11i Apps middletier.
I did not find any examples on how to achieve this using OAF. All I see is downloading file from BLOB inside a database.
please help..OAMessageDownloadBean is the bean that lets you download a file from middletier.
Please see the File Upload and Download chapter in devguide for implementation details.
Thanks
Tapash -
How to download a file from other server using servlet
Hi All....
Good Morning....
right now,i am facing a problem..i am trying to download a file which is in other server..i tried somany ways and i couldnt succeed in this...
will u pls give me solution for this..
because it is very urgent for me...
i am very much thankful if u provide me the code samples also....
i am seeking ur help...
Regards,
sathyaright now,i am facing a problem..i am trying to download a file which is in other server..i tried somany ways and i couldnt succeed in this...If you can tell some of our approaches and the failures you faced, someone might be able to help you.
I dont think anyone will just give the code samples.
Maybe you are looking for
-
Using table filters with transient VO attributes
Hi, I have a the following use case and I cannot seem to find a valid solution on my own without falling into deep depression and/or psychotic delirium. Anyway, I'm sure there's a solution and that it's pretty simple, and hopefully someone here will
-
Converting HDV @ 16:9 to a 4:3 letterbox frame - stretching question
Hi I'm helping a client export her project for a screening. Her sequence is HDV (1440x1080), playing of course as 16:9. The screening requires an MPEG-4 (H.264) of 640x480 frame size, with letterboxing. Originally, I tried simply exporting the sequen
-
Change default language without changing country ?
Hi, I am a British expat living in the Netherlands. My iTunes store has to be the Netherlands version because my address and bank details are Dutch. The problem is that the iTunes store and all account options are in Dutch and I can't understand it.
-
Where do I look on my computer to see which version of Firefox I am running?
I am not sure which version of Firefox I am running on my computer. How can I find out? I am using a desktop computer with windows.
-
Store+search+view+print inventory,store+search+print rent information
Good morning, I need some help regarding my Java Project. I was told by my lecturer to do one program[probably java applets] to store all informations about CDs and Videos. The program should be able to : 1)store,view,search and print the information