‎2007 Nov 08 5:31 PM
hi experts,
I have an issue involving dialog programming and file interface. When I press a button on the screen all the filenames present in a directory are to be populated in a table control. The point where I got stuck is getting the names of all files in a directory. Can any body please help me in this regard. Thanks in advance.
regards
‎2007 Nov 08 5:48 PM
You can use this FM to get the list of all files
TMP_GUI_DIRECTORY_LIST_FILES
DATA: TBL_FILES LIKE SDOKPATH OCCURS 10 WITH HEADER LINE,
TBL_DIRS LIKE SDOKPATH OCCURS 10 WITH HEADER LINE.
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
DIRECTORY = P_DIRECTORY
FILTER = 'Test*.Txt' "<< restricts to only TEXT files begining with Test
TABLES
FILE_TABLE = TBL_FILES
DIR_TABLE = TBL_DIRS.After getting the files in the TBL_FILES... loop the table and read the files with GUI_UPLOAD FM
Regars,
Naimesh Patel
‎2007 Nov 08 5:52 PM
Hi Naimesh,
I am accesing the files from presentation layer and I used this FM but it is saying filecount as 0 though there are files. I put the filter as '. but still it is not working. Thanks
‎2007 Nov 08 5:58 PM
Hi naimesh,
I got it thanks. Actually I was not giving the '\' at the end of the dir. Now it worked. Thanks u.
‎2007 Nov 08 5:59 PM