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

Display previous folder when browsing again from a parameter field

Former Member
0 Likes
842

Hi,

Can somebody suggest how to display the previous folder browsed as the default folder when browsing again from the parameter field. I am using WS_FILENAME_GET to browse a file.

Thanks in advance.

Regards,

Arun Mohan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
804

Use the class-mthod:

CL_GUI_FRONTEND_SERVICES=>DIRECTORY_GET_CURRENT to get the current directory.

use it as the default file path in the fm: ws_filename_get.

Regards,

Ravi

7 REPLIES 7
Read only

Former Member
0 Likes
804

Hi,

I think the function module itself help you to browse and select the required file you want, no need of extra coding required.

Read only

Former Member
0 Likes
805

Use the class-mthod:

CL_GUI_FRONTEND_SERVICES=>DIRECTORY_GET_CURRENT to get the current directory.

use it as the default file path in the fm: ws_filename_get.

Regards,

Ravi

Read only

0 Likes
804

I think this behavior is automatic when using the method file_open_dialog of class cl_gui_frontend_services.

REgards,

Rich Heilman

Read only

venkata_ramisetti
Active Contributor
0 Likes
804

Hi,

May be the following link is useful.

Thanks,

Ramakrishna

Read only

Former Member
0 Likes
804

Hi Arun,

Try this.

initialization.

IMPORT P_PATH FROM MEMORY ID 'AA'.

start-of-selection.

EXPORT P_PATH TO MEMORY ID 'AA'.

where p_path is the parameter of file path.

-Anu

Read only

Former Member
0 Likes
804

hi Arun,

Check this way out

data:    l_file         type filetable, 
           l_fileline     type file_table, 
           l_rc           type i. 

  class cl_gui_frontend_services definition load. 

  call method cl_gui_frontend_services=>file_open_dialog 
    exporting 
      window_title      = p_filetitle 
      initial_directory = 'C:Temp' 
    changing 
      file_table        = l_file 
      rc                = l_rc. 

  if sy-subrc = 0. 
    read table l_file into l_fileline index 1. 
  endif. 
  p_filename = l_fileline.

Regards,

Santosh

Read only

sridhar_k1
Active Contributor
0 Likes
804

Create a parameter ID or use existing parameter ID SOP, add it to user profile parameters in tx SU3.

use GET PARAMETER ID before the WS_FILENAME_GET call to get previous dir.

USe fm G_SET_USER_PARAMETER to set the parameter in user profile with current dir

REgards

Sridhar

Message was edited by: Sridhar K