2006 Mar 14 2:27 PM
Hello friends!!!
Can I build a match code that retrieve the files from the SAP application server????
Thanks in advance!!
Frinee
2006 Mar 14 3:22 PM
Hi Frinee,
You may try to use this FM:
<b>RZL_READ_DIR</b>
If the server name is left blank, it reads a directory from local presentation server, otherwise it reads the directory of the remote server
<b>RZL_READ_DIR_LOCAL</b>
Read a directory on the Application Server
Hope this will help.
Regards,
Ferry Lianto
Hi Frinee,
You may try to use this FM:
<b>RZL_READ_DIR</b>
If the server name is left blank, it reads a directory from local presentation server, otherwise it reads the directory of the remote server
<b>RZL_READ_DIR_LOCAL</b>
Read a directory on the Application Server
Hope this will help.
Regards,
Ferry Lianto
2006 Mar 14 2:37 PM
so you've to create and fill a customer table with your file names.
or try to work with logical filenames (transaction: FILE)
Andreas
2006 Mar 14 2:41 PM
For example, here I am accessing our test system's application layer thru the network.
report zrich_0001.
parameters: p_file type localfile.
at selection-screen on value-request for p_file.
data: ifile type filetable.
data: xfile like line of ifile.
data: rc type i.
call method cl_gui_frontend_services=>file_open_dialog
exporting
initial_directory
= '\<ip_address>qfilesvr400<as400_name>usrsapTST'
changing
file_table = ifile
rc = rc.
read table ifile into xfile index 1.
check sy-subrc = 0.
p_file = xfile-filename.
Regards,
Rich Heilman
2006 Mar 14 3:16 PM
Hello!!! thanks for your quick answers!!
Rich, I tried your solution, I copied and pasted the code and the match code pointed to my local files in my C drive. I don't understand why because the method has an initial directory directly to SAP server, I tried it using \tmp, it didn't work...
Thanks,
Frinee
2006 Mar 14 3:25 PM
2006 Mar 14 5:50 PM
Thanks for your answers!!!
I couldn't use Rich's solution because I don't have the server information (IP).
However I user this function modules I luckely found:
RFC_SYSTEM_INFO
F4_DXFILENAME_TOPRECURSION
They worked fine!!
Regards,
Frinee
2006 Mar 14 5:57 PM
Nice find. But it does not allow to go to other specific directories? Here is an example program using this function(for all others benefit).
report zrich_0001.
parameters: p_file type dxfields-longpath.
at selection-screen on value-request for p_file.
call function 'F4_DXFILENAME_TOPRECURSION'
importing
o_path = p_file.
Regards,
Rich Heilman
2006 Mar 14 6:05 PM
2006 Mar 14 2:37 PM
You can use the class/method as below. You just have to point it to the correct path. Here I am access my sneak preview file system, you can do the same across the network.
report zrich_0001.
parameters: p_file type localfile.
at selection-screen on value-request for p_file.
data: ifile type filetable.
data: xfile like line of ifile.
data: rc type i.
call method cl_gui_frontend_services=>file_open_dialog
exporting
initial_directory = 'usrsapnsp'
changing
file_table = ifile
rc = rc.
read table ifile into xfile index 1.
check sy-subrc = 0.
p_file = xfile-filename.
Regards,
Rich Heilman
2006 Mar 14 3:22 PM
Hi Frinee,
You may try to use this FM:
<b>RZL_READ_DIR</b>
If the server name is left blank, it reads a directory from local presentation server, otherwise it reads the directory of the remote server
<b>RZL_READ_DIR_LOCAL</b>
Read a directory on the Application Server
Hope this will help.
Regards,
Ferry Lianto
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |