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

App Server Files

Gurus,

In the following program, am accessing files on

C:\ drive but now i want to select files on the

App server. also do i need to add some special code or

just give path of the server files to access server

files? could someone please help me with the code

so that i can select server files. i will thank with

full points..

<i>PARAMETER p_path(40) OBLIGATORY DEFAULT 'C:\'.

  • Display file selection dialog

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.

PERFORM get_files.

START-OF-SELECTION.

PERFORM section_main.

FORM get_files.

dir = p_path.

DATA: folder TYPE string.

CALL METHOD

cl_gui_frontend_services=>directory_browse

EXPORTING

  • WINDOW_TITLE =

initial_folder = 'C:\'

CHANGING

selected_folder = folder.

  • EXCEPTION

  • CNTL_ERROR = 1

  • ERROR_NO_GUI = 2

  • NOT_SUPPORTED_BY_GUI = 3

  • others = 4

IF sy-subrc <> 0.

  • add your error message here

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

p_path = folder.

*fetch all files from directory, use *.doc as mask

CALL METHOD

cl_gui_frontend_services=>directory_list_files

EXPORTING

directory = folder

filter = '*.doc'

files_only = 'X'

  • DIRECTORIES_ONLY =

CHANGING

file_table = dir_tab

count = count

EXCEPTIONS

cntl_error = 1

directory_list_files_failed = 2

wrong_parameter = 3

error_no_gui = 4

not_supported_by_gui = 5

OTHERS = 6.

ENDFORM. "get_files</i>

thanks a ton

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 04:56 PM

    Check FM F4_dxfilename_toprecursion

    regards,

    Juan Mejí

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 12:45 AM
    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.