Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

So to read file on application server?

Former Member
0 Likes
426

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.

1 REPLY 1
Read only

former_member194669
Active Contributor
0 Likes
395

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


Check the similar thread:

aRs