Application Development 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: 

Get file list from Windows directory in background

Our SAP server is currently on a Linux server but migrating to Windows. Our PI servers are on Windows. Everything is running fine except when we are trying to run jobs that require to get a filelist from directory located on a server which is based on Windows.

All FM running in background on Linux will use Unix file patterns and fail on the CALL.

Although this is temporary, I thought SAP would allow this as mixed platforms exist especially during migration.

Anybody encountered that and found a solution?

Regards,

Alain

4 REPLIES 4

former_member226519
Active Contributor
0 Kudos

this workes for me as a F4 help with windows, UNIX, Linux ... :

parameter p_file like dxfields-longpath lower case.

at selection-screen on value-request for p_file.
  perform file_help using 'P_FILE'.

start-of-selection.
  write:/ p_file.

*&--------------------------------------------------------------------*
*&      Form  file_help
*&--------------------------------------------------------------------*
form file_help using value(pin_fn).
  data: lv_scrnfn like dynpread-fieldname,
        lv_svr    type msxxlist-name.

* ----------------------------------------------------------------------


*  get the name of the current server.
  call 'C_SAPGPARAM' id 'NAME' field 'rdisp/myname'
                     id 'VALUE' field  lv_svr.

  lv_scrnfn = pin_fn.

  call function 'F4_DXFILENAME_4_DYNP'
    exporting
      dynpfield_filename = lv_scrnfn
      dyname             = sy-repid
      dynumb             = sy-dynnr
      filetype           = 'P'
      location           = 'A'
      server             = lv_svr.
endform.                    "file_help

0 Kudos

Hi Volker,

Unfortunately, this does not work as the SAP Server is UNIX but the Server directory I need to get file list from is Windows and is not an SAP Server.

Thanks anyway,

Regs,

Alain

raymond_giuseppi
Active Contributor
0 Kudos

There must be RFC connections between servers?

Programs running on the Unix server could call RFC FMs on the other server to retrieve the files list and download or upload the files.

0 Kudos

Thanks Raymond, but the server I am querying is not a SAP Server but a regular Windows Server hosting PI. I don't think this would work. I will try to go to a solution I had built long ago (around 2003), but unfortunately don't have anymore as it was for another company. I had useed SM59 connection to call a VB program which was returning values I needed.

Regs,

Alain