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

file interface

Former Member
0 Likes
431

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

4 REPLIES 4
Read only

naimesh_patel
Active Contributor
0 Likes
414

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

Read only

0 Likes
414

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

Read only

0 Likes
414

Hi naimesh,

I got it thanks. Actually I was not giving the '\' at the end of the dir. Now it worked. Thanks u.

Read only

Former Member
0 Likes
414

answered