Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browsing Directories from GUI

Status
Not open for further replies.

vcastell

Programmer
Dec 3, 2002
1
US
In 4.6C, there is currently a class definition called CL_GUI_FRONTEND_SERVICES. This class allows you to perform various local operations like uploading files, checking for the existence of files, etc. I am currently interested in using method DIRECTORY_BROWSE. When using this method, I am not getting back the selected folder. I am able to set the title, which means that the interface is working. But, when I select the folder and hit the OK button on the popup, I am not getting the value of the selected folder. Nothing is being returned back.

I checked OSS and did not come across any documented bugs. Not sure if I am doing something wrong. The following is the piece of code that deals with the call of the method.

================================================
Data cref1 type ref to cl_gui_frontend_services.

data selfolder type string.

data title type string.
move 'Test title' to title.

create object cref1.

CALL METHOD cref1->DIRECTORY_BROWSE
EXPORTING
WINDOW_TITLE = title
* INITIAL_FOLDER =
CHANGING
SELECTED_FOLDER = selfolder
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
others = 3.
===========================================

If you know of any other possible means for browsing directories, let me know. From using 4.6C, it looks like everything relies on ABAP Objects, which is okay but the above method does not work properly.

Thanks in advance.

--Vince
 
Try this

CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
EXPORTING
DIRECTORY = DIRECTORY
* FILTER = ''
FILES_ONLY = 'X'
* DIRECTORIES_ONLY = 'X'
CHANGING
FILE_TABLE = filetab
COUNT = count
EXCEPTIONS
CNTL_ERROR = 1
DIRECTORY_LIST_FILES_FAILED = 2
WRONG_PARAMETER = 3
ERROR_NO_GUI = 4
others = 5.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top