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 get directory on F4

VenuAnumayam
Participant
0 Likes
2,749

Hello Experts,

Is there a FM to get Directory name on selection screen when the users hit F4, kinda like "KD_GET_FILENAME_ON_F4" for getting the filename?

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,631

you can call method directory_get from class cl_gui_frontend_services on the at selection-screen on value request for p_dir.

currently i am not infront of SAP system.. so just open the class in SE24 and see the methods for directory...

Edited by: Soumyaprakash Mishra on Sep 17, 2009 10:25 PM

Hello Experts,

Is there a FM to get Directory name on selection screen when the users hit F4, kinda like "KD_GET_FILENAME_ON_F4" for getting the filename?

Thanks.

6 REPLIES 6
Read only

Former Member
0 Likes
1,631

Hi

use F4_DXFILENAME_TOPRECURSION.

Read only

0 Likes
1,631

Hi,

This FM is also selecting the filename but not the directory. Thanks though.

Read only

0 Likes
1,631

Try this....

TMP_GUI_BROWSE_FOR_FOLDER

Prabhudas

Edited by: Prabhu Das on Sep 17, 2009 10:35 PM

Read only

0 Likes
1,631
AT SELECTION-SCREEN ON VALUE-REQUEST FOR path. 
 
  DATA: l_dir   TYPE string. 
 
* Browse the Directories 
  CALL METHOD cl_gui_frontend_services=>directory_browse 
*     EXPORTING 
*       WINDOW_TITLE        = 
*      INITIAL_FOLDER       = 
    CHANGING 
      selected_folder      = l_dir 
    EXCEPTIONS 
      cntl_error           = 1 
      error_no_gui         = 2 
      not_supported_by_gui = 3 
      OTHERS               = 4

this is what you need i guess..

.

Read only

0 Likes
1,631

Thanks all.

Read only

Former Member
0 Likes
1,632

you can call method directory_get from class cl_gui_frontend_services on the at selection-screen on value request for p_dir.

currently i am not infront of SAP system.. so just open the class in SE24 and see the methods for directory...

Edited by: Soumyaprakash Mishra on Sep 17, 2009 10:25 PM