‎2007 Jun 05 3:37 AM
Hi All,
I want to connect an external file server, and used the function WS_FILENAME_GET to search file list on the server.
During the process , I should input the username and pwd of the server.
How can I save the username and pwd, so the user needn't input
username and pwd once executing the program.
thanks,
‎2007 Jun 05 3:42 AM
WS_FILENAME_GET - local server ( presentation server )..
you want to connect unix server then use opendatset command.
‎2007 Jun 05 3:47 AM
See the some notes for unix server and i used ftp command
Below is the code to get all the files falling in the directory...... .
data: begin of t_tabl occurs 0,
line(132),
end of t_tabl,
data: lc_command(100) type c.
Get all the file name falling under specified directory...
lc_command(3) = 'ls '.
lc_command+3(45) = p_dir. " Directory of file path
call 'SYSTEM' id 'COMMAND' field lc_command
id 'TAB' field t_tabl-sys.
Check any files exits in the directory.......................
if t_tabl[] is initial.
message e006 with 'No files exist in the specified directory ' p_dir.
endif.
Above step will give you the all the fiels falling under the directory specified. But you have to loop through the internal table t_tabl to find the required files for eg: if you know the start few letters of the file name which are going to be constant always....like CWD_CNF*..
To delete the files.
loop at t_tabl.
lc_command(3) = 'rm'.
lc_command+3(45) = t_tabl-line.
call 'SYSTEM' id 'COMMAND' field lc_command
id 'TAB' field t_tabl-sys.
endloop.
‎2007 Jun 05 3:51 AM
The file server just like an sharing file. And i use WS_FILENAME_GET can find all
the files. Now I just want to keep the user name and pwd of the sharing file.
‎2007 Jun 05 4:16 AM