11-30-2009 3:55 PM
Hello, is there any search help for searching files in local pc?
I need it for a dynpro.
Any help?
Thanks!
11-30-2009 4:01 PM
Hi,
I didnt find any,
I think you can create one for your need from SE11
Regards,
Sid
11-30-2009 4:01 PM
Hi,
I didnt find any,
I think you can create one for your need from SE11
Regards,
Sid
11-30-2009 4:13 PM
Hello,
You have to code for this in the PROCESS ON VALUE-REQUEST block.
Inside this block you have to call the static method: CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG.
Hope i am clear.
BR,
Suhas
11-30-2009 4:13 PM
Though in the Code a dialog will open to select for directory , you need to define your logic or user can input the directory .
REPORT abc.
PARAMETERS check AS CHECKBOX .
types :
begin of ty_text,
text(100) type c,
end of ty_text.
data : l_folder type string,
l_count type i,
l_file_table type standard table of ty_text.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_BROWSE
CHANGING
SELECTED_FOLDER = l_folder.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
EXPORTING
DIRECTORY = l_folder
CHANGING
FILE_TABLE = l_file_table
COUNT = l_count.
I assumed you are aware of CL_GUI_FRONTEND_SERVICES=>file_open_dialog. I thought you want a list of all files and not usual file open dialog, and want to display that list like any other F4. )
Edited by: rajesh khatwa on Nov 30, 2009 5:17 PM
11-30-2009 4:15 PM
11-30-2009 4:34 PM
Hi,
I doubt for webdynpro you could be able to use gui frontend services....
Anyways you can give it a try....
otherwise there are some other classes for the same explicitly for webdynpro's
Regards,
Sid
11-30-2009 6:46 PM
Hi ,
Try this way...
PROCESS ON VALUE-REQUEST.
FIELD <DYNPRO-FIELDNAME> MODULE F4_filename.
MODULE F4_filename INPUT.
* Drop down to retrieve File Path
DATA: w_lcnt TYPE i,
t_lfilename TYPE filetable,
w_lfilename LIKE LINE OF t_lfilename.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Find File Path'
CHANGING
file_table = t_lfilename
rc = w_lcnt
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
OTHERS = 5.
IF sy-subrc <> 0.
ENDIF.
READ TABLE t_lfilename INTO w_lfilename INDEX 1.
IF sy-subrc NE 0.
CLEAR w_lfilename.
ENDIF.
<DYNPRO-FIELDNAME> = w_lfilename-filename.
ENDMODULE.
regards,
Prabhudas
11-30-2009 7:32 PM
Hi Javier,
<li>Try this way.
Thanks
Venkat.O
REPORT ztest_program.
DATA: wa_pfile TYPE file_table.
DATA: it_pfiles TYPE STANDARD TABLE OF file_table,
count TYPE i,
dir TYPE string VALUE 'C:\temp\'.
CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = dir
files_only = 'X'
CHANGING
file_table = it_pfiles
count = count
EXCEPTIONS
cntl_error = 1
directory_list_files_failed = 2
wrong_parameter = 3
error_no_gui = 4
not_supported_by_gui = 5
OTHERS = 6.
LOOP AT it_pfiles INTO wa_pfile.
WRITE wa_pfile.
ENDLOOP.
12-01-2009 7:10 AM
All this solutions are right for reports, but i need the code for a dynpro. I suppose that must be inserted in the PBO or PAI sections.
Thanks.