03-31-2006 6:55 AM
Hi All,
I have a issue regarding Application Server File Path browsing.
Actually in my selection-screen i will declare a parameter as <b>Application Server File Path</b> now when i press F4 in that field it should be able to browse through <b>Application Server Path's</b>.
Just like <b>F4_FILENAME</b> in the case of <b>Presentation Server File Path</b> Browsing.
Can anybody solve my issue.
Thanks in advance.
Thanks & Regards,
Rayeez.
03-31-2006 7:37 AM
hi...
u can try out with the following FM..
"F4_DXFILENAME_TOPRECURSION "
The detail description for it is...
*Popup to select one file from the given application server directory (pattern allowed).
*(Can be used also for selecting file on presentation server: calls WS_FILENAME_GET)
*Parameters: I_LOCATION_FLAG={A|P|space};
if I_LOCATION_FLAG is blank then popup to choose Appl./Present.; if I_SERVER='?' then popup to select appl.server.
as in...
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
I_LOCATION_FLAG = 'A' "(A) Server (P) Presentaión
I_SERVER = '?'
I_PATH =
FILEMASK = '.'
FILEOPERATION = 'R'
IMPORTING
O_LOCATION_FLAG =
O_SERVER =
O_PATH =
ABEND_FLAG =
EXCEPTIONS
RFC_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
regards,
Ananaya.S
03-31-2006 6:57 AM
03-31-2006 7:00 AM
Hi Shaik,
Just copy and paste:
Here is the code for retrieving list of files contained within specific Application server directory(SAP).
PARAMETER: p_fdir type pfeflnamel DEFAULT '/usr/sap/tmp'.
data: begin of it_filedir occurs 10.
include structure salfldir.
data: end of it_filedir.
START-OF-SELECTION.
Get Current Directory Listing for OUT Dir
call function 'RZL_READ_DIR_LOCAL'
exporting
name = p_fdir
tables
file_tbl = it_filedir.
List of files are contained within table it_filedir
loop at it_filedir.
write: / it_filedir-NAME.
endloop.
Hope this will help you.
Let me know incase of any concerns.
EDIT:
There are few FM for ur refernce :
RZL_READ_DIR_LOCAL
SUBST_GET_FILE_LIST Return table with file list for the given directory (pattern allowed)
F4_DXFILENAME_TOPRECURSION Popup to select one file from the given application server directory
TH_SERVER_LIST Returns list of application servers.
EPS_GET_DIRECTORY_LISTING Lists filenames from the application server .
Cheers
Sunny
Rewrd points, if found helpful
Message was edited by: Sunny
03-31-2006 7:01 AM
Hi Shaik,
Please check this sample code.
at selection-screen on value-request for f_app.
perform get_fname_app.
form get_fname_app.
data: c_fnh_mask type dxfields-filemask value '*.*',
search_dir type dxfields-longpath value '/sapglobal/users',
file_path like dxfields-longpath.
call function 'F4_DXFILENAME_TOPRECURSION'
exporting
i_location_flag = 'A'
i_server = ' '
i_path = search_dir
filemask = c_fnh_mask
fileoperation = 'R'
importing
o_path = file_path
exceptions
rfc_error = 1
others = 2
.
if sy-subrc eq 0.
f_app = file_path.
endif.
endform.
Hope this will help.
Regards,
Ferry Lianto
03-31-2006 7:12 AM
Hi,
The following code gives you the list of files available in the application server for the given directory.So with the internal table which the FM returns you can manipulate to meet your requirements.
PARAMETER: p_fdir type pfeflnamel DEFAULT '/usr/sap/tmp'.
data: begin of it_filedir occurs 10.
include structure salfldir.
data: end of it_filedir.
START-OF-SELECTION.
Get Current Directory Listing for OUT Dir
CALL FUNCTION 'RZL_READ_DIR_LOCAL'
EXPORTING
name = p_fdir
tables
file_tbl = it_filedir
EXCEPTIONS
ARGUMENT_ERROR = 1
NOT_FOUND = 2
OTHERS = 3
.
List of files are contained within table it_filedir
loop at it_filedir.
write: / it_filedir-NAME.
endloop.
03-31-2006 7:37 AM
hi...
u can try out with the following FM..
"F4_DXFILENAME_TOPRECURSION "
The detail description for it is...
*Popup to select one file from the given application server directory (pattern allowed).
*(Can be used also for selecting file on presentation server: calls WS_FILENAME_GET)
*Parameters: I_LOCATION_FLAG={A|P|space};
if I_LOCATION_FLAG is blank then popup to choose Appl./Present.; if I_SERVER='?' then popup to select appl.server.
as in...
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
I_LOCATION_FLAG = 'A' "(A) Server (P) Presentaión
I_SERVER = '?'
I_PATH =
FILEMASK = '.'
FILEOPERATION = 'R'
IMPORTING
O_LOCATION_FLAG =
O_SERVER =
O_PATH =
ABEND_FLAG =
EXCEPTIONS
RFC_ERROR = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
regards,
Ananaya.S
03-31-2006 8:21 AM
Hi Shaik,
you can use this FM <b>/SAPDMC/LSM_F4_SERVER_FILE</b>
L_FILEMASK = '*'.
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
DIRECTORY = L_DIRECTORY
FILEMASK = L_FILEMASK
IMPORTING
SERVERFILE = P_FILENAME
EXCEPTIONS
CANCELED_BY_USER = 1
OTHERS = 2.
Regards
Vijay