2007 Sep 08 12:41 AM
I have to read file on application server and display the report.
For that i have to use 'Open Dataset' and 'Read Dataset'.
my file on application server having naming convention like
'System ID + Date + TIme of file download'
On selection screen of my report there is only Sytem ID and Date.
I don't have 'Time Stamp' in my report.
So how I can fetch file on Application server.
Please guide me.
I have to read file on application server and display the report.
For that i have to use 'Open Dataset' and 'Read Dataset'.
my file on application server having naming convention like
'System ID + Date + TIme of file download'
On selection screen of my report there is only Sytem ID and Date.
I don't have 'Time Stamp' in my report.
So how I can fetch file on Application server.
Please guide me.
2007 Sep 08 12:50 AM
Hi,
Check this f4 function for search file from application server , you need code this into your code so user can select
Check these FM:
F4_DXFILENAME_TOPRECURSION
TH_SELECT_SERVER
Or check this code:
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
aRs