Application Development and Automation 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: 
Read only

Ftp file list

Former Member
0 Likes
2,287

hallo everybody,

I need to read a directory on an ftp server to know which files are stored...

Could you help me?

Thank you very much!

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,652

Check test program RSFTP002

Regards,

Rich Heilman

hallo everybody,

I need to read a directory on an ftp server to know which files are stored...

Could you help me?

Thank you very much!

8 REPLIES 8
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,653

Check test program RSFTP002

Regards,

Rich Heilman

Read only

0 Likes
1,652

thanks for your answer, but is there a function that gives an internal table with file list?

Read only

0 Likes
1,652

If you take a look at the program mentioned above, you will see this coding.



if cmd1 ne ' '.
  call function 'FTP_COMMAND'
    exporting
      handle        = hdl
      command       = cmd1
      compress      = compress
    tables
      data          = result
    exceptions
      command_error = 1
      tcpip_error   = 2.
  loop at result.
    write at / result-line.
  endloop.
  refresh result.
endif.

The RESULT internal table will have the list of documents, all you need to do is enter the correct command on the selection screen.

So for example, if your ftp destination url looks like this......


ftp://100.200.123.456/documents/

then enter the following on the selection screen of the test program.


Host                              100.200.123.456
Command 1                    dir documents

Run this program and you will see the list of files under this directory.

Regards,

Rich Heilman

Edited by: Rich Heilman on Jan 2, 2008 11:56 AM

Read only

0 Likes
1,652

Thank you very much.

I had seen how the function works, anyway the table has no structure, no it is not very east to get the name of the files stored in the table itsself.

Read only

0 Likes
1,652

That's right the table has no structure, which means that you will need to parse out the file names, using fixed length offsets and so on.

Regards,

Rich Heilman

Read only

0 Likes
1,652

Thanks guys,

your help is always precious.

Read only

Former Member
0 Likes
1,652

Check this function module...

RZL_READ_DIR_LOCAL

Read only

0 Likes
1,652

Thanks,

bu FM RZL_READ_DIR_LOCAL seems to be useful just for local directory, while I need to read an ftp directory.