05-28-2007 7:43 AM
Hi all,
Is there any FM for selecting a file path from apps server directily in the selection-screen.
waiting for reply.
thanks & regards,
J.prakash.
05-28-2007 7:45 AM
Hi,
can anybody of u will tell how to use the FM 'TMP_GUI_DIRECTORY_LIST_FILES', i.e., a bit of code i need.
05-28-2007 7:47 AM
Hi Prakash,
try this.
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
DIRECTORY = T_DIREC
TABLES
FILE_TABLE = FILE_TABLE
DIR_TABLE = DIR_TABLE .
IF DIR_TABLE[] IS INITIAL.
CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
EXPORTING
TEXTLINE1 = 'Please Enter Valid Directory'
TEXTLINE2 = 'Ex: d:\temp'.
MESSAGE e013(zmamin) WITH ''.
V_FLAG = ''.
Reward if useful.
Thanks
Aneesh.
05-28-2007 7:46 AM
Hi Prakash,
You need to use logical file name concept and after that ise Fm FILE_GET_NAME.
Reward points if useful.
Regards,
Atish
05-28-2007 9:53 AM
hi Prakash,
Here is d solution.
call FM : RZL_READ_DIR
pass the path in NAME(export parameter)
like C:\ - U will get all the files and folders in table parameter FILE_TBL
and size having 0000000000 are folders .
display these files and folders in any formate - i suggest - list display in popup window .
let user select any file /folder
if folder is selected call this FM once again - ohterwise if file is selected - get it in some variable
and do anything with it according to your requirement
Njoy..
Reward if it helps..
05-28-2007 10:00 AM
PARAMETERS: f_app(128).
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. "get_fname_app
12-21-2007 2:55 PM
05-28-2007 10:03 AM
Hi Prakash,
try using this fn module .. '/SAPDMC/LSM_F4_SERVER_FILE'.
Regards,
Vidya.
05-29-2007 4:51 AM
Hi Prakash,
Check out this :
PARAMETERS : p_f2 LIKE rlgrap-filename.
CONSTANTS : c_mask TYPE char9 VALUE ',*.*,*.*.'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_f2.
*-- Browse Application Server
PERFORM f1001_browse_appl_file.
&----
*& Form f1001_browse_appl_file
&----
text
----
FORM f1001_browse_appl_file .
DATA: lcl_directory TYPE char128.
lcl_directory = '/local'.
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = lcl_directory
filemask = c_mask
IMPORTING
serverfile = p_f2
EXCEPTIONS
canceled_by_user = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e000(zmm) WITH text-039.
flg_app = 'X'.
ENDIF.
ENDFORM. " f1001_browse_appl_file
-SatyaPriya
05-29-2007 2:22 PM
Hi Prakash,
You can use the class CL_GUI_FRONTEND_SERVICES also for this, instead of using Function module..
Regards
Indrajit
10-24-2007 6:42 AM
10-24-2007 7:05 AM
"ABAP code for retrieving list of files contained within specific Application server
" directory(SAP).
REPORT ZDIRFILES .
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
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.
Reward points if it is usefull....
Girish