2007 Sep 14 4:42 PM
Hi all,
After connecting to FTP.
I want to read the data into an internal table which is in location for eg:- /export/home/in/text.txt
The question is "How can i get all the data which is available in text.txt file to an internal table??"
Note: I am aware of FMs ftp_connect, ftp_command, ftp_disconnect. I tried using Open Dataset..but not successful.
I would appreciate if you can give a specific answer with an example.
helpful answer will be rewarded with points.
Thank You in advance.
2007 Sep 14 4:49 PM
What happened when you used OPEN DATASET?
Did you also use READ DATASET?
Rob
2007 Sep 14 4:55 PM
Hi VGP,
Those FM are not required. Simply write one program using open dataset.Use the following in your program.
program zreport1.
data: begin of i_upload occurs 0,
text(1000) type c,
end of i_upload.
selection-screen begin of block blk with frame title text-001.
parameters: fname like rlgrap-filename.
selection-screen end of block blk.
start-of-selection.
if not fname is initial.
perform zf_upload.
endif.
form zf_upload.
open dataset fname for input in text mode.
if sy-subrc <> 0.
message s999 with 'File not found or cannot be opened'.
stop.
endif.
do.
read dataset fname into i_upload.
if sy-subrc <> 0.
exit.
endif.
append i_upload.
clear i_upload.
enddo.
close dataset fname.
endform. " zf_upload
Hope this helps.
Please reward if useful.
Thanks,
Srinivasa
2007 Sep 14 5:11 PM
Hello,
when i use the Open Dataset..sy-subrc = 8, an exception is raised.
is there any alternative method or we have to use only Open Dataset...?
2007 Sep 14 5:33 PM
Hi VGP,
Do you have the permissions or authorizations to open the file?
Hope this helps.
Thanks,
Srinivasa
2007 Sep 14 5:37 PM
2007 Sep 14 6:18 PM
Hi VGP,
If possible can you send me your code?
What is the file name you are using?
Thanks,
Srinivasa
2007 Sep 14 6:25 PM
2007 Sep 14 6:25 PM
2007 Sep 14 6:27 PM
Hi VGP,
Please let me know what was the problem. How did you solved it?
Thanks,
Srinivasa
2007 Sep 17 1:15 PM
Hi Srinivasa,
I think we can't use open_dataset..., as mentioned in my question the file is in external application server.
I tried using the FM FTP_SERVER_TO_R3.