2007 Sep 24 2:58 AM
Hi all.
I need a directory browsing in dialog module. Meaning creating the field using screen painter. Any code for creating the directory?
thks
2007 Sep 24 9:06 AM
Instead of report..it should be Module...
<b>MODULE GET_FOLDER.</b>
data: objFile type ref to cl_gui_frontend_services.
data: pickedFolder type string.
data: initialFolder type string.
data : folder type string.
START-OF-SELECTION.
CALL SCREEN 100.
create object objFile.
objFile->directory_browse( exporting initial_folder = initialFolder
changing selected_folder = pickedFolder
exceptions cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3 ).
folder = pickedFolder.
ENDMODULE.<b></b>
Hi all.
I need a directory browsing in dialog module. Meaning creating the field using screen painter. Any code for creating the directory?
thks
2007 Sep 24 4:34 AM
Hi,
You can do it:
1. Create Input Field for directory browsing ( example name: Folder ).
2. In Flow Login of your screen add code :
PROCESS AFTER INPUT.
PROCESS ON VALUE-REQUEST.
FIELD folder MODULE GET_FOLDER.
3. Add this code at GET_FOLDER Module.
data: objFile type ref to cl_gui_frontend_services.
data: pickedFolder type string.
data: initialFolder type string.
create object objFile.
objFile->directory_browse( exporting initial_folder = initialFolder
changing selected_folder = pickedFolder
exceptions cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3 ).
folder = pickedFolder.
Regards,
2007 Sep 24 8:56 AM
some doubt in following the step
step1 completed.
step2
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
PROCESS ON VALUE-REQUEST.
FIELD folder MODULE GET_FOLDER.
issit the code for the flow login refer to above?
Step 3 i am totally lost.
what do u mean Add this code at GET_FOLDER Module, issit refer to my program. Below is my program can help me to debug. I checked the syntax, i gt this error. field folder is unknow? What statement mus i add?
REPORT ZGARY_DIRECTORY_DIALOG.
data: objFile type ref to cl_gui_frontend_services.
data: pickedFolder type string.
data: initialFolder type string.
START-OF-SELECTION.
CALL SCREEN 100.
create object objFile.
objFile->directory_browse( exporting initial_folder = initialFolder
changing selected_folder = pickedFolder
exceptions cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3 ).
folder = pickedFolder.
2007 Sep 24 4:35 AM
Hi gary
create field p_file in the screen and use process on value-request.
PROCESS BEFORE OUTPUT.
.......
PROCESS AFTER INPUT.
.......
PROCESS ON VALUE-REQUEST.
FIELD p_file MODULE browse_file.
module browse_file
DATA L_FILE(256).
L_FILE = P_FILE.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = L_FILE
DEF_PATH = ''
MASK = ',..'
MODE = 'O'
TITLE = 'Open File'
IMPORTING
FILENAME = P_FILE
EXCEPTIONS
INV_WINSYS = 01
NO_BATCH = 02
SELECTION_CANCEL = 03
SELECTION_ERROR = 04.
Regards
Wiboon
2007 Sep 24 8:46 AM
Hi
i gt this working code but using selection screen. Is it possible that can change to dialog module for me?
parameters: p_path type localfile.
at selection-screen on value-request for p_path.
data: path_str type string.
call method cl_gui_frontend_services=>directory_browse
exporting
window_title = 'Select Directory'
changing
selected_folder = path_str
exceptions
cntl_error = 1.
call method cl_gui_cfw=>flush
exceptions
cntl_system_error = 1
cntl_error = 2.
p_path = path_str.
Screen 1000 is created automatically
PROCESS BEFORE OUTPUT.
MODULE %_INIT_PBO.
MODULE %_PBO_REPORT.
MODULE %_PF_STATUS.
MODULE %_END_OF_PBO.
PROCESS AFTER INPUT.
MODULE %_BACK AT EXIT-COMMAND.
MODULE %_INIT_PAI.
FIELD !P_PATH MODULE %_P_PATH .
CHAIN.
FIELD P_PATH .
MODULE %_END_OF_SCREEN.
MODULE %_OK_CODE_1000.
ENDCHAIN.
PROCESS ON VALUE-REQUEST.
FIELD P_PATH MODULE %_P_PATH_VAL .
2007 Sep 24 8:59 AM
REPORT ZGARY_DIRECTORY_DIALOG.
data: objFile type ref to cl_gui_frontend_services.
data: pickedFolder type string.
data: initialFolder type string.
<b>data : folder type string.</b>
START-OF-SELECTION.
CALL SCREEN 100.
create object objFile.
objFile->directory_browse( exporting initial_folder = initialFolder
changing selected_folder = pickedFolder
exceptions cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3 ).
folder = pickedFolder.
2007 Sep 24 9:04 AM
it doesnt giv me any sytnax error. But is not working. i select the the input field nothing came out. Any where i miss out something on?
2007 Sep 24 9:06 AM
Instead of report..it should be Module...
<b>MODULE GET_FOLDER.</b>
data: objFile type ref to cl_gui_frontend_services.
data: pickedFolder type string.
data: initialFolder type string.
data : folder type string.
START-OF-SELECTION.
CALL SCREEN 100.
create object objFile.
objFile->directory_browse( exporting initial_folder = initialFolder
changing selected_folder = pickedFolder
exceptions cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3 ).
folder = pickedFolder.
ENDMODULE.<b></b>
2007 Sep 24 9:25 AM
Thk alot is working...
The directory is populated to the input field. However i cant check is my path is correct cos the input field only show partial of the path. Any ways for me to allow the input field to be scrollable? i already set the input field as scrollable in the screen painter but stil cannot scoll?
2007 Sep 24 9:27 AM
Hi,
You need to press the right arrow key to scroll through the field.
Else increase the width of input field.
Best regards,
Prashant
2007 Sep 24 9:40 AM
thks for helping!
I gt another question.
i need to create a similar program like se11
go to view, select a table view, gt a tab call selection criteria...
i want that selection criteria table
Selection criteria
Table | Fieldname | Operator | Comparison Value | And/Or
i need to create that table for user to enter record and save it to my database.
2007 Sep 25 3:26 AM
hihi....
Now i want to show all the files in the folder? hw can i do it? My program is a dialog module selection.
thks