Application Development 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: 

how to pop up for the local directory?

Former Member
0 Kudos

I need to popup the selection for local directory and my program generates the file and stores into the directory.

how to do this pop up of directory?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Venkat,

Try using following method

CALL METHOD cl_gui_frontend_services=>directory_browse

EXPORTING

window_title = <title you want to be displayed on the popup> Its optional

initial_folder = <default directory that is to be displayed> again optional

CHANGING

selected_folder = <pass the variable to capture the directory that is selected>

EXCEPTIONS

cntl_error = 1

error_no_gui = 2

not_supported_by_gui = 3

others = 4

.

IF sy-subrc <> 0.

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

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

ENDIF.

6 REPLIES 6

peter_ruiz2
Active Contributor
0 Kudos

Hi Venkatabby,

Use this method cl_gui_frontend_services=>file_open_dialog

regards,

Peter

Former Member
0 Kudos

Hi,

You can use FM POPUP_TO_DISPLAY_TEXT_LO. Just pass your directory in parameter TEXTLINE1.

Hope this will be helpful.

Thanks,

Amit

Former Member
0 Kudos

hi

CALL METHOD cl_gui_frontend_services=>file_save_dialog

EXPORTING

default_extension = 'text'

default_file_name = ld_fullpath

initial_directory = 'c:\temp\'

CHANGING

filename = ld_filename

path = ld_path

fullpath = ld_fullpath

user_action = ld_result.

and call the FM GUI_DOWNLOAD

Former Member
0 Kudos

Hi,

Use the below code and FM F4_FILENAME.

parameters: p_pcfile like rlgrap-filename default 'c:\test.txt'.

at selection-screen on value-request for p_pcfile.

call FM F4_FILENAME. " this FM will show the popup for saving in local directory.

Thanks,

Srilakshmi.

sujeet2918
Active Contributor
0 Kudos

Hello Venkat,

Please try to use below code:.

PARAMETERS: p_file type RLGRAP-filename,

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

IMPORTING

FILE_NAME = p_file

.

Hope it will solve your problem.

Have a Nice Day.

regards,

Sujeet

Former Member
0 Kudos

Hi Venkat,

Try using following method

CALL METHOD cl_gui_frontend_services=>directory_browse

EXPORTING

window_title = <title you want to be displayed on the popup> Its optional

initial_folder = <default directory that is to be displayed> again optional

CHANGING

selected_folder = <pass the variable to capture the directory that is selected>

EXCEPTIONS

cntl_error = 1

error_no_gui = 2

not_supported_by_gui = 3

others = 4

.

IF sy-subrc <> 0.

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

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

ENDIF.