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

METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST

Hi,

In METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST

EXPORTING

FILE =

RECEIVING

RESULT = . <-- May I know what is this result stand for and what kind of parameter should I pass in? Thanks!

Anyi

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jun 19, 2006 at 06:25 PM

    Result is of type ABAP_BOOL which is TYPE C length 1. It takes two values, space and 'X'.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2006 at 06:21 PM

    HI ANYI,

    RESULT:IS THE RETURN CODE FOR THE BUTTON U HAVE CLICKED

    FOR EX: '1' MIGHT BE THE RETURN CODE FOR 'YES'.

    DECLARE RESULT AS

    DATA: V_RES TYPE i.

    METHOD CL_GUI_FRONTEND_SERVICES=>FILE_EXIST

    EXPORTING

    FILE =

    RECEIVING

    RESULT = V_RES.

    Message was edited by: Priya

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi Zhu,

      Check this out

      data: file_name type string.

      data: <b>result type abap_bool.</b>

      data: rc type i.

      file_name = txt_work_file.

      call method cl_gui_frontend_services=>file_exist

      exporting

      file = file_name

      receiving

      result = result

      exceptions

      cntl_error = 1

      error_no_gui = 2

      wrong_parameter = 3

      others = 4.

  • author's profile photo Former Member
    Former Member
    Posted on Jun 19, 2006 at 06:23 PM

    This is a RECEIVING parameter. You do not enter anything. SAP will fill this field for you. It is the confirmation of whether or not the file exists in the specific path provided in your FILE parameter.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 19, 2006 at 06:23 PM

    This is a RECIEVING parameter, and you can use a TYPE ABAP_BOOL variable here. It will be "X" if the file exists, blank if not.

    
    
    type-pools: abap.
    
    data: result type abap_bool.
    data: filename type string.
    
    
    filename = 'C:test.xls'.
    
    
    call method cl_gui_frontend_services=>file_exist
      exporting
          file =  filename
      receiving
         result = result .
    
    if result = 'X'.
      write:/ 'Yep, file is there'.
    else.
      write:/ 'Nop, file isnt there'.
    endif.
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

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.