Application Development and Automation 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: 
Read only

Function module to popup local filepath

Former Member
0 Likes
2,853

Hi,

Is there any function module to give a popup to enter the local file path.

User should be able to either enter the path directly in the popup or select it by F4 help. Both must be possible.

Entered filepath must be verified before returning it.

Any pointers on it will be a great help.

Thanks and regards,

Karthik

4 REPLIES 4
Read only

Former Member
0 Likes
1,067

try gui_upload

Read only

0 Likes
1,067

try this also

k4_filename_*

Read only

0 Likes
1,067

Hi Karthikeyan,

Apart from GUI_UPLOAD and GUI_DOWNLOAD, which are better if you are uploading or downloading files, you can also use the following methods of class CL_GUI_FRONTEND_SERVICES.

CHECK_GUI_SUPPORT (checks GUI features)

DIRECTORY_EXIST (checks if a directory exists in the client)

FILE_EXIST (checks if a file exists)

FILE_OPEN_DIALOG (Displays a File Open Dialog)

FILE_SAVE_DIALOG (Shows a File Save Dialog )

Hope this helps : -)

Sameer

Read only

messier31
Active Contributor
0 Likes
1,067

Hi Karthik,

Check out following code.

DATA: IT_FILES TYPE FILETABLE,

WA_FILES LIKE LINE OF IT_FILES,

LV_RC TYPE I.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_PCPATH.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG.

EXPORTING

WINDOW_TITLE = 'Select Files'

  • DEFAULT_EXTENSION = '*.txt'

  • DEFAULT_FILENAME =

  • FILE_FILTER =

  • WITH_ENCODING =

  • INITIAL_DIRECTORY =

MULTISELECTION = 'X'

CHANGING

FILE_TABLE = IT_FILES

RC = LV_RC

<i> IT_FILES will contain list of files selected or

name of file selected if

MULTISELECTION = ' '</i>

Hope this helps you.

Enjoy SAP.

Pankaj Singh