Skip to Content
author's profile photo Former Member
Former Member

Check if a file exist

From abap i need to check if a file exist on the client pc.

Is this possible ?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Feb 03, 2005 at 07:33 PM

    Sure, use CL_GUI_FRONTEND_SERVICES. There is a method called FILE_EXIST.


    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Here is a quick & dirty example program for ya.

      report zrich_0004 .
      data: file type string,
            result(1) type c.
        file = 'C:/abaps/test.txt'.
        call method cl_gui_frontend_services=>file_exist
            file            = file
            result          = result.
        if result = 'X'.
          write:/ 'file does exist'.
          write:/ 'file not found'.


      Rich Heilman

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.