Check whether directory exist on both PC and AS

来源:互联网 发布:国家对网络币有规定不? 编辑:程序博客网 时间:2024/06/01 18:27

http://scn.sap.com/thread/280091

You can use the DIRECTORY_EXIST method for both, PC frontend and application server,  you will need to know the fully qualified name of the appilication server on your network in order for it to work.

For example,  we run on an AS400 and this path gets me to the application server and this works in the following program.

\<ip_address>qfilesvr400<host_Name>usrsapTST

report zrich_0001.

type-pools: abap.

data: rc type abap_bool.
data: dir type string.

parameters: p_file type localfile default 'C:'.


start-of-selection.

dir = p_file.

  call method cl_gui_frontend_services=>directory_exist
    exporting
      directory            = dir
    receiving
      result               = rc
    exceptions
      cntl_error           = 1
      error_no_gui         = 2
      wrong_parameter      = 3
      not_supported_by_gui = 4
      others               = 5.

  if rc = 'X'.

    write:/ 'The directory does exist'.

  else.

    write:/ 'The directory does not exist'.

  endif.

原创粉丝点击